/* === KAVA.SCHOOL platform === */
:root {
  --ink: #292929;
  --paper: #ffffff;
  --soft: #fafaf8;
  --line: #e6e2db;

  --coffee: #3C312D;
  --coffee-pair: #A2847A;
  --bordo: #811A19;
  --blue: #1A394D;
  --blue-pair: #D2E9F9;
  --green: #3E4F2F;
  --green-pair: #8EB56C;
  --orange: #A03800;
  --orange-pair: #4C1A00;

  --yellow: #FEFF55;
  --yellow-soft: #FFF278;

  /* Rounded corners (kept from refresh) */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --header-h: 64px;

  --fd: "Inter Tight", "Formular", system-ui, -apple-system, sans-serif;
  --fb: "Inter", "Involve", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, textarea, select { font: inherit; color: inherit; }
img, video { max-width: 100%; height: auto; }

body {
  font-family: var(--fb);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.015em;
  min-height: 100dvh;
}
.hidden { display: none !important; }

/* === Global loading bar === */
.loading-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 1000;
  background: linear-gradient(90deg, transparent, var(--yellow), transparent);
  background-size: 200% 100%;
  animation: loadingMove 1.2s linear infinite;
  pointer-events: none;
}
.loading-bar.hidden { display: none; }
@keyframes loadingMove {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* Skeleton placeholder */
.skeleton {
  display: block;
  background: linear-gradient(90deg, var(--soft) 0%, var(--line) 50%, var(--soft) 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
  min-height: 14px;
}
@keyframes skeletonShimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* === COURSE SWITCHER === */
.course-switcher {
  padding: 7px 30px 7px 12px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.02em;
  color: var(--ink);
  min-height: 36px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23292929' stroke-width='1.5' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  max-width: 200px;
  text-overflow: ellipsis;
}
.course-switcher.hidden { display: none; }
.course-switcher:focus { outline: 2px solid var(--yellow); }

/* === Course cards in admin === */
.course-card {
  border: 1.5px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--paper);
  padding: 18px 20px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.course-card h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}
.course-card .course-meta {
  font-size: 12px;
  opacity: 0.65;
  font-family: var(--fd);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.course-card .course-actions { display: flex; gap: 6px; }

/* === LOGIN OVERLAY === */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bordo);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-overlay.hidden { display: none; }
.login-card {
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}
.login-brand {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.login-title {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
}
.login-sub {
  font-size: 15px;
  line-height: 1.5;
  opacity: 0.7;
  margin: 0 0 22px;
}
.login-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.login-form input {
  padding: 14px 16px;
  font-size: 15px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  border-radius: var(--r-sm);
  letter-spacing: -0.01em;
}
.login-form input:focus { outline: 3px solid var(--yellow); outline-offset: 2px; }
.login-form .btn--primary {
  border-radius: var(--r-pill);
  padding: 14px 22px;
  font-size: 14px;
  text-transform: none;
  letter-spacing: -0.01em;
}
.login-status {
  font-size: 13px;
  margin: 12px 0 6px;
  font-family: var(--fd);
  font-weight: 700;
  min-height: 18px;
}
.login-status.success { color: var(--green); }
.login-status.error { color: var(--bordo); }
.login-hint {
  font-size: 12px;
  opacity: 0.55;
  margin: 8px 0 0;
  line-height: 1.4;
}
.login-magic-btn {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  font-family: var(--fb);
  font-size: 13px;
  color: var(--bordo);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px 8px;
}
.login-magic-btn:hover { color: var(--ink); }

/* === ROLE VISIBILITY === */
body[data-role="student"] [data-vis="curator"] { display: none !important; }
body[data-role="student"] [data-vis="admin"] { display: none !important; }
body[data-role="curator"] [data-vis="student"] { display: none !important; }
/* Пункт «admin-only» виден только когда профиль = admin */
body:not([data-profile-role="admin"]) [data-vis="admin"] { display: none !important; }

/* Role strip — shows curator mode */
.role-strip {
  display: none;
  background: var(--bordo);
  color: var(--paper);
  text-align: center;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-bottom: 1.5px solid var(--ink);
  position: sticky;
  top: var(--header-h);
  z-index: 49;
}
body[data-role="curator"] .role-strip { display: block; }

/* === TOPBAR === */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  height: var(--header-h);
  background: var(--paper);
  border-bottom: 1.5px solid var(--ink);
}
.menu-btn {
  width: 36px; height: 36px;
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  padding: 0 8px;
  border: 1.5px solid var(--ink);
}
.menu-btn span { display: block; height: 2px; background: var(--ink); }
.brand {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-dot { color: var(--bordo); }
body[data-role="curator"] .brand-dot { color: var(--yellow); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.role-switch { border: 1.5px solid var(--ink); display: inline-flex; }
.role-btn {
  min-height: 36px;
  padding: 8px 14px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--paper);
  border-right: 1.5px solid var(--ink);
  transition: background .12s ease;
}
.role-btn:last-child { border-right: none; }
.role-btn.active { background: var(--ink); color: var(--paper); }
.user-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 3px;
  border: 1.5px solid var(--ink);
}
.avatar {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--yellow);
  font-family: var(--fd);
  font-weight: 800;
  font-size: 12px;
}
.user-name {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.02em;
}

/* === LAYOUT === */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100dvh - var(--header-h));
}
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0; bottom: 0;
  width: 86vw; max-width: 320px;
  background: var(--paper);
  border-right: 1.5px solid var(--ink);
  padding: 20px 18px 24px;
  overflow-y: auto;
  transform: translateX(-105%);
  transition: transform .25s ease;
  z-index: 40;
  display: flex; flex-direction: column;
}
.sidebar.open { transform: translateX(0); }
.scrim {
  position: fixed; inset: var(--header-h) 0 0 0;
  background: rgba(41,41,41,.4);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 30;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.sidebar-eyebrow {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 6px;
  opacity: 0.55;
}
.sidebar-course {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 14px;
}
.nav-sep {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 18px 0 8px;
  padding: 0 12px;
  color: var(--bordo);
  position: relative;
}
.nav-sep::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  bottom: -4px;
  height: 1.5px;
  background: var(--ink);
  opacity: 0.15;
}

.nav-list { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1.5px solid transparent;
  font-family: var(--fd);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.02em;
  background: var(--paper);
  transition: background .12s ease, transform .1s ease;
  position: relative;
}
.nav-link:hover { background: var(--soft); }
.nav-link:active { transform: scale(0.98); }
.nav-link.active {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 6px; bottom: 6px;
  width: 4px;
  background: var(--yellow);
}
.nav-link.active .stage-pill { background: var(--yellow); color: var(--ink); }
.nav-link.active .badge { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.nav-ico {
  width: 20px;
  display: inline-flex; justify-content: center;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 15px;
}
.stage-pill {
  width: 26px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 11px;
  color: var(--paper);
  flex-shrink: 0;
}
.stage-pill.s-coffee  { background: var(--coffee); }
.stage-pill.s-blue    { background: var(--blue); }
.stage-pill.s-green   { background: var(--green); }
.stage-pill.s-bordo   { background: var(--bordo); }
.stage-pill.s-orange  { background: var(--orange); }

.badge {
  margin-left: auto;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 11px;
  padding: 2px 7px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  min-width: 24px;
  text-align: center;
}
.badge--alert { background: var(--bordo); color: var(--paper); border-color: var(--bordo); }

.sidebar-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1.5px solid var(--line);
}
.sidebar-progress-label {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px;
  opacity: 0.6;
}
.progress-bar {
  height: 8px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  position: relative;
  overflow: hidden;
}
.progress-fill {
  position: absolute; inset: 0 100% 0 0;
  background: var(--yellow);
  transition: right .3s ease;
}
.sidebar-progress-text {
  margin: 8px 0 0;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.03em;
}

/* === MAIN === */
.main {
  padding: 20px 18px 80px;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}
.screen { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* === Typography === */
.eyebrow {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: var(--bordo);
}
.h1 {
  font-family: var(--fd);
  font-weight: 900;
  font-size: clamp(36px, 8vw, 56px);
  letter-spacing: -0.05em;
  line-height: 0.92;
  margin: 0 0 16px;
}
.h2 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  margin: 28px 0 14px;
}
.h2.subtle {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  opacity: 0.75;
  margin: 28px 0 14px;
}
.hl { background: var(--yellow); padding: 0 6px 4px; }
.hl--bordo { background: var(--bordo); color: var(--paper); }
.lead {
  font-size: 16px;
  line-height: 1.55;
  max-width: 60ch;
  margin: 0 0 18px;
  color: var(--ink);
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  border: 1.5px solid var(--ink);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--paper);
  transition: background .12s ease, color .12s ease;
}
.btn { min-height: 44px; }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--bordo); }
.btn--ghost:hover { background: var(--soft); }
.btn--sm { min-height: 36px; padding: 9px 14px; font-size: 12px; }

.page-head {
  display: grid;
  gap: 14px;
  padding: 6px 0 18px;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 22px;
}
.page-head .h1 { margin-bottom: 8px; }

/* === HOME stages v2 === */
.home-stages {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.home-stage-card {
  display: grid;
  grid-template-areas:
    "num head    arrow"
    "num desc    desc"
    "bar bar     bar"
    "meta meta   meta";
  grid-template-columns: 76px 1fr auto;
  gap: 4px 14px;
  align-items: center;
  padding: 18px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  text-align: left;
  transition: all .15s ease;
  cursor: pointer;
  position: relative;
  border-radius: var(--r-md);
}
.home-stage-card .num { border-radius: 12px; }
.home-stage-card:hover {
  background: var(--soft);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}
.home-stage-card.completed {
  background: var(--soft);
}
.home-stage-card.completed::after {
  content: "✓";
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green);
  color: var(--paper);
  font-family: var(--fd);
  font-weight: 900;
  font-size: 16px;
}
.home-stage-card .num {
  grid-area: num;
  width: 76px; height: 76px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: -0.05em;
  color: var(--paper);
  align-self: start;
}
.home-stage-card.s-coffee .num { background: var(--coffee); }
.home-stage-card.s-blue .num { background: var(--blue); }
.home-stage-card.s-green .num { background: var(--green); }
.home-stage-card.s-bordo .num { background: var(--bordo); }
.home-stage-card.s-orange .num { background: var(--orange); }
.home-stage-card .head {
  grid-area: head;
}
.home-stage-card h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.04em;
  margin: 0 0 4px;
  line-height: 1.05;
}
.home-stage-card .desc-text {
  grid-area: desc;
  font-size: 13px;
  line-height: 1.35;
  margin: 0 0 12px;
  opacity: 0.7;
}
.home-stage-card .bar {
  grid-area: bar;
  height: 6px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}
