:root {
  color-scheme: light;
  --font: "Estedad", "IRANYekanX", "Dana", Tahoma, Arial, sans-serif;
  --page-bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-glass: rgba(255, 255, 255, .86);
  --text: #172033;
  --text-soft: #64748b;
  --text-faint: #94a3b8;
  --border: #e4eaf2;
  --shadow-sm: 0 8px 25px rgba(15, 23, 42, .06);
  --shadow-md: 0 20px 55px rgba(15, 23, 42, .1);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --success: #0f9f6e;
  --success-soft: #dff8ed;
  --warning: #d97706;
  --warning-soft: #fff3d6;
  --danger: #dc3f53;
  --danger-soft: #ffe5e9;
  --muted-soft: #edf2f7;
  --header-height: 76px;
  --bottom-nav-height: 74px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0d1320;
  --surface: #151d2c;
  --surface-soft: #111827;
  --surface-glass: rgba(21, 29, 44, .9);
  --text: #edf4ff;
  --text-soft: #a7b3c6;
  --text-faint: #748299;
  --border: #283347;
  --shadow-sm: 0 8px 25px rgba(0, 0, 0, .22);
  --shadow-md: 0 20px 55px rgba(0, 0, 0, .32);
  --success-soft: rgba(15, 159, 110, .16);
  --warning-soft: rgba(217, 119, 6, .17);
  --danger-soft: rgba(220, 63, 83, .16);
  --muted-soft: #202b3d;
}

body.theme-attendance {
  --primary: #0f766e;
  --primary-strong: #0b5e58;
  --primary-soft: #dff6f3;
  --secondary: #2563eb;
  --secondary-soft: #e5edff;
  --hero-gradient: linear-gradient(135deg, #0f766e 0%, #0d9488 52%, #2563eb 100%);
  --hero-shadow: 0 25px 65px rgba(15, 118, 110, .25);
}

body.theme-road {
  --primary: #6366f1;
  --primary-strong: #4f46e5;
  --primary-soft: #ececff;
  --secondary: #ec4899;
  --secondary-soft: #fde7f3;
  --hero-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  --hero-shadow: 0 25px 65px rgba(99, 102, 241, .28);
}

html[data-theme="dark"] body.theme-attendance {
  --primary-soft: rgba(15, 118, 110, .18);
  --secondary-soft: rgba(37, 99, 235, .16);
}

html[data-theme="dark"] body.theme-road {
  --primary-soft: rgba(99, 102, 241, .18);
  --secondary-soft: rgba(236, 72, 153, .15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 90% 5%, var(--primary-soft), transparent 28rem),
    radial-gradient(circle at 0 100%, var(--secondary-soft), transparent 24rem),
    var(--page-bg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  direction: rtl;
  transition: background .25s, color .25s;
}

body.theme-road::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .28;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(99, 102, 241, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, .06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.modal-open { overflow: hidden; }

.app-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--page-bg);
}

.gate-card { width: min(100%, 390px); text-align: center; }

.gate-logo,
.login-logo {
  display: grid;
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  color: #fff;
  place-items: center;
  border-radius: 28px;
  background: var(--hero-gradient);
  box-shadow: var(--hero-shadow);
  font-size: 31px;
}

.gate-spinner {
  width: 44px;
  height: 44px;
  margin: 18px auto;
  border: 4px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.login-view { min-height: 100vh; padding: 24px; }

.login-layout {
  display: grid;
  width: min(1120px, 100%);
  min-height: calc(100vh - 48px);
  margin: auto;
  overflow: hidden;
  grid-template-columns: 1fr .85fr;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 34px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}

.login-showcase {
  position: relative;
  display: flex;
  min-height: 600px;
  overflow: hidden;
  padding: 52px;
  color: #fff;
  flex-direction: column;
  justify-content: space-between;
  background: var(--hero-gradient);
}

.login-showcase::before,
.login-showcase::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
}

.login-showcase::before {
  width: 420px;
  height: 420px;
  inset: -120px auto auto -140px;
}

.login-showcase::after {
  width: 300px;
  height: 300px;
  inset: auto -100px -100px auto;
}

.login-brand,
.login-promo,
.login-proof { position: relative; z-index: 1; }

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.login-brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 17px;
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
  font-weight: 900;
}

.login-brand strong { display: block; font-size: 20px; }
.login-brand span { opacity: .75; font-size: 12px; }

.login-promo h1 {
  max-width: 520px;
  margin: 0 0 18px;
  font-size: clamp(31px, 5vw, 55px);
  line-height: 1.28;
  letter-spacing: -.8px;
}

.login-promo p {
  max-width: 520px;
  margin: 0;
  opacity: .82;
  font-size: 16px;
}

.login-proof { display: flex; gap: 22px; flex-wrap: wrap; }

.login-proof div {
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.11);
  backdrop-filter: blur(12px);
}

.login-proof strong,
.login-proof span { display: block; }
.login-proof strong { font-size: 20px; }
.login-proof span { opacity: .72; font-size: 11px; }

.login-panel {
  display: grid;
  padding: 50px;
  place-items: center;
}

.login-card { width: min(100%, 390px); }

