/* ============================================================
   PSLE Compo Club — Visual Design System
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f4f7fb;
  --bg-subtle: #eef2f8;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e8edf4;
  --border-strong: #d5dde9;

  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --primary-subtle: #f0f1ff;
  --primary-border: #ddd6fe;
  --primary-glow: rgba(99, 102, 241, 0.18);

  --accent-violet: #8b5cf6;
  --accent-sky: #38bdf8;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  --accent-rose: #fb7185;

  --success: #10b981;
  --success-subtle: #ecfdf5;
  --warning: #f59e0b;
  --warning-subtle: #fffbeb;
  --danger: #ef4444;
  --danger-subtle: #fef2f2;
  --info: #0ea5e9;
  --info-subtle: #f0f9ff;

  --sidebar-bg: #ffffff;
  --sidebar-border: var(--border);
  --sidebar-text: var(--text-muted);
  --sidebar-text-active: var(--primary);
  --sidebar-hover: var(--surface-soft);
  --sidebar-active: var(--primary-subtle);

  --sidebar-width: 272px;
  --header-height: 60px;
  --content-max: 1200px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 6px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --muted: var(--text-muted);
  --sidebar: var(--sidebar-bg);
  --shadow: var(--shadow-md);
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---- App shell ---- */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.main-area {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 55% at 100% 0%, rgba(199, 210, 254, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 0% 100%, rgba(186, 230, 253, 0.28) 0%, transparent 50%),
    var(--bg);
}

.main-content {
  padding: 2rem 2.5rem 4rem;
  min-width: 0;
}

.content-container {
  max-width: var(--content-max);
  margin: 0 auto;
}

.topbar {
  display: none;
  align-items: center;
  gap: 1rem;
  height: var(--header-height);
  padding: 0 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text);
}

/* ---- Sidebar ---- */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 1.5rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.03);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  padding: 0.35rem 0.5rem;
  margin-bottom: 1.75rem;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}

.brand-link:hover { background: var(--sidebar-hover); text-decoration: none; }

.brand-mark svg { display: block; width: 36px; height: 36px; }

.brand {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  font-weight: 500;
}

.nav-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  padding: 0 0.75rem;
  font-weight: 600;
}

.nav-list { list-style: none; padding: 0; margin: 0; }

.nav-list li { margin-bottom: 0.2rem; }

.nav-list a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
}

.nav-list a:hover {
  background: var(--sidebar-hover);
  color: var(--text);
  text-decoration: none;
}

.nav-list a:hover .nav-icon { opacity: 1; }

.nav-list a.active {
  background: var(--sidebar-active);
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-list a.active .nav-icon { opacity: 1; color: var(--primary); }

.nav-list a.nav-coach.active {
  background: var(--success-subtle);
  color: var(--success);
  box-shadow: inset 3px 0 0 var(--success);
}

.nav-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 0.75rem 0.5rem 0.85rem;
}

.user-chip {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 0;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a5b4fc, var(--primary));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-chip-body {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.user-chip-body strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip-body span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-signout {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.user-signout:hover {
  background: var(--danger-subtle);
  color: var(--danger);
  text-decoration: none;
}

/* ---- Breadcrumbs ---- */
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: 0.35rem;
  color: var(--border-strong);
}

.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }

/* ---- Page hero (dashboard headers) ---- */
.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 50%, #f0f4ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -5%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.page-hero h1 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.25;
}

.page-hero p {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 520px;
}

.page-hero__actions {
  display: flex;
  gap: 0.65rem;
  flex-shrink: 0;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.page-header h1 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.page-header p { margin: 0.35rem 0 0; color: var(--text-muted); }

.page-actions { display: flex; gap: 0.65rem; flex-shrink: 0; }

/* ---- Section headers ---- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-header p {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---- Dashboard split (promo + metrics) ---- */
.dashboard-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: stretch;
}

.practice-promo-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.75rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.practice-promo-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: var(--primary-subtle);
  color: var(--primary);
  flex-shrink: 0;
}

.practice-promo-card__icon svg {
  width: 22px;
  height: 22px;
}

.practice-promo-card h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.practice-promo-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.practice-promo-card .btn {
  align-self: flex-start;
  margin-top: 0.35rem;
}

@media (max-width: 900px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }
}

/* ---- Stat cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stats-grid--2x2 {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 0;
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.35rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-card__icon svg { width: 22px; height: 22px; }

.stat-card--indigo .stat-card__icon { background: var(--primary-subtle); color: var(--primary); }
.stat-card--sky .stat-card__icon { background: var(--info-subtle); color: var(--info); }
.stat-card--emerald .stat-card__icon { background: var(--success-subtle); color: var(--success); }
.stat-card--amber .stat-card__icon { background: var(--warning-subtle); color: var(--warning); }

.stat-card__label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.stat-card__value {
  display: block;
  font-family: var(--font-sans);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.stat-card__hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  gap: 1.75rem;
  margin: 2rem 0 0.5rem;
  align-items: start;
}

.admin-side-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.admin-side-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-side-metric strong {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.admin-side-metric span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-cloudinary {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.admin-cloudinary__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.admin-cloudinary__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-cloudinary__meta {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-cloudinary__pct {
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.admin-cloudinary__track {
  height: 0.65rem;
  border-radius: 999px;
  background: var(--surface-muted, #eef2f7);
  overflow: hidden;
}

.admin-cloudinary__fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.admin-cloudinary__fill--ok {
  background: linear-gradient(90deg, #34d399, #059669);
}

.admin-cloudinary__fill--warn {
  background: linear-gradient(90deg, #fbbf24, #d97706);
}

.admin-cloudinary__fill--critical {
  background: linear-gradient(90deg, #fb7185, #e11d48);
}

.admin-grading-policy {
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.admin-grading-policy__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-grading-policy__head h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.admin-grading-policy__head p {
  margin: 0.35rem 0 0;
  max-width: 42rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.admin-grading-policy__status-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.admin-grading-policy__status {
  min-height: 1rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.admin-grading-policy__status:not(:empty) {
  opacity: 1;
}

.admin-grading-policy__status[data-kind="ok"] {
  color: var(--success);
}

.admin-grading-policy__status[data-kind="error"] {
  color: #be123c;
}

.admin-grading-policy__status[data-kind="pending"] {
  color: var(--text-muted);
}

.admin-grading-policy__form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.admin-grading-policy__body {
  --delay-ease: cubic-bezier(0.25, 0.8, 0.25, 1);
  --delay-width: 17.5rem;
  --mode-control-height: 3.05rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.admin-grading-policy__mode-field {
  flex: 0 1 28rem;
  width: min(100%, 28rem);
}

.admin-grading-policy__field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.admin-grading-policy__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.admin-grading-policy__modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  width: 100%;
  height: var(--mode-control-height);
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  box-sizing: border-box;
}

.admin-grading-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: 100%;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--text-muted);
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.admin-grading-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-grading-chip:hover {
  color: var(--text);
}

.admin-grading-chip:has(input:checked) {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--primary-border);
}

.admin-grading-policy__delay {
  flex: 0 0 auto;
  width: 0;
  max-width: 0;
  margin-left: auto;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    width 0.38s var(--delay-ease),
    max-width 0.38s var(--delay-ease),
    opacity 0.22s ease;
}

.admin-grading-policy__delay.is-open {
  width: var(--delay-width);
  max-width: var(--delay-width);
  opacity: 1;
  pointer-events: auto;
}

.admin-grading-policy__delay-panel {
  width: var(--delay-width);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transform: translateX(-1.25rem);
  transition: transform 0.38s var(--delay-ease);
}

.admin-grading-policy__delay.is-open .admin-grading-policy__delay-panel {
  transform: translateX(0);
}

.admin-grading-minutes {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) 2.4rem;
  align-items: stretch;
  gap: 0.3rem;
  width: 100%;
  height: var(--mode-control-height);
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  box-sizing: border-box;
}

.admin-grading-minutes__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.admin-grading-minutes__btn:hover:not(:disabled) {
  background: var(--primary-subtle);
  color: var(--primary);
}

.admin-grading-minutes__btn:active:not(:disabled) {
  transform: scale(0.96);
}

.admin-grading-minutes__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-grading-minutes__field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 100%;
  border: 0;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.15s ease;
}

.admin-grading-minutes__field:focus-within {
  box-shadow: 0 0 0 2px var(--primary-glow), 0 1px 2px rgba(15, 23, 42, 0.06);
}

.admin-grading-minutes__field input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 9px;
  padding: 0 2.15rem 0 0.55rem;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text);
  appearance: textfield;
  -moz-appearance: textfield;
}

.admin-grading-minutes__field input[type="number"]::-webkit-outer-spin-button,
.admin-grading-minutes__field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.admin-grading-minutes__field input[type="number"]:focus {
  outline: none;
}

.admin-grading-minutes__unit {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
}

.admin-grading-policy__hint {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .admin-grading-policy__body {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-grading-policy__mode-field {
    width: 100%;
    flex: none;
  }

  .admin-grading-policy__delay {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 0;
    transition:
      max-height 0.38s var(--delay-ease),
      opacity 0.22s ease;
  }

  .admin-grading-policy__delay.is-open {
    width: 100%;
    max-width: 100%;
    max-height: 6rem;
  }

  .admin-grading-policy__delay-panel {
    width: 100%;
    transform: translateX(-0.85rem);
  }
}

@media (max-width: 640px) {
  .admin-grading-policy__head {
    flex-direction: column;
  }
}

.badge-scheduled,
.badge-processing,
.badge-pending {
  background: var(--warning-subtle);
  color: var(--warning);
}

.badge-skipped {
  background: var(--surface-muted, #eef2f7);
  color: var(--text-muted);
}

.badge-failed {
  background: rgba(225, 29, 72, 0.12);
  color: #be123c;
}

.badge-completed {
  background: var(--success-subtle);
  color: var(--success);
}

.admin-game-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-game-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-game-list strong {
  display: block;
  font-size: 0.92rem;
}

.admin-game-list span,
.admin-game-list em {
  font-size: 0.78rem;
  font-style: normal;
  color: var(--text-muted);
}

.admin-topic {
  max-width: 280px;
  color: var(--text-secondary);
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-user-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}

.admin-actions {
  text-align: right;
  white-space: nowrap;
}

.muted { color: var(--text-muted); }

.badge-handwritten { background: var(--warning-subtle); color: var(--warning); }
.badge-typed { background: var(--info-subtle); color: var(--info); }

@media (max-width: 960px) {
  .admin-split {
    grid-template-columns: 1fr;
  }
}

/* ---- Course cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.course-card__cover {
  height: 88px;
  position: relative;
}

.course-card__cover--indigo { background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%); }
.course-card__cover--violet { background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%); }
.course-card__cover--sky { background: linear-gradient(135deg, #bae6fd 0%, #7dd3fc 100%); }
.course-card__cover--emerald { background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%); }

.course-card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.course-card__body { padding: 1.25rem 1.35rem 1.35rem; flex: 1; display: flex; flex-direction: column; }

.course-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.course-card__meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-strong);
}

.course-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.course-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  flex: 1;
}

.course-card__footer {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ---- Generic card & panel ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
  margin-top: 15px;
}

.panel__header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.panel__header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.panel__header p {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.panel__body { padding: 1.25rem 1.5rem; }

.panel__body--flush { padding: 0; }

.stat-value {
  font-family: var(--font-sans);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

/* ---- Tables ---- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 0.9rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

th {
  background: var(--surface-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: #fafbff; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-admin { background: var(--primary-subtle); color: var(--primary); }
.badge-learner { background: var(--success-subtle); color: var(--success); }
.badge-topic { background: var(--primary-subtle); color: var(--primary); }
.badge-technique { background: var(--info-subtle); color: var(--info); }
.badge-vocabulary { background: var(--warning-subtle); color: var(--warning); }
.badge-resource { background: var(--success-subtle); color: var(--success); }
.badge-handwritten { background: var(--info-subtle); color: var(--info); }
.badge-typed { background: var(--primary-subtle); color: var(--primary); }
.badge-submitted { background: var(--warning-subtle); color: var(--warning); }
.badge-graded { background: var(--success-subtle); color: var(--success); }
.badge-open { background: var(--info-subtle); color: var(--info); }
.badge-enrolled { background: var(--primary-subtle); color: var(--primary); }
.badge-new { background: var(--info-subtle); color: var(--info); }
.badge-learning { background: var(--warning-subtle); color: var(--warning); }
.badge-known { background: var(--success-subtle); color: var(--success); }

/* ---- Buttons ---- */
.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.15rem;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary);
  color: var(--text-inverse);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 4px var(--primary-glow);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px var(--primary-glow);
  text-decoration: none;
}

.btn:active { transform: translateY(0); }
.btn:disabled, .btn.is-loading { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  box-shadow: none;
}