.home-stage-card .bar i {
  position: absolute;
  inset: 0 100% 0 0;
  background: var(--yellow);
  display: block;
  transition: right .3s ease;
}
.home-stage-card.s-coffee .bar i { background: var(--coffee-pair); }
.home-stage-card.s-blue .bar i { background: var(--blue-pair); }
.home-stage-card.s-green .bar i { background: var(--green-pair); }
.home-stage-card.s-bordo .bar i { background: var(--bordo); }
.home-stage-card.s-orange .bar i { background: var(--orange-pair); }
.home-stage-card.completed .bar i { background: var(--yellow); }
.home-stage-card .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1.5px solid var(--ink);
  font-family: var(--fd);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--paper);
  flex-shrink: 0;
  opacity: 1;
}
.home-stage-card .status-pill.todo { background: var(--soft); opacity: 0.85; }
.home-stage-card .status-pill.progress { background: var(--yellow); }
.home-stage-card .status-pill.done { background: var(--green); color: var(--paper); border-color: var(--green); }
.home-stage-card .stage-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-top: 6px;
}
.home-stage-card .stage-meta .dot {
  width: 4px; height: 4px;
  background: var(--ink);
  opacity: 0.3;
}
.home-stage-card .stage-meta .test-pill {
  padding: 2px 7px;
  background: var(--yellow);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  opacity: 1;
  font-weight: 800;
}
.home-stage-card .arrow {
  grid-area: arrow;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 22px;
  align-self: start;
}

/* === ADMIN v2 === */
.admin-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.stat-tile {
  padding: 18px 16px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  position: relative;
}
.stat-tile .stat-trend {
  position: absolute;
  top: 14px; right: 14px;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}
.stat-tile .stat-trend.up { background: var(--green-pair); }
.stat-tile .stat-trend.down { background: var(--bordo); color: var(--paper); border-color: var(--bordo); }
.stat-tile .stat-trend.flat { background: var(--soft); }
.stat-num {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 42px;
  letter-spacing: -0.05em;
  line-height: 1;
  display: block;
}
.stat-label {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 10px;
  opacity: 0.7;
  display: block;
}
.stat-tile.alert {
  background: var(--bordo);
  color: var(--paper);
}
.stat-tile.alert .stat-label { opacity: 0.85; }
.stat-tile.alert .stat-trend { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.stat-tile.accent { background: var(--yellow); }
.stat-tile-cta {
  display: inline-block;
  margin-top: 12px;
  padding: 7px 12px;
  border: 1.5px solid currentColor;
  background: transparent;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.stat-tile-cta:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.stat-tile.alert .stat-tile-cta:hover {
  background: var(--paper);
  color: var(--bordo);
  border-color: var(--paper);
}

.admin-todo {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.todo-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  transition: background .12s ease;
}
.todo-item:hover { background: var(--soft); }
.todo-item .label {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.todo-item .sub {
  font-size: 12px;
  opacity: 0.65;
  margin-top: 2px;
}
.todo-item .go {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
}

.activity {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.activity-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-left: 3px solid var(--line);
  font-size: 13.5px;
}
.activity-row.kind-hw { border-left-color: var(--green); }
.activity-row.kind-qa { border-left-color: var(--blue); }
.activity-row.kind-test { border-left-color: var(--orange); }
.activity-row.kind-join { border-left-color: var(--coffee); }
.activity-row .ico {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--fd);
  font-weight: 800;
  background: var(--soft);
}
.activity-row .when {
  font-size: 11px;
  opacity: 0.5;
  font-family: var(--fd);
  font-weight: 700;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* === Students list === */
.students-list { display: grid; gap: 8px; margin-top: 12px; }
.student-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  transition: background .12s ease;
}
.student-card:hover { background: var(--soft); }
.student-card .av {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 17px;
  background: var(--yellow);
}
.student-name {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.03em;
  margin: 0;
}
.student-meta {
  font-size: 12px;
  opacity: 0.65;
  margin-top: 2px;
}
.student-progress {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.student-progress .bar {
  width: 60px;
  height: 6px;
  background: var(--soft);
  border: 1.5px solid var(--ink);
  position: relative;
  overflow: hidden;
}
.student-progress .bar i {
  position: absolute;
  inset: 0;
  background: var(--yellow);
  display: block;
}

/* === Chips (filters) === */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
}
.chip {
  padding: 6px 12px;
  border: 1.5px solid var(--ink);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--paper);
}
.chip.active { background: var(--ink); color: var(--paper); }

/* === STAGE HERO === */
.stage-hero {
  padding: 24px;
  margin-bottom: 18px;
  color: var(--paper);
  border: 1.5px solid var(--ink);
}
.stage-hero.s-coffee  { background: var(--coffee); }
.stage-hero.s-blue    { background: var(--blue); }
.stage-hero.s-green   { background: var(--green); }
.stage-hero.s-bordo   { background: var(--bordo); }
.stage-hero.s-orange  { background: var(--orange); }
.stage-hero .eyebrow { color: var(--yellow); opacity: 1; }
.stage-hero .h1 { color: var(--paper); margin-bottom: 12px; }
.stage-hero .lead { color: var(--paper); opacity: 0.92; }
.stage-progress-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
}
.stage-progress-row .progress-bar {
  flex: 1;
  background: rgba(255,255,255,0.15);
  border-color: var(--paper);
}
.stage-progress-row .progress-fill { background: var(--yellow); }
.stage-progress-text {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 14px;
  color: var(--paper);
  min-width: 40px;
  text-align: right;
}

/* === TABS === */
.tabs-wrap {
  position: relative;
  margin-bottom: 18px;
}
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--ink);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.tabs::after {
  content: "";
  position: sticky;
  right: 0;
  width: 32px;
  flex-shrink: 0;
  background: linear-gradient(to left, var(--paper), transparent);
  pointer-events: none;
  align-self: stretch;
}
.tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 11px 18px;
  border: 1.5px solid var(--ink);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  background: var(--paper);
  white-space: nowrap;
  transition: background .12s ease, color .12s ease, transform .1s ease;
}
.tab:hover { background: var(--soft); }
.tab:active { transform: scale(0.97); }
.tab.active { background: var(--ink); color: var(--paper); }
.tab-content { padding-top: 4px; }

/* === KB === */
.search {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  font-size: 14px;
  background: var(--paper);
  margin-bottom: 12px;
}
.kb-list { display: grid; gap: 0; }
/* Legacy — оставлен на случай, если где-то ещё рендерится */
.kb-section-title {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bordo);
  margin: 24px 0 4px;
  padding: 8px 0;
  border-top: 1.5px solid var(--ink);
}
.kb-section-title:first-child { margin-top: 8px; border-top: none; }

/* Сворачиваемые разделы базы знаний */
.kb-section { border-top: 1.5px solid var(--ink); }
.kb-section:first-of-type { border-top: none; }
.kb-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 0;
  padding: 20px 4px;
  cursor: pointer;
  text-align: left;
  font-family: var(--fd);
  color: var(--ink);
  transition: background 0.15s ease;
}
.kb-section-toggle:hover { background: rgba(129, 26, 25, 0.04); }
.kb-section-name {
  flex: 1;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--bordo);
  line-height: 1.15;
}
.kb-section-meta {
  font-family: var(--ft);
  font-size: 13px;
  font-weight: 400;
  color: rgba(41, 41, 41, 0.55);
  white-space: nowrap;
}
.kb-section-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bordo);
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.kb-section.open .kb-section-icon { transform: rotate(45deg); }
.kb-section-body {
  display: none;
  padding: 0 0 18px;
  display: grid;
  gap: 8px;
}
.kb-section:not(.open) .kb-section-body { display: none; }
@media (max-width: 720px) {
  .kb-section-name { font-size: 18px; line-height: 1.2; }
  .kb-section-toggle { padding: 16px 4px; gap: 10px; }
  .kb-section-meta { display: none; }
  .kb-section-icon { width: 28px; height: 28px; font-size: 20px; }
}
.kb-body h4 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  margin: 16px 0 8px;
  color: var(--ink);
}
.kb-body h4:first-child { margin-top: 4px; }
.kb-body ol { padding-left: 22px; margin: 0 0 14px; }
.kb-body ol li { margin-bottom: 8px; line-height: 1.55; }

/* Таблицы в статьях (для шорткатов, сравнений и т.п.) */
.kb-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-family: var(--ft);
  font-size: 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}
.kb-body table thead {
  background: var(--ink);
  color: var(--paper);
}
.kb-body table th {
  text-align: left;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-right: 1px solid rgba(254, 248, 235, 0.18);
}
.kb-body table th:last-child { border-right: 0; }
.kb-body table td {
  padding: 10px 14px;
  border-top: 1px solid rgba(41, 41, 41, 0.12);
  border-right: 1px solid rgba(41, 41, 41, 0.08);
  vertical-align: top;
  line-height: 1.5;
}
.kb-body table td:last-child { border-right: 0; }
.kb-body table tr:nth-child(even) td {
  background: rgba(60, 49, 45, 0.03);
}
.kb-body table td:first-child {
  font-family: var(--fd);
  font-weight: 700;
  color: var(--bordo);
  white-space: nowrap;
  width: 1%;
}
.kb-body table td strong {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  padding: 2px 8px;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.02em;
  border: 1px solid var(--ink);
  white-space: nowrap;
}
.kb-body table th strong { background: transparent; border: 0; color: inherit; padding: 0; font-size: inherit; }

/* На мобиле — горизонтальный скролл вместо ломки */
@media (max-width: 720px) {
  .kb-body table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .kb-body table td:first-child { white-space: nowrap; }
}
.kb-card { border: 1.5px solid var(--ink); background: var(--paper); }
.kb-q {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-align: left;
  background: var(--paper);
  transition: background .12s ease;
}
.kb-q:hover { background: var(--soft); }
.kb-card.open .kb-q { background: var(--yellow); }
.kb-arrow {
  font-family: var(--fd);
  font-weight: 800;
  transition: transform .2s ease;
}
.kb-card.open .kb-arrow { transform: rotate(45deg); }
.kb-body {
  padding: 0 16px 16px;
  font-size: 14.5px;
  line-height: 1.55;
  border-top: 1.5px solid var(--line);
  display: none;
}
.kb-card.open .kb-body { display: block; padding-top: 14px; }
.kb-body ol, .kb-body ul { margin: 0; padding-left: 20px; }
.kb-body ol li, .kb-body ul li { margin-bottom: 6px; }
.kb-body code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 1px 6px;
}

/* === Video === */
.video-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.video-card {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  cursor: pointer;
}
.video-thumb {
  aspect-ratio: 16 / 10;
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd);
  font-weight: 900;
  font-size: 22px;
}
.video-meta-title {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 4px;
}
.video-meta-sub { font-size: 12px; opacity: 0.6; }
.video-state {
  width: 22px; height: 22px;
  border: 1.5px solid var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 800;
  background: var(--paper);
}
.video-card.done .video-state { background: var(--ink); color: var(--paper); }
.video-card.done .video-state::before { content: "✓"; }

/* === Q&A === */
.qa-list { display: grid; gap: 8px; }
.qa-card {
  border: 1.5px solid var(--ink);
  padding: 14px 16px;
  background: var(--paper);
}
.qa-card.unanswered { border-left: 4px solid var(--bordo); }
.qa-q {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.qa-a {
  font-size: 14px;
  line-height: 1.5;
  margin: 8px 0 0;
  padding-top: 10px;
  border-top: 1.5px solid var(--line);
}
.qa-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; opacity: 0.6; }
.qa-meta strong { font-weight: 700; opacity: 1; }
.qa-stage-chip {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  color: var(--paper);
  display: inline-block;
}