.login-card .login-logo {
  margin-right: 0;
  width: 68px;
  height: 68px;
  border-radius: 22px;
  font-size: 26px;
}

.login-card h2 { margin: 0 0 8px; font-size: 28px; }
.login-card > p { margin: 0 0 28px; color: var(--text-soft); }

.field-group { margin-bottom: 17px; }

.field-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
}

.input-shell { position: relative; }

.input-shell i {
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--text-faint);
  transform: translateY(-50%);
}

.input-shell input { padding-right: 46px; }

input,
textarea,
select {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--border);
  outline: none;
  border-radius: 14px;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

input,
select {
  min-height: 50px;
  padding: 0 15px;
}

textarea {
  min-height: 120px;
  padding: 13px 15px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
}

.form-help {
  display: flex;
  margin: 10px 0 22px;
  gap: 8px;
  color: var(--text-soft);
  align-items: flex-start;
  font-size: 12px;
}

.form-help i { margin-top: 5px; color: var(--primary); }

.login-footer {
  margin-top: 24px;
  padding-top: 19px;
  color: var(--text-faint);
  border-top: 1px dashed var(--border);
  text-align: center;
  font-size: 11px;
}

.btn {
  display: inline-flex;
  min-height: 46px;
  padding: 10px 18px;
  gap: 9px;
  border: 0;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  transition: transform .18s, box-shadow .18s, opacity .18s, background .18s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn:disabled,
.btn-disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
}

.btn-block { width: 100%; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 25%, transparent);
}

.btn-secondary { color: var(--primary); background: var(--primary-soft); }

.btn-ghost {
  color: var(--text-soft);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--border);
}

.btn-danger { color: var(--danger); background: var(--danger-soft); }

.btn-sm {
  min-height: 38px;
  padding: 7px 13px;
  border-radius: 11px;
  font-size: 12px;
}

.app-root {
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-height) + 32px + env(safe-area-inset-bottom));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  width: min(1180px, calc(100% - 32px));
  min-height: var(--header-height);
  margin: auto;
  gap: 14px;
  align-items: center;
}

.header-profile {
  display: flex;
  min-width: 0;
  gap: 11px;
  align-items: center;
}

.avatar {
  display: grid;
  overflow: hidden;
  color: #fff;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  background: var(--hero-gradient);
  font-weight: 900;
}

.header-avatar { width: 44px; height: 44px; }

.profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 27px;
  font-size: 24px;
  box-shadow: var(--shadow-sm);
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.header-user-copy { min-width: 0; }

.header-user-copy strong,
.header-user-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-copy strong { max-width: 250px; }
.header-user-copy span { color: var(--text-soft); font-size: 11px; }

.header-page {
  min-width: 0;
  margin-right: auto;
  text-align: center;
}

.header-page strong,
.header-page span { display: block; }
.header-page strong { font-size: 16px; }
.header-page span { color: var(--text-soft); font-size: 11px; }

.header-actions {
  display: flex;
  margin-right: auto;
  gap: 8px;
}

.icon-button {
  position: relative;
  display: grid;
  width: 43px;
  height: 43px;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  place-items: center;
  cursor: pointer;
}

.icon-button:hover { color: var(--primary); border-color: var(--primary); }

.unread-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  display: grid;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  color: #fff;
  border: 2px solid var(--surface);
  border-radius: 99px;
  background: var(--danger);
  place-items: center;
  font-size: 9px;
  font-weight: 900;
}

.main-content {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto 0;
}

.app-view { animation: view-enter .32s ease both; }

@keyframes view-enter {
  from { opacity: 0; transform: translateY(9px); }
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 270px;
  padding: 34px;
  color: #fff;
  border-radius: 30px;
  background: var(--hero-gradient);
  box-shadow: var(--hero-shadow);
}

.hero-card::before,
.hero-card::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
}

.hero-card::before {
  width: 420px;
  height: 420px;
  top: -270px;
  left: -120px;
}

.hero-card::after {
  width: 250px;
  height: 250px;
  right: -110px;
  bottom: -150px;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  gap: 30px;
  grid-template-columns: 1.35fr .65fr;
  align-items: center;
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .4px;
}

.hero-card .eyebrow { color: rgba(255,255,255,.68); }

.hero-copy h1 {
  margin: 0 0 7px;
  font-size: clamp(27px, 4vw, 45px);
  line-height: 1.35;
}

.hero-copy > p { max-width: 600px; margin: 0; opacity: .78; }

.hero-progress { max-width: 520px; margin-top: 25px; }

.progress-head {
  display: flex;
  margin-bottom: 8px;
  justify-content: space-between;
  font-size: 11px;
}

.progress-track {
  overflow: hidden;
  height: 9px;
  border-radius: 99px;
  background: rgba(255,255,255,.2);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transition: width .8s cubic-bezier(.2,.8,.2,1);
}

.hero-metrics {
  display: grid;
  gap: 13px;
  grid-template-columns: repeat(2, 1fr);
}

.hero-metric {
  padding: 19px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 20px;
  background: rgba(255,255,255,.11);
  backdrop-filter: blur(12px);
}

.hero-metric i,
.hero-metric span,
.hero-metric strong { display: block; }