.btn-danger {
  background: linear-gradient(180deg, #ef4444 0%, var(--danger) 100%);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.btn-lg { padding: 0.8rem 1.5rem; font-size: 0.95rem; border-radius: var(--radius-md); }
.btn-sm { padding: 0.42rem 0.85rem; font-size: 0.8rem; }

/* ---- Forms ---- */
.form-card {
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.form-card__title {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.form-card__subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.form-group { margin-bottom: 1.15rem; }

.form-group label, .field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.72rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

.form-group textarea { min-height: 160px; resize: vertical; line-height: 1.6; }

.field-hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.4rem; }
.field-error { font-size: 0.82rem; color: var(--danger); margin-top: 0.35rem; }

.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.radio-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.radio-pill:has(input:checked) {
  border-color: var(--primary-light);
  background: var(--primary-subtle);
}

.radio-pill input { width: auto; accent-color: var(--primary); }

/* ---- Alerts ---- */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.alert-error { background: var(--danger-subtle); color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: var(--success-subtle); color: var(--success); border: 1px solid #a7f3d0; }

/* ---- Empty states ---- */
.empty-state {
  padding: 3rem 2rem;
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--primary-subtle);
  display: grid;
  place-items: center;
  font-size: 1.75rem;
}

.empty-state h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.empty-state p {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Skeleton, toast, spinner (unchanged structure, refined) ---- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-soft) 25%, var(--border) 50%, var(--surface-soft) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.toast-stack {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
}

.toast {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  background: var(--text);
  color: var(--text-inverse);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
}

.toast-visible { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--info); }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.page-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.page-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 22rem;
  width: 100%;
}

.page-overlay-spinner {
  width: 44px;
  height: 44px;
  margin: 0;
  flex-shrink: 0;
  border-color: rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
}

.page-overlay-text {
  margin: 1.35rem 0 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.page-overlay-cancel {
  margin-top: 1.75rem;
  min-width: 7.5rem;
  padding: 0.55rem 1.35rem;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

.page-overlay-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.page-overlay-cancel:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

body.overlay-open { overflow: hidden; }

.loading-inline {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 2rem;
  color: var(--text-muted);
  justify-content: center;
}

.hidden { display: none !important; }

/* ---- Report markdown ---- */
.report-markdown {
  line-height: 1.7;
  font-size: 0.95rem;
  color: var(--text);
}

.report-markdown > h1:first-child {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.report-markdown h1 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.report-markdown h2 {
  margin: 1.35rem 0 0.65rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.report-markdown h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.report-markdown p,
.report-markdown ul,
.report-markdown ol {
  margin-bottom: 0.85rem;
}

.report-markdown ul,
.report-markdown ol {
  padding-left: 1.25rem;
}

.report-markdown li {
  margin-bottom: 0.35rem;
}

.report-markdown strong {
  color: var(--text);
  font-weight: 700;
}

.report-markdown blockquote {
  margin: 0.85rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--primary-light);
  background: var(--primary-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.report-markdown pre,
.report-markdown code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.88rem;
}

.report-markdown pre {
  white-space: pre-wrap;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.report-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.85rem 0 1.1rem;
  font-size: 0.9rem;
}

.report-markdown th,
.report-markdown td {
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
}

.report-markdown th {
  background: var(--surface-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.report-score {
  display: grid;
  gap: 0.55rem;
  margin: 0.85rem 0 1.1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-soft) 100%);
  box-shadow: var(--shadow-sm);
}

.report-score__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.report-score__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.report-score__value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--primary);
}

.report-score__max {
  margin-left: 0.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.report-score__meter {
  height: 0.45rem;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.report-score__meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  transition: width 0.35s ease;
}

.report-score--high {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #fff 0%, var(--success-subtle) 100%);
}

.report-score--high .report-score__value { color: var(--success); }
.report-score--high .report-score__meter-fill {
  background: linear-gradient(90deg, #6ee7b7, var(--success));
}

.report-score--mid {
  border-color: var(--primary-border);
  background: linear-gradient(135deg, #fff 0%, var(--primary-subtle) 100%);
}

.report-score--low {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff 0%, var(--danger-subtle) 100%);
}

.report-score--low .report-score__value { color: var(--danger); }
.report-score--low .report-score__meter-fill {
  background: linear-gradient(90deg, #fca5a5, var(--danger));
}

.report-al {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.85rem 0 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-subtle) 100%);
  box-shadow: var(--shadow-sm);
}

.report-al__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.report-al__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--text-inverse);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.report-al--high {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #fff 0%, var(--success-subtle) 100%);
}

.report-al--high .report-al__value {
  background: var(--success);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.report-al--mid {
  border-color: var(--primary-border);
}

.report-al--low {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff 0%, var(--danger-subtle) 100%);
}

.report-al--low .report-al__value {
  background: var(--danger);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.22);
}

/* ---- Composition Coach ---- */
.coach-layout {
  width: 100%;
  max-width: none;
}

.coach-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.coach-setup .panel__body {
  padding-bottom: 1.35rem;
}

.coach-setup .form-group {
  margin-bottom: 0;
}

.coach-input-area {
  min-width: 0;
}

.coach-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.25rem;
}

.coach-typed {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.coach-typed__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.coach-typed textarea {
  width: 100%;
  min-height: min(68vh, 480px);
  resize: vertical;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font: inherit;
  line-height: 1.6;
  background: var(--surface-soft);
}

.coach-typed textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--surface);
}

.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin-top: 1rem; }

.mode-tab {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.mode-tab.active {
  background: var(--primary-subtle);
  border-color: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.15s;
}

.filter-tab:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.filter-tab.active {
  background: var(--primary-subtle);
  border-color: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  cursor: pointer;
}

.score-strip--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.upload-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: min(68vh, 480px);
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.upload-section:hover,
.upload-section.dragover {
  border-color: var(--primary-light);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.upload-section.has-preview {
  cursor: default;
  padding: 1.25rem;
  border-style: solid;
  border-color: var(--border);
  background: var(--surface-soft);
}

.upload-section.has-preview:hover,
.upload-section.has-preview.dragover {
  box-shadow: var(--shadow-sm);
  background: var(--surface-soft);
}

.upload-section.has-preview.dragover {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.upload-section__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 360px;
}

.upload-section__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.upload-section__lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.upload-preview {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-preview.hidden,
.upload-section__empty.hidden {
  display: none;
}

.upload-preview__frame {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  line-height: 0;
}

.upload-preview__frame:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}

.upload-preview__frame img {
  display: block;
  max-width: 100%;
  max-height: min(62vh, 520px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.upload-preview__shade {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.upload-preview__frame:hover .upload-preview__shade,
.upload-preview__frame:focus-visible .upload-preview__shade {
  opacity: 1;
}

.upload-preview__remove {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}

.upload-preview__frame:hover .upload-preview__remove,
.upload-preview__frame:focus-within .upload-preview__remove,
.upload-preview__remove:focus-visible {
  opacity: 1;
  transform: scale(1);
}

.upload-preview__remove:hover {
  background: var(--danger);
}

.upload-preview__remove:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (hover: none) {
  .upload-preview__remove {
    opacity: 1;
    transform: scale(1);
  }

  .upload-preview__shade {
    display: none;
  }
}

.upload-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--primary-subtle);
  color: var(--primary);
  display: grid;
  place-items: center;
}

.hint { font-size: 0.82rem; color: var(--text-muted); margin: 0.65rem 0 0; }

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.score-strip { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-bottom: 1.25rem; }
.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

.score-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-subtle) 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.95rem;
  box-shadow: var(--shadow-sm);
}

.score-card--high {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #fff 0%, var(--success-subtle) 100%);
}

.score-card--high .score-card__value { color: var(--success); }
.score-card--high .score-card__meter-fill {
  background: linear-gradient(90deg, #6ee7b7, var(--success));
}

.score-card--low {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff 0%, var(--danger-subtle) 100%);
}

.score-card--low .score-card__value { color: var(--danger); }
.score-card--low .score-card__meter-fill {
  background: linear-gradient(90deg, #fca5a5, var(--danger));
}

.score-card__label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 700;
}

.score-card__value {
  margin-top: 0.25rem;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.score-card__value span {
  margin-left: 0.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.score-card__meter {
  margin-top: 0.55rem;
  width: 100%;
  height: 0.38rem;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.score-card__meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary) 100%);
}

.score-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  background: linear-gradient(135deg, var(--primary-subtle), #fff);
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
}

.score-chip-label { color: var(--text-muted); margin-right: 0.15rem; }
.score-chip strong { font-size: 1.05rem; color: var(--primary); font-weight: 700; }

.coach-results {
  margin-top: 1.5rem;
}

.report-tabs-shell {
  margin-bottom: 1rem;
  /* Room for active-tab glow so overflow doesn't clip the top/sides */
  padding: 5px 4px 6px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}

.report-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  width: max-content;
  min-width: 100%;
}

.report-tab {
  flex: 0 0 auto;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.48rem 0.95rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}

.report-tab:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.report-tab.active {
  background: var(--primary-subtle);
  border-color: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.report-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.report-panels {
  overflow: hidden;
  transition: height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.report-panels.is-animating {
  will-change: height;
}

.report-tab-panel {
  display: none;
}

.report-tab-panel.active {
  display: block;
  animation: report-fade 0.22s ease;
}

@keyframes report-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .report-panels {
    transition: none;
  }

  .report-tab-panel.active {
    animation: none;
  }
}

@media (max-width: 900px) {
  .coach-actions {
    justify-content: stretch;
  }

  .coach-actions .btn {
    width: 100%;
  }

  .upload-section,
  .coach-typed textarea {
    min-height: 360px;
  }
}

/* ---- Games SPA shell (one document for menu + all games) ---- */
body.games-app-page .content-container {
  max-width: 1100px;
}

body.games-app-page .breadcrumbs {
  display: none;
}

.games-app {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* In normal view the game shells simply sit at the top like any page. */
.games-app--play .quiz-shell {
  width: 100%;
  max-width: 680px;
  margin: 0 auto 2rem;
}

.games-app--study .flash-shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  min-height: 0;
  justify-content: flex-start;
}

/* ---- Fullscreen: .is-fullscreen is synced by games_fullscreen.js ---- */
.games-app.is-fullscreen {
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: clamp(1.25rem, 3.5vh, 2.25rem) clamp(1.25rem, 4vw, 2.75rem);
  box-sizing: border-box;
  overflow: auto;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(199, 210, 254, 0.4) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(186, 230, 253, 0.28) 0%, transparent 50%),
    var(--bg);
}

.games-app.is-fullscreen .games-app__chrome {
  width: min(960px, 100%);
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
}

/* Hub keeps its normal top-aligned grid, just constrained and centered horizontally. */
.games-app.is-fullscreen .games-view {
  width: min(960px, 100%);
  margin-left: auto;
  margin-right: auto;
}

/* All games (quiz + flashcard study): center the game in the viewport. */
.games-app.is-fullscreen.games-app--play .games-view,
.games-app.is-fullscreen.games-app--study .games-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  min-height: 0;
}

.games-app.is-fullscreen.games-app--play .quiz-shell {
  /* Override base .quiz-shell flex:1 so it doesn't stretch — let games-view center it */
  flex: 0 0 auto;
  width: min(680px, 100%);
  margin: 0 auto;
}

.games-app.is-fullscreen.games-app--study .flash-shell {
  flex: 0 0 auto;
  min-height: 0;
  width: min(720px, 100%);
  margin: 0 auto;
}

.games-app__chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  min-height: 2.5rem;
}

.games-app__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}

.games-app__back svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.games-app__back:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-subtle);
  text-decoration: none;
  box-shadow: none;
}

.games-app__chrome-title {
  flex: 1;
  min-width: 0;
}

.games-app__chrome-title.hidden {
  display: none;
}

.games-app__chrome .flash-fs-btn {
  margin-left: auto;
  flex-shrink: 0;
}

.games-view {
  flex: 1;
  width: 100%;
}

.games-view.is-loading {
  min-height: 12rem;
}

.games-loading {
  display: flex;
  justify-content: center;
  padding: 2rem 0 1rem;
}

.games-loading.hidden { display: none; }