/* === HW === */
.hw-list { display: grid; gap: 10px; }
.hw-card {
  border: 1.5px solid var(--ink);
  padding: 16px 18px;
  background: var(--paper);
  display: grid;
  gap: 10px;
}
.hw-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
}
.hw-title {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.03em;
  margin: 0;
}
.hw-sub {
  font-size: 12px;
  opacity: 0.65;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.hw-status {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1.5px solid var(--ink);
}
.hw-status--todo { background: var(--paper); }
.hw-status--review { background: var(--yellow); }
.hw-status--accepted { background: var(--green-pair); }
.hw-status--rework { background: var(--bordo); color: var(--paper); border-color: var(--bordo); }
.hw-desc { font-size: 14px; line-height: 1.5; }
.hw-comment {
  background: var(--soft);
  border-left: 3px solid var(--bordo);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
}
.hw-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* === Schedule — calendar grid + list (KAVA brand) === */
.cal-month {
  background: var(--bordo);
  border: none;
  border-radius: var(--r-lg);
  padding: 22px 22px 18px;
  margin-bottom: 18px;
  color: var(--paper);
}
.cal-head { margin-bottom: 16px; }
.cal-eyebrow {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--yellow);
  opacity: 0.85;
  margin: 0 0 6px;
}
.cal-title {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--paper);
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.cal-weekdays span {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.6;
  text-align: center;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  transition: background .12s ease, transform .1s ease;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 14px;
  color: var(--paper);
}
.cal-cell.empty {
  background: transparent;
  border-color: transparent;
}
.cal-cell[data-sch-event] { cursor: pointer; }
.cal-cell[data-sch-event]:hover {
  transform: scale(1.05);
  border-color: var(--yellow);
}
.cal-day { font-size: 14px; line-height: 1; }
.cal-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: block;
}
.cal-dot.k-lecture { background: var(--yellow); }
.cal-dot.k-deadline { background: var(--paper); }
.cal-dot.k-stream { background: var(--yellow-soft); }
.cal-cell.k-lecture {
  background: rgba(254, 255, 85, 0.2);
  border-color: var(--yellow);
}
.cal-cell.k-deadline {
  background: var(--coffee);
  border-color: var(--coffee);
  color: var(--paper);
}
.cal-cell.k-stream {
  background: var(--yellow-soft);
  border-color: var(--yellow-soft);
  color: var(--ink);
}
.cal-cell.k-stream .cal-dot { background: var(--ink); }
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.cal-legend .leg {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cal-legend .leg::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 3px;
  display: block;
}
.cal-legend .leg-lecture::before { background: rgba(254, 255, 85, 0.4); border: 1.5px solid var(--yellow); }
.cal-legend .leg-deadline::before { background: var(--coffee); }
.cal-legend .leg-stream::before { background: var(--yellow-soft); }

@media (min-width: 600px) {
  .cal-cell { font-size: 16px; }
  .cal-day { font-size: 16px; }
  .cal-title { font-size: 28px; }
}

/* === Schedule list (under calendar) === */
.schedule { display: grid; gap: 10px; }
.sch-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  border: 1.5px solid var(--ink);
  padding: 14px 16px;
  background: var(--paper);
  align-items: center;
}
.sch-date {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.sch-date small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
  opacity: 0.65;
}
.sch-title {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.sch-kind { font-size: 12px; opacity: 0.85; font-weight: 600; }
.sch-kind.k-lecture { color: var(--blue); }
.sch-kind.k-deadline { color: var(--bordo); }
.sch-kind.k-stream { color: var(--green); }

/* === Streams === */
.stream-upcoming {
  border: 1.5px solid var(--ink);
  background: var(--coffee);
  color: var(--paper);
  padding: 22px;
  display: grid; gap: 10px;
  margin-bottom: 14px;
}
.stream-upcoming h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  margin: 0;
}
.stream-upcoming .meta { font-size: 13px; opacity: 0.9; }
.stream-archive { display: grid; grid-template-columns: 1fr; gap: 10px; }
.stream-archive-card {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  display: grid;
  gap: 10px;
}
.stream-thumb {
  aspect-ratio: 16/9;
  background: var(--blue);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd);
  font-weight: 900;
  font-size: 28px;
}
.stream-archive-card .meta { padding: 0 14px 14px; }
.stream-archive-card h4 {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.stream-archive-card p { font-size: 12px; opacity: 0.6; margin: 0; }

.stream-stage-group {
  margin-bottom: 24px;
  border: 1.5px solid var(--ink);
  padding: 16px;
}
.stream-stage-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.stream-stage-head h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.03em;
  margin: 0;
}

/* === News === */
.news-list { display: grid; gap: 8px; }
.news-list.big { gap: 12px; }
.news-card {
  border: 1.5px solid var(--ink);
  padding: 14px 16px;
  background: var(--paper);
}
.news-card.big { padding: 18px 20px; }
.news-date {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}
.news-title {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.03em;
  margin: 6px 0 8px;
}
.news-card.big .news-title { font-size: 22px; }
.news-body { font-size: 14px; line-height: 1.5; margin: 0; }

/* === FORM ERROR === */
.form-error {
  background: var(--bordo);
  color: var(--paper);
  padding: 10px 12px;
  border: 1.5px solid var(--bordo);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

/* === ADMIN ROW (edit/delete on content cards) === */
.admin-row {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1.5px solid var(--line);
  background: var(--soft);
}
.admin-row button {
  min-height: 36px;
  padding: 8px 14px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  transition: transform .1s ease, background .12s ease;
}
.admin-row button:hover { background: var(--yellow); }
.admin-row button:active { transform: scale(0.97); }
.admin-row button.danger { color: var(--bordo); border-color: var(--bordo); }
.admin-row button.danger:hover { background: var(--bordo); color: var(--paper); }

/* === ANALYTICS === */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 880px) {
  .analytics-grid { grid-template-columns: 1fr 1fr; }
  .analytics-card.full { grid-column: 1 / -1; }
}
.analytics-card {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 20px;
}
.analytics-card h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  text-transform: uppercase;
}
.analytics-card .ac-sub {
  font-size: 12px;
  opacity: 0.6;
  margin: 0 0 16px;
}
.bar-chart {
  display: grid;
  gap: 8px;
}
.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 50px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.bar-row .lbl {
  font-family: var(--fd);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-row .track {
  position: relative;
  height: 14px;
  background: var(--soft);
  border: 1.5px solid var(--ink);
  overflow: hidden;
}
.bar-row .fill {
  position: absolute;
  inset: 0 100% 0 0;
  background: var(--yellow);
  transition: right .3s ease;
}
.bar-row .val {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 13px;
  text-align: right;
}
.stacked-bar {
  height: 28px;
  border: 1.5px solid var(--ink);
  display: flex;
  overflow: hidden;
  margin-bottom: 12px;
}
.stacked-bar .seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 12px;
  color: var(--ink);
  min-width: 24px;
}
.stacked-bar .seg.todo { background: var(--paper); border-right: 1.5px solid var(--ink); }
.stacked-bar .seg.review { background: var(--yellow); border-right: 1.5px solid var(--ink); }
.stacked-bar .seg.accepted { background: var(--green-pair); border-right: 1.5px solid var(--ink); }
.stacked-bar .seg.rework { background: var(--bordo); color: var(--paper); }
.stacked-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--fd);
  font-weight: 700;
}
.stacked-legend span { display: inline-flex; align-items: center; gap: 6px; }
.stacked-legend span::before {
  content: "";
  width: 10px; height: 10px;
  border: 1.5px solid var(--ink);
  display: block;
}
.stacked-legend .l-todo::before { background: var(--paper); }
.stacked-legend .l-review::before { background: var(--yellow); }
.stacked-legend .l-accepted::before { background: var(--green-pair); }
.stacked-legend .l-rework::before { background: var(--bordo); }

/* === DRAG HANDLE === */
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  cursor: grab;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }
.drag-handle:hover { background: var(--yellow); }
[draggable="true"] { transition: opacity .15s ease; }
.is-dragging { opacity: 0.4; }
.drop-target {
  outline: 2px dashed var(--bordo);
  outline-offset: -2px;
}