.hero-metric i { margin-bottom: 13px; opacity: .72; }
.hero-metric strong { font-size: 28px; line-height: 1; }
.hero-metric span { margin-top: 7px; opacity: .72; font-size: 11px; }

.stats-grid {
  display: grid;
  margin-top: 20px;
  gap: 14px;
  grid-template-columns: repeat(4, 1fr);
}

.stat-card {
  display: flex;
  min-width: 0;
  padding: 18px;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  align-items: center;
}

.stat-icon {
  display: grid;
  width: 46px;
  height: 46px;
  color: var(--primary);
  flex: 0 0 auto;
  border-radius: 15px;
  background: var(--primary-soft);
  place-items: center;
}

.stat-copy { min-width: 0; }
.stat-copy strong,
.stat-copy span { display: block; }
.stat-copy strong { font-size: 20px; }
.stat-copy span {
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.home-columns {
  display: grid;
  margin-top: 20px;
  gap: 20px;
  grid-template-columns: 1.25fr .75fr;
  align-items: start;
}

.surface-card {
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-heading {
  display: flex;
  margin-bottom: 18px;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
}

.section-heading.compact { margin-bottom: 13px; }

.section-heading h2,
.section-heading h3 { margin: 0; line-height: 1.4; }

.section-heading h2 { font-size: 21px; }
.section-heading h3 { font-size: 17px; }

.section-heading p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 12px;
}

.text-button {
  display: inline-flex;
  padding: 5px;
  gap: 6px;
  color: var(--primary);
  border: 0;
  background: none;
  align-items: center;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
}

.next-action-card {
  display: grid;
  padding: 21px;
  gap: 17px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background:
    linear-gradient(135deg, var(--primary-soft), transparent 58%),
    var(--surface-soft);
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.next-action-icon {
  display: grid;
  width: 57px;
  height: 57px;
  color: #fff;
  border-radius: 18px;
  background: var(--hero-gradient);
  place-items: center;
  font-size: 20px;
}

.next-action-copy h3 { margin: 0 0 3px; font-size: 17px; }

.next-action-copy p {
  display: flex;
  margin: 0 0 9px;
  gap: 6px;
  color: var(--text-soft);
  align-items: center;
  font-size: 11px;
}

.status-pill {
  display: inline-flex;
  min-height: 27px;
  padding: 4px 9px;
  gap: 5px;
  border-radius: 99px;
  align-items: center;
  font-size: 10px;
  font-weight: 900;
}

.status-success { color: var(--success); background: var(--success-soft); }
.status-warning { color: var(--warning); background: var(--warning-soft); }
.status-danger { color: var(--danger); background: var(--danger-soft); }
.status-primary { color: var(--primary); background: var(--primary-soft); }
.status-muted { color: var(--text-soft); background: var(--muted-soft); }

.score-list { display: grid; gap: 7px; }

.score-row {
  display: flex;
  min-width: 0;
  padding: 11px 0;
  gap: 11px;
  border-bottom: 1px dashed var(--border);
  align-items: center;
}

.score-row:last-child { border-bottom: 0; }

.score-row-icon {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  border-radius: 12px;
  place-items: center;
  font-size: 11px;
}

.score-row-icon.positive { color: var(--success); background: var(--success-soft); }
.score-row-icon.negative { color: var(--danger); background: var(--danger-soft); }

.score-row-copy { min-width: 0; flex: 1; }
.score-row-copy strong,
.score-row-copy span { display: block; }

.score-row-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.score-row-copy span { color: var(--text-faint); font-size: 9px; }
.score-row > b { flex: 0 0 auto; font-size: 13px; }
.score-positive { color: var(--success); }
.score-negative { color: var(--danger); }

.mini-badges {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}

.mini-badge {
  display: flex;
  min-width: 0;
  padding: 13px;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  align-items: center;
}

.mini-badge > span {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: var(--warning-soft);
  place-items: center;
  font-size: 19px;
}

.mini-badge strong,
.mini-badge small { display: block; }

.mini-badge strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.mini-badge small { color: var(--text-faint); font-size: 9px; }
.view-intro {
  display: flex;
  margin-bottom: 21px;
  padding: 22px 25px;
  gap: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  align-items: center;
}

.view-intro-icon {
  display: grid;
  width: 57px;
  height: 57px;
  color: var(--primary);
  flex: 0 0 auto;
  border-radius: 18px;
  background: var(--primary-soft);
  place-items: center;
  font-size: 20px;
}

.view-intro h1 { margin: 0 0 3px; font-size: 22px; }
.view-intro p { margin: 0; color: var(--text-soft); font-size: 12px; }

.event-list,
.lesson-list,
.leaderboard-list,
.badges-grid { display: grid; gap: 14px; }

.event-card {
  position: relative;
  display: grid;
  overflow: hidden;
  padding: 21px;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  grid-template-columns: auto 1fr;
}

.event-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  content: "";
  background: var(--text-faint);
}

.event-card.status-success::after { background: var(--success); }
.event-card.status-warning::after { background: var(--warning); }
.event-card.status-danger::after { background: var(--danger); }
.event-card.status-primary::after { background: var(--primary); }

.event-index {
  display: grid;
  width: 48px;
  height: 48px;
  color: var(--primary);
  border-radius: 16px;
  background: var(--primary-soft);
  place-items: center;
  font-weight: 900;
}

.event-card-main { min-width: 0; }

.event-card-head {
  display: flex;
  margin-bottom: 9px;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
}

.event-points {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
}

.event-card h3,
.journey-card h3 { margin: 0 0 5px; font-size: 17px; }

.event-card p,
.journey-card p { margin: 0; color: var(--text-soft); font-size: 12px; }

.event-meta {
  display: flex;
  margin-top: 13px;
  gap: 14px;
  color: var(--text-soft);
  flex-wrap: wrap;
  font-size: 10px;
}

.event-meta span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.event-card-actions {
  display: flex;
  margin-top: 16px;
  gap: 8px;
  flex-wrap: wrap;
}

.journey-list {
  position: relative;
  display: grid;
  gap: 0;
}

.journey-list::before {
  position: absolute;
  top: 15px;
  right: 24px;
  bottom: 15px;
  width: 3px;
  content: "";
  border-radius: 99px;
  background: linear-gradient(var(--primary), var(--secondary));
  opacity: .22;
}

.journey-node {
  position: relative;
  display: grid;
  padding-bottom: 20px;
  gap: 18px;
  grid-template-columns: 50px 1fr;
  animation: journey-enter .45s calc(var(--node-index) * 45ms) ease both;
}

@keyframes journey-enter {
  from { opacity: 0; transform: translateY(14px); }
}

.journey-marker {
  position: relative;
  z-index: 2;
  display: grid;
  width: 49px;
  height: 49px;
  color: #fff;
  border: 6px solid var(--page-bg);
  border-radius: 50%;
  background: var(--primary);
  place-items: center;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 28%, transparent);
}