.games-loading__card {
  width: min(100%, 520px);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.games-loading__line {
  height: 0.85rem;
  width: 100%;
}

.games-loading__line--lg { height: 1.35rem; width: 55%; }
.games-loading__line--sm { width: 40%; }

.games-loading__block {
  height: 8rem;
  width: 100%;
  border-radius: var(--radius-md);
}

.games-loading__label {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

body.games-app-page--study .games-view .flash-shell {
  min-height: 0;
}

/* ---- Quiz end metrics ---- */
.quiz-done__score {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 0 1.15rem;
}

.quiz-done__stat {
  min-width: 5.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  text-align: center;
}

.quiz-done__stat strong {
  display: block;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--text);
}

.quiz-done__stat span {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.quiz-done__best {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.quiz-done__best.is-record {
  color: var(--success);
  font-weight: 650;
}

.game-card__stats span.is-best {
  color: var(--primary);
  font-weight: 700;
}

/* ---- Games hub ---- */
.games-hub {
  width: 100%;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
  text-decoration: none;
}

.game-card__media {
  height: 120px;
  display: grid;
  place-items: center;
  color: var(--primary);
}

.game-card__media svg {
  width: 42px;
  height: 42px;
}

.game-card__media--flash {
  background:
    radial-gradient(circle at 80% 20%, rgba(165, 180, 252, 0.55), transparent 45%),
    linear-gradient(135deg, var(--primary-subtle) 0%, #e0f2fe 100%);
}

.game-card__media--show {
  background:
    radial-gradient(circle at 20% 80%, rgba(167, 243, 208, 0.5), transparent 45%),
    linear-gradient(135deg, var(--success-subtle) 0%, #ecfeff 100%);
  color: var(--success);
}

.game-card__media--upgrade {
  background:
    radial-gradient(circle at 80% 80%, rgba(253, 230, 138, 0.55), transparent 45%),
    linear-gradient(135deg, var(--warning-subtle) 0%, #fff7ed 100%);
  color: var(--warning);
}

.game-card__media--plot {
  background:
    radial-gradient(circle at 15% 20%, rgba(251, 113, 133, 0.28), transparent 45%),
    linear-gradient(135deg, var(--danger-subtle) 0%, #fff1f2 100%);
  color: var(--danger);
}

.game-card__media--hook {
  background:
    radial-gradient(circle at 70% 30%, rgba(125, 211, 252, 0.5), transparent 45%),
    linear-gradient(135deg, var(--info-subtle) 0%, #eef2ff 100%);
  color: var(--info);
}

.game-card__media--dash,
.game-card__media--catch {
  background:
    radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.4), transparent 48%),
    linear-gradient(145deg, #0f172a 0%, #134e4a 100%);
  color: #67e8f9;
}

/* ---- Quiz games ---- */
body.game-play-page .main-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
}

body.game-play-page .content-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
}

.quiz-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  margin: 0 auto 2rem;
}

.quiz-shell:fullscreen,
.quiz-shell:-webkit-full-screen,
.quiz-shell.is-fullscreen {
  max-width: none;
  margin: 0;
  min-height: 100%;
  height: 100%;
  width: 100%;
  padding: clamp(1.25rem, 4vh, 2.5rem) clamp(1rem, 4vw, 2.5rem);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(199, 210, 254, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(186, 230, 253, 0.3) 0%, transparent 50%),
    var(--bg);
}

.quiz-shell:fullscreen .quiz-shell__back,
.quiz-shell:-webkit-full-screen .quiz-shell__back,
.quiz-shell.is-fullscreen .quiz-shell__back {
  display: none !important;
}

.quiz-shell:fullscreen .quiz-panel,
.quiz-shell:-webkit-full-screen .quiz-panel,
.quiz-shell.is-fullscreen .quiz-panel,
.quiz-shell:fullscreen .quiz-done,
.quiz-shell:-webkit-full-screen .quiz-done,
.quiz-shell.is-fullscreen .quiz-done {
  width: min(720px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.quiz-shell:fullscreen .quiz-shell__header,
.quiz-shell:-webkit-full-screen .quiz-shell__header,
.quiz-shell.is-fullscreen .quiz-shell__header {
  width: min(720px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.quiz-shell__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.quiz-shell__tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  flex-shrink: 0;
}

.quiz-shell__back {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.quiz-shell__back:hover { color: var(--primary); }

.quiz-shell__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--primary);
}

.quiz-shell__header h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.quiz-shell__meta {
  min-width: 120px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.quiz-shell__progress {
  margin-top: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.quiz-shell__progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  transition: width 0.25s ease;
}

.quiz-panel {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.quiz-panel.is-leaving {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.quiz-panel.is-entering {
  animation: quiz-panel-in 0.32s ease both;
}

@keyframes quiz-panel-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.quiz-panel__stem {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  color: var(--text-secondary);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.5;
}

.quiz-panel__prompt {
  margin: 0 0 1.1rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--primary-light);
  background: var(--primary-subtle);
  transform: translateY(-1px);
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option__index {
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.quiz-option__text {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.5;
  padding-top: 0.15rem;
}

.quiz-option.is-correct {
  border-color: #6ee7b7;
  background: var(--success-subtle);
  animation: quiz-option-reveal 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quiz-option.is-correct .quiz-option__index {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.quiz-option.is-wrong {
  border-color: #fca5a5;
  background: var(--danger-subtle);
  animation: quiz-option-reveal 0.35s ease both;
}

.quiz-option.is-wrong .quiz-option__index {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

@keyframes quiz-option-reveal {
  from {
    transform: scale(0.98);
    box-shadow: none;
  }
  55% {
    transform: scale(1.015);
  }
  to {
    transform: none;
  }
}

/* Sentence Upgrade — tap phrase to complete */
.complete-stage {
  margin-top: 0.5rem;
}

.complete-stage__lead {
  margin: 0 0 1.1rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.complete-stage__slot {
  display: inline-block;
  margin-left: 0.2rem;
  padding: 0.1rem 0.55rem;
  border-radius: 8px;
  border: 1.5px dashed var(--primary-light);
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 750;
}

.complete-stage__slot.is-filled {
  border-style: solid;
  background: var(--surface);
  color: inherit;
}

.complete-choices {
  display: grid;
  gap: 0.65rem;
}

.complete-choice {
  width: 100%;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  text-align: left;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.complete-choice:hover:not(:disabled) {
  border-color: var(--primary-light);
  background: var(--primary-subtle);
  transform: translateY(-1px);
}

.complete-choice:disabled {
  cursor: default;
}

.complete-choice.is-correct {
  border-color: #6ee7b7;
  background: var(--success-subtle);
}

.complete-choice.is-wrong {
  border-color: #fca5a5;
  background: var(--danger-subtle);
}

/* Plot Hole — tap a story line */
.story-scene {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary-light);
  background: var(--primary-subtle);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.5;
}

.story-spot {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.35rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.story-line {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  padding: 1rem 1.1rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.18s ease;
}

.story-line:last-child {
  border-bottom: none;
}

.story-line:hover:not(:disabled) {
  background: var(--primary-subtle);
}

.story-line:disabled {
  cursor: default;
}

.story-line__num {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.story-line__text {
  flex: 1;
  font-size: 0.98rem;
  line-height: 1.6;
  padding-top: 0.15rem;
}

.story-line.is-correct {
  background: var(--success-subtle);
}

.story-line.is-correct .story-line__num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.story-line.is-wrong {
  background: var(--danger-subtle);
}

.story-line.is-wrong .story-line__num {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* Opening Hook — drag to rank */
.lineup-hint {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.lineup-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.lineup-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: grab;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.lineup-item.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.lineup-item.is-drag-over {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.lineup-item.is-correct {
  border-color: #6ee7b7;
  background: var(--success-subtle);
}

.lineup-item.is-wrong {
  border-color: #fca5a5;
  background: var(--danger-subtle);
}

.lineup-item__handle {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: -0.12em;
  user-select: none;
}

.lineup-item__rank {
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lineup-item__text {
  font-size: 0.94rem;
  line-height: 1.5;
}

.lineup-item__moves {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.lineup-item__up,
.lineup-item__down {
  width: 1.65rem;
  height: 1.35rem;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
}

.lineup-item__up:hover:not(:disabled),
.lineup-item__down:hover:not(:disabled) {
  border-color: var(--primary-light);
  background: var(--primary-subtle);
}

.lineup-submit {
  width: 100%;
}

/* ---- Craft Catch ---- */
.dash-shell {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.dash-shell.is-setup {
  min-height: min(70vh, 640px);
}

.dash-hud__stats.is-muted {
  opacity: 0.35;
}

.dash-setup {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0.5rem 0 1rem;
}

.dash-setup.hidden,
.dash-board.hidden {
  display: none !important;
}

.dash-setup__panel {
  width: min(100%, 440px);
  margin: 0;
  padding: 1.35rem 1.35rem 1.4rem;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.dash-setup__title {
  margin: 0 0 0.75rem;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  text-align: left;
}

.dash-howto {
  margin: 0 0 1.15rem;
  padding: 0.85rem 0.95rem 0.85rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: left;
}

.dash-howto li + li {
  margin-top: 0.4rem;
}

.dash-howto strong {
  color: var(--text);
}

.dash-setup__label {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
}

.dash-setup__start {
  width: 100%;
}

.dash-diff {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.dash-diff__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.dash-diff__name {
  font-size: 1rem;
  font-weight: 750;
}

.dash-diff__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  text-align: right;
}

.dash-diff__line {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.dash-diff__btn:hover {
  border-color: var(--primary-light);
}

.dash-diff__btn.is-selected {
  border-color: #0d9488;
  background: rgba(13, 148, 136, 0.1);
}

.dash-diff__btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.dash-count {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.dash-count__btn {
  min-width: 2.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  color: inherit;
}

.dash-count__btn:hover {
  border-color: var(--primary-light);
}

.dash-count__btn.is-selected {
  border-color: #0d9488;
  background: rgba(13, 148, 136, 0.1);
}

.dash-count__btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.dash-shell.is-shake {
  animation: dash-shake 0.35s ease;
}

@keyframes dash-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

.dash-hud {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.dash-hud__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dash-hud__title {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.dash-hud__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text-secondary);
}

.dash-hearts {
  display: inline-flex;
  gap: 0.25rem;
}

.dash-heart {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
}

.dash-heart.is-on {
  background: #e11d48;
  border-color: #be123c;
}

.dash-board {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
  flex: 1;
}

.dash-read {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
  width: 100%;
  padding: 1.15rem 1.25rem 1rem;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.dash-read__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.dash-status {
  margin: 0;
  flex: 1;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-muted);
}

.dash-status.is-good {
  color: #0f766e;
}

.dash-status.is-bad {
  color: #be123c;
}

.dash-status.is-info {
  color: var(--text-secondary);
}

.dash-timer-label {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.dash-timer-label.is-urgent,
.dash-timer.is-urgent {
  color: #be123c;
}

.dash-timer {
  min-width: 2.75rem;
  text-align: center;
  padding: 0.15rem 0.45rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.dash-timer.is-urgent {
  border-color: rgba(190, 18, 60, 0.45);
  background: rgba(225, 29, 72, 0.1);
}

.dash-mission {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--text);
}

.dash-sentence {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--bg);
  border: 1px solid var(--border);
}

.dash-sentence__label {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dash-sentence__label:first-child {
  margin-top: 0;
}

.dash-sentence__weak {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.45;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.dash-sentence__weak.is-faded {
  opacity: 0.45;
}

.dash-sentence__live {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.45rem);
  font-weight: 750;
  line-height: 1.5;
  color: var(--text);
}

.dash-sentence__live.is-complete {
  color: #0f766e;
}

.dash-tok--blank {
  display: inline-block;
  min-width: 3.6rem;
  padding: 0 0.2rem;
  border-bottom: 2.5px solid #0d9488;
  color: #0d9488;
  letter-spacing: 0.08em;
}

.dash-tok--filled {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  background: rgba(13, 148, 136, 0.14);
  color: #0f766e;
}

.dash-timer-track {
  height: 0.45rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}

.dash-timer-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: #0d9488;
  transition: width 0.2s linear, background 0.2s ease;
}

.dash-timer-fill.is-urgent {
  background: #e11d48;
}

.dash-stage-wrap {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 360px;
  height: min(52vh, 520px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-card);
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(125, 211, 252, 0.18), transparent 55%),
    linear-gradient(180deg, #0b1220 0%, #152238 55%, #1a2f28 100%);
}

.dash-arena {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.dash-chip {
  position: absolute;
  top: -3rem;
  transform: translateX(-50%);
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 2px solid rgba(226, 232, 240, 0.45);
  font: inherit;
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  color: #f8fafc;
  background: #1e293b;
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.35);
  white-space: nowrap;
  max-width: min(90vw, 240px);
  overflow: hidden;
  text-overflow: ellipsis;
  animation-name: dash-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  touch-action: manipulation;
  z-index: 1;
}

.dash-chip.is-hit-good {
  background: #0f766e;
  border-color: #5eead4;
}

.dash-chip.is-hit-bad {
  background: #9f1239;
  border-color: #fda4af;
}

.dash-chip.is-caught {
  animation: none;
  opacity: 0;
  transform: translateX(-50%) scale(1.15);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.dash-chip:focus-visible {
  outline: 2px solid #f8fafc;
  outline-offset: 3px;
}

@keyframes dash-fall {
  from {
    top: -3rem;
  }
  to {
    top: calc(100% + 1rem);
  }
}

.dash-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(3px);
  padding: 1rem;
  z-index: 8;
}

.dash-ready {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(2px);
  padding: 1rem;
  z-index: 7;
}

.dash-ready.hidden {
  display: none;
}

.dash-ready__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: min(100%, 240px);
  text-align: center;
}

.dash-ready__ring {
  position: relative;
  width: 108px;
  height: 108px;
}

.dash-ready__svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dash-ready__track,
.dash-ready__progress {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
}

.dash-ready__track {
  stroke: #e2e8f0;
}

.dash-ready__progress {
  stroke: var(--primary);
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke 0.15s ease;
}

.dash-ready__num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.dash-ready__hint {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-secondary);
}

.dash-overlay.hidden {
  display: none;
}

.dash-overlay__card {
  width: min(100%, 380px);
  max-height: min(100%, 90%);
  overflow: auto;
  padding: 1.15rem 1.2rem 1.2rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.dash-overlay__card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.dash-overlay__card > p {
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.45;
}

.dash-result__eyebrow {
  margin: 0 0 0.35rem !important;
  font-size: 0.75rem !important;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted) !important;
}

.dash-result__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.85rem 0 1rem;
}

.dash-result__stat {
  padding: 0.7rem 0.5rem;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.dash-result__stat strong {
  display: block;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.dash-result__stat span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--text-muted);
}

.dash-result__copy {
  margin: 0 0 0.65rem !important;
}

.dash-result__best {
  margin: 0 0 1rem !important;
  font-weight: 700;
  color: var(--text-secondary);
}

.dash-result__best.is-record {
  color: #0f766e;
}

.dash-result__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* Fullscreen: keep question above playfield (never side-by-side) */
.games-app.is-fullscreen.games-app--play .dash-shell {
  flex: 1 1 auto;
  width: min(860px, 100%);
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
}

.games-app.is-fullscreen.games-app--play .dash-shell.is-setup {
  min-height: 0;
}

.games-app.is-fullscreen.games-app--play .dash-setup {
  flex: 1;
}

.games-app.is-fullscreen.games-app--play .dash-board {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.games-app.is-fullscreen.games-app--play .dash-read {
  flex: 0 0 auto;
}

.games-app.is-fullscreen.games-app--play .dash-stage-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 420px;
}

.games-app.is-fullscreen.games-app--play .dash-mission {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
}

.games-app.is-fullscreen.games-app--play .dash-sentence__live {
  font-size: clamp(1.3rem, 2.2vw, 1.55rem);
}

@media (max-width: 640px) {
  .dash-read {
    padding: 0.95rem 1rem 0.85rem;
  }

  .dash-read__top {
    flex-direction: column;
    gap: 0.35rem;
  }

  .dash-stage-wrap {
    min-height: 300px;
    height: 48vh;
  }

  .dash-setup__panel {
    width: min(100%, 440px);
  }
}

.quiz-feedback {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--surface-soft);
  opacity: 0;
  transform: translateY(6px);
  transition:
    grid-template-rows 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    margin-top 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.4s ease;
}

.quiz-feedback__inner {
  min-height: 0;
  overflow: hidden;
  padding: 0 1.1rem;
  transition: padding 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-feedback.is-open {
  grid-template-rows: 1fr;
  margin-top: 1.15rem;
  border-color: var(--border);
  opacity: 1;
  transform: none;
}

.quiz-feedback.is-open .quiz-feedback__inner {
  padding: 1rem 1.1rem;
}

.quiz-feedback__result {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 750;
}

.quiz-feedback__result.is-correct { color: var(--success); }
.quiz-feedback__result.is-wrong { color: var(--danger); }

.quiz-feedback__explain {
  margin: 0 0 0.95rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.quiz-done {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
}

.quiz-done:not(.hidden) .quiz-done__card {
  animation: quiz-panel-in 0.35s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .quiz-panel,
  .quiz-panel.is-leaving,
  .quiz-panel.is-entering,
  .quiz-option.is-correct,
  .quiz-option.is-wrong,
  .quiz-feedback,
  .quiz-feedback__inner,
  .flash-stage__grade.is-open,
  .quiz-done:not(.hidden) .quiz-done__card {
    animation: none !important;
    transition: none !important;
  }
}

.quiz-done__card {
  width: min(100%, 420px);
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.quiz-done__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--success-subtle);
  color: var(--success);
}

.quiz-done__card h2 { margin: 0 0 0.4rem; }
.quiz-done__card p { margin: 0 0 1.25rem; color: var(--text-muted); }

.quiz-done__actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .quiz-shell__header {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-shell__tools {
    align-items: stretch;
  }

  .quiz-shell__meta { text-align: left; }
}

.game-card__body {
  padding: 1.25rem 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.game-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.game-card__due {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--warning);
}

.game-card h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.game-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  flex: 1;
}

.game-card__stats {
  display: flex;
  gap: 0.85rem;
  margin-top: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---- Flashcard study stage ---- */
body.flash-study-page .main-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
}

body.flash-study-page .content-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
}

.flash-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - 4rem);
  padding: 0.5rem 0 1rem;
}

.flash-shell:fullscreen,
.flash-shell:-webkit-full-screen,
.flash-shell.is-fullscreen {
  min-height: 100%;
  height: 100%;
  width: 100%;
  padding: clamp(1.25rem, 4vh, 2.5rem) clamp(1rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(199, 210, 254, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(186, 230, 253, 0.3) 0%, transparent 50%),
    var(--bg);
  box-sizing: border-box;
}

.flash-shell:fullscreen .flash-stage__back,
.flash-shell:-webkit-full-screen .flash-stage__back,
.flash-shell.is-fullscreen .flash-stage__back {
  display: none !important;
}

.flash-stage {
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0 auto;
}

.flash-shell:fullscreen .flash-stage,
.flash-shell:-webkit-full-screen .flash-stage,
.flash-shell.is-fullscreen .flash-stage {
  width: min(880px, 100%);
  height: 100%;
  justify-content: center;
}

.flash-stage__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.flash-stage__title {
  min-width: 0;
}

.flash-stage__back {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.flash-stage__back:hover {
  color: var(--primary);
}

.flash-stage__header h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.flash-stage__tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  flex-shrink: 0;
}

.flash-fs-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.flash-fs-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-subtle);
}

.flash-fs-btn[aria-pressed="true"] {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-subtle);
}

.flash-stage__meta {
  min-width: 140px;
  text-align: right;
}

.flash-stage__count {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.flash-stage__progress {
  height: 0.4rem;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.flash-stage__progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  transition: width 0.25s ease;
}

.flash-stage__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.flash-card {
  display: block;
  width: 100%;
  min-height: clamp(340px, 56vh, 460px);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  perspective: 1400px;
  font: inherit;
  color: inherit;
  text-align: left;
}

.flash-shell:fullscreen .flash-card,
.flash-shell:-webkit-full-screen .flash-card,
.flash-shell.is-fullscreen .flash-card {
  min-height: clamp(400px, 62vh, 560px);
}

.flash-card:focus-visible {
  outline: none;
}

.flash-card:focus-visible .flash-card__face {
  box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-lg);
}

.flash-card__inner {
  position: relative;
  width: 100%;
  min-height: inherit;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.flash-card.is-flipped .flash-card__inner {
  transform: rotateY(180deg);
}

.flash-card.is-instant .flash-card__inner {
  transition: none !important;
}

.flash-card__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 2.25rem 1.75rem;
  border-radius: calc(var(--radius-xl) + 4px);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 12% 18%, rgba(199, 210, 254, 0.55), transparent 40%),
    linear-gradient(165deg, #ffffff 0%, #f5f7ff 100%);
  box-shadow: var(--shadow-lg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flash-card__face > * {
  opacity: 1;
  transition: opacity 0.22s ease;
}

.flash-card.is-content-hidden .flash-card__face > * {
  opacity: 0;
}

.flash-card__face--back {
  transform: rotateY(180deg);
  border-color: #c4b5fd;
  background:
    radial-gradient(circle at 88% 20%, rgba(196, 181, 253, 0.45), transparent 42%),
    linear-gradient(165deg, #ffffff 0%, #f5f3ff 100%);
}

.flash-card__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.flash-card__chip--answer {
  background: #ede9fe;
  color: #6d28d9;
}

.flash-card__prompt {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.flash-card__term {
  font-size: clamp(2.1rem, 5.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  text-align: center;
  color: var(--text);
  line-height: 1.2;
  max-width: 18ch;
}

.flash-card__term--answer {
  color: #5b21b6;
}

.flash-card__detail {
  margin: 0.15rem 0 0;
  max-width: 32rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(109, 40, 217, 0.16);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

.flash-card__hint {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.flash-card__hint-key {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem;
  margin-right: 0.25rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 700;
}

.flash-stage__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  margin-top: 1.5rem;
  width: 100%;
  min-height: 7.5rem;
}

.flash-stage__waiting {
  display: none;
}

.flash-stage__grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  width: min(100%, 420px);
  margin: 0 auto;
}

.flash-stage__grade.is-open {
  animation: flash-grade-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes flash-grade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.flash-grade-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.flash-grade-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.flash-grade-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.flash-grade-btn__key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-bottom: 0.2rem;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.flash-grade-btn__label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.flash-grade-btn__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.flash-grade-btn--again:hover {
  border-color: #fca5a5;
  background: var(--danger-subtle);
}

.flash-grade-btn--again.is-chosen {
  border-color: #f87171;
  background: var(--danger-subtle);
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.22);
}

.flash-grade-btn--good:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.flash-grade-btn--good.is-chosen {
  border-color: #2563eb;
  background: #dbeafe;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.flash-grade-btn--good.is-chosen .flash-grade-btn__label {
  color: #1d4ed8;
}

.flash-grade-btn--good.is-chosen .flash-grade-btn__key {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #dbeafe;
}

.flash-stage--done {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(640px, 100%);
  flex: 1;
  margin: 0 auto;
  padding: 1rem 0;
}

.flash-done-card {
  width: min(100%, 420px);
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.flash-done-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--success-subtle);
  color: var(--success);
}

.flash-done-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
}

.flash-done-card p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

.flash-done-card__actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  body.flash-study-page .main-content {
    padding-top: 0.85rem;
  }

  .flash-stage__header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .flash-stage__tools {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .flash-stage__meta {
    text-align: right;
    min-width: 0;
    flex: 1;
  }

  .flash-stage__grade {
    grid-template-columns: 1fr;
  }

  .flash-fs-btn__label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flash-card__inner,
  .game-card {
    transition: none;
  }
}

/* ---- Public home page ---- */
.home-page {
  min-height: 100vh;
  background: #f4f7fc;
  color: var(--text);
  overflow-x: hidden;
}

.home-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.home-ambient__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 90% at 50% -20%, rgba(238, 242, 255, 0.85) 0%, transparent 65%),
    linear-gradient(180deg, #f6f8fc 0%, #f4f7fc 50%, #f8fafc 100%);
}

.home-ambient__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, black 15%, transparent 75%);
  opacity: 0.5;
}

.home-ambient__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.home-ambient__glow--1 {
  width: 700px;
  height: 700px;
  top: -20%;
  left: -22%;
  background: rgba(199, 210, 254, 0.28);
}

.home-ambient__glow--2 {
  width: 600px;
  height: 600px;
  top: 15%;
  right: -22%;
  background: rgba(186, 230, 253, 0.22);
}

.home-ambient__glow--3 {
  width: 480px;
  height: 480px;
  bottom: 5%;
  left: 15%;
  background: rgba(196, 181, 253, 0.18);
}

.home-ambient__glow--4 {
  display: none;
}

.home-shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Full-width header */
.home-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.home-header--scrolled {
  border-bottom-color: rgba(226, 232, 240, 0.7);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.home-header__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.home-header__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  margin-right: auto;
  flex-shrink: 0;
}

.home-header__brand svg {
  width: 30px;
  height: 30px;
}

.home-header__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0;
  background: none;
  border: none;
  backdrop-filter: none;
}

.home-header__nav a {
  padding: 0.25rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0;
  transition: color 0.15s;
}

.home-header__nav a:hover {
  color: var(--text);
  background: none;
}

.home-header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.home-header__signin {
  padding: 0.45rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.home-header__signin:hover {
  color: var(--text);
}

.home-header__cta {
  padding: 0.5rem 1rem !important;
  font-size: 0.84rem !important;
}

.home-gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 55%, var(--accent-sky) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.home-lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 2rem;
  max-width: 34rem;
}

/* Intro zone — single seamless backdrop across landing + gap */
.home-intro {
  position: relative;
}

.home-intro__backdrop {
  position: absolute;
  inset: 0;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.home-intro__backdrop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.21;
  filter: saturate(0.7) blur(1px);
  transform: scale(1.06);
}

.home-intro__backdrop-fade {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 130% 95% at 50% 48%,
    rgba(244, 247, 252, 0.2) 0%,
    rgba(244, 247, 252, 0.55) 45%,
    rgba(244, 247, 252, 0.82) 100%
  );
}

.home-intro__backdrop-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 31px,
    rgba(99, 102, 241, 0.028) 31px,
    rgba(99, 102, 241, 0.028) 32px
  );
  mask-image: radial-gradient(ellipse 130% 95% at 50% 48%, black 8%, transparent 88%);
  opacity: 0.9;
}

.home-intro__gap {
  height: 2rem;
  position: relative;
  z-index: 1;
}

/* Full-viewport landing — centers the existing hero section */
.home-landing {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: calc(100vh - 4.25rem);
  min-height: calc(100dvh - 4.25rem);
  padding: 0.5rem 0 2.75rem;
}

.home-below {
  position: relative;
  z-index: 1;
  scroll-margin-top: 1rem;
  padding-top: 0;
}

.home-below #features {
  padding-top: 2rem;
  margin-top: 1rem;
}

.home-below > .home-section:first-child,
.home-below > .home-workflow:first-child {
  margin-top: 0;
}

.home-landing .home-hero {
  width: 100%;
  padding: 0;
  margin: 0;
  transform: translateY(-1.5vh);
}

.home-scroll-hint {
  position: absolute;
  bottom: 0.65rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  pointer-events: none;
  user-select: none;
  animation: home-scroll-bounce 2.2s ease-in-out infinite;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.home-scroll-hint--hidden {
  opacity: 0;
  visibility: hidden;
  animation: none;
}

.home-scroll-hint__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-scroll-hint__chevron {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

.home-scroll-hint__chevron svg {
  width: 1rem;
  height: 1rem;
}

@keyframes home-scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* Hero */
.home-hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(2rem, 4vw, 3.25rem);
  align-items: center;
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 6vw, 4.5rem);
}

@media (min-width: 1100px) {
  .home-landing .home-hero {
    gap: 3.5rem;
  }

  .home-landing .home-hero h1 {
    font-size: clamp(2.5rem, 3.6vw, 3.45rem);
  }

  .home-landing .home-lead {
    font-size: 1.12rem;
    max-width: 36rem;
  }

  .home-landing .home-hero__frame {
    aspect-ratio: 5 / 4;
  }
}

.home-hero h1 {
  font-size: clamp(2.35rem, 4.8vw, 3.35rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.home-hero__actions .btn { padding: 0.8rem 1.6rem; }

.home-hero__copy {
  text-align: left;
}

.home-hero .btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

.home-hero .btn-secondary:hover { background: var(--surface-soft); }

.home-hero__media {
  position: relative;
}

.home-hero__frame {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  aspect-ratio: 4 / 3;
}

.home-hero__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-hero__card {
  position: absolute;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  padding: 0.85rem 1rem;
  max-width: 200px;
  animation: home-float 5s ease-in-out infinite;
}

.home-hero__card--score {
  bottom: -1rem;
  left: -1.25rem;
}

.home-hero__card--feedback {
  top: 1.25rem;
  right: -1rem;
  max-width: 210px;
  animation-delay: -2.5s;
}

.home-hero__card-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.home-hero__card--score strong {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.home-hero__card--score strong span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.home-hero__card-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 500;
  margin-top: 0.15rem;
}

.home-hero__card--feedback p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

@keyframes home-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Section layout */
.home-section {
  margin-bottom: clamp(4rem, 8vw, 6.5rem);
  scroll-margin-top: 5rem;
}

.home-section__header {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 3rem;
}

.home-section__header h2 {
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.65rem;
  color: var(--text);
}

.home-section__header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

/* Feature cards */
.home-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.home-feature-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s;
}

.home-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.home-feature-card__media {
  height: 200px;
  overflow: hidden;
  background: var(--surface-soft);
}

.home-feature-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.home-feature-card:hover .home-feature-card__media img {
  transform: scale(1.04);
}

.home-feature-card__body {
  padding: 1.4rem 1.5rem 1.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.home-feature-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
}

.home-feature-card__icon svg { width: 20px; height: 20px; }

.home-feature-card__icon--coach { background: var(--success-subtle); color: var(--success); }
.home-feature-card__icon--assign { background: var(--primary-subtle); color: var(--primary); }
.home-feature-card__icon--grade { background: var(--info-subtle); color: var(--info); }

.home-feature-card__body h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.home-feature-card__body p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Workflow */
.home-workflow {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(2rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 5rem;
}

.home-workflow__visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--surface-soft);
}

.home-workflow__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-workflow__content h2 {
  font-size: clamp(1.5rem, 2.8vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 1.75rem;
  color: var(--text);
}

.home-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.home-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.home-step__num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.home-step h3 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.home-step p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* CTA */
.home-cta {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: clamp(3rem, 6vw, 5rem);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.home-cta__bg {
  position: absolute;
  inset: 0;
}

.home-cta__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-cta__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.88) 45%, rgba(240, 241, 255, 0.82) 100%);
}

.home-cta__panel {
  position: relative;
  z-index: 1;
  padding: clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}

.home-cta__panel h2 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
  color: var(--text);
}

.home-cta__panel .btn {
  margin-top: 0.5rem;
}

/* Footer */
.home-footer {
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--border);
}

.home-footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.home-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 320px;
}

.home-footer__brand strong {
  font-size: 0.95rem;
  color: var(--text);
}

.home-footer__brand span {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.home-footer__links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.home-footer__links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
}

.home-footer__links a:hover { color: var(--primary); }

.home-footer__copy {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .home-hero__card { animation: none; }
  .home-feature-card,
  .home-feature-card__media img { transition: none; }
  .home-scroll-hint { animation: none; }
}

/* ---- Login & register (split layout) ---- */
html:has(body.auth-layout) {
  overflow: hidden;
  height: 100%;
}

body.auth-layout {
  overflow: hidden;
  height: 100dvh;
  min-height: 100dvh;
}

.auth-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-ambient__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 80% at 0% 0%, rgba(224, 231, 255, 0.9) 0%, transparent 55%),
    radial-gradient(ellipse 90% 70% at 100% 100%, rgba(224, 242, 254, 0.75) 0%, transparent 50%),
    linear-gradient(145deg, #f5f7fc 0%, #f0f4ff 42%, #faf8ff 100%);
}

.auth-ambient__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 20%, transparent 78%);
  opacity: 0.55;
}

.auth-ambient__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(88px);
}

.auth-ambient__glow--1 {
  width: 520px;
  height: 520px;
  top: -18%;
  left: -12%;
  background: rgba(165, 180, 252, 0.35);
}

.auth-ambient__glow--2 {
  width: 460px;
  height: 460px;
  bottom: -12%;
  right: -8%;
  background: rgba(186, 230, 253, 0.28);
}

.auth-ambient__glow--3 {
  width: 360px;
  height: 360px;
  top: 38%;
  left: 42%;
  background: rgba(196, 181, 253, 0.2);
}

.login-page {
  position: relative;
  z-index: 1;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 3.5rem);
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border-strong);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.85);
}