/* === SEARCH === */
.topbar-search-btn {
  width: 36px; height: 36px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar-search-btn:hover { background: var(--yellow); }

.search-panel {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 16px 16px;
}
.search-panel-scrim {
  position: absolute; inset: 0;
  background: rgba(41,41,41,.55);
}
.search-panel-content {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  width: 100%;
  max-width: 680px;
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
}
.search-panel-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  border-bottom: 1.5px solid var(--ink);
}
.search-panel-head input {
  padding: 16px 18px;
  border: none;
  font-size: 16px;
  font-family: var(--fb);
  background: var(--paper);
  letter-spacing: -0.01em;
  outline: none;
}
.search-close-btn {
  width: 56px;
  border: none;
  border-left: 1.5px solid var(--ink);
  background: var(--paper);
  font-family: var(--fd);
  font-weight: 800;
  font-size: 24px;
}
.search-close-btn:hover { background: var(--soft); }
.search-results {
  overflow-y: auto;
  flex: 1;
  padding: 12px;
}
.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 4px 16px;
}
.search-suggestions p {
  width: 100%;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 0 0 4px;
}
.search-suggestion {
  padding: 6px 12px;
  border: 1.5px solid var(--ink);
  font-family: var(--fd);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: -0.01em;
  background: var(--paper);
  cursor: pointer;
}
.search-suggestion:hover { background: var(--yellow); }
.search-group { margin-bottom: 14px; }
.search-group-title {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: 6px 4px 8px;
}
.search-result {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  margin-bottom: 6px;
  width: 100%;
  text-align: left;
  font-family: var(--fb);
  transition: background .12s ease;
}
.search-result:hover { background: var(--yellow); }
.search-result .type {
  width: 32px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft);
  font-family: var(--fd);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.search-result .title {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.search-result .sub {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 2px;
}
.search-result .arrow {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 16px;
}

/* === LESSON NOTES === */
.lesson-notes {
  width: 100%;
  min-height: 110px;
  padding: 14px 16px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-family: var(--fb);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  letter-spacing: -0.01em;
}
.lesson-notes:focus { outline: 3px solid var(--yellow); outline-offset: 2px; }
.lesson-notes-status {
  font-size: 11px;
  opacity: 0.55;
  margin: 6px 0 0;
  font-family: var(--fd);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: 14px;
}

/* === ONBOARDING === */
.onboard-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.onboard-modal .scrim { position: absolute; inset: 0; background: rgba(41,41,41,.6); }
.onboard-content {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  width: 100%;
  max-width: 460px;
  padding: 32px 28px;
  text-align: center;
}
.onboard-step {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 0 0 14px;
}
.onboard-ico {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  background: var(--yellow);
  font-family: var(--fd);
  font-weight: 900;
  font-size: 36px;
}
.onboard-content h2 {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 12px;
}
.onboard-content p {
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 22px;
}
.onboard-dots {
  display: flex; justify-content: center; gap: 6px;
  margin-bottom: 18px;
}
.onboard-dots span {
  width: 8px; height: 8px;
  background: var(--line);
}
.onboard-dots span.active { background: var(--ink); }
.onboard-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* === HOME HERO v3 — KAVA brand (бордо + жёлтый) === */
.hero-card {
  border: none;
  background: var(--bordo);
  color: var(--paper);
  padding: 32px 30px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
}
.hero-card::before {
  content: "";
  position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, var(--yellow) 0%, transparent 65%);
  opacity: 0.12;
  border-radius: 50%;
}
.hero-card .eyebrow {
  color: var(--yellow);
  opacity: 1;
}
.hero-card .h1 {
  color: var(--paper);
  font-family: var(--fd);
  font-weight: 800;
  font-size: clamp(34px, 7vw, 48px);
  letter-spacing: -0.04em;
  margin: 0 0 6px;
  line-height: 1;
}
.hero-card .hero-name {
  color: var(--paper);
}
.hero-tagline {
  font-family: var(--fd);
  font-weight: 700;
  font-size: clamp(18px, 3.5vw, 22px);
  letter-spacing: -0.02em;
  color: var(--yellow);
  margin: 0 0 18px;
  display: inline-block;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 2px;
  line-height: 1.2;
}
.hero-card .lead {
  color: var(--paper);
  opacity: 0.9;
  max-width: 56ch;
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.55;
}
.hero-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 22px;
}
.hero-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-pill);
}
.hero-progress-fill {
  position: absolute;
  inset: 0 100% 0 0;
  background: var(--yellow);
  transition: right .4s ease;
  border-radius: var(--r-pill);
}
.hero-progress-text {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.03em;
  min-width: 48px;
  text-align: right;
  color: var(--yellow);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
.hero-actions .btn--primary {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--yellow);
  border-radius: var(--r-pill);
  padding: 14px 24px;
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: 14px;
}
.hero-actions .btn--primary:hover {
  background: var(--paper);
  border-color: var(--paper);
}
.btn--ghost-on-dark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border: 1.5px solid var(--paper);
  border-radius: var(--r-pill);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: none;
  background: transparent;
  color: var(--paper);
  min-height: 44px;
  transition: background .12s ease, color .12s ease;
}
.btn--ghost-on-dark:hover {
  background: var(--paper);
  color: var(--bordo);
}
.btn--ghost-on-dark:active { transform: scale(0.97); }
.hero-card .eyebrow {
  color: var(--yellow);
  opacity: 1;
  margin-bottom: 12px;
}
.hero-card .h1 {
  color: var(--paper);
  font-size: clamp(40px, 9vw, 64px);
  margin: 0 0 18px;
}
.hero-card .hl {
  background: var(--yellow);
  color: var(--ink);
}
.hero-card .lead {
  color: var(--paper);
  opacity: 0.85;
  max-width: 540px;
  margin-bottom: 22px;
  font-size: 15px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 22px;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.hero-stat {
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0 14px 0 0;
}
.hero-stat:last-child { border-right: none; padding-right: 0; }
.hero-stat:not(:first-child) { padding-left: 14px; }
.hero-stat-num {
  font-family: var(--fd);
  font-weight: 800;
  font-size: clamp(28px, 5vw, 36px);
  letter-spacing: -0.04em;
  line-height: 1;
  display: block;
  color: var(--yellow);
}
.hero-stat-num .pct {
  font-size: 14px;
  opacity: 0.7;
  letter-spacing: 0;
  margin-left: 4px;
  color: var(--paper);
}
.hero-stat-label {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.75;
  margin-top: 8px;
  display: block;
}

/* === "TODAY" focus card (HOME) — KAVA brand === */
.today-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 26px 28px;
  background: var(--coffee);
  border: none;
  margin-bottom: 18px;
  position: relative;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: var(--fb);
  color: var(--paper);
  border-radius: var(--r-lg);
  transition: transform .15s ease, box-shadow .15s ease;
  overflow: hidden;
}
.today-card::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--yellow) 0%, transparent 65%);
  opacity: 0.1;
  border-radius: 50%;
}
.today-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(60, 49, 45, 0.3);
}
.today-card:active { transform: translateY(0); }
.today-card .kicker {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--yellow);
  margin: 0;
  position: relative;
  z-index: 1;
}
.today-card h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: clamp(22px, 4vw, 28px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 4px 0 6px;
  color: var(--paper);
  position: relative;
  z-index: 1;
}
.today-card .reason {
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  color: var(--paper);
  opacity: 0.85;
  max-width: 52ch;
  position: relative;
  z-index: 1;
}
.today-card .cta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yellow);
  position: relative;
  z-index: 1;
}
.today-card .cta-row .arrow {
  font-size: 22px;
}
.today-card.done {
  background: var(--soft);
  border: 1.5px solid var(--line);
  color: var(--ink);
}
.today-card.done::before { display: none; }
.today-card.done .kicker { color: var(--green); }
.today-card.done h3 { color: var(--ink); }
.today-card.done .reason { color: var(--ink); }
.today-card.done .cta-row { border-top-color: var(--line); color: var(--green); }

/* === STAGE PATH — pill buttons === */
.stage-path {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.stage-path::-webkit-scrollbar { display: none; }
.stage-path-item {
  flex-shrink: 0;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
  padding: 9px 14px;
  border-radius: var(--r-pill);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  transition: all .15s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stage-path-item:hover {
  border-color: rgba(255,255,255,0.5);
  color: var(--paper);
}
.stage-path-item.completed {
  background: rgba(254,255,85,0.12);
  border-color: rgba(254,255,85,0.4);
  color: var(--yellow);
}
.stage-path-item.completed::before {
  content: "✓";
  font-weight: 800;
}
.stage-path-item.current {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
  font-weight: 800;
}
.stage-path-label {
  display: inline;
}
.stage-path-item i { display: none; }
@media (max-width: 600px) {
  .stage-path-item { font-size: 11px; padding: 8px 12px; }
}

/* === HOME continue / deadlines === */
.continue-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1.5px solid var(--ink);
  background: var(--yellow);
  cursor: pointer;
  text-align: left;
  transition: background .12s ease;
}
.continue-card:hover { background: var(--yellow-soft); }
.continue-card .ico {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--fd);
  font-weight: 900;
  font-size: 22px;
}
.continue-card .label {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}
.continue-card h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
  margin: 4px 0 0;
  line-height: 1.1;
}
.continue-card .go {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 24px;
}

.deadlines { display: grid; gap: 8px; margin-bottom: 18px; }

/* === Combined timeline section (calendar + deadlines) === */
.timeline-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.timeline-deadlines { display: grid; gap: 8px; align-content: start; }
.timeline-deadlines:empty { display: none; }
.timeline-calendar:empty { display: none; }
.timeline-deadlines .deadline-row { width: 100%; }
.timeline-deadlines-title {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bordo);
  margin: 0 0 4px;
  padding-left: 2px;
}
@media (min-width: 900px) {
  .timeline-section {
    grid-template-columns: 1.5fr 1fr;
    align-items: start;
  }
  .timeline-calendar { order: 0; }
  .timeline-deadlines { order: 1; }
}
.deadline-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  width: 100%;
  text-align: left;
  font-family: var(--fb);
  transition: background .12s ease, transform .1s ease;
}
.deadline-row:hover { background: var(--soft); }
.deadline-row:active { transform: scale(0.99); }
.deadline-row .date {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.04em;
  line-height: 1;
}
.deadline-row .date small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
  opacity: 0.6;
}
.deadline-row .label {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  margin: 0;
}
.deadline-row .meta {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 2px;
}
.deadline-row .days {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 12px;
  padding: 4px 10px;
  border: 1.5px solid var(--ink);
}
.deadline-row .days.urgent { background: var(--bordo); color: var(--paper); border-color: var(--bordo); }
.deadline-row .days.soon { background: var(--yellow); }

/* === PROFILE === */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.profile-card {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 20px;
}
.profile-card.profile-stats h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.profile-avatar {
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: var(--yellow);
  font-family: var(--fd);
  font-weight: 900;
  font-size: 36px;
  margin-bottom: 14px;
}
.profile-info { display: grid; gap: 8px; }
.profile-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row strong {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}
.profile-row span { word-break: break-word; }
.profile-row .edit-btn {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--bordo);
  background: transparent;
  padding: 4px 8px;
  border: 1.5px solid var(--bordo);
}
.profile-row .edit-btn:hover { background: var(--bordo); color: var(--paper); }

.profile-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.profile-stat-row:last-child { border-bottom: none; }
.profile-stat-label {
  font-size: 13px;
  opacity: 0.7;
}
.profile-stat-num {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.achievements {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.achievement {
  padding: 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  text-align: center;
}
.achievement.unlocked { background: var(--yellow); }
.achievement.locked { opacity: 0.4; }
.achievement .ico {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 28px;
  display: block;
  margin-bottom: 4px;
}
.achievement .name {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  display: block;
}
.achievement .desc {
  font-size: 10.5px;
  opacity: 0.6;
  margin-top: 3px;
  display: block;
  line-height: 1.3;
}

@media (min-width: 700px) {
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .achievements { grid-template-columns: repeat(4, 1fr); }
}

/* === STAGE COMPLETE BANNER === */
.complete-banner {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  margin-bottom: 16px;
  border: 1.5px solid var(--ink);
  background: var(--yellow);
}
.complete-banner .ico {
  width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--fd);
  font-weight: 900;
  font-size: 28px;
}
.complete-banner h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}
.complete-banner p {
  font-size: 13px;
  margin: 0;
}
.complete-banner a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
}

/* === LESSON DETAIL === */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.breadcrumbs button {
  background: none;
  border: none;
  padding: 4px 0;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bordo);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  cursor: pointer;
}
.breadcrumbs button:hover { color: var(--ink); }
.breadcrumbs .sep {
  color: var(--ink);
  opacity: 0.35;
  font-size: 12px;
}
.breadcrumbs .current { opacity: 0.6; }

.after-card-section { margin-top: 4px; margin-bottom: 26px; }
.after-card {
  border: 1.5px solid var(--ink);
  background: var(--yellow);
  padding: 20px 22px;
}
.after-card .kicker {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.after-list {
  counter-reset: after-step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.after-list li {
  counter-increment: after-step;
  position: relative;
  padding-left: 36px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
}
.after-list li::before {
  content: counter(after-step);
  position: absolute;
  left: 0; top: -2px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--fd);
  font-weight: 800;
  font-size: 13px;
}
.after-list li.done {
  text-decoration: line-through;
  opacity: 0.6;
}
.after-list li.done::before {
  background: var(--green);
  color: var(--paper);
  content: "✓";
}

.lesson-player {
  border: 1.5px solid var(--ink);
  margin-bottom: 22px;
  overflow: hidden;
  background: var(--ink);
}
.player-placeholder {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 30% 30%, rgba(254,255,85,0.08) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(129,26,25,0.12) 0%, transparent 50%),
    var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 20px;
  position: relative;
}
.player-placeholder::before {
  content: "ВИДЕОУРОК";
  position: absolute;
  top: 14px; left: 14px;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--yellow);
  background: rgba(0,0,0,0.4);
  padding: 4px 8px;
}
.player-placeholder::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 36px;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}
.player-controls {
  position: absolute;
  bottom: 12px; left: 14px; right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--paper);
  opacity: 0.85;
}
.player-controls .timeline {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.2);
  position: relative;
}
.player-controls .timeline i {
  position: absolute;
  inset: 0 70% 0 0;
  background: var(--yellow);
}
.play-circle {
  width: 88px; height: 88px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--yellow);
  background: rgba(254,255,85,0.1);
  color: var(--yellow);
  font-size: 32px;
  border-radius: 50%;
  transition: transform .2s ease, background .2s ease;
  cursor: pointer;
  z-index: 1;
}
.play-circle:hover {
  transform: scale(1.08);
  background: var(--yellow);
  color: var(--ink);
}
.player-hint {
  margin: 0;
  font-size: 11px;
  opacity: 0.55;
  line-height: 1.4;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.02em;
  z-index: 1;
}