.journey-node.status-success .journey-marker { background: var(--success); }
.journey-node.status-warning .journey-marker { background: var(--warning); }
.journey-node.status-danger .journey-marker { background: var(--danger); }

.journey-node.status-muted .journey-marker {
  color: var(--text-faint);
  background: var(--muted-soft);
}

.journey-card {
  position: relative;
  padding: 21px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.journey-card::before {
  position: absolute;
  top: 18px;
  right: -8px;
  width: 15px;
  height: 15px;
  content: "";
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--surface);
  transform: rotate(45deg);
}

.event-order { color: var(--primary); font-size: 10px; font-weight: 900; }

.lesson-list { grid-template-columns: repeat(2, 1fr); }

.lesson-card {
  display: grid;
  overflow: hidden;
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  grid-template-columns: 180px 1fr;
}

.lesson-cover {
  position: relative;
  display: grid;
  min-height: 100%;
  overflow: hidden;
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), var(--secondary-soft));
  place-items: center;
  font-size: 40px;
}

.lesson-cover img { width: 100%; height: 100%; object-fit: cover; }

.lesson-complete {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  color: #fff;
  border-radius: 99px;
  background: rgba(15, 159, 110, .92);
  font-size: 9px;
  font-weight: 900;
}

.lesson-copy {
  display: flex;
  min-width: 0;
  padding: 21px;
  flex-direction: column;
}

.lesson-meta {
  display: flex;
  gap: 12px;
  color: var(--text-soft);
  font-size: 9px;
}

.lesson-meta span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.lesson-copy h3 { margin: 10px 0 4px; font-size: 17px; }

.lesson-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--text-soft);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 11px;
}

.lesson-progress-line {
  overflow: hidden;
  height: 6px;
  margin-top: auto;
  border-radius: 99px;
  background: var(--muted-soft);
}

.lesson-progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.lesson-footer {
  display: flex;
  margin-top: 12px;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.lesson-footer small { color: var(--text-soft); font-size: 9px; }

.leaderboard-list { max-width: 760px; margin: auto; }

.leader-row {
  display: grid;
  min-width: 0;
  padding: 14px 17px;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  grid-template-columns: 38px 44px 1fr auto;
  align-items: center;
}

.leader-row.is-current {
  border-color: var(--primary);
  background:
    linear-gradient(135deg, var(--primary-soft), transparent),
    var(--surface);
}

.leader-rank { text-align: center; font-weight: 900; }

.leader-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  color: #fff;
  border-radius: 14px;
  background: var(--hero-gradient);
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.leader-copy { min-width: 0; }
.leader-copy strong,
.leader-copy span { display: block; }

.leader-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.leader-copy span { color: var(--text-soft); font-size: 9px; }
.leader-row > b { color: var(--primary); font-size: 14px; }
.leader-row > b small { color: var(--text-soft); font-size: 8px; }

.profile-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: .72fr 1.28fr;
  align-items: start;
}

.profile-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.profile-main { text-align: center; }
.profile-main .profile-avatar { margin: 0 auto 13px; }
.profile-main h2 { margin: 0 0 2px; }
.profile-main > p { margin: 0 0 17px; color: var(--text-soft); direction: ltr; }

.profile-group-badge {
  display: inline-flex;
  padding: 6px 11px;
  color: var(--primary);
  border-radius: 99px;
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 900;
}

.profile-facts { display: grid; margin-top: 22px; gap: 8px; }

.profile-fact {
  display: flex;
  padding: 11px 12px;
  gap: 9px;
  border-radius: 13px;
  background: var(--surface-soft);
  text-align: right;
  align-items: center;
}