.login-brand__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.login-brand__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  will-change: opacity, transform;
}

.login-brand__photo--login {
  object-position: center center;
}

.login-brand__photo--register {
  object-position: center center;
}

.login-brand[data-mode="login"] .login-brand__photo--login,
.login-brand:not([data-mode="register"]) .login-brand__photo--login {
  opacity: 0.42;
  transform: scale(1);
  z-index: 1;
}

.login-brand[data-mode="register"] .login-brand__photo--register {
  opacity: 0.42;
  transform: scale(1);
  z-index: 1;
}

.login-brand[data-mode="register"] .login-brand__photo--login {
  opacity: 0;
  transform: scale(1.05);
  z-index: 0;
}

.login-brand[data-mode="login"] .login-brand__photo--register,
.login-brand:not([data-mode="register"]) .login-brand__photo--register {
  opacity: 0;
  transform: scale(1.08);
  z-index: 0;
}

.login-brand--animated .login-brand__photo {
  transition:
    opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-brand__bg-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(
      118deg,
      rgba(248, 250, 252, 0.72) 0%,
      rgba(241, 245, 249, 0.62) 38%,
      rgba(226, 232, 240, 0.5) 100%
    ),
    rgba(100, 116, 139, 0.18);
  pointer-events: none;
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.login-brand__content {
  position: relative;
  z-index: 4;
  width: 100%;
  max-width: 400px;
}

.login-brand__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.login-brand__logo svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.login-brand h1 {
  font-size: clamp(1.65rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  line-height: 1.25;
  color: var(--text);
}

.login-brand__content > p {
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

.login-brand__features {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.login-brand__feature {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.login-brand__feature svg {
  flex-shrink: 0;
  color: var(--primary);
  opacity: 0.85;
}

@media (max-height: 860px) {
  .login-brand { padding: 1.75rem; }
  .login-brand__logo { margin-bottom: 1.1rem; }
  .login-brand h1 { font-size: clamp(1.45rem, 2.5vw, 1.7rem); }
  .login-brand__features { margin-top: 1.25rem; gap: 0.6rem; }
}

.login-form-side {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.75);
}

.login-form-side__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(155deg, #f9fbff 0%, #f3f6fd 48%, #f8f6ff 100%);
}

.login-form-side__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 100% 8%, rgba(165, 180, 252, 0.28) 0%, transparent 58%),
    radial-gradient(ellipse 75% 55% at 0% 92%, rgba(186, 230, 253, 0.22) 0%, transparent 52%),
    radial-gradient(ellipse 50% 40% at 55% 50%, rgba(196, 181, 253, 0.12) 0%, transparent 70%);
}

.login-form-side__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 95% 85% at 50% 50%, black 25%, transparent 82%);
  opacity: 0.65;
}