.lesson-head { margin-bottom: 22px; }
.lesson-head .eyebrow { color: var(--bordo); }
.lesson-head .h1 { font-size: clamp(28px, 6vw, 44px); margin: 4px 0 10px; }
.lesson-meta {
  font-size: 13px;
  opacity: 0.6;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
}
.lesson-meta strong { opacity: 1; }

.lesson-section { margin-bottom: 26px; }
.lesson-section .h2 { margin-top: 0; }
.lesson-body {
  max-width: 65ch;
}
.lesson-body p {
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 16px;
  color: var(--ink);
}
.lesson-body p strong {
  background: var(--yellow-soft);
  padding: 0 4px;
  font-weight: 700;
}
.lesson-body ul, .lesson-body ol {
  padding-left: 24px;
  margin: 0 0 18px;
}
.lesson-body li {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 8px;
  padding-left: 4px;
}
.lesson-body li::marker { color: var(--bordo); font-weight: 700; }

.materials { display: grid; gap: 8px; }
.material-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  text-decoration: none;
  transition: background .12s ease;
}
.material-card:hover { background: var(--yellow); }
.material-ico {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--soft);
  font-family: var(--fd);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.material-card.figma .material-ico { background: var(--coffee); color: var(--paper); }
.material-card.pdf .material-ico { background: var(--bordo); color: var(--paper); }
.material-card.link .material-ico { background: var(--blue); color: var(--paper); }
.material-label {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.02em;
  margin: 0 0 2px;
}
.material-sub {
  font-size: 11px;
  opacity: 0.55;
}
.material-arrow {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
}

.lesson-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 22px;
  border-top: 1.5px solid var(--ink);
  margin-top: 22px;
}
@media (min-width: 600px) {
  .lesson-actions { grid-template-columns: auto 1fr auto; }
}

/* === HW with submission === */
.hw-submission {
  background: var(--soft);
  border-left: 3px solid var(--green);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
}
.hw-submission strong { font-weight: 700; }
.hw-submission .sub-row {
  display: flex; gap: 8px; align-items: center;
  margin-top: 6px;
  font-size: 12px;
  flex-wrap: wrap;
}
.hw-submission .file-chip {
  padding: 2px 8px;
  border: 1px solid var(--ink);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  background: var(--paper);
}
.hw-submission a { color: var(--blue); text-decoration: underline; word-break: break-all; }

/* === Notification dot === */
.nav-dot {
  display: none;
  width: 8px; height: 8px;
  background: var(--bordo);
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-link.has-unread .nav-dot { display: inline-block; }
.nav-link.has-unread:not(.active) .badge { background: var(--bordo); color: var(--paper); border-color: var(--bordo); }

/* === Finance === */
.finance-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}
.finance-row .av {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 14px;
  background: var(--yellow);
}
.finance-name {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  margin: 0;
}
.finance-meta {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 2px;
}
.finance-sum {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.finance-pill {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1.5px solid var(--ink);
}
.finance-pill.paid { background: var(--green-pair); }
.finance-pill.unpaid { background: var(--bordo); color: var(--paper); border-color: var(--bordo); }

/* === Telegram CTA === */
.tg-cta {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 22px;
  align-items: start;
  padding: 28px;
  border: 1.5px solid var(--ink);
  background: var(--blue);
  color: var(--paper);
}
.tg-cta-ico {
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--fd);
  font-weight: 900;
  font-size: 38px;
  flex-shrink: 0;
}
.tg-cta h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
  color: var(--paper);
}
.tg-cta p {
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0 0 16px;
  opacity: 0.92;
}
.tg-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tg-cta .btn--primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
  text-decoration: none;
}
.tg-cta .btn--primary:hover { background: var(--yellow); }
.tg-cta .btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
  text-decoration: none;
}
.tg-cta .btn--ghost:hover { background: rgba(255,255,255,0.1); }
.tg-cta-note {
  font-size: 12px;
  opacity: 0.65;
  margin: 14px 0 0;
  font-style: italic;
}
@media (max-width: 600px) {
  .tg-cta { grid-template-columns: 1fr; padding: 22px; }
  .tg-cta-ico { width: 60px; height: 60px; font-size: 28px; }
}

/* === Chat (deprecated, kept for future) === */
.chat {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  display: flex; flex-direction: column;
  height: 60dvh;
  min-height: 400px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.msg {
  max-width: 80%;
  padding: 8px 12px;
  border: 1.5px solid var(--ink);
  font-size: 14px;
  line-height: 1.4;
}
.msg .who {
  display: block;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.65;
}
.msg.mine { align-self: flex-end; background: var(--yellow); }
.msg.curator { background: var(--coffee); color: var(--paper); }
.msg.curator .who { opacity: 0.85; }
.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1.5px solid var(--ink);
  background: var(--soft);
}
.chat-input input {
  padding: 11px 12px;
  border: 1.5px solid var(--ink);
  font-size: 14px;
  background: var(--paper);
}

/* === Test === */
.test-intro {
  border: 1.5px solid var(--ink);
  padding: 18px;
  background: var(--soft);
  margin-bottom: 14px;
}
.test-intro h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}
.test-intro p { font-size: 14px; line-height: 1.5; margin: 0; }
.test-q {
  border: 1.5px solid var(--ink);
  padding: 16px 18px;
  background: var(--paper);
  margin-bottom: 10px;
}
.test-q h4 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
}
.test-options { display: grid; gap: 6px; }
.test-option {
  text-align: left;
  padding: 11px 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.3;
  transition: background .12s ease;
  width: 100%;
}
.test-option:hover:not(:disabled) { background: var(--soft); }
.test-option:disabled { cursor: default; }
.test-option.correct { background: var(--green-pair); border-color: var(--green); }
.test-option.wrong { background: var(--bordo); color: var(--paper); border-color: var(--bordo); }
.test-option.reveal { background: var(--yellow); }
.test-explain {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--ink);
  background: var(--soft);
  font-size: 13.5px;
  line-height: 1.45;
}
.test-result {
  margin-top: 14px;
  padding: 18px;
  border: 1.5px solid var(--ink);
  background: var(--yellow);
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
  text-align: center;
}

.empty {
  padding: 20px 18px;
  background: var(--soft);
  border: 1.5px dashed var(--ink);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  text-align: center;
}
.empty strong { font-family: var(--fd); font-weight: 700; }
.empty-cta {
  display: inline-flex;
  margin-top: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 13px;
  color: var(--bordo);
}

/* === Modal === */
.modal-root {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.modal-scrim { position: absolute; inset: 0; background: rgba(41,41,41,.5); }
.modal {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  width: 100%;
  max-width: 520px;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 26px 22px 22px;
}
/* Большая модалка — для карточки ученика */
.modal--wide {
  max-width: 1100px;
  max-height: 94dvh;
  padding: 32px 36px 28px;
}
.modal--wide .modal-title { font-size: 26px; padding-right: 40px; }
.modal--wide .modal-body { gap: 14px; }
.modal--wide .modal-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1.5px solid var(--ink);
  position: sticky;
  bottom: -28px;
  background: var(--paper);
}
/* Аналитика на широкой модалке — посвободнее */
.modal--wide .student-analytics .sa-cell { padding: 18px 14px; }
.modal--wide .student-analytics .sa-val { font-size: 24px; }
.modal--wide .modal-subhead { font-size: 14px; margin: 22px 0 10px; }
/* HW-ряды на широкой модалке — горизонтально */
.modal--wide .student-hw-list {
  grid-template-columns: 1fr 1fr;
  display: grid;
  gap: 8px;
}
.modal--wide .student-hw-row { flex-direction: row; }
@media (max-width: 980px) {
  .modal--wide .student-hw-list { grid-template-columns: 1fr; }
}
.modal-close {
  position: absolute; top: 8px; right: 8px;
  width: 36px; height: 36px;
  border: 1.5px solid var(--ink);
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
  background: var(--paper);
}
.modal-title {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  margin: 0 0 14px;
}
.modal-body { display: grid; gap: 12px; }
.modal-body label {
  display: grid; gap: 6px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.modal-body input, .modal-body textarea, .modal-body select {
  padding: 11px 12px;
  border: 1.5px solid var(--ink);
  font-size: 14px;
  background: var(--paper);
  font-family: var(--fb);
}
.modal-body textarea { min-height: 90px; resize: vertical; }
.modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 16px;
}

/* === DESKTOP === */
@media (min-width: 880px) {
  .topbar { padding: 12px 24px; }
  .menu-btn { display: none; }
  .layout { grid-template-columns: 280px 1fr; }
  .sidebar {
    position: sticky;
    top: var(--header-h);
    height: calc(100dvh - var(--header-h));
    transform: none;
    max-width: none;
    width: auto;
    z-index: 1;
  }
  body[data-role="curator"] .sidebar {
    top: calc(var(--header-h) + 32px);
    height: calc(100dvh - var(--header-h) - 32px);
  }
  .scrim { display: none; }
  .main { padding: 36px 40px 100px; max-width: 880px; margin: 0; }
  .page-head { grid-template-columns: 1fr auto; align-items: end; }
  .stream-archive { grid-template-columns: 1fr 1fr; }
  .home-stage-card { grid-template-columns: 80px 1fr auto; }
  .home-stage-card .num { width: 80px; height: 80px; font-size: 30px; }
  .admin-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1200px) {
  .main { padding: 44px 56px 120px; max-width: 1040px; }
}

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