.profile-fact i { width: 24px; color: var(--primary); text-align: center; }
.profile-fact div { min-width: 0; }
.profile-fact span,
.profile-fact strong { display: block; }
.profile-fact span { color: var(--text-soft); font-size: 9px; }

.profile-fact strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.profile-actions { display: grid; margin-top: 18px; gap: 9px; }
.profile-content { display: grid; gap: 20px; }
.badges-grid { grid-template-columns: repeat(2, 1fr); }

.badge-card {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 15px;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
}

.badge-card.is-locked { opacity: .55; filter: grayscale(.65); }

.badge-icon {
  display: grid;
  width: 47px;
  height: 47px;
  flex: 0 0 auto;
  border-radius: 15px;
  background: var(--warning-soft);
  place-items: center;
  font-size: 23px;
}

.badge-card h4 { margin: 0 0 2px; font-size: 12px; }
.badge-card p { margin: 0; color: var(--text-soft); font-size: 9px; }

.badge-card small {
  display: block;
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 8px;
}

.badge-check,
.badge-lock {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 12px;
}

.badge-check { color: var(--success); }
.badge-lock { color: var(--text-faint); }

.notice-card {
  display: flex;
  padding: 15px;
  gap: 12px;
  border-radius: 17px;
  align-items: flex-start;
}

.notice-card > i { margin-top: 4px; font-size: 18px; }
.notice-card strong,
.notice-card p,
.notice-card small { display: block; }

.notice-card p { margin: 3px 0; font-size: 10px; }
.notice-card small { opacity: .65; font-size: 8px; }
.notice-card.neutral { color: var(--text-soft); background: var(--muted-soft); }
.notice-card.warning { color: var(--warning); background: var(--warning-soft); }
.notice-card.success { color: var(--success); background: var(--success-soft); }
.notice-card.danger { color: var(--danger); background: var(--danger-soft); }

.admin-reply {
  margin-top: 9px;
  padding: 9px;
  color: var(--text);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
}

.review-form { display: grid; margin-top: 15px; gap: 10px; }

.bottom-nav {
  position: fixed;
  z-index: 60;
  right: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  width: min(570px, calc(100% - 24px));
  min-height: var(--bottom-nav-height);
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 25px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  grid-template-columns: repeat(5, 1fr);
  transform: translateX(50%);
}

.bottom-nav button {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 7px 4px;
  gap: 2px;
  color: var(--text-faint);
  border: 0;
  border-radius: 18px;
  background: transparent;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.bottom-nav button i { font-size: 18px; }

.bottom-nav button.is-active {
  color: var(--primary);
  background: var(--primary-soft);
}

.modal,
.drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: opacity .22s, visibility .22s;
}

.modal.is-open,
.drawer.is-open { visibility: visible; opacity: 1; }

.modal-backdrop,
.drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(9, 15, 28, .58);
  backdrop-filter: blur(5px);
}

.modal-panel {
  position: absolute;
  right: 50%;
  bottom: 0;
  display: flex;
  overflow: hidden;
  width: min(860px, calc(100% - 24px));
  max-height: min(88vh, 900px);
  border: 1px solid var(--border);
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  flex-direction: column;
  transform: translate(50%, 30px);
  transition: transform .25s;
}

.modal.is-open .modal-panel { transform: translate(50%, 0); }
.modal-panel.modal-wide { width: min(1000px, calc(100% - 24px)); }

.modal-header,
.drawer-header {
  display: flex;
  min-height: 70px;
  padding: 14px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
}

.modal-header h2,
.drawer-header h2 { margin: 0; font-size: 17px; }

.modal-body { overflow: auto; padding: 21px; }

.modal-footer {
  display: flex;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  justify-content: flex-end;
}

.modal-close {
  display: grid;
  width: 39px;
  height: 39px;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
  place-items: center;
  cursor: pointer;
}

.drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  width: min(430px, 92vw);
  height: 100%;
  border-right: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .26s;
}

.drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-body { overflow: auto; padding: 14px; }
.notification-list { display: grid; gap: 8px; }

.notification-item {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 13px;
  gap: 10px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  grid-template-columns: 40px 1fr auto;
  text-align: right;
  align-items: start;
  cursor: pointer;
}

.notification-item.is-unread {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
  background: var(--primary-soft);
}

.notification-icon {
  display: grid;
  width: 38px;
  height: 38px;
  color: var(--primary);
  border-radius: 12px;
  background: var(--surface);
  place-items: center;
}

.notification-copy { min-width: 0; }
.notification-copy strong,
.notification-copy span,
.notification-copy small { display: block; }
.notification-copy strong { font-size: 11px; }
.notification-copy span { margin: 2px 0; color: var(--text-soft); font-size: 9px; }
.notification-copy small { color: var(--text-faint); font-size: 8px; }
.unread-dot { margin-top: 7px; color: var(--primary); font-size: 7px; }

.detail-hero {
  display: grid;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-soft);
  grid-template-columns: 250px 1fr;
}

.detail-hero img,
.detail-hero-placeholder {
  width: 100%;
  min-height: 230px;
  height: 100%;
  object-fit: cover;
}