.login-form-side__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
}

.login-form-side__glow--1 {
  width: 340px;
  height: 340px;
  top: -8%;
  right: -6%;
  background: rgba(129, 140, 248, 0.22);
}

.login-form-side__glow--2 {
  width: 300px;
  height: 300px;
  bottom: -10%;
  left: -8%;
  background: rgba(56, 189, 248, 0.16);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-xl);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 28px rgba(15, 23, 42, 0.07),
    0 0 0 1px rgba(99, 102, 241, 0.06) inset;
  backdrop-filter: blur(16px) saturate(1.15);
  padding: clamp(1.35rem, 3.5vw, 2rem);
}

.login-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}

.login-back:hover {
  color: var(--text);
}

.login-card h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.025em;
  color: var(--text);
}

.auth-panel[data-auth="register"] h2 {
  margin-bottom: 1.5rem;
}

.login-card .subtitle {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

.auth-panels {
  position: relative;
  overflow: hidden;
}

.auth-panels--animated {
  transition:
    height 0.34s cubic-bezier(0.4, 0, 0.2, 1),
    min-height 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-panels--animated .auth-panel {
  transition: opacity 0.34s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.34s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-panel {
  margin: 0;
}

.auth-panel:not(.is-active) {
  display: none;
}

.auth-panels--animated .auth-panel:not(.is-active) {
  display: block;
}

.auth-panels--animated .auth-panel:not(.is-active) {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(1.25rem);
}

.auth-panels--animated[data-mode="register"] .auth-panel[data-auth="login"]:not(.is-active) {
  transform: translateX(-1.25rem);
}

.auth-panels--animated[data-mode="login"] .auth-panel[data-auth="register"]:not(.is-active) {
  transform: translateX(1.25rem);
}

@media (prefers-reduced-motion: reduce) {
  .auth-panels,
  .auth-panels--animated .auth-panel {
    transition: none;
  }

  .auth-panels--animated .auth-panel:not(.is-active) {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
  }

  .login-brand--animated .login-brand__photo {
    transition: none;
  }

  .login-brand[data-mode="login"] .login-brand__photo--login,
  .login-brand:not([data-mode="register"]) .login-brand__photo--login,
  .login-brand[data-mode="register"] .login-brand__photo--register {
    transform: none;
  }

  .login-brand[data-mode="register"] .login-brand__photo--login,
  .login-brand[data-mode="login"] .login-brand__photo--register,
  .login-brand:not([data-mode="register"]) .login-brand__photo--register {
    transform: none;
  }
}

.login-card .form-group {
  margin-bottom: 1.1rem;
}

.login-submit {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.75rem 1.25rem;
}

.login-switch {
  margin: 1.5rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
}

.login-switch a {
  font-weight: 600;
  color: var(--primary);
}

.login-switch a:hover {
  color: var(--primary-hover);
}

.login-note {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}

/* ---- Misc ---- */
.roster-panel { margin-top: 0; }

.inline-form {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form select, .inline-form input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
}

.pagination {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.pagination a, .pagination span {
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  font-weight: 500;
}

.pagination a:hover { background: var(--surface-soft); text-decoration: none; }
.pagination .active { background: var(--primary); color: white; border-color: var(--primary); }

.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: var(--info-subtle);
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.info-banner strong { color: var(--info); }

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-height: 760px) and (max-width: 900px) {
  .auth-card { padding: 1.1rem; }
  .login-back { margin-bottom: 1.1rem; }
  .login-card h2 { font-size: 1.35rem; }
  .login-card .subtitle { font-size: 0.86rem; margin-bottom: 0.9rem; }
  .login-card .form-group { margin-bottom: 0.75rem; }
  .login-submit { padding: 0.65rem 1rem; }
  .login-note { font-size: 0.75rem; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.25s;
    box-shadow: var(--shadow-lg);
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .main-content { padding: 1.25rem; }
  .page-hero { flex-direction: column; padding: 1.35rem; }
  .radio-row { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form-side {
    padding: 1.25rem 1rem;
    min-height: 0;
    border-left: none;
    align-items: center;
  }
  .auth-card { padding: 1.25rem; }
  .login-card .form-group { margin-bottom: 0.9rem; }
  .login-card .subtitle { margin-bottom: 1.15rem; }
  .login-note { margin-top: 0.75rem; padding-top: 0.75rem; }
  .login-switch { margin-top: 1.15rem; }
  .home-landing { min-height: calc(100vh - 3.75rem); min-height: calc(100dvh - 3.75rem); padding-bottom: 2.25rem; }
  .home-landing .home-hero { transform: none; }
  .home-landing .home-hero { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
  .home-hero__copy { text-align: center; }
  .home-lead { margin-left: auto; margin-right: auto; }
  .home-hero__actions { justify-content: center; }
  .home-hero__card--score { left: 0.5rem; bottom: -0.5rem; }
  .home-hero__card--feedback { right: 0.5rem; }
  .home-features { grid-template-columns: 1fr; }
  .home-workflow { grid-template-columns: 1fr; }
  .home-header__nav { display: none; }
  .home-header__signin { display: none; }
  .home-header__cta { padding: 0.45rem 0.85rem !important; }
  .home-landing { min-height: calc(100vh - 3.5rem); min-height: calc(100dvh - 3.5rem); padding-bottom: 2.25rem; }
  .home-footer__inner { flex-direction: column; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ---- Daily Practice admin ---- */
.dp-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.dp-layout--topics {
  grid-template-columns: 1fr;
}

.dp-admin-folder {
  margin-top: 0.25rem;
}

.dp-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0 0.35rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.dp-admin-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.15rem 0.7rem;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-bottom-color: transparent;
  border-radius: 10px 10px 0 0;
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dp-admin-tab:hover {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.dp-admin-tab.is-active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  box-shadow: 0 -1px 0 var(--surface);
}

.dp-admin-folder__panel {
  border-top-left-radius: 0;
  margin-top: 0;
}

.dp-submissions-filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.dp-submissions-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem 1rem;
  align-items: start;
}

.dp-submissions-filters__grid > .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  min-width: 0;
}

.dp-submissions-filters__grid > .form-group > label {
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.dp-submissions-filters__grid .form-group > input,
.dp-submissions-filters__grid .form-group > select,
.dp-submissions-filters__grid .dp-tag-search__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.72rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;
  line-height: 1.25;
  background: var(--surface);
  color: var(--text);
}

.dp-submissions-filters__grid .form-group > input:focus,
.dp-submissions-filters__grid .form-group > select:focus,
.dp-submissions-filters__grid .dp-tag-search__input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

.dp-combobox {
  position: relative;
}

.dp-submissions-filters .dp-tag-search {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  flex: none;
}

.dp-submissions-table-wrap {
  margin-top: 0.25rem;
}

.dp-submissions-empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem 1rem;
}

.dp-submissions-skel-row td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.dp-submissions-skel {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr;
  gap: 0.75rem;
  align-items: center;
}

.dp-detail-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0 1rem;
}

.dp-skel-line,
.lpd-skel-line {
  display: block;
  height: 0.75rem;
  width: 70%;
  border-radius: var(--radius-sm);
}

.dp-skel-line--sm,
.lpd-skel-line--sm {
  width: 38%;
}

.dp-skel-line--lg,
.lpd-skel-line--lg {
  width: 88%;
  height: 0.95rem;
}

.dp-skel-block,
.lpd-skel-block {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 7rem;
  border-radius: 0;
}

.dp-skel-block--detail {
  min-height: 10rem;
  border-radius: var(--radius-sm);
}

.dp-task-card--skeleton {
  pointer-events: none;
  cursor: default;
}

.dp-task-card--skeleton::before {
  opacity: 0.35;
}

.dp-task-card--skeleton:hover {
  transform: none;
  box-shadow: var(--shadow-card);
  border-color: var(--border);
}

.dp-task-cards:not(.dp-task-cards--list) .dp-task-card--skeleton .dp-task-card__hit {
  cursor: default;
  gap: 0.65rem;
  padding-bottom: 1rem;
}

.dp-task-cards:not(.dp-task-cards--list) .dp-task-card--skeleton .dp-task-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 1rem 0.25rem;
}

.dp-task-card--skeleton .dp-task-card__media {
  position: relative;
}

.dp-task-cards--list .dp-task-card--skeleton .dp-task-card__body {
  display: contents;
  padding: 0;
}

.dp-task-cards--list .dp-task-card--skeleton .dp-skel-block {
  min-height: 48px;
  height: 48px;
  border-radius: 8px;
}

.dp-task-cards--list .dp-task-card--skeleton:hover .dp-task-card__hit {
  background: transparent;
}

#dp-submissions-pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

#dp-submissions-pagination[hidden] {
  display: none !important;
}

.dp-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dp-panel__actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dp-view-toggle {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  gap: 2px;
}

.dp-view-toggle__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dp-view-toggle__btn:hover {
  color: var(--text);
  background: var(--surface);
}

.dp-view-toggle__btn.is-active {
  background: var(--primary-subtle);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.dp-view-toggle__btn svg {
  display: block;
}

.dp-filter-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 1.25rem 12px;
  border-bottom: 1px solid var(--border);
}

.dp-filter-groups {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.dp-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.dp-filter-group--tags {
  flex: 1 1 16rem;
}

.dp-filter-group--difficulty {
  flex: 0 0 auto;
  margin-left: auto;
  align-items: flex-end;
}

.dp-filter-groups .dp-filter-badges {
  padding: 0;
  border-bottom: none;
}

.dp-filter-select {
  display: block;
  width: 100%;
  min-width: 12rem;
  max-width: 280px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.3;
  cursor: pointer;
}

.dp-filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

@media (max-width: 640px) {
  .dp-filter-group--difficulty {
    margin-left: 0;
    align-items: stretch;
    width: 100%;
  }

  .dp-filter-select {
    max-width: none;
  }
}

.dp-filter-badges__empty {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.dp-subtitle-more {
  margin-left: 4px;
  font-size: inherit;
  font-weight: 400;
  color: #6b7280;
  white-space: nowrap;
}

.dp-filter-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #6b7280;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.dp-filter-badge:hover {
  border-color: #674fa7;
  color: #674fa7;
}

.dp-filter-badge.is-selected {
  background: rgba(103, 79, 167, 0.1);
  border-color: #674fa7;
  color: #674fa7;
  font-weight: 600;
}

.dp-filter-badge.dp-filter-clear-btn {
  color: #6b7280;
  border-style: dashed;
}

.dp-filter-badge.dp-filter-clear-btn:hover {
  border-color: #674fa7;
  border-style: dashed;
  color: #674fa7;
}

.dp-manage-tags__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dp-manage-tags__hint {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

#dp-manage-tags-modal .dp-category-list {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
  max-height: min(50vh, 360px);
  overflow-y: auto;
}

#dp-manage-tags-modal .dp-category-item {
  align-items: center;
}

#dp-manage-tags-modal .dp-category-name {
  flex: 1;
  min-width: 0;
}

.dp-category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 4rem;
}

