:root {
  /* Светлая тема: тёплый нейтральный беж-серый, не белый */
  --bg: #ece8e1;
  --surface: #f7f4ef;
  --surface-2: #e4dfd6;
  --text: #24211c;
  --muted: #6e675c;
  --line: #d6cfc3;
  --accent: #0e8f81;
  --accent-ink: #ffffff;
  --accent-soft: #d5ebe5;
  --warn: #a8690f;
  --warn-soft: #f4e6cc;
  --danger: #b63a32;
  --danger-soft: #f3dcd7;
  --ok: #2c7f45;
  --ok-soft: #dbebdc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 50, 35, .06), 0 6px 18px rgba(60, 50, 35, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121615; --surface: #191f1d; --surface-2: #212927; --text: #e7ece9; --muted: #95a29d;
    --line: #2c3633; --accent: #2cc4b1; --accent-ink: #062420; --accent-soft: #163632;
    --warn: #e0a84a; --warn-soft: #33281a; --danger: #ef7a72; --danger-soft: #3a1f1d;
    --ok: #63c483; --ok-soft: #18301f; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121615; --surface: #191f1d; --surface-2: #212927; --text: #e7ece9; --muted: #95a29d;
  --line: #2c3633; --accent: #2cc4b1; --accent-ink: #062420; --accent-soft: #163632;
  --warn: #e0a84a; --warn-soft: #33281a; --danger: #ef7a72; --danger-soft: #3a1f1d;
  --ok: #63c483; --ok-soft: #18301f; --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }

/* layout */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a, .nav button { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 500; background: none; border: 0; font: inherit; cursor: pointer; }
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--surface-2); }
.container { max-width: 1120px; margin: 0 auto; padding: 28px 16px 64px; }