.detail-hero-placeholder {
  display: grid;
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), var(--secondary-soft));
  place-items: center;
  font-size: 44px;
}

.detail-hero-copy { padding: 24px; }
.detail-hero-copy h3 { margin: 13px 0 6px; font-size: 22px; }
.detail-hero-copy p { margin: 0; color: var(--text-soft); font-size: 12px; }

.detail-facts {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
}

.detail-facts > div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.detail-facts i,
.detail-facts span,
.detail-facts b { display: block; }
.detail-facts i { margin-bottom: 10px; color: var(--primary); }
.detail-facts span { color: var(--text-soft); font-size: 9px; }
.detail-facts b { margin-top: 3px; font-size: 11px; }

.detail-actions {
  display: flex;
  margin: 16px 0 22px;
  gap: 9px;
  flex-wrap: wrap;
}

.modal-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px dashed var(--border);
}

.news-list,
.feedback-list { display: grid; gap: 10px; }

.news-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-soft);
  grid-template-columns: 130px 1fr;
}

.news-card img { width: 100%; height: 100%; min-height: 120px; object-fit: cover; }
.news-card > div { padding: 14px; }
.news-card h4 { margin: 0 0 4px; }
.news-card p { margin: 0; color: var(--text-soft); font-size: 10px; }
.news-card small { display: block; margin-top: 7px; color: var(--text-faint); font-size: 8px; }

.feedback-card {
  position: relative;
  margin: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-soft);
}

.feedback-card > i { color: var(--primary); opacity: .3; font-size: 22px; }
.feedback-card p { margin: 6px 0 11px; font-size: 11px; }
.feedback-card footer b,
.feedback-card footer span { display: block; }
.feedback-card footer b { font-size: 10px; }
.feedback-card footer span { color: var(--text-soft); font-size: 8px; }

.survey-intro {
  margin-bottom: 14px;
  padding: 13px;
  color: var(--text-soft);
  border-radius: 14px;
  background: var(--primary-soft);
  font-size: 11px;
}

.survey-progress {
  display: flex;
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  justify-content: space-between;
}

.survey-questions,
.quiz-questions { display: grid; gap: 15px; }

.question-block {
  min-width: 0;
  margin: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
}

.question-block legend {
  display: flex;
  max-width: 100%;
  padding: 0 5px;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  align-items: flex-start;
}

.question-number {
  display: grid;
  width: 27px;
  height: 27px;
  color: var(--primary);
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--primary-soft);
  place-items: center;
  font-size: 9px;
}

.required-mark { color: var(--danger); }

.rating-options { display: flex; gap: 7px; flex-wrap: wrap; }