.dp-category-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.dp-category-item:last-child {
  border-bottom: none;
}

.dp-category-item:hover {
  background: #fafbff;
}

.dp-category-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
}

.dp-item-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.25rem;
}

.dp-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.dp-empty p { margin: 0; }

.dp-task-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(271px, 1fr));
  gap: 1rem;
  min-height: 8rem;
  padding: 4px 0;
}

.dp-task-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.dp-task-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  opacity: 0.85;
  z-index: 2;
}

.dp-task-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.dp-task-card__hit {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 220px;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.dp-task-card__media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, var(--bg-subtle) 0%, var(--primary-subtle) 100%);
  overflow: hidden;
  z-index: 0;
}

.dp-task-card__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dp-task-card__media-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.dp-task-card__media-icon svg {
  width: 22px;
  height: 22px;
}

.dp-task-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  width: 100%;
  min-height: 100%;
  justify-content: flex-start;
  padding: 0.95rem 1rem 1rem;
  background: transparent;
  background-image: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.82) 0%,
    rgba(15, 23, 42, 0.45) 42%,
    rgba(15, 23, 42, 0) 100%
  );
  color: #fff;
}

.dp-task-card__body .dp-task-card__title,
.dp-task-card__body .dp-task-card__footer,
.dp-task-card__body .dp-task-card__footer-label {
  color: #fff;
}

.dp-task-card__body .dp-task-card__footer svg {
  color: #fff;
}

.dp-task-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.dp-task-card__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
}

.dp-task-card__chip svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.dp-task-card__chip--difficulty {
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 600;
}

.dp-difficulty--1 {
  color: #1f6b4a;
  background: #e8f6ef;
  border-color: #b7e0c8;
}

.dp-difficulty--2 {
  color: #8a5a10;
  background: #fff4e0;
  border-color: #efd3a0;
}

.dp-difficulty--3 {
  color: #8a2e2e;
  background: #fceaea;
  border-color: #e8b4b4;
}

.dp-task-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dp-task-card__topic {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
  margin-top: auto;
}

/* List-only difficulty slot; grid uses the chip in __meta */
.dp-task-card__difficulty-slot {
  display: none;
}

.dp-task-card .dp-tag-chips {
  margin-top: 0;
  gap: 0.35rem;
  min-height: 0;
}

.dp-task-card .dp-tag-chip {
  padding: 0.15rem 0.5rem;
  font-size: 0.68rem;
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--text-muted);
}

.dp-task-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--text-muted);
}

.dp-task-card__footer svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary);
  transition: transform 0.15s ease;
}

.dp-task-card:hover .dp-task-card__footer svg {
  transform: translateX(2px);
}

/* Topics list layout — table-style */
.dp-task-list-header {
  display: none;
}

.dp-task-cards--list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-height: 0;
}

.dp-task-cards--list .dp-task-list-header {
  display: grid;
  grid-template-columns: 48px minmax(160px, 1.5fr) minmax(140px, 1fr) 110px;
  gap: 1rem;
  align-items: center;
  padding: 0.7rem 1.25rem;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dp-task-cards--list .dp-task-list-header__action {
  text-align: right;
}

.dp-task-cards--list .dp-task-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

.dp-task-cards--list .dp-task-card::before {
  display: none;
}

.dp-task-cards--list .dp-task-card + .dp-task-card {
  border-top: 1px solid var(--border);
}

.dp-task-cards--list .dp-task-card:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.dp-task-cards--list .dp-task-card:hover .dp-task-card__hit {
  background: #fafbff;
}

.dp-task-cards--list .dp-task-card__hit {
  display: grid;
  grid-template-columns: 48px minmax(160px, 1.5fr) minmax(140px, 1fr) 110px;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  min-height: 0;
}

.dp-task-cards--list .dp-task-card__media {
  position: static;
  inset: auto;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  z-index: auto;
}

.dp-task-cards--list .dp-task-card__media-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  box-shadow: none;
}

.dp-task-cards--list .dp-task-card__media-icon svg {
  width: 14px;
  height: 14px;
}

.dp-task-cards--list .dp-task-card__body {
  display: contents;
  position: static;
  z-index: auto;
  background: none;
  background-image: none;
  justify-content: initial;
  padding: 0;
  color: inherit;
}

.dp-task-cards--list .dp-task-card__meta {
  display: none;
}

.dp-task-cards--list .dp-task-card__topic {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
  min-width: 0;
  margin-top: 0;
}

.dp-task-cards--list .dp-task-card__difficulty-slot {
  display: inline-flex;
  flex: 0 0 auto;
  max-width: 100%;
}

.dp-task-cards--list .dp-task-card__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  min-width: 0;
  flex: 1 1 8rem;
}

.dp-task-cards--list .dp-task-card__topic .dp-task-card__chip--difficulty {
  flex: 0 0 auto;
  max-width: 100%;
}

.dp-task-cards--list .dp-tag-chips {
  margin: 0;
  min-height: 0;
  min-width: 0;
  gap: 0.3rem;
}

.dp-task-cards--list .dp-tag-chip {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dp-task-cards--list .dp-task-card__footer {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  width: auto;
  overflow: visible;
}

.dp-task-cards--list .dp-task-card__footer-label {
  display: inline;
}

.dp-task-cards--list .dp-task-card__footer svg {
  display: block;
  width: 14px;
  height: 14px;
}

.dp-task-cards--list .dp-empty {
  padding: 2rem 1.25rem;
  border-top: none;
}

@media (max-width: 720px) {
  .dp-task-cards--list .dp-task-list-header,
  .dp-task-cards--list .dp-task-card__hit {
    grid-template-columns: 44px minmax(0, 1fr) 64px;
  }

  .dp-task-cards--list .dp-task-list-header__tags,
  .dp-task-cards--list .dp-tag-chips {
    display: none;
  }

  .dp-task-cards--list .dp-task-list-header__action,
  .dp-task-cards--list .dp-task-card__footer {
    justify-self: end;
  }

  .dp-task-cards--list .dp-task-card__footer-label {
    display: none;
  }
}

.dp-tag-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  min-height: 1.5rem;
  position: relative;
}

.dp-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f5f7fa;
  border: 1px solid #d1d5db;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  line-height: 1.4;
}

.dp-tag-chip--removable {
  padding-right: 4px;
}

.dp-tag-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.dp-tag-chip__remove:hover {
  color: #674fa7;
  background: rgba(103, 79, 167, 0.08);
}

.dp-tag-chip-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px dashed #d1d5db;
  background: #ffffff;
  color: #674fa7;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.dp-tag-chip-add:hover {
  border-color: #674fa7;
  background: rgba(103, 79, 167, 0.06);
}

.dp-tag-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 160px;
  max-width: 220px;
  flex: 1 1 160px;
}

.dp-tag-search__input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  background: #ffffff;
  color: inherit;
  margin-bottom: 10px;

}

.dp-tag-search__input:focus {
  outline: none;
  border-color: #674fa7;
  box-shadow: 0 0 0 2px rgba(103, 79, 167, 0.15);
}

.dp-tag-search__results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 180px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  padding: 4px;
}

.dp-tag-search__option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: inherit;
  cursor: pointer;
}

.dp-tag-search__option:hover,
.dp-tag-search__option.is-active {
  background: rgba(103, 79, 167, 0.08);
  color: #674fa7;
}

.dp-tag-search__empty {
  padding: 8px 10px;
  font-size: 12px;
  color: #6b7280;
}

.dp-filter-badges-skel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.dp-filter-badge-skel {
  display: inline-block;
  height: 2rem;
  width: 5.5rem;
  border-radius: 999px;
}

.dp-filter-badge-skel:nth-child(2) { width: 4.25rem; }
.dp-filter-badge-skel:nth-child(3) { width: 6.5rem; }
.dp-filter-badge-skel:nth-child(4) { width: 3.75rem; }
.dp-filter-badge-skel:nth-child(5) { width: 5rem; }
.dp-filter-badge-skel:nth-child(6) { width: 4.5rem; }

.dp-tag-filter-skeleton-line {
  width: 100%;
}

/* Choose tags — A–Z quick sidebar */
.dp-tag-az {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dp-tag-az-layout {
  display: flex;
  align-items: stretch;
  gap: 0.35rem 0.5rem;
  min-height: 12rem;
  max-height: min(50vh, 22rem);
}

.dp-tag-az-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
  scroll-behavior: smooth;
}

.dp-tag-az-results {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dp-tag-az-group__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dp-tag-az-heading {
  margin: 0 0 0.45rem;
  padding: 0.15rem 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.dp-tag-az-sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  width: 1.25rem;
  padding: 0.1rem 0;
  user-select: none;
}

.dp-tag-az-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
  cursor: default;
  opacity: 0.35;
}

.dp-tag-az-letter.is-available {
  color: #674fa7;
  opacity: 1;
  cursor: pointer;
}

.dp-tag-az-letter.is-available:hover,
.dp-tag-az-letter.is-available:focus-visible {
  background: rgba(103, 79, 167, 0.12);
  outline: none;
}

.dp-tag-az-letter.is-active {
  color: #674fa7;
  background: rgba(103, 79, 167, 0.16);
  opacity: 1;
  font-weight: 800;
}

@media (max-width: 480px) {
  .dp-tag-az-layout {
    max-height: min(55vh, 20rem);
  }

  .dp-tag-az-letter {
    font-size: 0.58rem;
  }
}

.dp-detail-heading {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.dp-detail-difficulty {
  margin: 0 0 1.15rem;
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  border: 1px solid transparent;
}

#dp-detail-tags {
  margin-bottom: 12px;
}

.dp-detail-section {
  margin-bottom: 1.15rem;
}

.dp-detail-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.dp-detail-instructions {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  color: var(--text);
}

.dp-detail-instructions.is-empty {
  color: var(--text-muted);
  font-style: italic;
}

.dp-detail-points {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dp-detail-points li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dp-detail-points li + li {
  margin-top: 0.35rem;
}

.dp-detail-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.dp-images-section {
  margin-top: 1.15rem;
}

.dp-images-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dp-images-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.dp-image-slot {
  position: relative;
  aspect-ratio: 1;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  overflow: hidden;
}

.dp-image-slot.has-image {
  border-style: solid;
}

.dp-image-slot__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dp-image-slot__upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  height: 100%;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.dp-image-slot__upload:hover {
  color: var(--primary);
  background: var(--primary-subtle);
}

.dp-image-slot__upload.is-uploading {
  opacity: 0.6;
  pointer-events: none;
}

.dp-image-slot__plus {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--primary);
}

.dp-image-slot__remove {
  position: absolute !important;
  top: 0.35rem;
  right: 0.35rem;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.dp-image-slot.is-thumbnail {
  border-color: #674fa7;
  box-shadow: 0 0 0 1px #674fa7;
}

.dp-image-slot__thumb-badge {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: #674fa7;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.dp-image-slot__thumb-btn {
  position: absolute !important;
  left: 0.35rem;
  right: 0.35rem;
  bottom: 0.35rem;
  z-index: 2;
  padding: 6px 10px !important;
  font-size: 12px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  color: #674fa7 !important;
  border: 1px solid #d1d5db !important;
}

.dp-image-slot__thumb-btn.is-active,
.dp-image-slot__thumb-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.dp-image-slot.has-image:hover .dp-image-slot__thumb-btn:not(:disabled) {
  opacity: 1;
}

.dp-detail-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.dp-detail-image {
  display: block;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.dp-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 600px) {
  .dp-images-slots,
  .dp-detail-images {
    grid-template-columns: 1fr;
  }
}

.dp-modal[hidden] { display: none !important; }

.dp-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.dp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.dp-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.dp-modal__dialog--wide { max-width: 560px; }
.dp-modal__dialog--xl { max-width: 1240px; }

.dp-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.dp-modal__header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.dp-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
}