.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 4px 8px 18px; }
.side-nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--accent-soft); color: var(--text); }
.side-foot { margin-top: 24px; padding: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.admin-main { padding: 28px 32px 64px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }

/* components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 14px/1.2 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.06); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.inline { display: inline; }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 14px/1.4 var(--font);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.count { background: var(--danger); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 700; }

.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.notice-warn { background: var(--warn-soft); color: var(--warn); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
tr.unread td { background: color-mix(in srgb, var(--warn-soft) 55%, transparent); }

.stat { padding: 18px 20px; }
.stat b { display: block; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }

.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* student */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; margin-bottom: 28px; }
.hero h1 { font-size: 30px; }
.ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring span { width: 74px; height: 74px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.module-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 28px 0 12px; }
.weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.week-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); min-height: 150px; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
a.week-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.week-card .num { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.week-card h3 { margin: 0; font-size: 16px; }
.week-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.week-card.locked { background: var(--surface-2); box-shadow: none; }
.week-card.locked .num { color: var(--muted); }
.week-card.locked h3 { color: var(--muted); }

.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li + li { border-top: 1px solid var(--line); }
.lesson-list a { display: flex; align-items: center; gap: 14px; padding: 13px 4px; color: var(--text); }
.lesson-list a:hover { text-decoration: none; color: var(--accent); }
.lesson-list a.current { color: var(--accent); font-weight: 600; }
.dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.dot.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lesson-list .dur { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.file-list li:first-child { border-top: 0; }
.file-ico { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; text-transform: uppercase; }

/* player + watermark */
.player-shell { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; user-select: none; -webkit-user-select: none; }
.player-shell:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
.player-shell iframe, .player-shell > #kplayer, .player-shell > #kplayer > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wm-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.wm-tile { position: absolute; inset: -50%; opacity: .085; transform: rotate(-24deg); background-repeat: repeat; }
.wm-float { position: absolute; color: #fff; font: 600 14px/1.2 var(--font); text-shadow: 0 1px 3px rgba(0,0,0,.65); opacity: .5; white-space: nowrap; transition: left 1.6s ease, top 1.6s ease; }
.player-tools { position: absolute; right: 12px; top: 12px; z-index: 6; }
.fs-btn { background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; font: 600 12px var(--font); cursor: pointer; }
.player-blocked { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; background: #0b0f0e; color: #fff; text-align: center; padding: 24px; }
.player-empty { display: grid; place-items: center; color: #9fb0aa; text-align: center; padding: 24px; position: absolute; inset: 0; }

.kick-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10,16,14,.86); display: grid; place-items: center; padding: 16px; }
.kick-overlay .card { max-width: 440px; text-align: center; }

/* login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { margin-bottom: 24px; justify-content: center; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
details summary { cursor: pointer; font-weight: 600; }
.feedback { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--surface-2); border-radius: 0 10px 10px 0; margin-top: 8px; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 16px; }
  .sidebar .brand { padding: 0 8px 0 0; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .side-foot { display: none; }
  .admin-main { padding: 20px 16px 48px; }
  .grid-2, .grid-3, .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar-in { gap: 8px; }
  .brand small { display: none; }
  .nav a, .nav button { padding: 8px; font-size: 14px; }
  .hero { grid-template-columns: 1fr; }
  h1, .hero h1 { font-size: 24px; }
}

/* ===== ЛК ученика: карточка, ачивки ===== */
.profile-card { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.avatar { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ff8f6b, #f04f7c 55%, #8b5cf6); box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--line); }
.profile-meta h1 { margin: 0 0 4px; font-size: 26px; }
.achievements { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.ach { width: 74px; height: 74px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; text-align: center;
  font-size: 10.5px; line-height: 1.15; color: var(--muted); padding: 6px; position: relative; background: var(--surface); }
.ach b { display: block; font-size: 18px; color: var(--muted); }
.ach.done { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--text); }
.ach.done b { color: var(--accent); }
.ach.pending { border-style: solid; border-color: var(--warn); }
.ach.final { width: 86px; height: 86px; }
.ach.final.done { background: linear-gradient(135deg, #ffd56b, #ff9f43); border-color: #ff9f43; color: #3b2400; }
.ach.final.done b { color: #3b2400; }
.ach-arrow { color: var(--line); font-size: 18px; }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.mini-stat { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.mini-stat b { font-size: 22px; display: block; line-height: 1.2; font-variant-numeric: tabular-nums; }
.mini-stat span { font-size: 12px; color: var(--muted); }
.coin { color: #b87700; }
:root[data-theme="dark"] .coin { color: #ffc24a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .coin { color: #ffc24a; } }

/* ===== Неделя: чек-лист + плеер ===== */
.week-title { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 18px 22px; text-align: center; margin-bottom: 16px; }
.week-title h1 { margin: 0; font-size: 24px; }
.lesson-box { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: stretch; }
.checklist input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; margin: 6px 0 0; border: 2px solid var(--line); border-radius: 8px; flex: none; cursor: pointer; background: var(--surface); display: grid; place-items: center; }
.checklist input[type=checkbox]:checked { background: #7ccf3f; border-color: #5aa82a; }
.checklist input[type=checkbox]:checked::after { content: "✓"; color: #fff; font-weight: 900; font-size: 16px; }
.checklist a { flex: 1; display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); font-size: 14px; }
.checklist a:hover { border-color: var(--accent); text-decoration: none; }
.checklist a.current { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.checklist .dur { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars input { display: none; }
.stars label { font-size: 26px; cursor: pointer; color: var(--line); margin: 0; font-weight: 400; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #ffb400; }

.link-card { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface); }
.link-card:hover { border-color: var(--accent); text-decoration: none; }
.link-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; flex: none; background: var(--surface-2); }
.miro-preview { position: relative; display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 9; background: #fbd85d; }
.miro-preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.miro-preview .miro-open { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between; padding: 12px; background: linear-gradient(transparent 55%, rgba(0,0,0,.55)); color: #fff; font-weight: 700; }
.miro-preview:hover .miro-open { background: linear-gradient(transparent 40%, rgba(0,0,0,.65)); text-decoration: none; }
.miro-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #1a1a1a; font-weight: 800; font-size: 22px; }

.att { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 800; font-size: 13px; }
.att-yes { background: var(--ok-soft); color: var(--ok); }
.att-no { background: var(--danger-soft); color: var(--danger); }
.att-wait { background: var(--surface-2); color: var(--muted); }

.footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.footer-in { max-width: 1120px; margin: 0 auto; padding: 24px 16px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 14px; }

.upload-progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; display: none; }
.upload-progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

@media (max-width: 900px) {
  .lesson-box { grid-template-columns: 1fr; }
  .lesson-box .player-col { order: -1; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .profile-card { grid-template-columns: 1fr; justify-items: start; }
  .ach { width: 60px; height: 60px; font-size: 9px; }
  .ach.final { width: 68px; height: 68px; }
  .ach-arrow { display: none; }
}

.theme-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-size: 16px; display: inline-grid; place-items: center; }
.theme-btn:hover { background: var(--surface-2); }
.preview-bar { background: #2b2620; color: #f3ede2; font-size: 13px; text-align: center; padding: 7px 16px; }
.preview-bar a { color: #ffd27a; font-weight: 600; }
.bell { position: relative; }
.bell .count { position: absolute; top: 0; right: 0; font-size: 10px; padding: 0 5px; }
.checklist a.locked { pointer-events: none; opacity: .55; }
.checklist input[type=checkbox]:disabled { cursor: default; }

/* ===== аналитика ===== */
.bars { display: grid; gap: 8px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 52px; gap: 12px; align-items: center; color: var(--text); padding: 4px 6px; border-radius: 8px; }
.bar-row:hover, .bar-row.active { background: var(--surface-2); text-decoration: none; }
.bar-label { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-row.active .bar-track { background: var(--bg); }
.bar-track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mini-avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #ff8f6b, #8b5cf6); }
.kpi { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline; gap: 6px; }
.kpi small { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi-bad { color: var(--danger); } .kpi-mid { color: var(--warn); } .kpi-good { color: var(--ok); }
.line-chart { width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.line-chart .grid { stroke: var(--line); stroke-width: 1; }
.line-chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.line-chart .series { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.line-chart .hit { fill: transparent; cursor: pointer; }
.line-chart .pt:hover .dot { r: 6.5; }
@media (max-width: 640px) { .bar-row { grid-template-columns: 110px 1fr 44px; } }

/* ===== журнал группы ===== */
.journal { border-collapse: separate; border-spacing: 0; }
.journal th, .journal td { padding: 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.journal th:first-child, .journal td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; }
.journal th { font-size: 11px; text-transform: none; letter-spacing: 0; }
.journal th .d { display: block; font-size: 12px; color: var(--text); font-weight: 700; }
.journal .sep { border-left: 2px solid var(--line); }
.jcell { width: 34px; height: 34px; border-radius: 10px; border: 0; font: 800 15px var(--font); cursor: pointer; display: inline-grid; place-items: center; }
.jcell:hover { outline: 2px solid var(--accent); }
.jcell.att-yes { background: var(--ok-soft); color: var(--ok); }
.jcell.att-no { background: var(--danger-soft); color: var(--danger); }
.jcell.proj-yes { background: linear-gradient(135deg, #ffd56b, #ff9f43); color: #3b2400; }
.jcell.proj-no { background: var(--surface-2); color: var(--muted); }
.jcell.proj-pending { background: var(--warn-soft); color: var(--warn); }
.jfuture { color: var(--muted); font-size: 12px; }

/* ===== календарь ===== */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 160px; display: flex; flex-direction: column; gap: 6px; }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-head { font-size: 12px; color: var(--muted); }
.cal-head b { color: var(--text); }
.cal-item { display: flex; flex-direction: column; gap: 1px; font-size: 12px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); color: var(--text); border-left: 3px solid var(--c, var(--accent)); }
.cal-item:hover { text-decoration: none; filter: brightness(.97); }
.cal-item.busy { border-left-color: var(--line); opacity: .7; }
.cal-empty { color: var(--line); text-align: center; margin-top: 20px; }
@media (max-width: 900px) { .cal { grid-template-columns: 1fr; } .cal-day { min-height: 0; } }
.zoom-btn { background: #2d8cff; border-color: #2d8cff; color: #fff; }

/* ===== геймификация ===== */
.avatar-wrap { position: relative; }
.lvl-badge { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); background: #2b2620; color: #ffd27a; font: 800 11px var(--font); padding: 3px 8px; border-radius: 99px; white-space: nowrap; border: 2px solid var(--surface); }
.mode-badge { display: inline-flex; gap: 4px; align-items: center; padding: 3px 10px; border-radius: 99px; font-weight: 700; font-size: 13px; background: #2b2620; color: #ffd27a; }
.xp { margin-top: 10px; max-width: 460px; }
.xp-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 4px; }
.xp-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #8b5cf6); }
.bosses { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.badge-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; border-radius: 12px; border: 1px dashed var(--line); filter: grayscale(1); opacity: .55; }
.badge-card.got { filter: none; opacity: 1; border: 1px solid var(--accent); background: var(--accent-soft); }
.badge-ico { font-size: 28px; line-height: 1.2; }
.leaderboard { margin: 0; padding-left: 22px; }
.leaderboard li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.leaderboard li.me { color: var(--accent); font-weight: 700; }

/* ===== потоки и группы ===== */
.new-cohort { position: relative; }
.new-cohort summary { list-style: none; }
.new-cohort summary::-webkit-details-marker { display: none; }
.popover { position: absolute; right: 0; top: 46px; width: 340px; z-index: 30; }
.cohort { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.cohort + .cohort { margin-top: 22px; }
.cohort-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cohort-head h2 { margin: 0; font-size: 22px; }
.timeline { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin: 18px 0; }
.tl-seg { height: 30px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.tl-seg.past { background: var(--accent-soft); color: var(--accent); }
.tl-seg.cur { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi-tile { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; }
.kpi-tile b { display: block; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-tile span { font-size: 12px; color: var(--muted); }
.kpi-tile.warn { background: var(--warn-soft); }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 16px; }
.group-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--bg); border-top: 4px solid var(--tier, var(--line)); }
.group-card.tier-legend { --tier: #e0a33a; }
.group-card.tier-team { --tier: var(--accent); }
.group-card.tier-solo { --tier: #8a8172; }
.group-card h3 { margin: 6px 0 8px; }
.gc-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.tier { font-weight: 700; color: var(--muted); }
.gc-mentor { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; min-height: 24px; }
.gc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 14px 0 10px; }
.gc-stats b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.gc-stats span { font-size: 11px; color: var(--muted); }
.gc-flags { display: flex; gap: 10px; font-size: 12px; font-weight: 600; }
.gc-flags .ok { color: var(--ok); } .gc-flags .no { color: var(--danger); }
.gc-edit { margin-top: 10px; font-size: 13px; }
.group-card.add { display: grid; place-items: center; border-style: dashed; border-top-width: 1px; color: var(--muted); min-height: 120px; }
.group-card.add[open] { display: block; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } .timeline { grid-template-columns: repeat(6, 1fr); } .popover { position: static; width: auto; margin-top: 8px; } }

/* ===== правки: компактные недели, монеты, аватар ===== */
img.avatar { object-fit: cover; padding: 0; }
a.avatar:hover { text-decoration: none; filter: brightness(1.05); }
.coin-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 12px; border-radius: 99px; background: var(--surface-2); color: var(--text); }
.coin-chip:hover { text-decoration: none; filter: brightness(.97); }
.coin-chip b { font-size: 18px; }
.stats-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.module-row { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.module-row:first-of-type { border-top: 0; }
.module-name { display: flex; flex-direction: column; line-height: 1.25; }
.week-tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.week-tile { position: relative; width: 78px; height: 78px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; overflow: hidden; }
a.week-tile:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.week-tile .wt-num { font-size: 24px; font-weight: 800; line-height: 1; }
.week-tile .wt-sub { font-size: 11px; color: var(--muted); }
.week-tile .wt-bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); }
.week-tile.done { background: var(--accent-soft); border-color: var(--accent); }
.week-tile.done .wt-sub { color: var(--accent); font-weight: 700; }
.week-tile.locked { background: var(--surface-2); color: var(--muted); }
.avatar-upload { display: flex; align-items: center; gap: 18px; }
@media (max-width: 640px) { .module-row { grid-template-columns: 1fr; } .stats-row.three { grid-template-columns: 1fr; } .week-tile { width: 64px; height: 64px; } }

/* ===== правки ЛК ученика: верх, аватар, подвал ===== */
.dash-top { align-items: stretch; }
.dash-top > aside { align-self: start; }
.avatar { width: 128px; height: 128px; }
.avatar-empty { background: var(--surface-2); color: var(--muted); position: relative; overflow: visible; }
.avatar-empty > svg { width: 64%; height: 64%; fill: currentColor; opacity: .55; margin-top: 10%; }
.avatar-upload-ico { position: absolute; top: 2px; right: 2px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; box-shadow: 0 0 0 3px var(--surface); }
.avatar-upload-ico svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.xp-ends { display: flex; justify-content: space-between; }
.bosses { gap: 4px; flex-wrap: nowrap; }
.ach { width: 88px; height: 88px; font-size: 11px; flex: 0 0 auto; }
.ach-arrow { font-size: 14px; }
.ach.final { width: 96px; height: 96px; }
.stats-row.compact { display: flex; flex-wrap: wrap; gap: 10px; }
.stats-row.compact .mini-stat { flex: 0 0 auto; min-width: 150px; }
.badges { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.proj-check-cell { width: 1%; text-align: right; }
.proj-check { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--line); color: #fff; font-weight: 800; font-size: 15px; }
.proj-check.on { background: var(--ok); border-color: var(--ok); }
body:has(> .footer) { padding-bottom: 72px; }
.footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin-top: 0; }
.footer-in { padding: 14px 16px; }
@media (max-width: 900px) { .badges { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .avatar { width: 104px; height: 104px; }
  .bosses { flex-wrap: wrap; }
  .ach { width: 76px; height: 76px; font-size: 9.5px; }
  .ach.final { width: 84px; height: 84px; }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-in { gap: 6px 14px; padding: 10px 16px; font-size: 12px; }
  body:has(> .footer) { padding-bottom: 96px; }
}

/* ===== кабинет ученика: фиолетовый акцент (галочки остаются зелёными) ===== */
body.student { --accent: #7448d6; --accent-ink: #ffffff; --accent-soft: #e9e1f8; }
:root[data-theme="dark"] body.student { --accent: #a98bff; --accent-ink: #1b1030; --accent-soft: #2b2244; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.student { --accent: #a98bff; --accent-ink: #1b1030; --accent-soft: #2b2244; } }
body.student .xp-bar i { background: linear-gradient(90deg, #8b5cf6, #c084fc); }

.week-module { margin: 0 0 4px; font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.feedback-box { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); }
.feedback-box textarea { min-height: 0; resize: vertical; }
.feedback-box .stars label { font-size: 22px; }
.coin-note { font-size: 13px; font-weight: 700; color: var(--muted); }
.task-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.info-pop { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 12px; cursor: help; outline: none; }
.info-pop .info-body { display: none; position: absolute; right: -8px; top: 26px; width: 260px; padding: 12px 14px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 13px; line-height: 1.45; font-weight: 400; text-align: left; z-index: 40; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.info-pop:hover .info-body, .info-pop:focus .info-body { display: block; }
.coin-chip a { color: inherit; }
.coin-chip a:hover { text-decoration: none; }
.coin-chip { align-items: center; }
[hidden] { display: none !important; }
.badge-reward { margin-top: 4px; font-size: 12px; font-weight: 700; color: #b87700; }
.badge-card.got .badge-reward { color: var(--ok); }
.info-pop .info-body a { color: inherit; text-decoration: underline; }
.footer-rules { max-width: 560px; text-align: right; line-height: 1.45; } @media (max-width: 640px) { .footer-rules { text-align: left; } }

/* ===== приложение на телефоне (PWA) ===== */
.tabbar { display: none; }
.install-tip { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); margin-bottom: 14px; font-size: 14px; }
.install-tip[hidden] { display: none; }
.ios-share { display: inline-block; transform: rotate(-90deg); }
.push-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.news-feed { display: grid; gap: 14px; max-width: 760px; }
.news-img { width: calc(100% + 40px); margin: -20px -20px 14px; max-height: 320px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; display: block; }
.news-admin.muted { opacity: .6; }
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
  .tabbar a span { font-size: 20px; line-height: 1; height: 24px; display: grid; place-items: center; }
  .tabbar a span img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a:hover { text-decoration: none; }
  body.student { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .footer { margin-bottom: 0; }
  .container { padding-top: 16px; }
  .player-shell { border-radius: 10px; }
}
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
}
@media (max-width: 640px) {
  body.student .footer { position: static; margin-top: 24px; }
  body.student:has(> .footer) { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}

/* ===== премиальный ритм: больше воздуха в кабинете ученика ===== */
body.student .container { padding-top: 40px; padding-bottom: 88px; }
body.student .card { padding: 30px; border-radius: 20px; }
body.student .grid { gap: 28px; }
body.student .stack > * + * { margin-top: 28px; }
body.student .section-gap { margin-top: 28px; }
body.student h2 { font-size: 21px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
body.student .stats-row { gap: 16px; margin-top: 28px; }
body.student .mini-stat { padding: 18px 20px; border-radius: 16px; }
body.student .bosses { margin-top: 28px; gap: 10px; }
body.student .week-title { padding: 26px 28px; border-radius: 20px; margin-bottom: 0; }
body.student .player-card .profile-card { gap: 28px; }

/* монета-лопатка */
.coin-ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: .3em; flex: none; }
.coin-chip a { display: inline-flex; align-items: center; }
.coin-balance { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; font-size: 40px; font-weight: 800; line-height: 1.1; }
.coin-balance .coin-ico { width: 44px; height: 44px; margin: 0; }
.coin-balance .unit { font-size: 18px; color: var(--muted); font-weight: 600; }
.nav-coins { display: inline-flex; align-items: center; }
.tabbar .coin-ico { width: 22px; height: 22px; margin: 0; }

/* ачивки: крупная иконка, монета в углу */
.badges { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; margin-top: 0; }
.badge-card { position: relative; padding: 26px 10px 18px; gap: 8px; border-radius: 16px; min-height: 140px; justify-content: center; }
.badge-card .badge-ico { font-size: 44px; line-height: 1; }
.badge-card b { font-size: 13px; line-height: 1.25; }
.badge-coins { position: absolute; top: 8px; right: 10px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; color: #a86f00; }
.badge-coins .coin-ico { margin-right: 2px; width: 15px; height: 15px; }
:root[data-theme="dark"] .badge-coins { color: #ffc24a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-coins { color: #ffc24a; } }
.badge-card .badge-reward, .badge-card .small { display: none; }

/* программа: модули колонками */
.modules { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.module-col { background: var(--surface-2); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.module-no { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.module-title { font-size: 16px; margin-bottom: 10px; }
.module-col .week-tiles { gap: 8px; }
.module-col .week-tile { width: 54px; height: 54px; border-radius: 12px; background: var(--surface); }
.module-col .week-tile.locked { background: transparent; border-style: dashed; }
.module-col .week-tile.done { background: var(--accent-soft); }
.module-col .week-tile .wt-num { font-size: 19px; }
.module-col .week-tile .wt-sub { font-size: 10px; }
.module-row { display: none; }

/* публикации: ровная сетка */
.pub-list { display: flex; flex-direction: column; }
.pub-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 128px 36px; gap: 14px; align-items: center; min-height: 68px; padding: 10px 0; border-top: 1px solid var(--line); }
.pub-row:first-child { border-top: 0; }
.pub-name { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.pub-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 13px; font-weight: 800; color: var(--muted); }
.pub-row.is-ok .pub-no { background: var(--accent); color: var(--accent-ink); }
.pub-row input { height: 44px; }
.pub-action { width: 100%; height: 44px; justify-content: center; }
.pub-row .badge.pub-action { display: inline-flex; align-items: center; border-radius: 10px; font-size: 13px; }
.pub-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-status { width: 32px; height: 32px; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 900; font-size: 15px; }
.pub-status.on { background: #3fae5a; border-color: #3fae5a; color: #fff; }
.pub-status.wait { border-color: var(--warn); font-size: 13px; }
.pub-status.no { border-color: var(--danger); color: var(--danger); }
.proj-check-cell, .proj-check { display: none; }

/* задание недели и отзыв */
.task-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
body.student .feedback-box { margin-top: 20px; padding: 18px 20px; border-radius: 16px; }
.feedback-box .fb-fields { margin: 14px 0; gap: 12px !important; }
.feedback-box.has-feedback .fb-form { display: none; }
.feedback-box.has-feedback.editing .fb-form { display: block; margin-top: 14px; }
.stars-static { color: #ffb400; font-size: 18px; letter-spacing: 1px; }
.stars-static span { color: var(--line); }
.coin-note { display: inline-flex; align-items: center; }

.footer-rules { max-width: 760px; }

@media (max-width: 1100px) { .modules { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  body.student .container { padding-top: 20px; }
  body.student .card { padding: 20px; border-radius: 16px; }
  body.student .grid, body.student .stack > * + *, body.student .section-gap { gap: 20px; margin-top: 20px; }
  .modules { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pub-row { grid-template-columns: 1fr 36px; grid-template-areas: "name status" "input input" "action action"; gap: 10px; }
  .pub-row .pub-name { grid-area: name; } .pub-row .pub-status { grid-area: status; }
  .pub-row input, .pub-row .pub-link { grid-area: input; } .pub-row .pub-action { grid-area: action; }
  .badges { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .badge-card { min-height: 118px; padding: 22px 6px 12px; } .badge-card .badge-ico { font-size: 36px; }
}

/* ===== итерация: кнопки, ширины, ачивки 5×2, программа в ряд ===== */
/* кнопки ученика: светлая тема — чёрные как «Легенда», тёмная — жёлтые как её текст */
body.student .btn-primary { background: #2b2620; border-color: #2b2620; color: #fff; }
body.student .btn-primary:hover { background: #3a332b; filter: none; }
:root[data-theme="dark"] body.student .btn-primary { background: #ffd27a; border-color: #ffd27a; color: #241c0c; }
:root[data-theme="dark"] body.student .btn-primary:hover { background: #ffdc93; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.student .btn-primary { background: #ffd27a; border-color: #ffd27a; color: #241c0c; }
}

/* верх главной: карточка шире, Miro и чат уже */
.dash-top { grid-template-columns: minmax(0, 1fr) 270px !important; }
.dash-top .bosses { flex-wrap: nowrap; justify-content: space-between; gap: 4px; }
.dash-top .ach { width: 84px; height: 84px; flex: none; }
.dash-top .ach.final { width: 92px; height: 92px; }
.dash-top .ach-arrow { font-size: 14px; }

/* ачивки: 5 в ряд, с короткой подписью */
.badges { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.badge-card { min-height: 158px; padding: 28px 12px 18px; }
.badge-card .badge-hint { display: block; font-size: 11.5px; line-height: 1.3; color: var(--muted); }

/* программа: недели строго в один ряд, без номеров */
.module-col { padding: 16px; gap: 12px; }
.mod-head { display: flex; flex-direction: column; gap: 2px; }
.mod-no { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mod-name { font-size: 16px; }
.wt-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; }
.wt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 58px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-variant-numeric: tabular-nums; }
a.wt:hover { border-color: var(--accent); text-decoration: none; }
.wt-date { font-size: 13px; font-weight: 700; }
.wt-state { font-size: 11px; color: var(--muted); font-weight: 600; }
.wt.done { background: var(--accent-soft); border-color: transparent; }
.wt.done .wt-state { color: var(--ok); font-size: 14px; }
.wt.current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.wt.current .wt-state { color: var(--accent-ink); opacity: .85; }
.wt.locked { background: transparent; border-style: dashed; color: var(--muted); }
.wt.locked .wt-state { font-size: 12px; }

/* поля ввода ссылок — скруглённые, как остальные */
input[type=url] { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 14px/1.4 var(--font); }
input[type=url]:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.pub-row input { border-radius: 12px; }
.pub-action { border-radius: 12px; }

@media (max-width: 1100px) {
  .dash-top { grid-template-columns: 1fr !important; }
  .badges { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 640px) {
  .dash-top .bosses { flex-wrap: wrap; justify-content: flex-start; }
  .dash-top .ach { width: 64px; height: 64px; } .dash-top .ach.final { width: 70px; height: 70px; }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
.coin-chip b { white-space: nowrap; }

/* выравнивание карточек в сетке по верхнему краю */
.grid > .card + .card, .grid > section + section { margin-top: 0; }
/* строка урока над плеером */
.lesson-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.lesson-bar-title { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.lesson-bar-title b { font-size: 18px; line-height: 1.3; }
.lesson-pos { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
/* недели: одинаковая ширина ячеек во всех модулях (по 3 места) */
.wt-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
/* закрытые недели в тёмной теме — лёгкая серая подложка */
:root[data-theme="dark"] .wt.locked { background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wt.locked { background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .14); } }
.wt.locked { background: rgba(0, 0, 0, .025); }

/* недели: по центру плашки модуля, одинаковая ширина, «сейчас» — чёрная (в тёмной теме — жёлтая) */
.wt-row { display: flex !important; justify-content: center; gap: 8px; }
.wt { width: 76px; flex: none; }
.wt.current { background: #2b2620; border-color: #2b2620; color: #fff; box-shadow: none; }
.wt.current .wt-state { color: #fff; opacity: .8; }
:root[data-theme="dark"] .wt.current { background: #ffd27a; border-color: #ffd27a; color: #241c0c; }
:root[data-theme="dark"] .wt.current .wt-state { color: #241c0c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wt.current { background: #ffd27a; border-color: #ffd27a; color: #241c0c; }
  :root:not([data-theme="light"]) .wt.current .wt-state { color: #241c0c; }
}
.wt.done { background: var(--surface); border: 1px solid var(--line); }
.ico-check { width: 18px; height: 18px; fill: none; stroke: var(--ok); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.module-col .mod-head { align-self: stretch; }
@media (max-width: 640px) { .wt { width: 64px; } }

/* недели: узкие (как в модуле из 3 недель), строго по центру плашки и без выхода за её края */
.wt-row { display: flex !important; justify-content: center; gap: 6px; width: 100%; }
.wt-row .wt { flex: 0 0 calc((100% - 12px) / 3); width: auto; min-width: 0; }
.pub-xp { font-size: 11px; font-weight: 800; color: var(--muted); background: var(--surface-2); padding: 2px 7px; border-radius: 99px; margin-left: -4px; align-self: flex-start; }
.pub-row.is-ok .pub-xp { color: var(--ok); background: var(--ok-soft); }

/* ===== расписание ===== */
.sched { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.meet { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.meet:first-of-type { border-top: 0; }
.meet.next { background: var(--accent-soft); margin: 0 -14px; padding: 16px 14px; border-radius: 14px; border-top: 0; }
.meet-date { display: flex; flex-direction: column; } .meet-date span { font-size: 13px; color: var(--muted); }
.meet-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zoom-link { white-space: nowrap; }
.past { margin-top: 18px; } .past summary { font-weight: 600; color: var(--muted); }
.past-row { padding: 10px 0; grid-template-columns: 110px minmax(0, 1fr) auto; }
.att-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.att-cell { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--surface); }
.att-day { font-size: 12px; font-weight: 700; color: var(--muted); }
.att-mark { font-size: 16px; font-weight: 900; line-height: 1; min-height: 16px; }
.att-cell.ok { background: var(--ok-soft); border-color: transparent; } .att-cell.ok .att-mark { color: var(--ok); }
.att-cell.miss { background: var(--danger-soft); border-color: transparent; } .att-cell.miss .att-mark { color: var(--danger); }
.att-cell.empty, .att-cell.future { border-style: dashed; }
.att-cell.final { grid-column: span 2; aspect-ratio: auto; background: linear-gradient(135deg, #ffe7a1, #f4b829); border-color: transparent; }
.att-cell.final .att-day { color: #5a3d00; } .att-cell.final.miss { background: var(--danger-soft); }
@media (max-width: 900px) { .sched { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .meet { grid-template-columns: 70px minmax(0, 1fr); } .meet .zoom-link { grid-column: 1 / -1; justify-content: center; } }

/* тёмная тема: логотип «П» и ссылки в подвале — жёлтые, как кнопки */
:root[data-theme="dark"] body.student .brand-mark { background: #ffd27a; color: #241c0c; }
:root[data-theme="dark"] body.student .footer a { color: #ffd27a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.student .brand-mark { background: #ffd27a; color: #241c0c; }
  :root:not([data-theme="light"]) body.student .footer a { color: #ffd27a; }
}

/* ===== кнопка «Сообщить об ошибке» ===== */
.bug-widget { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.bug-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 600 12px var(--font); padding: 6px 12px; border-radius: 99px; cursor: pointer; box-shadow: var(--shadow); }
.bug-toggle:hover { color: var(--text); border-color: var(--text); }
.bug-panel { order: -1; width: 300px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: 10px; }
.bug-panel[hidden] { display: none; }
.bug-panel textarea { min-height: 70px; }
body:has(> .footer) .bug-widget { bottom: 92px; }
@media (max-width: 640px) { .bug-widget { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); } .bug-panel { width: calc(100vw - 24px); } }

/* ===== публикации: ровные круги, награда над названием, единая сетка ===== */
.pub-row { grid-template-columns: 200px minmax(0, 1fr) 140px 36px !important; }
.pub-name { gap: 14px; }
.pub-no { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; }
.pub-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pub-reward { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; color: #a86f00; line-height: 1; }
.pub-reward .coin-ico { width: 13px; height: 13px; margin-right: 3px; }
:root[data-theme="dark"] .pub-reward { color: #ffc24a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pub-reward { color: #ffc24a; } }
.pub-row .pub-status { justify-self: end; }
.pub-row .pub-action { justify-self: stretch; }
.pub-xp { display: none; }

/* ===== жёлтый логотип и ссылки подвала в обеих темах ===== */
body.student .brand-mark { background: #ffd27a; color: #241c0c; }
body.student .footer a { color: #b07a00; }
:root[data-theme="dark"] body.student .footer a { color: #ffd27a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.student .footer a { color: #ffd27a; } }

/* ===== кабинет ученика: жёлтый акцент вместо фиолетового (как кнопки) ===== */
body.student { --accent: #d9a02c; --accent-ink: #241c0c; --accent-soft: #f6e9c8; }
body.student a:not(.btn):not(.wt):not(.chip) { color: #a87400; }
:root[data-theme="dark"] body.student { --accent: #ffd27a; --accent-ink: #241c0c; --accent-soft: #3a3121; }
:root[data-theme="dark"] body.student a:not(.btn):not(.wt):not(.chip) { color: #ffd27a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.student { --accent: #ffd27a; --accent-ink: #241c0c; --accent-soft: #3a3121; }
  :root:not([data-theme="light"]) body.student a:not(.btn):not(.wt):not(.chip) { color: #ffd27a; }
}
body.student .xp-bar i { background: linear-gradient(90deg, #e8b54a, #ffd27a); }
body.student .coin-chip a, body.student .tabbar a, body.student .nav a, body.student a.brand, body.student a.avatar { color: inherit; }
body.student .tabbar a.active { color: var(--accent); }
body.student .avatar { background: linear-gradient(135deg, #ffd27a, #e8a93a); }
body.student .avatar.avatar-empty { background: var(--surface-2); }
.avatar-upload-ico svg { stroke: var(--accent-ink); }
/* профиль: тап по кругу меняет фото */
.avatar-pick { cursor: pointer; flex: none; }
.avatar-pick:hover .avatar { filter: brightness(1.05); }
/* проект на проверке (напр. «Изометрия») — зелёная обводка */
body.student .ach.pending { border-style: solid; border-color: var(--ok); }

/* пройденная неделя — приглушённый бирюзово-зелёный */
.wt.done { background: rgba(38, 150, 130, .14); border-color: rgba(38, 150, 130, .22); color: var(--text); }
.wt.done .wt-state { color: var(--ok); }
:root[data-theme="dark"] .wt.done { background: rgba(80, 200, 175, .13); border-color: rgba(80, 200, 175, .22); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wt.done { background: rgba(80, 200, 175, .13); border-color: rgba(80, 200, 175, .22); } }

/* попап SCoin: компактный, серый, открывается над значком */
.info-pop .info-body { width: 210px; padding: 8px 12px; top: auto; bottom: calc(100% + 8px); right: -6px; border-radius: 10px;
  background: #5f5950; color: #f4f1ec; font-size: 12.5px; line-height: 1.4; box-shadow: 0 6px 16px rgba(0,0,0,.14); }
:root[data-theme="dark"] .info-pop .info-body { background: #3a4240; color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .info-pop .info-body { background: #3a4240; color: var(--text); } }

/* публикации: койны справа над кнопкой; серые, пока не засчитано */
.pub-act { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; }
.pub-act .pub-reward { filter: grayscale(1); opacity: .55; }
.pub-row.is-ok .pub-act .pub-reward { filter: none; opacity: 1; }
@media (max-width: 640px) { .pub-row .pub-act { grid-area: action; } }