.rating-option input,
.choice-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rating-option span {
  display: grid;
  width: 39px;
  height: 39px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  place-items: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.rating-option input:checked + span {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.choice-options { display: grid; gap: 7px; }

.choice-option span {
  display: flex;
  min-height: 44px;
  padding: 9px 12px;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  align-items: center;
  cursor: pointer;
  font-size: 10px;
}

.choice-option span i { color: var(--text-faint); }

.choice-option input:checked + span {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.choice-option input:checked + span i::before {
  content: "\f058";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.lesson-detail-meta {
  display: flex;
  margin-bottom: 14px;
  gap: 9px;
  flex-wrap: wrap;
}

.lesson-detail-meta span {
  display: inline-flex;
  padding: 6px 9px;
  gap: 5px;
  color: var(--text-soft);
  border-radius: 10px;
  background: var(--surface-soft);
  align-items: center;
  font-size: 9px;
}

.lesson-media {
  width: 100%;
  max-height: 520px;
  margin-bottom: 18px;
  border-radius: 18px;
  object-fit: contain;
  background: #000;
}

.lesson-audio { width: 100%; margin-bottom: 18px; }

.rich-content {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.rich-content img { height: auto; border-radius: 15px; }
.rich-content a { color: var(--primary); text-decoration: underline; }

.education-quiz {
  margin-top: 24px;
  padding-top: 23px;
  border-top: 1px dashed var(--border);
}

.quiz-result {
  display: flex;
  margin-bottom: 14px;
  padding: 13px;
  gap: 10px;
  border-radius: 14px;
  align-items: center;
}

.quiz-result.passed { color: var(--success); background: var(--success-soft); }
.quiz-result.failed { color: var(--warning); background: var(--warning-soft); }

.quiz-result strong,
.quiz-result p { display: block; margin: 0; }
.quiz-result strong { font-size: 11px; }
.quiz-result p { font-size: 9px; }

.like-button.is-liked { color: var(--danger); background: var(--danger-soft); }

.empty-state { padding: 32px 18px; color: var(--text-soft); text-align: center; }

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  color: var(--primary);
  border-radius: 20px;
  background: var(--primary-soft);
  place-items: center;
  font-size: 21px;
}

.empty-state h3 { margin: 0; color: var(--text); font-size: 14px; }
.empty-state p { max-width: 420px; margin: 5px auto 0; font-size: 10px; }

.skeleton-card {
  display: flex;
  padding: 17px;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.skeleton-card.compact { padding: 13px; }

.skeleton {
  display: block;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    var(--muted-soft),
    color-mix(in srgb, var(--muted-soft) 50%, var(--surface)),
    var(--muted-soft)
  );
  background-size: 200% 100%;
  animation: skeleton 1.3s infinite linear;
}

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

.skeleton-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border-radius: 15px;
}

.skeleton-lines { display: grid; width: 100%; gap: 8px; }
.skeleton-line { width: 60%; height: 10px; }
.skeleton-line.long { width: 86%; }
.skeleton-line.short { width: 35%; }

.toast-container {
  position: fixed;
  z-index: 3000;
  top: 18px;
  left: 18px;
  display: grid;
  width: min(390px, calc(100% - 36px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: grid;
  padding: 13px;
  gap: 10px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
  grid-template-columns: 26px 1fr 28px;
  align-items: start;
  pointer-events: auto;
  animation: toast-enter .25s ease both;
}

@keyframes toast-enter {
  from { opacity: 0; transform: translateY(-12px); }
}

.toast-leave {
  opacity: 0;
  transform: translateY(-8px);
  transition: .2s;
}

.toast > i { margin-top: 3px; font-size: 18px; }
.toast-success > i { color: var(--success); }
.toast-error > i { color: var(--danger); }
.toast-warning > i { color: var(--warning); }
.toast-info > i { color: var(--primary); }

.toast-copy strong,
.toast-copy span { display: block; }
.toast-copy strong { font-size: 11px; }
.toast-copy span { color: var(--text-soft); font-size: 9px; }

.toast-close {
  display: grid;
  width: 27px;
  height: 27px;
  color: var(--text-faint);
  border: 0;
  border-radius: 9px;
  background: transparent;
  place-items: center;
  cursor: pointer;
}

@media (max-width: 960px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-showcase { display: none; }
  .login-panel { min-height: calc(100vh - 48px); }
  .home-columns,
  .profile-layout { grid-template-columns: 1fr; }
  .lesson-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --header-height: 68px; }
  body { font-size: 14px; }

  .header-inner,
  .main-content { width: min(100% - 22px, 1180px); }

  .header-page { display: none; }
  .header-user-copy strong { max-width: 145px; font-size: 11px; }
  .header-user-copy span { font-size: 9px; }
  .header-actions { margin-right: auto; }
  .main-content { margin-top: 16px; }

  .hero-card {
    min-height: auto;
    padding: 23px;
    border-radius: 24px;
  }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: 27px; }
  .hero-copy > p { font-size: 12px; }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); }
  .hero-metric { padding: 15px; }
  .stats-grid { gap: 9px; grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 13px; }
  .stat-icon { width: 40px; height: 40px; border-radius: 13px; }
  .stat-copy strong { font-size: 16px; }

  .surface-card { padding: 17px; border-radius: 21px; }

  .next-action-card { grid-template-columns: auto 1fr; }
  .next-action-button { grid-column: 1 / -1; }
  .next-action-button .btn { width: 100%; }

  .mini-badges,
  .badges-grid { grid-template-columns: 1fr; }

  .view-intro { padding: 17px; border-radius: 21px; }
  .view-intro h1 { font-size: 18px; }

  .event-card {
    padding: 16px;
    gap: 12px;
    grid-template-columns: 41px 1fr;
  }

  .event-index {
    width: 39px;
    height: 39px;
    border-radius: 13px;
    font-size: 11px;
  }

  .lesson-card { min-height: 0; grid-template-columns: 110px 1fr; }
  .lesson-copy { padding: 15px; }
  .lesson-copy h3 { font-size: 14px; }
  .lesson-copy p { -webkit-line-clamp: 2; font-size: 9px; }
  .lesson-meta { gap: 7px; flex-wrap: wrap; }
  .lesson-footer { align-items: flex-end; }

  .leader-row {
    padding: 11px;
    grid-template-columns: 32px 38px 1fr auto;
  }

  .leader-avatar { width: 37px; height: 37px; }

  .detail-hero { grid-template-columns: 1fr; }

  .detail-hero img,
  .detail-hero-placeholder {
    min-height: 170px;
    max-height: 240px;
  }

  .detail-hero-copy { padding: 17px; }
  .detail-facts { grid-template-columns: repeat(2, 1fr); }
  .news-card { grid-template-columns: 90px 1fr; }

  .modal-panel,
  .modal-panel.modal-wide {
    width: 100%;
    max-height: 92vh;
    border-radius: 25px 25px 0 0;
  }

  .modal-body { padding: 15px; }

  .journey-list::before { right: 20px; }

  .journey-node {
    gap: 12px;
    grid-template-columns: 42px 1fr;
  }

  .journey-marker {
    width: 42px;
    height: 42px;
    border-width: 5px;
    font-size: 12px;
  }

  .journey-card { padding: 16px; }

  .bottom-nav {
    bottom: max(7px, env(safe-area-inset-bottom));
    width: calc(100% - 14px);
    min-height: 66px;
    padding: 6px;
    border-radius: 22px;
  }

  .bottom-nav button { font-size: 8px; }
  .bottom-nav button i { font-size: 16px; }

  .toast-container {
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
  }
}

@media (max-width: 430px) {
  .login-view { padding: 0; }

  .login-layout {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .login-panel {
    min-height: 100vh;
    padding: 28px 22px;
  }

  .hero-metrics { gap: 8px; }
  .hero-metric strong { font-size: 22px; }
  .stat-card { gap: 9px; }
  .stat-copy span { font-size: 9px; }

  .lesson-card { grid-template-columns: 1fr; }
  .lesson-cover { min-height: 150px; }

  .event-card-head,
  .lesson-footer { align-items: flex-start; }

  .detail-facts { grid-template-columns: 1fr 1fr; }
}


/* Phase 5 UX hardening - 6.4.0 */
.modal-panel,.drawer-panel{max-height:calc(100dvh - 32px);overscroll-behavior:contain}
.notification-item:disabled{opacity:.72;cursor:wait}
.btn,.icon-button,.nav-button,.bottom-nav-button{touch-action:manipulation}
@media(max-width:720px){.modal{padding:0}.modal-panel{width:100%;max-height:92dvh;margin-top:auto;border-radius:24px 24px 0 0}.modal-body{overscroll-behavior:contain}.drawer-panel{width:min(100%,430px)}.app-main{padding-bottom:calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 28px)}}


/* attendance-note-hotfix-v10.0.4 */
.attendance-user-note{display:flex;gap:10px;align-items:flex-start;margin:12px 0 4px;padding:10px 12px;border-radius:13px;background:linear-gradient(135deg,rgba(245,158,11,.10),rgba(249,115,22,.06));border:1px solid rgba(245,158,11,.24);color:#7c4a03}.attendance-user-note>i{margin-top:3px;font-size:15px;color:#d97706}.attendance-user-note>div{min-width:0;display:grid;gap:3px}.attendance-user-note strong{font-size:12px;font-weight:900;color:#92400e}.attendance-user-note span{font-size:13px;line-height:1.75;color:#6b4b16;white-space:pre-wrap;overflow-wrap:anywhere}.attendance-user-note.compact{margin:8px 0;padding:8px 10px}.attendance-user-note.detail{margin:14px 0;padding:13px 14px}.theme-dark .attendance-user-note{background:rgba(245,158,11,.09);border-color:rgba(245,158,11,.22);color:#fde68a}.theme-dark .attendance-user-note strong,.theme-dark .attendance-user-note span{color:#fde68a}@media(max-width:640px){.attendance-user-note{padding:9px 10px;border-radius:11px}.attendance-user-note span{font-size:12.5px}}

/* survey-modal-hotfix-v11.4.2d
   Samsung/Android hardening:
   - On small screens the whole survey form is the single scroll owner.
   - Footer stays in normal document flow after the final question.
   - Radio inputs occupy the visible option instead of living at an undefined
     absolute static position, preventing focus-induced scroll jumps. */
#surveyForm {
  height: min(900px, calc(100dvh - 16px));
  max-height: min(900px, calc(100dvh - 16px));
}
#surveyForm > .modal-header,
#surveyForm > .modal-footer {
  flex: 0 0 auto;
}
#surveyModalBody {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
}
#surveyModalBody .survey-questions {
  min-height: 0;
  padding-bottom: 8px;
}
#surveyModalBody .question-block {
  scroll-margin-block: 14px;
}