.dp-modal__close:hover {
  background: var(--surface);
  color: var(--text);
}

.dp-modal__body {
  padding: 1.25rem 1.35rem 1.35rem;
}

.dp-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding: 0 1.35rem 1.25rem;
}

.dp-modal__body > .dp-modal__footer {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
}

.dp-bulk-hint {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.dp-bulk-hint__intro {
  margin: 0 0 0.45rem;
  font-weight: 600;
  color: var(--text);
}

.dp-bulk-hint__list {
  margin: 0;
  padding-left: 1.15rem;
}

.dp-bulk-hint__list li + li {
  margin-top: 0.35rem;
}

.dp-bulk-hint code {
  font-size: 0.85em;
}

.dp-bulk-actions {
  margin-bottom: 1rem;
}

.dp-bulk-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 180px;
  padding: 1.5rem 1.25rem;
  border: 2px dashed var(--border-strong, var(--border));
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  margin-bottom: 0.25rem;
}

.dp-bulk-dropzone:hover,
.dp-bulk-dropzone:focus-visible {
  border-color: var(--primary-light);
  background: var(--primary-subtle);
  outline: none;
}

.dp-bulk-dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.dp-bulk-dropzone.has-file {
  border-style: solid;
  border-color: var(--primary-border, var(--primary-light));
}

.dp-bulk-dropzone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dp-bulk-dropzone__icon {
  color: var(--primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dp-bulk-dropzone__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text);
}

.dp-bulk-dropzone__subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dp-bulk-dropzone__file {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dp-bulk-dropzone.has-file .dp-bulk-dropzone__file {
  color: var(--primary);
}

.dp-bulk-lock[hidden] {
  display: none !important;
}

.dp-bulk-lock {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.55);
}

.dp-bulk-lock__panel {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
  padding: 1.5rem 1.5rem 1.35rem;
}

.dp-bulk-lock__panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.dp-bulk-lock__warn {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.dp-bulk-lock__status,
.dp-bulk-lock__counts {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dp-bulk-lock__bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.dp-bulk-lock__bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.2s ease;
}

.dp-bulk-lock__errors {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  max-height: 160px;
  overflow: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dp-bulk-lock__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.15rem;
}

.dp-points-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.dp-points-header .field-label { margin: 0; }

.dp-points-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  max-height: 9.75rem; /* ~3 point rows */
  overflow-y: auto;
  padding-right: 0.15rem;
}

.dp-point-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.dp-point-row input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
}

.dp-point-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.dp-point-remove.btn,
button.btn.dp-point-remove {
  color: var(--primary);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  padding: 0.42rem 0.55rem;
  flex-shrink: 0;
  filter: none;
  transform: none;
}

.dp-point-remove.btn:hover,
button.btn.dp-point-remove:hover {
  background: var(--primary-subtle);
  color: var(--primary-hover);
  box-shadow: none;
  filter: none;
  transform: none;
}

.dp-point-remove svg {
  display: block;
  stroke: currentColor;
}

@media (max-width: 900px) {
  .dp-layout {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Learner Writing Challenge
   ============================================================ */

body.lpd-modal-open {
  overflow: hidden;
}

.lpd-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lpd-filter__header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.lpd-filter__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.lpd-filter__subtitle {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.lpd-filter .dp-filter-badges {
  margin-top: 0;
}

.lpd-filter .dp-filter-groups {
  padding: 0.35rem 0 0;
  border-bottom: none;
}

.lpd-grid-wrap .panel__body {
  min-height: 280px;
}

.lpd-topics-skeleton[hidden] {
  display: none !important;
}

.lpd-card--skeleton {
  pointer-events: none;
  cursor: default;
}

.lpd-card--skeleton::before {
  opacity: 0.35;
}

.lpd-card--skeleton:hover {
  transform: none;
  box-shadow: var(--shadow-card);
  border-color: var(--border);
}

.lpd-card--skeleton .lpd-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 1rem 1rem;
}

.lpd-card--skeleton .lpd-card__media {
  position: relative;
}

.lpd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.lpd-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  text-align: left;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  font: inherit;
  color: inherit;
  min-height: 220px;
  overflow: hidden;
}

.lpd-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 2;
  opacity: 0.9;
}

.lpd-card__media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, var(--bg-subtle) 0%, var(--primary-subtle) 100%);
  overflow: hidden;
  z-index: 0;
}

.lpd-card__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  background: var(--bg-subtle);
}

.lpd-card__media-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.lpd-card__media-icon svg {
  width: 22px;
  height: 22px;
}

.lpd-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  flex: 1;
  width: 100%;
  min-height: 100%;
  justify-content: flex-start;
  padding: 0.95rem 1rem 1rem;
  background: transparent;
  background-image: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.82) 0%,
    rgba(15, 23, 42, 0.45) 42%,
    rgba(15, 23, 42, 0) 100%
  );
  color: #fff;
}

.lpd-card__body .lpd-card__title,
.lpd-card__body .lpd-card__hint,
.lpd-card__body .lpd-card__number {
  color: #fff;
}

.lpd-card__body .lpd-card__footer svg {
  color: #fff;
}

.lpd-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  margin-top: 0;
}

.lpd-card .dp-tag-chips {
  margin-top: 0;
  gap: 0.35rem;
  min-height: 0;
  width: 100%;
}

.lpd-card .dp-tag-chip {
  padding: 0.15rem 0.5rem;
  font-size: 0.68rem;
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--text-muted);
}

.lpd-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.lpd-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.lpd-card__badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.lpd-card__difficulty {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.lpd-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.lpd-card__number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.lpd-card__title {
  margin: 0;
  margin-top: auto;
  width: 100%;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lpd-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding-top: 0.35rem;
}

.lpd-card__hint {
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--text-muted);
}

.lpd-card__footer svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary);
  transition: transform 0.15s ease;
}

.lpd-card:hover .lpd-card__footer svg {
  transform: translateX(2px);
}

.lpd-card__score {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--primary);
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
}

.lpd-card__score svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.lpd-card--available::before {
  background: var(--primary);
}