/* === Mobile fixes (≤600px) — stage pages, admin === */
@media (max-width: 600px) {
  /* Stage hero — compact */
  .stage-hero { padding: 18px; }
  .stage-hero .h1 { font-size: 28px; }
  .stage-hero .lead { font-size: 14px; }
  .stage-progress-row { gap: 10px; margin-top: 12px; }

  /* Stage tabs — больше места */
  .tabs { padding-bottom: 10px; gap: 5px; }
  .tab { padding: 10px 14px; font-size: 12.5px; min-height: 42px; }

  /* Lesson player — на всю ширину */
  .lesson-player { margin-left: -18px; margin-right: -18px; border-left: none; border-right: none; border-radius: 0; }
  .lesson-head .h1 { font-size: 26px; }

  /* After-list — компактнее */
  .after-card { padding: 18px; }
  .after-list li { font-size: 14px; padding-left: 32px; }

  /* HW card — отступы */
  .hw-card { padding: 14px 16px; }
  .hw-title { font-size: 16px; }
  .hw-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hw-status { align-self: flex-start; }

  /* Video card — текст шире */
  .video-card { grid-template-columns: 80px 1fr auto !important; padding: 8px !important; }
  .video-thumb { font-size: 18px; }
  .video-meta-title { font-size: 14px; }

  /* KB card — drag-handle меньше */
  .kb-q { padding: 12px 14px; font-size: 14.5px; }
  .kb-body { padding: 0 14px 14px; font-size: 14px; }

  /* Calendar cells — поменьше */
  .cal-month { padding: 16px 14px 14px; }
  .cal-title { font-size: 20px; }
  .cal-grid { gap: 4px; }
  .cal-cell { border-radius: 9px; font-size: 12px; }
  .cal-cell .cal-day { font-size: 12px; }
  .cal-legend { gap: 10px; }
  .cal-legend .leg { font-size: 10px; }

  /* Admin stats — 1 колонка на узких */
  .admin-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-tile { padding: 14px 12px; }
  .stat-num { font-size: 32px; }
  .stat-label { font-size: 10px; }
  .stat-tile-cta { font-size: 10px; padding: 6px 10px; }

  /* Admin sections — компактные заголовки */
  .page-head { padding: 4px 0 14px; margin-bottom: 16px; gap: 10px; }
  .page-head .h1 { font-size: 28px; margin-bottom: 4px; }
  .page-head .lead { font-size: 14px; }

  /* Student cards в админке */
  .student-card {
    grid-template-columns: 36px 1fr;
    padding: 12px 14px;
  }
  .student-card .av { width: 36px; height: 36px; font-size: 14px; }
  .student-card .student-progress {
    grid-column: 1 / -1;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    justify-content: space-between;
  }
  .student-progress .bar { width: 100%; flex: 1; }
  .student-name { font-size: 14px; }
  .student-meta { font-size: 11px; }

  /* Finance row */
  .finance-row {
    grid-template-columns: 36px 1fr;
    gap: 10px;
    padding: 12px;
  }
  .finance-row .av { width: 36px; height: 36px; font-size: 13px; }
  .finance-sum { grid-column: 2 / -1; font-size: 13px; }
  .finance-pill { grid-column: 2 / -1; justify-self: start; }

  /* Analytics */
  .analytics-card { padding: 16px 14px; }
  .bar-row { grid-template-columns: 70px 1fr 42px; gap: 8px; font-size: 12px; }

  /* Modal на мобиле — больше места */
  .modal { padding: 22px 18px 18px; }
  .modal-title { font-size: 20px; }

  /* Hero на мобиле */
  .hero-card { padding: 24px 22px; }
  .hero-card .h1 { font-size: 32px; }
  .hero-tagline { font-size: 16px; }
  .hero-stats { gap: 0; padding-top: 18px; }
  .hero-stat { padding-right: 8px; }
  .hero-stat:not(:first-child) { padding-left: 8px; }
  .hero-stat-num { font-size: 26px; }
  .hero-stat-label { font-size: 9px; }

  /* Today card */
  .today-card { padding: 22px 20px; }
  .today-card h3 { font-size: 20px; }
}

/* =====================================================
   MOBILE FIX — глобальные правила для маленьких экранов
   ===================================================== */
@media (max-width: 720px) {
  /* Login overlay — растягиваем правильно */
  .login-overlay {
    padding: 16px;
    align-items: flex-start;
    padding-top: 40px;
  }
  .login-card {
    max-width: 100%;
    width: 100%;
    padding: 28px 22px;
    border-radius: 18px;
  }
  .login-title { font-size: 24px; line-height: 1.15; }
  .login-sub { font-size: 14px; }
  .login-brand { font-size: 16px; margin-bottom: 22px; }
  .login-form input { font-size: 16px; padding: 13px 14px; }
  .login-form button[type="submit"],
  .login-form .btn { font-size: 15px; padding: 14px 18px; }

  /* Topbar — мобильная компактная версия. Скрываем второстепенные элементы. */
  .topbar {
    padding: 8px 10px;
    gap: 6px;
    grid-template-columns: auto 1fr auto;
  }
  .brand { font-size: 12px; }
  .menu-btn { width: 32px; height: 32px; }
  /* Селект курса — компактнее */
  .course-switcher {
    max-width: 140px;
    font-size: 10px;
    padding: 6px 22px 6px 8px;
    background-position: right 6px center;
    min-height: 32px;
  }
  .topbar-right { gap: 4px; }
  /* На мобиле скрываем переключатель Ученик/Куратор и поиск — они есть в боковом меню */
  .topbar #roleSwitch { display: none !important; }
  .topbar .topbar-search-btn { display: none; }
  /* Гость-чип сжимаем */
  .user-chip {
    padding: 2px 6px 2px 2px;
    gap: 4px;
  }
  .user-chip .avatar { width: 28px; height: 28px; font-size: 13px; }
  .user-chip .user-name { font-size: 11px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar > * { min-width: 0; }

  /* Карточка ученика на мобиле — крупная, кликабельная */
  .student-card {
    grid-template-columns: 44px 1fr !important;
    gap: 10px !important;
    padding: 14px !important;
    cursor: pointer;
    position: relative;
  }
  .student-card::after {
    content: "→";
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 18px;
    opacity: 0.4;
  }
  .student-card .av { width: 44px !important; height: 44px !important; font-size: 16px !important; }
  .student-card .student-name { font-size: 15px !important; padding-right: 24px; }
  .student-card .student-meta { font-size: 12px !important; word-break: break-word; }
  .student-card .student-progress {
    grid-column: 1 / -1;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
  }
  .student-card .student-progress .bar { flex: 1; }

  /* Список учеников — крупные отступы и подсказка */
  .students-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }
  #studentsSearch { font-size: 14px; padding: 12px 14px; }

  /* Главный контейнер — без огромных отступов */
  .main {
    padding: 16px 14px 80px;
  }

  /* Hero на мобиле — компактнее */
  .hero-card {
    padding: 22px 18px;
    border-radius: 18px;
  }
  .hero-card .h1 { font-size: 28px; line-height: 1.1; }
  .hero-tagline { font-size: 15px; }

  /* Карточки на главной */
  .home-stage-card {
    padding: 20px 16px;
  }
  .home-stage-card .num { font-size: 26px; }
  .home-stage-card h3 { font-size: 17px; line-height: 1.2; }

  /* Уроки */
  .lesson-card { padding: 14px 14px; }
  .lesson-title { font-size: 15px; }

  /* Таблицы (если есть) */
  table { font-size: 13px; }

  /* Заголовки страниц */
  .page-head { gap: 8px; }
  .page-head .h1 { font-size: 24px; }

  /* Поиск — растягиваем */
  .search { font-size: 14px; padding: 10px 14px; }

  /* Кнопки на всю ширину где нужно */
  .btn--big, .btn-full { width: 100%; }

  /* Sidebar — мобильное меню, выезжает */
  .sidebar {
    width: 86%;
    max-width: 320px;
  }
}

/* =====================================================
   COURSE SWITCHER BUTTON (в шапке)
   ===================================================== */
.course-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 16px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.02em;
  color: var(--ink);
  min-height: 36px;
  max-width: 220px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.course-switcher-btn:hover { background: var(--soft); }
.csb-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.csb-chev { font-size: 10px; opacity: 0.6; }

/* =====================================================
   NAVIGATION BUBBLES — кружочки для общих и доп. услуг
   ===================================================== */
.nav-bubble {
  display: flex !important;
  align-items: center;
  gap: 12px !important;
  padding: 8px 12px !important;
}
.nav-bub {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
}
.nav-bub.b-blue { background: var(--blue-pair); color: var(--blue); }
.nav-bub.b-green { background: var(--green-pair); color: var(--green); }
.nav-bub.b-coffee { background: var(--coffee-pair); color: var(--coffee); }
.nav-bub.b-yellow { background: var(--yellow); color: var(--ink); }
.nav-bub.b-bordo { background: var(--bordo); color: var(--paper); }
.nav-bubble:hover { background: var(--soft); }
.nav-bubble.nav-extra:hover { background: rgba(254, 255, 85, 0.25); }

/* Убираем странную подсветку для .nav-action */
.nav-link.nav-action {
  color: inherit;
  font-weight: 700;
}
.nav-link.nav-action:hover { background: var(--soft); }

/* =====================================================
   CHAT OPTIONS (выбор чата / бота)
   ===================================================== */
.chat-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.chat-option {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 28px 26px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease;
}
.chat-option:hover { transform: translateY(-2px); background: var(--soft); }
.chat-option--main { background: var(--green-pair); }
.chat-option--bot { background: var(--yellow); }
.chat-option-ico {
  font-size: 40px;
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}
.chat-option h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 22px;
  margin: 8px 0 4px;
  letter-spacing: -0.02em;
}
.chat-option p {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 12px;
  opacity: 0.85;
}
.chat-option-cta {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--bordo);
  margin-top: auto;
}
@media (max-width: 720px) {
  .chat-options { grid-template-columns: 1fr; gap: 12px; }
  .chat-option { padding: 22px 20px; }
  .chat-option-ico { font-size: 32px; width: 52px; height: 52px; }
  .chat-option h3 { font-size: 18px; }
}

/* =====================================================
   MY COURSES (отдельная страница выбора курса)
   ===================================================== */