/* Keep the real radio control exactly on top of its visible option. */
.rating-option,
.choice-option {
  position: relative;
}
.rating-option input,
.choice-option input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: .001;
  pointer-events: auto;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.rating-option span,
.choice-option span {
  position: relative;
  z-index: 1;
}
.rating-option:focus-within span,
.choice-option:focus-within span {
  outline: 2px solid color-mix(in srgb, var(--primary) 34%, transparent);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  #surveyModal {
    overflow: hidden;
    overscroll-behavior: none;
  }

  /* Do not use a nested flex scroller on mobile. The FORM itself scrolls. */
  #surveyForm {
    position: absolute;
    inset: 0;
    right: 0;
    bottom: 0;
    left: 0;
    top: 0;
    display: block;
    width: 100%;
    height: auto !important;
    min-height: 100%;
    max-height: none !important;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 0;
    transform: none !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
  }

  #surveyForm > .modal-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-top: max(14px, env(safe-area-inset-top));
    background: var(--surface);
  }

  #surveyModalBody {
    display: block;
    min-height: auto;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: auto;
  }

  #surveyForm > .modal-footer {
    position: relative;
    z-index: 4;
    margin-top: 4px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    background: var(--surface);
  }

  #surveyModalBody .survey-questions {
    padding-bottom: 10px;
  }
}


/* ENSAN360 Update 04 — readability baseline */
:where(.score-row-copy span,.mini-badge small,.lesson-complete,.lesson-meta,.lesson-footer small,.leader-copy span,.leader-row>b small,.profile-fact span,.badge-card p,.badge-card small,.notice-card small,.notification-copy span,.notification-copy small,.detail-facts span,.news-card small,.feedback-card footer span,.question-number,.lesson-detail-meta span,.quiz-result p,.toast-copy span,.header-user-copy span,.lesson-copy p,.stat-copy span){font-size:11px!important;line-height:1.65}
.bottom-nav button{font-size:11px!important}
@media (max-width:760px){.bottom-nav button{font-size:11px!important}.notification-copy span,.lesson-copy p,.toast-copy span{font-size:12px!important}}