.lpd-card--available .lpd-card__badge {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.lpd-card--available .lpd-card__media {
  background: linear-gradient(160deg, var(--bg-subtle) 0%, var(--primary-subtle) 100%);
}

.lpd-card--available .lpd-card__media-icon {
  color: var(--primary);
}

.lpd-card--done::before {
  background: var(--success);
}

.lpd-card--done .lpd-card__badge {
  background: var(--success-subtle);
  color: #059669;
  border: 1px solid #a7f3d0;
}

.lpd-card--done .lpd-card__media {
  background: linear-gradient(160deg, var(--bg-subtle) 0%, var(--success-subtle) 100%);
}

.lpd-card--done .lpd-card__media-icon {
  color: var(--success);
}

.lpd-card--done:hover {
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
}

.lpd-modal-lead {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.lpd-tag-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.lpd-tag-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  min-height: 96px;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.lpd-tag-card:hover {
  border-color: #674fa7;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.lpd-tag-card.is-selected {
  border-color: #674fa7;
  background: #f7f4fc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.lpd-tag-card__check {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lpd-tag-card.is-selected .lpd-tag-card__check {
  border-color: #674fa7;
  background: #674fa7;
  color: #fff;
}

.lpd-tag-card__name {
  font-weight: 600;
  color: var(--text);
  padding-right: 1.5rem;
}

.lpd-tag-card__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lpd-topics {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.lpd-topics-section__header {
  margin-bottom: 1rem;
}

.lpd-topics-section__header h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.lpd-topics-section__header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.lpd-card__tag {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--primary);
}

.lpd-empty-inline {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.lpd-detail-dialog {
  max-width: 1240px;
  width: min(1240px, calc(100vw - 2rem));
  max-height: min(94vh, 960px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lpd-detail-heading {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.lpd-detail-number {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #674fa7;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lpd-detail-difficulty {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  margin-top: 0.15rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  border: 1px solid transparent;
}

.lpd-detail-body {
  padding-top: 0.5rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lpd-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.25fr);
  gap: 1.75rem;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.lpd-detail-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.lpd-detail-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.lpd-detail-compose,
.lpd-detail-submitted {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f5f7fa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.lpd-detail-compose[hidden],
.lpd-detail-submitted[hidden] {
  display: none !important;
}

.lpd-detail-compose__header h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.lpd-detail-compose__header p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.lpd-detail-compose__actions {
  display: flex;
  justify-content: flex-end;
}

.lpd-detail-compose .mode-tabs {
  margin: 0;
}

.lpd-detail-compose .lpd-submit-panels .upload-section {
  min-height: 280px;
}

.lpd-detail-compose .lpd-submit-panels .coach-typed textarea {
  min-height: 280px;
}

.lpd-detail-status {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.lpd-detail-status--available {
  background: rgba(103, 79, 167, 0.12);
  color: #674fa7;
}

.lpd-detail-status--done {
  background: var(--success-subtle);
  color: #047857;
}

.lpd-attempt-picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
}

.lpd-attempt-picker__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.lpd-attempt-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
}

.lpd-attempt-select:focus {
  outline: none;
  border-color: #674fa7;
  box-shadow: 0 0 0 3px rgba(103, 79, 167, 0.15);
}

.lpd-attempt-picker--output {
  margin-bottom: 0;
}

.lpd-detail-section {
  min-width: 0;
  max-width: 100%;
}

.lpd-detail-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.lpd-detail-instructions {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  line-height: 1.6;
  color: var(--text-secondary);
}

.lpd-detail-points {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--text-secondary);
  line-height: 1.5;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lpd-detail-points li {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lpd-detail-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.lpd-detail-image {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  aspect-ratio: 4 / 3;
}

.lpd-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lpd-submit-panels .upload-section {
  min-height: 220px;
}

.lpd-submit-panels .coach-typed textarea {
  min-height: 220px;
}

.lpd-output-dialog {
  max-width: min(920px, 96vw);
  max-height: min(92vh, 960px);
}

.lpd-output-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lpd-output-meta {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.lpd-last-score-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.25rem;
}

.lpd-last-score-row .lpd-last-score {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
}

.lpd-last-score-row #lpd-open-output {
  flex: 0 0 auto;
  white-space: nowrap;
}

.lpd-last-score {
  margin: 0.35rem 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
}

.lpd-last-score__main {
  min-width: 0;
}

.lpd-last-score__tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.lpd-last-score--improved {
  border-color: color-mix(in srgb, #15803d 35%, var(--border));
  background: color-mix(in srgb, #15803d 10%, var(--surface));
}

.lpd-last-score--improved .lpd-last-score__tag {
  color: #166534;
  background: color-mix(in srgb, #15803d 16%, transparent);
}

.lpd-last-score--declined {
  border-color: color-mix(in srgb, #b45309 35%, var(--border));
  background: color-mix(in srgb, #b45309 10%, var(--surface));
}

.lpd-last-score--declined .lpd-last-score__tag {
  color: #9a3412;
  background: color-mix(in srgb, #b45309 16%, transparent);
}

.lpd-last-score--same {
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.lpd-last-score--same .lpd-last-score__tag {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.lpd-last-score[hidden] {
  display: none !important;
}

.lpd-score-compare {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.lpd-score-compare[hidden] {
  display: none !important;
}

.lpd-score-compare__title {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.lpd-score-compare__detail,
.lpd-score-compare__club {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.lpd-score-compare__club {
  margin-top: 0.35rem;
}

.lpd-score-compare--improved {
  border-color: color-mix(in srgb, #15803d 35%, var(--border));
  background: color-mix(in srgb, #15803d 10%, var(--surface));
}

.lpd-score-compare--improved .lpd-score-compare__title {
  color: #166534;
}

.lpd-score-compare--declined {
  border-color: color-mix(in srgb, #b45309 35%, var(--border));
  background: color-mix(in srgb, #b45309 10%, var(--surface));
}

.lpd-score-compare--declined .lpd-score-compare__title {
  color: #9a3412;
}

.lpd-score-compare--same {
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.lpd-output-text {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
  max-height: min(55vh, 480px);
  overflow: auto;
}

.lpd-output-image-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.lpd-output-image-link img {
  display: block;
  width: 100%;
  max-height: min(60vh, 520px);
  object-fit: contain;
  background: #f8fafc;
}

.lpd-output-report-section {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lpd-output-report-section[hidden],
.lpd-output-report-section.hidden {
  display: none !important;
}

.lpd-output-report-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.lpd-output-dialog .score-strip {
  margin: 0;
}

@media (max-width: 900px) {
  .lpd-detail-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .lpd-detail-main {
    overflow-y: visible;
  }

  .lpd-detail-side {
    order: -1;
    overflow-y: visible;
  }
}

@media (max-width: 800px) {
  .lpd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lpd-detail-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .lpd-grid {
    grid-template-columns: 1fr;
  }

  .lpd-detail-images {
    grid-template-columns: 1fr;
  }

  .lpd-filter__header {
    gap: 0.35rem;
  }
}

/* ============================================================
   Daily Mission FAB (learner)
   ============================================================ */

.dm-root {
  position: fixed;
  right: 1.5rem;
  bottom: 5.5rem;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  pointer-events: none;
}

.dm-root > * {
  pointer-events: auto;
}

.dm-fab {
  position: relative;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--success);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(16, 185, 129, 0.18);
  cursor: pointer;
  display: grid;
  place-items: center;
  animation: dm-float 3.2s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dm-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(16, 185, 129, 0.22);
}

.dm-fab:focus-visible {
  outline: 2px solid var(--success);
  outline-offset: 3px;
}

.dm-fab__ring {
  position: absolute;
  inset: 0;
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.dm-fab__ring-track {
  fill: none;
  stroke: #d1fae5;
  stroke-width: 4;
}

.dm-fab__ring-progress {
  fill: none;
  stroke: var(--success);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.45s ease;
}

.dm-fab__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--success-subtle);
  color: var(--success);
}

.dm-root--complete .dm-fab__icon {
  background: var(--success);
  color: #fff;
}

.dm-root--open .dm-fab {
  animation: none;
}

@keyframes dm-float {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(16, 185, 129, 0.18);
  }
  50% {
    transform: translateY(-8px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1), 0 6px 14px rgba(16, 185, 129, 0.24);
  }
}

.dm-panel {
  width: min(320px, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transform-origin: bottom right;
  animation: dm-panel-in 0.22s ease;
}

.dm-panel[hidden] {
  display: none !important;
}

@keyframes dm-panel-in {
  from {
    opacity: 0;
    transform: translate(12px, 12px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

.dm-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.dm-panel__eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--success);
  margin-bottom: 0.15rem;
}

.dm-panel__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.dm-panel__close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.dm-panel__close:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.dm-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.dm-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.dm-item__check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.dm-item--done .dm-item__check {
  background: var(--success-subtle);
  color: var(--success);
}

.dm-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.dm-item__title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.dm-item__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dm-item--done .dm-item__meta {
  color: var(--success);
  font-weight: 600;
}

.dm-panel__footer {
  padding: 0.65rem 1rem 0.9rem;
  border-top: 1px solid var(--border);
}

.dm-streak {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Admin Daily Mission configure */
.dm-admin-config-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dm-admin-config-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--surface-soft);
}

.dm-admin-config-card__key {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.dm-admin-config-card .form-group {
  margin-bottom: 0.75rem;
}

.dm-admin-config-card .form-group:last-of-type {
  margin-bottom: 0.75rem;
}

.dm-admin-active {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.dm-learners-skel {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.35rem 0;
}

.dm-config-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dm-admin-config-card--skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.dm-learner-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0 0.5rem;
}

.dm-learner-summary--skel {
  margin-bottom: 0.25rem;
}

.dm-learner-chip-skel {
  display: block;
  height: 4.25rem;
  border-radius: 12px;
}

.dm-learner-email {
  margin: 0 0 1rem;
}

.dm-learner-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.dm-learner-chip {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dm-learner-chip__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.dm-learner-chip strong {
  font-size: 1.15rem;
  color: var(--text);
}

.dm-learner-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.dm-learner-section h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.dm-learner-section__sub {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}

.dm-learner-missions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dm-learner-mission {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: var(--surface);
}

.dm-learner-mission--done {
  background: var(--success-subtle);
  border-color: #a7f3d0;
}

.dm-learner-mission__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.dm-learner-mission__meta {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.dm-learner-mission--done .dm-learner-mission__meta {
  color: var(--success);
}

.dm-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.75rem 0 0.85rem;
}

.dm-month-nav__label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  flex: 1;
}

.dm-breakdown-cal {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.dm-breakdown-cal__weekdays,
.dm-breakdown-cal__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.dm-breakdown-cal__weekdays {
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.dm-breakdown-cal__weekday {
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.dm-breakdown-cal__cell {
  min-height: 4.5rem;
  padding: 0.4rem 0.3rem 0.45rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.dm-breakdown-cal__cell:nth-child(7n) {
  border-right: none;
}

.dm-breakdown-cal__days > .dm-breakdown-cal__cell:nth-last-child(-n + 7) {
  border-bottom: none;
}

.dm-breakdown-cal__cell--pad {
  background: var(--surface-soft);
  min-height: 4.5rem;
}

.dm-breakdown-cal__cell--muted {
  background: var(--surface-soft);
  opacity: 0.55;
}

.dm-breakdown-cal__cell--completed {
  background: var(--success-subtle);
}

.dm-breakdown-cal__cell--missed {
  background: var(--danger-subtle);
}

.dm-breakdown-cal__cell--upcoming {
  background: var(--surface);
}

.dm-breakdown-cal__cell--in_progress {
  background: var(--warning-subtle);
}

.dm-breakdown-cal__day {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.dm-breakdown-cal__cell .dm-status {
  padding: 0.12rem 0.4rem;
  font-size: 0.65rem;
  border-radius: 999px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.dm-status--completed {
  background: var(--success-subtle);
  color: var(--success);
}

.dm-status--missed {
  background: var(--danger-subtle);
  color: var(--danger);
}

.dm-status--upcoming {
  background: var(--surface-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.dm-status--in-progress {
  background: var(--warning-subtle);
  color: var(--warning);
}

.dm-learner-empty {
  margin: 0;
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .dm-root {
    right: 1rem;
    bottom: 4.75rem;
  }

  .dm-fab {
    width: 56px;
    height: 56px;
  }

  .dm-fab__ring {
    width: 56px;
    height: 56px;
  }

  .dm-fab__icon {
    width: 38px;
    height: 38px;
  }

  .dm-fab__icon svg {
    width: 22px;
    height: 22px;
  }

  .dm-learner-summary {
    grid-template-columns: 1fr;
  }

  .dm-breakdown-cal__cell,
  .dm-breakdown-cal__cell--pad {
    min-height: 3.75rem;
    padding: 0.3rem 0.2rem 0.35rem;
    gap: 0.2rem;
  }

  .dm-breakdown-cal__weekday {
    padding: 0.4rem 0.15rem;
    font-size: 0.65rem;
  }

  .dm-breakdown-cal__day {
    font-size: 0.75rem;
  }

  .dm-breakdown-cal__cell .dm-status {
    font-size: 0.58rem;
    padding: 0.08rem 0.28rem;
  }
}

/* Learner dashboard Daily Mission breakdown */
.learner-dm-dashboard__header {
  margin-top: 0.25rem;
}

.learner-dm-dashboard {
  margin-bottom: 1.75rem;
}

.learner-dm-dashboard .dm-learner-section {
  border-top: 1px solid var(--border);
}

/* ---- Admin shell-first skeletons ---- */
.admin-stat-skel {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}

.admin-skel-icon {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.ov-stat-skel {
  pointer-events: none;
}

.admin-skel-row td {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.course-card--skeleton {
  pointer-events: none;
}

.course-card--skeleton .course-card__cover {
  display: flex;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.admin-skel-cover {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 7rem;
  border-radius: 0;
}

.course-card--skeleton .course-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.coach-shell-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.coach-shell-skel-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.coach-shell-skel-tab {
  display: inline-block;
  height: 2.25rem;
  width: 9.5rem;
  border-radius: 0.65rem;
}

.coach-shell[hidden],
.coach-shell-skeleton[hidden] {
  display: none !important;
}

/* --- Pricing & billing UX --- */
.home-pricing {
  padding-top: 2rem;
}

.home-pricing__lead {
  max-width: 42rem;
  margin: 0.75rem auto 0;
  color: var(--text-muted);
}

.home-pricing__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.home-pricing-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  padding: 1.75rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.home-pricing-card--club {
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: 0 24px 60px rgba(79, 70, 229, 0.18);
}

.home-pricing-card__badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.home-pricing-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

.home-pricing-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 0.45rem;
}

.home-pricing-card__price {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.home-pricing-card__price span {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
}

.home-pricing-card__note {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.home-pricing-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.pricing-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pricing-card--club {
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.08);
}

.pricing-card__badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--indigo-700, #4338ca);
}

.pricing-card__badge--club {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.pricing-card__title {
  margin: 0;
  font-size: 1.35rem;
}

.pricing-card__lead,
.pricing-card__tagline,
.pricing-card__allowance {
  margin: 0;
  color: var(--text-muted);
}

.pricing-card__price {
  margin: 0;
}

.pricing-card__amount {
  font-size: 1.75rem;
  font-weight: 700;
}

.pricing-card__period {
  display: block;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pricing-card__features {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.4rem;
}

.pricing-card__actions {
  margin-top: auto;
}

.trial-banner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(79, 70, 229, 0.25);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(14, 165, 233, 0.08));
}

.trial-banner__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--indigo-700, #4338ca);
}

.trial-banner__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.trial-banner__lead {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  max-width: 46rem;
}

.trial-banner__credits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}

.trial-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.trial-banner__link {
  color: var(--indigo-700, #4338ca);
  font-weight: 600;
  text-decoration: none;
}

.trial-banner__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
}

.credit-meters {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
}

.credit-meters__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.85rem;
}

.credit-meters__title {
  margin: 0;
  font-size: 1rem;
}

.credit-meters__meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.credit-meters__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.credit-meter__label-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

.credit-meter__track {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.credit-meter__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}

.credit-meter--handwritten .credit-meter__fill {
  background: linear-gradient(90deg, #10b981, #059669);
}

.credit-meter--warn .credit-meter__fill {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.credit-meter--empty .credit-meter__fill {
  background: #94a3b8;
}

.credit-meter__remaining {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.credit-meters__note {
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.credit-gate {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.credit-gate.hidden,
.credit-gate[hidden] {
  display: none !important;
}

body.credit-gate-open {
  overflow: hidden;
}

.credit-gate__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
}

.credit-gate__panel {
  position: relative;
  width: min(100%, 26.5rem);
  border-radius: 1.25rem;
  padding: 1.75rem 1.5rem 1.35rem;
  background:
    linear-gradient(180deg, rgba(79, 70, 229, 0.06), transparent 42%),
    var(--surface);
  border: 1px solid rgba(79, 70, 229, 0.18);
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.28);
}

.credit-gate__hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  padding-right: 1.5rem;
}

.credit-gate__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  display: grid;
  place-items: center;
  color: #4338ca;
  background: rgba(79, 70, 229, 0.12);
  flex-shrink: 0;
}

.credit-gate__eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--indigo-700, #4338ca);
}

.credit-gate__title {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.credit-gate__lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.credit-gate__meters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1.15rem 0 1.25rem;
}

.credit-gate__meter-chip {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.9);
}

.credit-gate__meter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.credit-gate__meter-chip strong {
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--text);
}

.credit-gate__meter-suffix {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.credit-gate__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.credit-gate__btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.credit-gate__btn--primary {
  order: 1;
}

.credit-gate__btn--draft {
  order: 2;
}

.credit-gate__dismiss {
  order: 3;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  border-radius: 0.65rem;
}

.credit-gate__dismiss:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
}

.composition-draft-banner {
  margin-bottom: 1rem;
}

.composition-draft-banner.hidden,
.composition-draft-banner[hidden] {
  display: none !important;
}

.composition-draft-banner__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(79, 70, 229, 0.25);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(14, 165, 233, 0.06));
}

.composition-draft-banner__eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--indigo-700, #4338ca);
}

.composition-draft-banner__title {
  margin: 0 0 0.2rem;
  font-weight: 600;
}

.composition-draft-banner__meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.composition-draft-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.credit-gate__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.credit-gate__close:hover {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text);
}

.billing-page {
  display: grid;
  gap: 1.25rem;
  max-width: 52rem;
}

.billing-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.35rem 1.4rem;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.billing-card--flush {
  padding: 0;
  overflow: hidden;
}

.billing-card--flush .table-wrap,
.billing-card--flush .empty-state {
  border: none;
  box-shadow: none;
}

.billing-card__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.billing-card__label {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #674FA7;
}

.billing-card__title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

.billing-card__lead {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.billing-card__lead--pending { color: #b45309; }
.billing-card__lead--error { color: #b91c1c; }

.billing-card--dev details {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.billing-card--dev summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.payment-pay-box {
  border: 1px solid rgba(103, 79, 167, 0.22);
  border-radius: 0.9rem;
  padding: 1.1rem 1.15rem;
  background: linear-gradient(180deg, rgba(240, 196, 48, 0.08), rgba(103, 79, 167, 0.05));
  margin-bottom: 1rem;
}

.payment-pay-box__badge {
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #F0C430;
  color: #1f2937;
  margin-bottom: 0.55rem;
}

.payment-pay-box h3 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

.payment-pay-box p {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
}

.checkout-form .form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.btn.is-disabled,
a.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

@media (max-width: 720px) {
  .checkout-form .form-row {
    grid-template-columns: 1fr;
  }
}

.billing-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
  background: rgba(79, 70, 229, 0.12);
  color: #4338ca;
}

.billing-status--payment_pending,
.billing-status--pending {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.billing-status--active,
.billing-status--confirmed {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.billing-status--rejected,
.billing-status--expired {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.billing-status-panel .panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.billing-status__lead {
  margin: 0 0 1rem;
}

.billing-status__lead--pending {
  color: #b45309;
}

.billing-status__lead--error {
  color: #b91c1c;
}

.checkout-steps {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.checkout-step {
  text-align: center;
  font-size: 0.82rem;
  padding: 0.55rem 0.35rem;
  border-radius: 0.65rem;
  border: 1px dashed var(--border);
  color: var(--text-muted);
}

.checkout-step.is-active {
  border-style: solid;
  border-color: rgba(79, 70, 229, 0.45);
  color: var(--text);
  background: rgba(79, 70, 229, 0.06);
}

.checkout-step.is-done {
  border-style: solid;
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
  background: rgba(16, 185, 129, 0.06);
}

.checkout-features {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
}

.checkout-note {
  margin: 0.85rem 0;
  color: var(--text-muted);
}

.billing-claim-details {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
}

.billing-claim-details div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem;
}

.billing-claim-details dt {
  margin: 0;
  color: var(--text-muted);
}

.billing-claim-details dd {
  margin: 0;
  font-weight: 600;
}

.billing-preview-banner,
.billing-preview-dev .hint {
  margin-bottom: 1rem;
}

.billing-preview-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.billing-preview-form select {
  min-width: 12rem;
}

.payments-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.payments-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
}

.payments-tab.is-active {
  border-color: rgba(79, 70, 229, 0.45);
  color: #4338ca;
  background: rgba(79, 70, 229, 0.08);
}

.payments-table__email,
.payments-table__payer,
.payments-table__note,
.payments-table__reason {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

@media (max-width: 900px) {
  .home-pricing__cards,
  .pricing-cards,
  .credit-meters__grid,
  .checkout-steps {
    grid-template-columns: 1fr;
  }

  .trial-banner {
    grid-template-columns: 1fr;
  }
}