.my-courses-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
@media (min-width: 980px) {
  .my-courses-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 920px;
  }
}
@media (max-width: 720px) {
  .my-courses-grid { grid-template-columns: 1fr; }
}
.my-course-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, background 0.15s ease;
}
.my-course-card:hover { transform: translateY(-2px); }
.my-course-card.s-coffee { background: var(--coffee-pair); }
.my-course-card.s-blue { background: var(--blue-pair); }
.my-course-card.s-green { background: var(--green-pair); }
.my-course-card.s-bordo { background: var(--bordo); color: var(--paper); }
.my-course-card.s-orange { background: var(--orange); color: var(--paper); }
.mc-num {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.mc-body h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 17px;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.mc-meta { font-size: 12px; opacity: 0.75; margin: 4px 0 0; }
.mc-arrow {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 22px;
}
.mc-pill {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.my-course-card.is-current { outline: 3px solid var(--bordo); }

/* Пока приложение грузится — прячем весь интерфейс, чтобы не мигало */
body.is-booting .topbar,
body.is-booting .sidebar,
body.is-booting .main,
body.is-booting .role-strip,
body.is-booting .scrim,
body.is-booting .layout {
  visibility: hidden;
}

/* На экранах выбора курса/потока + админ-экранах сайдбар, кнопка курса и гамбургер скрыты.
   Пользователь должен видеть только основной контент. Внутри курса всё вернётся. */
body[data-screen="my-courses"] .sidebar,
body[data-screen="my-cohorts"] .sidebar,
body[data-screen="admin-curators"] .sidebar,
body[data-screen="admin-courses"] .sidebar,
body[data-screen="admin-finance"] .sidebar,
body[data-screen="admin-requests"] .sidebar {
  display: none !important;
}
body[data-screen="my-courses"] .scrim,
body[data-screen="my-cohorts"] .scrim,
body[data-screen="admin-curators"] .scrim,
body[data-screen="admin-courses"] .scrim,
body[data-screen="admin-finance"] .scrim,
body[data-screen="admin-requests"] .scrim {
  display: none !important;
}
body[data-screen="my-courses"] .menu-btn,
body[data-screen="my-cohorts"] .menu-btn,
body[data-screen="admin-curators"] .menu-btn,
body[data-screen="admin-courses"] .menu-btn,
body[data-screen="admin-finance"] .menu-btn,
body[data-screen="admin-requests"] .menu-btn,
body[data-screen="my-courses"] #courseSwitcherBtn,
body[data-screen="my-cohorts"] #courseSwitcherBtn,
body[data-screen="admin-curators"] #courseSwitcherBtn,
body[data-screen="admin-courses"] #courseSwitcherBtn,
body[data-screen="admin-finance"] #courseSwitcherBtn,
body[data-screen="admin-requests"] #courseSwitcherBtn {
  display: none !important;
}
/* Контент растягиваем во всю ширину — без места под сайдбар */
body[data-screen="my-courses"] .main,
body[data-screen="my-cohorts"] .main,
body[data-screen="admin-curators"] .main,
body[data-screen="admin-courses"] .main,
body[data-screen="admin-finance"] .main,
body[data-screen="admin-requests"] .main {
  margin-left: 0 !important;
  width: 100%;
  max-width: 1100px;
  padding-left: 24px;
  padding-right: 24px;
}
body[data-screen="my-courses"] .layout,
body[data-screen="my-cohorts"] .layout,
body[data-screen="admin-curators"] .layout,
body[data-screen="admin-courses"] .layout,
body[data-screen="admin-finance"] .layout,
body[data-screen="admin-requests"] .layout {
  grid-template-columns: 1fr !important;
}
/* Полоска «Режим куратора» не нужна на экранах выбора курса и админских */
body[data-screen="my-courses"] .role-strip,
body[data-screen="my-cohorts"] .role-strip,
body[data-screen="admin-curators"] .role-strip,
body[data-screen="admin-courses"] .role-strip,
body[data-screen="admin-finance"] .role-strip,
body[data-screen="admin-requests"] .role-strip {
  display: none !important;
}

/* =====================================================
   FINANCE — двухуровневая навигация: список потоков → ученицы
   ===================================================== */
.finance-cohort-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.finance-cohort-card {
  display: grid;
  grid-template-areas:
    "head total"
    "stats stats"
    "arrow arrow";
  gap: 8px;
  padding: 20px 22px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: transform 0.15s ease, background 0.15s ease;
}
.finance-cohort-card:hover {
  background: var(--soft);
  transform: translateY(-2px);
}
.fcc-head { grid-area: head; }
.fcc-head h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 17px;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.fcc-cohort {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--yellow);
  color: var(--ink);
  padding: 2px 8px;
  border: 1px solid var(--ink);
  display: inline-block;
}
.fcc-total {
  grid-area: total;
  font-family: var(--fd);
  font-weight: 900;
  font-size: 22px;
  color: var(--bordo);
  text-align: right;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.fcc-stats {
  grid-area: stats;
  font-size: 13px;
  color: var(--ink);
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.fcc-dot { opacity: 0.4; }
.fcc-paid { color: #2e7d32; font-weight: 700; }
.fcc-partial { color: var(--bordo); font-weight: 700; }
.fcc-unpaid { opacity: 0.6; font-weight: 700; }
.fcc-empty {
  font-style: italic;
  opacity: 0.5;
  font-size: 12px;
}
.finance-cohort-card.is-empty {
  background: var(--soft);
  opacity: 0.78;
}
.finance-cohort-card.is-empty .fcc-total { color: var(--ink); opacity: 0.5; }
.fcc-arrow {
  grid-area: arrow;
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
  opacity: 0.4;
}

.finance-back-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--line);
}
.finance-cohort-current {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  margin: 0;
  flex: 1;
}
.finance-cohort-current-total {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 20px;
  color: var(--bordo);
  background: var(--yellow);
  padding: 6px 14px;
  border: 1.5px solid var(--ink);
}
.finance-cohort-students { display: grid; gap: 10px; }

/* Мини-плитки фильтра внутри потока */
.finance-mini-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.fin-tile-mini {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s ease, transform 0.12s ease;
}
.fin-tile-mini:hover { background: var(--soft); transform: translateY(-1px); }
.fin-tile-mini.is-active {
  background: var(--ink);
  color: var(--paper);
}
.fin-tile-mini.is-active.full { background: #2e7d32; }
.fin-tile-mini.is-active.two,
.fin-tile-mini.is-active.three,
.fin-tile-mini.is-active.four { background: var(--yellow); color: var(--ink); }
.fin-tile-mini.is-active.unpaid { background: var(--bordo); color: var(--paper); }
.fin-tile-num {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
}
.fin-tile-label {
  font-size: 11px;
  font-family: var(--fd);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.75;
}
.fin-tile-mini.is-active .fin-tile-label { opacity: 1; }
.finance-cohort-search {
  margin-bottom: 8px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  padding: 12px 14px;
  font-size: 14px;
  width: 100%;
  font-family: var(--fb);
}
.finance-cohort-search:focus { outline: 2px solid var(--yellow); }
.finance-search-hint {
  font-size: 12px;
  color: var(--bordo);
  font-family: var(--fd);
  font-weight: 700;
  margin: 0 0 14px;
}

@media (max-width: 720px) {
  .finance-cohort-card {
    grid-template-areas:
      "head"
      "total"
      "stats"
      "arrow";
  }
  .fcc-total { text-align: left; font-size: 20px; }
  .finance-back-bar { flex-wrap: wrap; }
  .finance-cohort-current { font-size: 15px; }
}

/* =====================================================
   FINANCE — расширенная карточка ученицы с email, статусом и кнопками
   ===================================================== */
.finance-row--ext {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  grid-template-areas:
    "av info status"
    "av info actions"
    "history history history";
  gap: 8px 14px;
  align-items: center;
  padding: 14px 20px !important;
}
.finance-row--ext .av { grid-area: av; }
.finance-row--ext .fin-info { grid-area: info; }
.finance-row--ext .fin-status-block {
  grid-area: status;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.finance-row--ext .fin-actions {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.finance-row--ext .fin-payments-history {
  grid-area: history;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--soft);
  border: 1px dashed var(--line);
  display: grid;
  gap: 4px;
}
.fin-payment-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto 1fr;
  gap: 8px;
  font-size: 12px;
  align-items: center;
}
.fin-pmt-part { font-family: var(--fd); font-weight: 800; color: var(--bordo); }
.fin-pmt-amount { font-family: var(--fd); font-weight: 700; }
.fin-pmt-method { opacity: 0.6; }
.fin-pmt-date { opacity: 0.6; font-size: 11px; }
.fin-pmt-note { font-style: italic; opacity: 0.7; font-size: 11px; }
.finance-email { font-size: 12px; opacity: 0.65; margin: 2px 0; word-break: break-all; }
.finance-pill.partial { background: var(--yellow); color: var(--ink); }
.finance-pill.unpaid { background: rgba(129, 26, 25, 0.1); color: var(--bordo); }
.finance-pill.paid { background: rgba(46, 125, 50, 0.12); color: var(--ink); }
.stat-tile.alert-soft { background: var(--yellow); }

@media (max-width: 720px) {
  .finance-row--ext {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "av info"
      "status status"
      "actions actions"
      "history history";
  }
  .finance-row--ext .fin-status-block { flex-direction: row; align-items: center; justify-content: space-between; }
  .finance-row--ext .fin-actions { align-items: stretch; }
  .finance-row--ext .fin-actions .btn { width: 100%; }
}

/* =====================================================
   FINANCE — разбивка по потокам
   ===================================================== */
.finance-cohort {
  margin-bottom: 26px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}
.finance-cohort-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--soft);
  border-bottom: 1.5px solid var(--ink);
}
.finance-cohort-title {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  margin: 0;
}
.finance-cohort-meta {
  font-size: 12px;
  opacity: 0.6;
  margin: 4px 0 0;
}
.finance-cohort-total {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 18px;
  color: var(--bordo);
  background: var(--yellow);
  padding: 6px 12px;
  border: 1.5px solid var(--ink);
  white-space: nowrap;
}
.finance-cohort-list { padding: 6px 0; }
.finance-cohort-list .finance-row { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.finance-cohort-list .finance-row:last-child { border-bottom: none; }

/* Метка курса в карточке заявки */
.req-course {
  display: inline-block;
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 4px 10px;
  font-size: 12px;
  margin: 6px 0;
  font-family: var(--fd);
  font-weight: 700;
}

/* =====================================================
   ADMIN ACCESS — карточки на «Курсы школы» для админа
   ===================================================== */
.admin-access-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1.5px solid var(--line);
}
.admin-access-label {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bordo);
  margin: 0 0 12px;
}
.admin-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.admin-access-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.admin-access-card:hover { background: var(--soft); }
.admin-access-card .aa-ico {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  font-size: 18px;
  font-weight: 800;
}
.admin-access-card h4 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 15px;
  margin: 0 0 2px;
  letter-spacing: -0.02em;
}
.admin-access-card p { font-size: 12px; opacity: 0.65; margin: 0; }
.aa-arrow { font-family: var(--fd); font-weight: 800; font-size: 18px; opacity: 0.5; }

/* =====================================================
   ADMIN — кураторы и их курсы
   ===================================================== */
.curators-list { display: grid; gap: 12px; margin-top: 14px; }
.curator-card {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 18px 20px;
}
.curator-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.curator-card h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  margin: 0;
}
.curator-meta { font-size: 12px; opacity: 0.7; margin: 4px 0 0; }
.curator-pill {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  background: var(--soft);
  border: 1px solid var(--ink);
  white-space: nowrap;
}
.curator-pill.admin { background: var(--yellow); }
.curator-note { font-size: 12px; opacity: 0.6; font-style: italic; margin: 8px 0 0; }
.curator-section-label {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 14px 0 8px;
}
.curator-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
}
.curator-course-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
}
.curator-course-row:hover { background: var(--paper); }
.curator-course-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--bordo);
  cursor: pointer;
  flex-shrink: 0;
}

.req-contact {
  font-size: 12px;
  opacity: 0.7;
  margin: 6px 0 0;
}

/* Кнопка «Назад» в шапке экрана */
.back-btn {
  background: transparent;
  border: 1.5px solid var(--ink);
  padding: 6px 12px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s ease;
}
.back-btn:hover { background: var(--soft); }

/* =====================================================
   ADMIN REQUESTS (заявки от учениц)
   ===================================================== */
