/* Геймифицированный кабинет — Duolingo × Notion × Khan */
/* Design tokens — shared-ui.css (:root --hub-*) */

body.hub-page {
  background: var(--hub-bg);
  color: #1e293b;
}

.hub-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.hub-header {
  background: linear-gradient(145deg, var(--hub-teal) 0%, var(--hub-teal-dark) 100%);
  color: #fff;
  border-radius: 0 0 var(--hub-radius) var(--hub-radius);
  padding: 20px 20px 24px;
  margin: 0 -16px 24px;
  box-shadow: var(--hub-shadow);
}

.hub-header__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.hub-streak {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hub-streak__icon {
  font-size: 1.5rem;
}

.hub-streak__val {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.hub-streak__lbl {
  font-size: 0.85rem;
  opacity: 0.9;
}

.hub-level {
  text-align: right;
}

.hub-level__badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}

.hub-level__xp {
  display: block;
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 4px;
}

.hub-today {
  flex: 1;
  min-width: 0;
  text-align: center;
  color: inherit;
}

.hub-today--link {
  text-decoration: none;
  border-radius: 10px;
  padding: 2px 10px;
  transition: background 0.15s ease;
}

.hub-today--link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.hub-today__label {
  display: block;
  font-size: 0.68rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.hub-today__stats {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.25;
}

.hub-today__stats strong {
  font-size: 1.1rem;
  font-weight: 800;
}

.hub-today-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.hub-today-bar__fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.hub-xp-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.hub-xp-bar__fill {
  height: 100%;
  background: #fde047;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.hub-streak-warn {
  font-size: 0.85rem;
  background: rgba(253, 224, 71, 0.2);
  padding: 8px 12px;
  border-radius: 10px;
  margin: 8px 0 12px;
}

.hub-goal {
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}

.hub-goal__bar {
  flex: 1 1 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.hub-goal__fill {
  height: 100%;
  background: #fff;
  border-radius: 999px;
  opacity: 0.9;
}

.hub-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hub-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--hub-text);
  margin: 0 0 12px;
}

.hub-mission__kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hub-muted);
  margin: 0 0 8px;
  font-weight: 600;
}

.hub-mission__card {
  background: var(--hub-card);
  border-radius: var(--hub-radius);
  padding: 20px;
  box-shadow: var(--hub-shadow);
  border: 1px solid rgba(15, 118, 110, 0.1);
}

.hub-mission__icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.hub-mission__title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--hub-text);
}

.hub-mission__sub {
  color: var(--hub-muted);
  margin: 0 0 12px;
  font-size: 0.92rem;
}

.hub-mission__why {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(15, 118, 110, 0.06);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--hub-text);
  border-left: 3px solid var(--hub-brand, #0f766e);
  line-height: 1.4;
}

.hub-mission__after {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--hub-muted);
}

.hub-mission__next {
  margin: 0;
  text-align: center;
  font-size: 0.88rem;
}

.hub-mission__next a {
  color: var(--hub-brand, #0f766e);
  font-weight: 600;
  text-decoration: none;
}

.hub-mission__next a:hover {
  text-decoration: underline;
}

.hub-mission__meta {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.85rem;
  color: var(--hub-muted);
}

/* hub-btn — shared-ui.css (hub uses slightly larger tap targets) */
.hub-btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
}

.hub-mission__topics {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: rgba(15, 118, 110, 0.06);
  border-radius: 10px;
  border-left: 3px solid var(--hub-teal);
}

.hub-mission__topic {
  margin: 0;
  font-size: 0.92rem;
  color: var(--hub-text);
  line-height: 1.45;
}

.hub-mission__topic + .hub-mission__topic {
  margin-top: 4px;
}

.hub-mission__topic-label {
  display: inline-block;
  min-width: 4.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hub-muted);
}

.hub-mission__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hub-mission__actions--single .hub-mission__cta {
  width: 100%;
}

.hub-mission__cta-secondary {
  font-size: 0.95rem;
  padding: 10px 20px;
}