.requests-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.request-card {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 16px 18px;
}
.request-card.req-upgrade { background: var(--yellow); }
.request-card.req-consult { background: var(--green-pair); }
.request-card.req-closed { background: var(--soft); opacity: 0.7; }
.req-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 6px;
}
.req-type {
  font-family: var(--fd);
  font-weight: 800;
  color: var(--bordo);
}
.request-card h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.req-meta { font-size: 13px; line-height: 1.4; margin: 4px 0; opacity: 0.85; }
.req-amount {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 14px;
  margin: 8px 0 12px;
}
.req-amount strong { color: var(--bordo); font-size: 18px; }
.req-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.req-status {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid var(--ink);
}
.req-status--paid { background: rgba(46, 125, 50, 0.2); }
.req-status--rejected, .req-status--cancelled { background: rgba(129, 26, 25, 0.15); }
.req-status--done { background: var(--yellow); }

/* =====================================================
   UPGRADE TARIFF + CONSULTATION (платные сервисы)
   ===================================================== */
.upgrade-list { display: grid; gap: 10px; margin-top: 10px; }
.upgrade-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 14px 16px;
}
.upgrade-name {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 16px;
  color: var(--bordo);
  grid-column: 1 / -1;
}
.upgrade-prices { font-size: 13px; line-height: 1.6; }
.upgrade-base { color: var(--ink); }
.upgrade-base-label { font-size: 11px; opacity: 0.55; }
.upgrade-diff { opacity: 0.75; }
.upgrade-final-line { color: var(--bordo); font-size: 14px; margin-top: 4px; }
.upgrade-row .btn { align-self: end; white-space: nowrap; }

.consult-pricing {
  text-align: center;
  padding: 16px;
  border: 1.5px solid var(--ink);
  background: var(--yellow);
  margin: 8px 0;
}
.consult-price-big {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 36px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.consult-price-label {
  font-family: var(--fd);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.65;
  margin-top: 4px;
}

/* Кнопки «Платные сервисы» в сайдбаре */
.nav-link.nav-action {
  color: var(--bordo);
  font-weight: 700;
}
.nav-link.nav-action:hover { background: rgba(129, 26, 25, 0.08); }

/* =====================================================
   HW QUEUE (куратор) — карточки с сабмишн от ученицы
   ===================================================== */
.hw-submission-curator {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--soft);
  border: 1.5px dashed var(--ink);
}
.hw-submission-curator .hw-sub-date {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 0 0 10px;
}
.hw-sub-text {
  background: var(--paper);
  padding: 10px 12px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.hw-sub-text strong, .hw-sub-link strong, .hw-sub-file strong {
  font-family: var(--fd);
  font-weight: 800;
}
.hw-sub-link {
  background: var(--paper);
  padding: 10px 12px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  font-size: 14px;
  word-break: break-all;
}
.hw-sub-link a { color: var(--bordo); text-decoration: underline; }
.hw-sub-file {
  margin-bottom: 8px;
}
.hw-sub-file .file-chip {
  background: var(--yellow);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 10px 14px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  word-break: break-all;
  text-align: left;
  display: inline-block;
  max-width: 100%;
}
.hw-sub-file .file-chip:hover { background: var(--yellow-soft); }
.hw-no-sub {
  font-size: 13px;
  opacity: 0.5;
  font-style: italic;
  margin: 10px 0;
}
.hw-curator-note {
  margin: 10px 0;
  padding: 10px 12px;
  background: rgba(46, 125, 50, 0.08);
  border-left: 3px solid rgba(46, 125, 50, 0.6);
  font-size: 13px;
  line-height: 1.45;
}
.chip-count {
  display: inline-block;
  margin-left: 6px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 800;
}
.chip.active .chip-count { background: var(--paper); color: var(--ink); }
.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}
.chip-row + .chip-row {
  border-top: 1.5px solid var(--line);
  margin-top: 4px;
}
.chip-row-label {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-right: 6px;
}

/* =====================================================
   STUDENT MODAL FIX — кнопка «Закрыть» и отступы
   ===================================================== */
.modal-close {
  z-index: 10;
}
/* Заголовок этапа в карточке ученика — отступ от описания */
.stage-hero h1, #stageTitle { margin-bottom: 14px !important; }
#stageLead { margin-top: 8px !important; line-height: 1.5; }
/* Очередь проверки — отступы */
[data-screen="admin-hw"] .page-head .h1 { margin-bottom: 10px; }
[data-screen="admin-hw"] .page-head .lead { margin-top: 4px; line-height: 1.5; }

/* =====================================================
   HW SUBMIT — модалка сдачи работы
   ===================================================== */
.hw-submit-block {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 12px 14px;
  margin: 8px 0;
}
.hw-submit-label {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hw-submit-ico { font-size: 18px; }
.hw-submit-block input[type="file"],
.hw-submit-block input[type="url"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  font-family: var(--fb);
  font-size: 14px;
  background: var(--paper);
}
.hw-submit-hint {
  font-size: 11px;
  opacity: 0.55;
  margin: 6px 0 0;
  line-height: 1.4;
}

/* =====================================================
   HW REVIEW BANNERS — заметный статус проверки для ученицы
   ===================================================== */
.hw-review-banner {
  padding: 14px 16px;
  margin: -4px -4px 14px;
  border: 1.5px solid var(--ink);
  font-size: 14px;
  line-height: 1.5;
  font-family: var(--ft);
}
.hw-review-banner strong { font-family: var(--fd); font-weight: 800; }
.hw-rb--review { background: var(--yellow); color: var(--ink); }
.hw-rb--accepted { background: rgba(46, 125, 50, 0.15); color: var(--ink); border-color: rgba(46, 125, 50, 0.6); }
.hw-rb--rework { background: rgba(129, 26, 25, 0.08); border-color: var(--bordo); }
.hw-rb-comment {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--bordo);
  font-style: italic;
  color: var(--ink);
}

/* Большая кнопка «Сдать работу» */
.btn--big {
  padding: 14px 22px;
  font-size: 15px;
  width: 100%;
  margin-top: 12px;
}
.hw-submit-btn {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--fd);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hw-submit-btn:hover { background: var(--bordo); }

/* =====================================================
   KB EDITOR — images & preview
   ===================================================== */
.kb-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.kb-upload-hint {
  font-size: 12px;
  opacity: 0.7;
}
.kb-preview-wrap {
  margin-top: 12px;
  border: 1.5px dashed var(--ink);
  background: var(--soft);
  padding: 12px 14px;
  max-height: 320px;
  overflow-y: auto;
}
.kb-preview-label {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: 0 0 8px;
}
.kb-preview img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0;
}
/* Картинки внутри статей KB */
.kb-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px 0;
  border: 1.5px solid var(--ink);
}

/* =====================================================
   STAGE LOCK / INTRO BADGES
   ===================================================== */
.nav-stage.locked {
  opacity: 0.55;
  cursor: not-allowed;
  position: relative;
}
.nav-stage.locked .stage-pill { filter: grayscale(0.7); }
.nav-stage.is-intro .stage-pill {
  background: var(--coffee) !important;
  color: var(--yellow);
}
.nav-stage-title {
  flex: 1;
  text-align: left;
}
.nav-lock {
  font-size: 14px;
  margin-left: auto;
  opacity: 0.7;
}

.home-stage-card.locked {
  opacity: 0.65;
  position: relative;
  cursor: not-allowed;
}
.home-stage-card.locked:hover { transform: none; }
.stage-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(254, 248, 235, 0.85);
  font-family: var(--fd);
  font-weight: 800;
  color: var(--bordo);
  text-align: center;
  padding: 0 20px;
  pointer-events: none;
}
.stage-lock-overlay span {
  font-size: 32px;
  display: block;
}
.stage-lock-overlay b {
  font-size: 13px;
  font-weight: 800;
}

.home-stage-card.is-intro {
  background: linear-gradient(135deg, var(--coffee) 0%, #5C4A42 100%) !important;
  color: var(--paper);
}
.home-stage-card.is-intro .num,
.home-stage-card.is-intro h3,
.home-stage-card.is-intro .desc-text { color: var(--paper); }
.intro-badge {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--fd);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  margin-bottom: 6px;
}
.status-pill.intro {
  background: var(--yellow);
  color: var(--ink);
}
.status-pill.locked {
  background: rgba(0,0,0,0.15);
  color: var(--ink);
}

/* =====================================================
   STUDENT MODAL — analytics + stage access
   ===================================================== */
.modal-subhead {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 18px 0 8px;
}
.modal-meta-line {
  font-size: 12px;
  opacity: 0.7;
  margin: 0 0 8px;
}

.student-analytics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.sa-cell {
  padding: 16px 12px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  text-align: center;
}
.sa-val {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 22px;
  line-height: 1.1;
  color: var(--bordo);
}
.sa-lbl {
  font-size: 11px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}
@media (max-width: 980px) {
  .student-analytics { grid-template-columns: repeat(3, 1fr); }
}

.student-stages-list {
  display: grid;
  gap: 6px;
}
.student-stage-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-size: 13px;
}
.ssr-num {
  font-family: var(--fd);
  font-weight: 900;
  font-size: 16px;
  color: var(--bordo);
}
.ssr-title { font-weight: 700; }
.ssr-state {
  font-size: 12px;
  opacity: 0.7;
  white-space: nowrap;
}
.ssr-spacer { width: 78px; }

.student-hw-list {
  display: grid;
  gap: 6px;
}
.student-hw-row {
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.shw-title { flex: 1; }
.shw-status { font-weight: 700; white-space: nowrap; }
.student-hw-row.shw-accepted { background: rgba(46, 125, 50, 0.06); }
.student-hw-row.shw-review { background: var(--yellow); }
.student-hw-row.shw-rework { background: rgba(129, 26, 25, 0.06); }

/* =====================================================
   MOBILE — student modal
   ===================================================== */
@media (max-width: 720px) {
  .student-analytics {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .sa-cell { padding: 10px 8px; }
  .sa-val { font-size: 16px; }
  .sa-lbl { font-size: 9px; }

  .student-stage-row {
    grid-template-columns: 32px 1fr auto;
    gap: 8px;
    padding: 10px;
    font-size: 12px;
  }
  .student-stage-row .ssr-state {
    grid-column: 1 / -1;
    font-size: 11px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
    margin-top: 4px;
  }
  .student-stage-row [data-toggle-access] {
    grid-row: 1;
    font-size: 11px;
    padding: 6px 10px;
  }
  .ssr-num { font-size: 14px; }

  .student-hw-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    font-size: 12px;
  }
  .shw-status { font-size: 11px; opacity: 0.8; }

  /* Модалка сама — на мобиле полноэкранная */
  #modalRoot.modal-root {
    align-items: stretch;
    padding: 0;
  }
  .modal {
    max-width: 100%;
    max-height: 100vh;
    width: 100%;
    border-radius: 0;
    border: none;
    padding: 20px 16px 100px;
    overflow-y: auto;
  }
  .modal-title { font-size: 18px; padding-right: 30px; }
  .modal-body { overflow-y: visible; }
  .modal-foot {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--paper);
    border-top: 1.5px solid var(--ink);
    padding: 12px 16px;
    z-index: 10;
    display: flex;
    gap: 8px;
  }
  .modal-foot .btn { flex: 1; }
}