/* hub-btn:hover — shared-ui.css */

.hub-forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 520px) {
  .hub-forecast-grid {
    grid-template-columns: 1fr;
  }
}

.hub-forecast-card {
  background: var(--hub-card);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
}

.hub-forecast-card__label {
  font-size: 0.75rem;
  color: var(--hub-muted);
  margin: 0 0 4px;
}

.hub-forecast-card__score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--hub-teal);
  margin: 0;
}

.hub-forecast-card__hint {
  font-size: 0.75rem;
  color: var(--hub-muted);
  margin: 6px 0 0;
}

.hub-achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.hub-achievement {
  background: var(--hub-card);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
}

.hub-achievement__icon {
  font-size: 1.5rem;
}

.hub-achievement__title {
  font-size: 0.85rem;
  font-weight: 600;
}

.hub-more {
  margin-top: 28px;
  background: var(--hub-card);
  border-radius: var(--hub-radius);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.hub-more summary {
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
  color: var(--hub-text);
}

.hub-more__inner {
  padding: 0 18px 18px;
}

.hub-section-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hub-section-row {
  display: block;
  padding: 12px 14px;
  background: var(--hub-bg);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.hub-section-row:hover {
  background: #e8f5f3;
}

.hub-section-row__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hub-section-row__meta {
  font-size: 0.85rem;
  color: var(--hub-muted);
  margin: 4px 0 8px;
}

.hub-section-row__bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.hub-section-row__bar div {
  height: 100%;
  background: var(--hub-teal);
  border-radius: 999px;
}

.hub-muted {
  color: var(--hub-muted);
  font-size: 0.9rem;
}

.hub-more__link {
  margin-top: 16px;
}

.hub-more__link a {
  color: var(--hub-teal);
  font-weight: 600;
}

.hub-page .dash-page-hint,
.hub-page #todayCard,
.hub-page #diagnosticDeltaCard,
.hub-page #progressCard,
.hub-page #gapsMapCard,
.hub-page #competencyCard,
.hub-page #knowledgeMapCard,
.hub-page #marathonCard,
.hub-page #planTrackerCard,
.hub-page .dash-page-title {
  display: none !important;
}

.hub-page .site-header {
  background: transparent;
  border: none;
  box-shadow: none;
}

.hub-page .lk-layout {
  max-width: none;
  padding: 0;
}

.hub-plan-mini__link {
  margin-top: 8px;
  font-size: 0.85rem;
}

.hub-alerts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.hub-alerts--empty {
  display: none;
}

.hub-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--hub-card, #fff);
  border: 1px solid #e2ebe6;
  border-radius: 14px;
  box-shadow: var(--hub-shadow);
}

.hub-alert--diag {
  border-color: #fcd34d;
  background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
}

.hub-alert--hw {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #f0fdf9 0%, #fff 100%);
}

.hub-alert__icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.hub-alert__body {
  flex: 1;
  min-width: 0;
}

.hub-alert__body strong {
  display: block;
  font-size: 0.95rem;
  color: var(--hub-text, #134e4a);
  margin-bottom: 2px;
}

.hub-alert__body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--hub-muted, #64748b);
  line-height: 1.35;
}

.hub-alert .hub-btn--primary,
.hub-alert .hub-btn--outline {
  width: auto;
}

.hub-alert__cta {
  flex-shrink: 0;
  align-self: center;
  white-space: nowrap;
  width: auto;
}

.hub-alert__done {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hub-teal, #0f766e);
}

@media (max-width: 560px) {
  .hub-alert {
    flex-wrap: wrap;
  }

  .hub-alert__body {
    flex: 1 1 calc(100% - 48px);
  }

  .hub-alert__cta {
    flex: 1 1 100%;
    align-self: stretch;
    margin-top: 8px;
  }

  .hub-alert .hub-btn--primary,
  .hub-alert .hub-btn--outline {
    width: 100%;
  }
}

.hub-hw-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hub-page .hub-tools {
  max-width: 640px;
  margin: 24px auto;
}

/* Встроенный хаб на prep-dashboard.html */
body.prep-dash--hub {
  background: var(--hub-bg, #f4f6f5);
}

.hub-shell--prep-dash {
  max-width: 960px;
  margin: 0 auto 8px;
  padding: 0 0 8px;
}

.hub-shell--prep-dash .hub-header {
  margin: 0 0 20px;
  border-radius: var(--hub-radius);
}

.prep-dash--hub .prep-dash__main {
  padding-top: 16px !important;
}

.prep-dash--hub .prep-dash__topbar--compact {
  margin-bottom: 8px;
}

.prep-dash--hub .prep-dash__topbar--compact .prep-dash__page-title {
  font-size: 1.15rem;
}

.prep-dash--hub .prep-dash__col-main--hub {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 0 8px;
}

.prep-dash--hub .prep-dash__roadmap-wrap,
.prep-dash--hub .prep-dash__themes-wrap,
.prep-dash--hub .hub-more--secondary {
  background: var(--hub-card);
  border-radius: var(--hub-radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: var(--hub-shadow);
  border: none;
}

.prep-dash--hub .prep-dash__roadmap-wrap > summary,
.prep-dash--hub .prep-dash__themes-wrap > summary,
.prep-dash--hub .hub-more--secondary > summary {
  cursor: pointer;
  margin-bottom: 0;
  list-style: none;
}

.prep-dash--hub .prep-dash__roadmap-wrap > summary::-webkit-details-marker,
.prep-dash--hub .prep-dash__themes-wrap > summary::-webkit-details-marker,
.prep-dash--hub .hub-more--secondary > summary::-webkit-details-marker {
  display: none;
}

.prep-dash--hub .prep-dash__roadmap-inner .prep-dash__roadmap-sub {
  margin: 12px 0;
  font-size: 0.88rem;
  color: var(--hub-muted);
}

.prep-dash--hub .prep-dash__roadmap--nested {
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.prep-dash--hub .hub-more--secondary .hub-forecasts,
.prep-dash--hub .hub-more--secondary .hub-achievements {
  margin-bottom: 0;
}

.prep-dash--hub .hub-more--secondary .hub-section-title {
  margin-bottom: 0;
}

.prep-dash--hub .prep-dash__roadmap {
  margin-bottom: 16px;
}

.prep-dash--hub .prep-dash__themes-wrap {
  margin-top: 8px;
}

.prep-dash--hub .prep-dash__themes-wrap > summary {
  cursor: pointer;
  margin-bottom: 12px;
}

/* Мини-план на student.html */
.hub-plan-mini {
  background: var(--hub-card);
  border-radius: var(--hub-radius);
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: var(--hub-shadow);
}

.hub-plan-mini__forecast {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--hub-muted);
}

.hub-plan-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.hub-plan-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--hub-bg);
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}

a.hub-plan-step:hover {
  border-color: rgba(15, 118, 110, 0.25);
  background: rgba(15, 118, 110, 0.04);
}

.hub-plan-step.is-done {
  opacity: 0.65;
}

.hub-plan-step.is-locked {
  opacity: 0.5;
  cursor: help;
}

[data-plan-lock-tip] {
  position: relative;
  cursor: help;
}

[data-plan-lock-tip]::after {
  content: attr(data-plan-lock-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(260px, 90vw);
  padding: 8px 11px;
  background: #1e293b;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  border-radius: 8px;
  white-space: normal;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.22);
}

[data-plan-lock-tip]:hover::after,
[data-plan-lock-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.hub-plan-step.is-locked[data-plan-lock-tip]:focus-visible {
  outline: 2px solid var(--hub-teal, #0f766e);
  outline-offset: 2px;
}

.hub-plan-step--just-done {
  animation: hub-step-pulse 1.1s ease 2;
  border-color: rgba(15, 118, 110, 0.45) !important;
  background: rgba(15, 118, 110, 0.1) !important;
}

.hub-plan-step--next {
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.35);
  border-color: rgba(15, 118, 110, 0.25) !important;
}

.hub-plan-mini--return {
  scroll-margin-top: 80px;
}

.hub-plan-mini--day-done {
  animation: hub-step-pulse 1.2s ease 1;
}

@keyframes hub-step-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.01);
  }
}

.hub-plan-step__mark {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
}

.hub-plan-step__label {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
}

.hub-plan-step__time {
  font-size: 0.78rem;
  color: var(--hub-muted);
}

.hub-plan-mini__legend,
.hub-plan-mini__link {
  margin: 0;
  font-size: 0.78rem;
  color: var(--hub-muted);
  line-height: 1.45;
}

.hub-plan-mini__link {
  margin-top: 8px;
}

.hub-btn--ghost {
  background: transparent;
  color: var(--hub-teal, #0f766e);
  border: 1px solid rgba(15, 118, 110, 0.25);
  box-shadow: none;
}

.hub-btn--ghost:hover {
  background: rgba(15, 118, 110, 0.06);
}

body.prep-session-summary-open {
  overflow: hidden;
}

.prep-session-summary {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.prep-session-summary.hidden {
  display: none;
}

.prep-session-summary__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.prep-session-summary__card {
  position: relative;
  width: min(100%, 420px);
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 22px;
  box-shadow: 0 24px 64px rgba(15, 118, 110, 0.18);
  text-align: center;
  animation: prep-session-pop 0.35s ease;
}

@keyframes prep-session-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.prep-session-summary__icon {
  font-size: 2.4rem;
  margin: 0 0 8px;
  line-height: 1;
}

.prep-session-summary__title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  color: var(--hub-text, #134e4a);
}

.prep-session-summary__subtitle {
  margin: 0 0 14px;
  color: var(--hub-muted, #64748b);
  font-size: 0.95rem;
  line-height: 1.4;
}

.prep-session-summary__xp {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--hub-teal, #0f766e);
}

.prep-session-summary__streak,
.prep-session-summary__score,
.prep-session-summary__quiz,
.prep-session-summary__today {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: #334155;
}

.prep-session-summary__next {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--hub-bg, #f4f6f5);
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: left;
  color: #334155;
}

.prep-session-summary__next-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hub-muted, #64748b);
  margin-bottom: 4px;
}

.prep-session-summary__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.prep-session-summary__btn {
  width: 100%;
  text-align: center;
  text-decoration: none;
  justify-content: center;
}

.mode-intro {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px;
  background: var(--hub-card, #fff);
  border: 1px solid #e2ebe6;
  border-radius: var(--hub-radius, 16px);
  box-shadow: var(--hub-shadow);
}

.mode-intro--review {
  border-color: #bfdbfe;
  background: linear-gradient(160deg, #eff6ff 0%, #fff 55%);
}

.mode-intro--scenario {
  border-color: #c4b5fd;
  background: linear-gradient(160deg, #f5f3ff 0%, #fff 55%);
}

.mode-intro__kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hub-muted, #64748b);
}

.mode-intro__title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--hub-text, #134e4a);
}

.mode-intro__body {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #334155;
  margin-bottom: 12px;
}

.mode-intro__topics {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.mode-intro__topics li {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.mode-intro__topic-code {
  display: inline-block;
  min-width: 2.5rem;
  font-weight: 700;
  color: var(--hub-teal, #0f766e);
}

.mode-intro__meta,
.mode-intro__xp {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--hub-muted, #64748b);
  line-height: 1.4;
}

.mode-intro__xp {
  font-weight: 600;
  color: var(--hub-teal, #0f766e);
}

.mode-intro__cta {
  width: 100%;
  margin-top: 14px;
}

.mode-result__xp {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--hub-teal, #0f766e);
}

.mode-result__wrong,
.mode-result__remain {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: #334155;
}

.mode-result__remain--clear {
  color: var(--hub-teal, #0f766e);
  font-weight: 600;
}

.mode-result__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.mode-result__wrong-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
