.coupon-admin-hero {
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: 1.25rem;
  background: linear-gradient(120deg, #123f83, #116da3);
  color: white;
  margin-bottom: 1.25rem;
}
.coupon-admin-hero h2 { color: white; margin-block: .75rem; }
.coupon-admin-hero p { color: #e4efff; max-width: 38rem; }
.coupon-admin-hero .badge { background: #e7f8ff; color: #144e80; letter-spacing: .08em; }
.coupon-list, .coupon-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.coupon-card { min-width: 0; margin: 0; border-top: 4px solid #1779df; }
.coupon-card-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; }
.coupon-code { font-family: ui-monospace, monospace; letter-spacing: .08em; overflow-wrap: anywhere; }
.coupon-card progress { width: 100%; height: .6rem; accent-color: #1779df; }
.coupon-card .actions { flex-wrap: wrap; }
.coupon-state.is-active { background: #e3f7ed; color: #11683e; }
.coupon-editor { margin-bottom: 1.25rem; }
.checkout-coupon { margin-block: 1rem; padding: 1.1rem; border: 1px dashed #88afd7; border-radius: 1rem; background: #f0f7ff; }
.checkout-coupon > strong { color: #144e80; font-size: 1.1rem; }
.checkout-coupon p { margin-block: .4rem .8rem; }
.coupon-entry { display: flex; gap: .6rem; align-items: center; }
.coupon-entry input { flex: 1; min-width: 0; text-transform: uppercase; }
.coupon-totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem; margin-block: 1rem; }
.coupon-totals dt { color: #526981; overflow-wrap: anywhere; }
.coupon-totals dd { margin: 0; text-align: right; font-weight: 600; }
.coupon-saving { color: #11683e; }
@media (max-width: 600px) {
  .coupon-list, .coupon-form-grid { grid-template-columns: minmax(0, 1fr); }
  .checkout-coupon { padding: .85rem; }
}

:root {
  --ink: #17233d;
  --muted: #66748a;
  --accent: #1779df;
  --accent-dark: #0d4ea6;
  --accent-soft: #eaf5ff;
  --navy: #1779df;
  --sun: #ffca55;
  --bg: #f4f8fc;
  --surface: #ffffff;
  --surface-raised: #f0f6fc;
  --line: #dce7f2;
  --outline: #91a9bf;
  --focus: #0b6fd3;
  --positive: #16784e;
  --positive-bg: #e3f7ed;
  --shadow: 0 10px 30px rgba(23, 73, 120, .10);
  --radius-sm: .75rem;
  --radius-md: 1rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  font-family: Inter, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.dashboard-score small { color: #dff2ff; font-size: .72rem; }

body { background: linear-gradient(180deg, #edf6ff 0, var(--bg) 17rem, var(--bg) 100%); }
.site-header {
  background: linear-gradient(105deg, #0d6fda 0%, #1788ed 58%, #2ca4ef 100%);
  box-shadow: 0 8px 24px rgba(16, 99, 177, .18);
}
.shortcut::after {
  content: "›";
  position: absolute;
  right: .8rem;
  top: 50%;
  transform: translateY(-50%);
  color: #a9c5db;
  font-size: 1.5rem;
  font-weight: 600;
}
.shortcut-grid .shortcut:nth-child(-n+4) {
  min-height: 6.7rem;
  border-color: #c4def4;
  background: linear-gradient(150deg, white, #eef8ff);
}
.header-inner { min-height: 4.75rem; }
.brand { font-size: 1.18rem; letter-spacing: -.025em; }
.brand small { color: #e1f2ff; font-weight: 600; letter-spacing: .025em; }
.brand-mark {
  width: 3rem;
  height: 3rem;
  border-radius: .9rem;
  border: 2px solid rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 5px 14px rgba(0, 55, 120, .16);
}
#nav a { border-radius: .8rem; }
#nav a:hover, #nav a[aria-current="page"] { background: rgba(255, 255, 255, .18); }
.nav-indicator { color: inherit; }

.button, button {
  gap: .45rem;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(23, 121, 223, .12);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.button:hover, button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button-icon {
  display: block; flex: none; width: 1rem; height: 1rem;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.secondary, button.secondary {
  color: var(--accent-dark);
  border-color: #b9cfe3;
  background: white;
  box-shadow: none;
}
.secondary:hover, button.secondary:hover { background: var(--accent-soft); border-color: var(--accent); }
.danger.secondary { color: #a82b36; border-color: #dfb6bd; background: white; }

.hero, .dashboard-welcome, .referral-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 18%, rgba(103, 220, 255, .35), transparent 28%),
    linear-gradient(115deg, #0a63ca 0%, #1687e8 58%, #35b8ef 100%);
  box-shadow: 0 18px 42px rgba(15, 107, 190, .2);
}
.hero::before, .hero::after, .dashboard-welcome::before {
  background: rgba(255, 255, 255, .10);
}
.hero .lead, .hero-proof, .dashboard-welcome .lead { color: #eaf6ff; }
.hero .eyebrow, .dashboard-welcome .eyebrow { color: #dff4ff; }
.hero .button { color: #123a67; border-color: #fff; background: #fff; }
.hero .button.secondary { color: white; border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.12); }
.hero-art {
  border: 1px solid rgba(255,255,255,.7);
  background: linear-gradient(160deg, #fff, #edf7ff);
  box-shadow: 0 22px 50px rgba(0, 61, 120, .22);
}
.hero-art::before { color: var(--accent); }
.hero-art .progress-ring { border-color: #dcebfa; border-top-color: var(--accent); border-right-color: #29a5eb; }

.dashboard-welcome { border: 0; }
.dashboard-welcome {
  min-height: 18rem;
  padding: clamp(1.35rem, 4vw, 2.6rem);
  grid-template-columns: minmax(0, 1fr) minmax(12rem, .42fr);
}
.dashboard-welcome::after {
  content: "";
  position: absolute;
  right: 28%;
  bottom: -7rem;
  width: 15rem;
  height: 15rem;
  border: 2rem solid rgba(255,255,255,.07);
  border-radius: 50%;
}
.dashboard-intro { position: relative; z-index: 1; }
.dashboard-welcome h1 {
  max-width: 13ch;
  margin-bottom: .7rem;
  color: white;
  font-size: clamp(2rem, 5.8vw, 3.65rem);
  letter-spacing: -.055em;
  text-wrap: balance;
}
.dashboard-welcome .lead { max-width: 44rem; font-size: clamp(1rem, 2vw, 1.13rem); }
.hero-quick-links { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.25rem; }
.hero-quick-links .button { min-height: 3rem; }
.hero-quick-links .button:first-child { color: #0750a0; background: white; border-color: white; }
.hero-quick-links .button.secondary { color: white; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.45); }
.dashboard-score {
  position: relative;
  z-index: 1;
  min-height: 12rem;
  align-content: center;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
}
.dashboard-score span { color: #e7f4ff; }
.dashboard-score .button { color: var(--accent-dark); border-color: white; background: white; }
.dashboard-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin-top: .85rem;
}
.dashboard-highlights > span {
  display: grid;
  gap: .08rem;
  padding: .8rem 1rem;
  border: 1px solid #d6e7f6;
  border-radius: 1rem;
  background: linear-gradient(145deg, white, #edf7ff);
  box-shadow: 0 6px 18px rgba(24, 88, 141, .05);
}
.dashboard-highlights strong { color: var(--accent-dark); font-size: .93rem; }
.dashboard-highlights small { color: var(--muted); font-size: .73rem; }

.panel, .card, .feature, .stat-tile, .library-folder, .course-material,
.progress-tile, .progress-chart, .notification-list, .resource-card,
.timetable-card, .group-card, .video-card, .affairs-year,
.support-faq details, .course-intro, .auth-card, .ebook-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px rgba(26, 79, 128, .07);
}
.panel:hover, .card:hover, .shortcut:hover {
  border-color: #bfd9ef;
  box-shadow: 0 14px 32px rgba(26, 101, 166, .11);
}
.card-cover, .card-cover.alt-1, .card-cover.alt-2, .book-cover {
  color: white;
  background: linear-gradient(140deg, #0d6ed5, #28a4ea);
}
.card-cover.alt-1 { background: linear-gradient(140deg, #176ecb, #5c8ee5); }
.card-cover.alt-2 { background: linear-gradient(140deg, #0a8c9e, #31b9bd); }
.card-cover span { color: white; border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.10); }
.card {
  border-radius: 1.35rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); }
.card .card-cover, .card > .cover-gallery { border-radius: 1.35rem 1.35rem .8rem .8rem; }
.card-body h3 { font-size: 1.18rem; color: var(--ink); }
.card-body { min-height: 0; }
.card-footer .button { box-shadow: 0 6px 14px rgba(23,121,223,.18); }
.card .price, .price { color: var(--accent-dark); }
.badge {
  color: #0a6c43;
  background: var(--positive-bg);
}
.live-badge { color: #a04408; background: #fff1db; }

.shortcut-grid { gap: .8rem; }
.shortcut {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: white;
  box-shadow: 0 7px 20px rgba(27, 84, 132, .06);
}
.shortcut-icon {
  color: white !important;
  background: linear-gradient(145deg, #1b82e1, #31a6ed) !important;
  box-shadow: 0 6px 14px rgba(23, 121, 223, .18);
}
.shortcut:nth-child(3n+2) .shortcut-icon { background: linear-gradient(145deg, #12a1a8, #39c3c3) !important; }
.shortcut:nth-child(3n) .shortcut-icon { background: linear-gradient(145deg, #4f70d8, #7c8ee8) !important; }
.shortcut strong { color: var(--ink); }
.shortcut small { color: var(--muted); }

.section-heading h2 { font-weight: 780; }
.section-kicker {
  display: block;
  margin-bottom: .18rem;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.section-heading a { color: var(--accent); font-weight: 750; }
.stat-tile { background: linear-gradient(155deg, #fff, #f2f8fe); }
.profile-menu-row {
  border-color: var(--line);
  background: white;
}
.profile-menu-icon, .profile-social a {
  color: var(--accent-dark);
  background: var(--accent-soft);
}
.avatar, .profile-avatar .avatar { color: white; background: linear-gradient(145deg, #197fe0, #2eb1e8); }
.admin-area-card {
  border: 1px solid var(--line);
  background: white;
  box-shadow: 0 7px 22px rgba(22, 85, 140, .07);
}
.admin-area-icon, .admin-add {
  color: white;
  background: linear-gradient(145deg, #197de0, #35a9ea);
}
.admin-analytics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.admin-stat { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .7rem; padding: .9rem; background: linear-gradient(145deg, white, #eef7ff); }
.admin-stat .admin-stat-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .8rem; color: white; background: linear-gradient(145deg, #1779df, #2fa9eb); }
.admin-stat-icon svg { width: 1.25rem; height: 1.25rem; }
.admin-stat-copy { display: grid; gap: .05rem; min-width: 0; }
.admin-stat-copy > span { color: var(--muted); font-size: .75rem; font-weight: 750; }
.admin-stat-copy > strong { color: var(--accent-dark); font-size: 1.5rem; line-height: 1.1; overflow-wrap: anywhere; }
.admin-stat-copy small { color: var(--muted); font-size: .75rem; line-height: 1.3; }
.admin-stat.stat-share { grid-column: span 1; background: linear-gradient(145deg, #effff8, #e4f8f0); }
.admin-stat.stat-share .admin-stat-icon { background: linear-gradient(145deg, #12865c, #28ad7a); }
.admin-stat strong, .result-value { color: var(--accent-dark); }
.manage-item { border-left: 4px solid var(--accent); }
.course-folder-header-with-back { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.course-folder-header-with-back .course-folder-heading { min-width: 0; overflow-wrap: anywhere; }
#main .course-folder-header-with-back .button.course-folder-back {
  width: 2.75rem; height: 2.75rem; min-width: 2.75rem; min-height: 2.75rem;
}
.free-material-manage-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: .2rem .65rem; padding: .75rem;
}
.free-material-manage-item > h3 { grid-column: 1; grid-row: 1; margin: 0; overflow-wrap: anywhere; }
.free-material-manage-item > p.muted { grid-column: 1; grid-row: 2; margin: 0; overflow-wrap: anywhere; }
.free-material-manage-item > .actions { grid-column: 2; grid-row: 1 / 3; justify-content: flex-end; }
.free-material-manage-item > .status { grid-column: 1 / -1; }
.free-material-manage-item > .status:empty { display: none; }
.free-material-manage-item:has(.confirm-prompt) > .actions { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; }
.free-material-folder-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.free-material-folder-actions { margin-left: auto; min-width: 0; max-width: 100%; }
.free-material-folder-actions .actions { justify-content: flex-end; }
.free-material-folder-actions .confirm-prompt { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.free-material-folder-form > .status { grid-column: 1 / -1; }
.manage-test-item {
  padding: 0;
  border: 1px solid #d5e5f4;
  border-left: 4px solid #1683e6;
  border-radius: 1rem;
  background: linear-gradient(145deg, #fff 20%, #f5faff 100%);
  box-shadow: 0 8px 20px rgba(20, 92, 153, .07);
}
.manage-test-course {
  overflow: hidden;
  border: 1px solid #d5e5f4;
  border-left: 4px solid #1683e6;
  border-radius: 1rem;
  background: linear-gradient(145deg, #fff 20%, #f5faff 100%);
  box-shadow: 0 8px 20px rgba(20, 92, 153, .07);
}
.manage-test-course > .manage-course-summary { min-height: 3.8rem; }
.manage-test-course-title { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.manage-test-course-title .badge { color: #24558a; background: #eaf4ff; }
.manage-test-course-list { display: grid; gap: .6rem; padding: 0 .75rem .75rem; }
.manage-test-course-list .manage-test-item { margin: 0; box-shadow: 0 3px 10px rgba(20, 92, 153, .045); }
.manage-test-summary { min-height: 3.1rem; padding: .65rem .8rem; font-size: .94rem; }
.manage-test-summary-title { min-width: 0; overflow-wrap: anywhere; }
.manage-test-item .manage-item-body { grid-template-columns: minmax(0, 1fr); gap: .75rem; padding: .95rem; }
.manage-test-item .manage-main { min-width: 0; }
.manage-test-item .manage-title h3 { color: #18395c; }
.manage-test-item .test-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  color: #24558a;
  background: #eaf4ff;
}
.manage-test-item .test-mode-badge.live { color: #a44c17; background: #fff0e3; }
.manage-test-item .test-mode-badge .line-icon { width: .9rem; height: .9rem; }
.manage-test-item .manage-date { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.manage-test-item .manage-date > .line-icon { width: 1rem; height: 1rem; color: #5a7899; }
.manage-test-item .manage-details li {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .6rem;
  border: 1px solid #e1edf7;
  background: #fff;
  color: #49627c;
}
.manage-test-item .manage-details .line-icon { width: .95rem; height: .95rem; color: #3284c7; }
.manage-test-item .manage-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: .7rem;
  border-top: 1px solid #e2edf7;
}
.manage-test-item .manage-actions .button { min-height: 2.55rem; border-radius: .75rem; }
.manage-test-item .manage-actions .line-icon { width: 1rem; height: 1rem; margin-right: .4rem; }
.manage-test-item .manage-actions { align-items: center; gap: .45rem; }
.manage-test-item .manage-actions button,
.manage-test-item .manage-actions .button { gap: .4rem; }
.manage-test-item .manage-actions .confirm-delete > button { display: inline-flex; align-items: center; gap: .4rem; }
.admin-section-actions .admin-add .line-icon { width: 1.3rem; height: 1.3rem; }
.manage-test-item .manage-note {
  max-width: none;
  margin: 0;
  padding: .55rem .7rem;
  border-radius: .7rem;
  color: #546b83;
  background: #edf4fa;
}
.manage-test-item .status { margin: 0; }
.admin-section-toolbar h2 { flex: 1; min-width: 0; color: var(--ink); }
.subject-question-manager { display: grid; gap: .8rem; }
.subject-question-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.subject-question-toolbar h3 { margin: 0; }
.subject-question-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: .8rem; }
.subject-question-card { display: grid; align-content: start; gap: .7rem; min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface); }
.subject-question-heading { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.subject-question-heading strong { overflow: hidden; text-overflow: ellipsis; }
.subject-question-count { flex: none; padding: .2rem .5rem; border-radius: 2rem; color: var(--accent-dark); background: var(--accent-soft); font-weight: 700; }
.subject-question-card .confirm-delete { margin-top: .15rem; }
.subject-question-manager .subject-question-toolbar {
  min-height: 4.5rem;
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.subject-question-manager .subject-add-button {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--target);
  min-width: var(--target);
  min-height: var(--target);
  padding: .55rem;
  border: 1px solid #1972c8;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #1683e6, #3468d9);
  box-shadow: 0 6px 15px rgba(28, 110, 211, .2);
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.subject-question-manager .subject-add-button:hover {
  color: #fff;
  background: linear-gradient(135deg, #0d72ce, #2857c7);
  box-shadow: 0 9px 20px rgba(28, 110, 211, .27);
  transform: translateY(-1px);
}
.subject-question-manager .subject-add-button .line-icon {
  width: 1.3rem;
  height: 1.3rem;
}
.subject-question-manager .subject-add-button:focus-visible {
  outline: 3px solid rgba(22, 131, 230, .35);
  outline-offset: 3px;
}
.support-ticket {
  display: grid;
  gap: .4rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: white;
}
.support-ticket + .support-ticket { margin-top: .65rem; }
.support-phone { color: var(--accent-dark); font-weight: 800; text-decoration: none; }
.support-ticket .entry-text { margin: 0; color: var(--ink); line-height: 1.55; white-space: pre-wrap; }
.legal-list { display: grid; gap: .75rem; margin: 0; padding-left: 1.25rem; }
.exam-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.exam-choice { display: flex; align-items: center; gap: .55rem; min-height: 3rem; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .8rem; background: white; cursor: pointer; }
.exam-choice:has(input:checked) { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.exam-choice input { flex: none; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.exam-choice span { font-size: .85rem; font-weight: 700; line-height: 1.25; }
.actions { align-items: center; }
.actions > .button, .actions > button { flex: 0 1 auto; }
.test-series-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .7rem; }
.test-series-row .actions { justify-content: end; max-width: 12rem; }
.test-series-row .button, .test-series-row button { min-height: 2.7rem; padding: .55rem .9rem; white-space: normal; text-align: center; }
.test-row-actions { flex-wrap: wrap; }
.first-attempt-score { color: #17613f; font-size: .85rem; font-weight: 750; white-space: nowrap; }
.test-series-action { gap: .45rem; border-radius: .8rem; font-weight: 750; transition: transform .16s ease, box-shadow .16s ease; }
.test-series-action .line-icon { width: 1.05rem; height: 1.05rem; flex: none; }
.test-series-action:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(24, 70, 120, .12); }
.test-series-leaderboard { color: #17613f; border-color: #c5e7d3; background: #edf8f1; }
.test-series-leaderboard:hover { color: #124e33; background: #e0f2e7; }
.test-series-paper { color: #3e4e9a; border-color: #ced7f3; background: #f0f3ff; }
.test-series-paper:hover { color: #303e82; background: #e4eaff; }
.test-download-action { display: flex; flex-direction: column; align-items: flex-start; }
.test-start-button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-width: 8.5rem; border-radius: .9rem; }
.test-start-button svg { width: 1.1rem; height: 1.1rem; transition: transform .18s ease; }
.test-start-button:hover svg { transform: translateX(3px); }
.download-row { grid-template-columns: minmax(0,1fr) auto; }
.download-row > button { width: auto; white-space: nowrap; }
.notification-list { display: grid; gap: .55rem; padding: .8rem; }
.notification-card { padding: .85rem; border: 1px solid var(--line); border-radius: .9rem; background: white; }
.admin-area-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.admin-area-group { display: grid; gap: .55rem; }
.admin-area-group h2 { margin: 0; padding-left: .2rem; color: var(--accent-dark); font-size: 1rem; letter-spacing: .01em; }
.admin-area-group-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .65rem; }
.admin-area-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-content: center;
  row-gap: .15rem;
  min-height: 5.25rem;
}
.admin-area-card :is(strong, small) { min-width: 0; overflow-wrap: anywhere; }
main:is([data-page="admin"], [data-page="admin-publish-test"]):has(.admin-section-toolbar) > :is(.lead, .admin-analytics) { display: none; }
@media (max-width: 700px) {
  #auth-form .auth-alternatives { gap: .5rem; }
  .admin-analytics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .admin-stat { padding: .75rem; gap: .55rem; }
  .admin-stat-icon { width: 2.25rem; height: 2.25rem; border-radius: .7rem; }
  .admin-stat-copy > strong { font-size: clamp(1.1rem, 5vw, 1.45rem); }
  .admin-area-group-grid { grid-template-columns: 1fr; }
  .test-series-row { grid-template-columns: 1fr; }
  .test-series-row .actions { justify-content: flex-start; max-width: none; }
  .test-series-row .actions .button { min-width: 7rem; }
  .download-row { grid-template-columns: 1fr; }
  .download-row > button { justify-self: start; width: auto; }
  .leaderboard-summary { grid-template-columns: 1fr; }
  .leaderboard-summary > div:first-child { grid-column: auto; }
  .leaderboard-podium { grid-template-columns: 1fr; min-height: 0; }
  .podium-place.place-1, .podium-place.place-2, .podium-place.place-3 { min-height: 0; order: initial; }
  .exam-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.legal-list li { padding-left: .2rem; line-height: 1.65; }
[data-page="privacy"] main, [data-page="terms"] main { max-width: 62rem; }
[data-page="privacy"] main > .panel, [data-page="terms"] main > .panel { margin-bottom: .85rem; }
[data-page="privacy"] main > .panel p, [data-page="terms"] main > .panel p { margin-bottom: 0; color: var(--muted); line-height: 1.7; }

#main[data-page="test-series"] > h1 { margin-bottom: .45rem; color: #153a64; font-size: clamp(1.9rem, 5vw, 2.6rem); }
#main[data-page="test-series"] > .lead { max-width: 44rem; margin-bottom: 1.35rem; }
#main[data-page="test-series"] .library-panel { display: grid; gap: 1rem; padding: 0; border: 0; background: transparent; box-shadow: none; }
#main[data-page="test-series"] .test-series-course-list { display: grid; gap: 1rem; }
#main[data-page="test-series"] .library-folder {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .9rem;
  padding: clamp(1rem, 4vw, 1.4rem);
  overflow: hidden;
  border-color: #d3e6f7;
  background: linear-gradient(145deg, #fff 25%, #f0f8ff 100%);
  box-shadow: 0 12px 30px rgba(20, 92, 153, .09);
}
#main[data-page="test-series"] .library-folder > .folder-icon { grid-row: 1 / 3; align-self: center; }
#main[data-page="test-series"] .library-folder > .button { grid-column: 2; justify-self: start; margin-top: .15rem; }
#main[data-page="test-series"] .folder-icon {
  width: 3.25rem;
  height: 3.25rem;
  color: #fff;
  background: linear-gradient(145deg, #1683e6, #41b4ed);
  box-shadow: 0 6px 14px rgba(23, 121, 223, .2);
}
#main[data-page="test-series"] .folder-icon .line-icon { width: 1.5rem; height: 1.5rem; }
#main[data-page="test-series"] .library-folder-content { grid-column: 1 / -1; }
#main[data-page="test-series"] .library-folder-content > h2 { color: #18395c; font-size: 1.15rem; }
#main[data-page="test-series"] .library-folder-content .entries { margin-top: .9rem; }
#main[data-page="test-series"] .library-folder-content .entries li {
  padding: 1rem;
  border: 1px solid #e1edf7;
  border-radius: 1rem;
  background: rgba(255,255,255,.9);
}
#main[data-page="test-series"] .test-series-row > div:first-child strong { display: block; color: #253d5b; line-height: 1.45; }
#main[data-page="test-series"] .test-start-button { min-height: 2.9rem; color: #fff; }
@media (max-width: 700px) {
  #main[data-page="test-series"] .library-folder { gap: .75rem; }
  #main[data-page="test-series"] .library-folder-content .entries li { padding: .85rem; }
  #main[data-page="test-series"] .test-series-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: .65rem;
  }
  #main[data-page="test-series"] .test-series-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
  #main[data-page="test-series"] .test-series-row .actions {
    justify-content: flex-start;
    max-width: none;
    width: 100%;
  }
  #main[data-page="test-series"] .test-start-button { min-width: 8rem; }
}

.exam-topbar, .exam-sidebar, .exam-question {
  border-color: var(--line);
  background: white;
  box-shadow: 0 8px 24px rgba(25, 78, 122, .07);
}
.question-tile { color: var(--accent-dark); border-color: #bed5e8; background: white; }
.question-tile.answered { color: white; border-color: #168453; background: #168453; }
.question-tile.unanswered { color: white; border-color: #d94a4a; background: #d94a4a; }
.question-tile.marked { color: #7a4a05; border-color: #efbd70; background: #fff3d9; }
.question-tile.answered-marked { color: #613700; border-color: #edae38; background: #ffc65d; }
.exam-counters span { background: #edf6ff; }
.exam-option { border-color: #d4e3ef; background: white; }
.exam-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.exam-shell { display: grid; gap: .85rem; }
.exam-subject-tabs {
  display: flex;
  gap: .55rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: .2rem .1rem .5rem;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.exam-subject-tab {
  display: grid;
  flex: 0 0 auto;
  justify-items: start;
  gap: .1rem;
  min-width: 9rem;
  min-height: 3.25rem;
  padding: .5rem .85rem;
  border: 1px solid #d5e2ef;
  border-radius: .9rem;
  color: #53677e;
  background: #f5f8fc;
  box-shadow: none;
  text-align: left;
}
.exam-subject-tab > span { font-size: .88rem; font-weight: 780; }
.exam-subject-tab > small { color: inherit; font-size: .7rem; font-weight: 600; opacity: .8; }
.exam-subject-tab[aria-selected="true"] {
  color: white;
  border-color: #0871cf;
  background: linear-gradient(135deg, #218be7, #0868c2);
  box-shadow: 0 5px 14px rgba(8, 104, 194, .2);
}
.exam-subject-tab:hover:not([aria-selected="true"]) { color: var(--accent-dark); border-color: #9eb9d4; background: #eaf3fb; }
.exam-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--muted);
}
.exam-scoring { display: flex; flex-wrap: wrap; gap: .45rem; min-width: 0; }
.score-chip { display: grid; gap: .05rem; min-width: 8.5rem; padding: .4rem .65rem; border: 1px solid; border-radius: .75rem; line-height: 1.25; }
.score-chip > span { font-size: .72rem; font-weight: 650; }
.score-chip > strong { font-size: .9rem; }
.score-correct { color: #17653e; border-color: #c6ead5; background: #e8f7ee; }
.score-penalty { color: #a02b36; border-color: #f0ccd0; background: #fff0f1; }
.score-neutral { color: #52657b; border-color: #dce5ef; background: #f3f6fa; }
.exam-timer {
  flex: none;
  min-width: 5.3rem;
  padding: .45rem .7rem;
  border-radius: .75rem;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.exam-timer.danger { color: #a92332; background: #fff0f1; }
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 19rem); gap: .9rem; align-items: start; }
.exam-main { display: grid; gap: .65rem; min-width: 0; }
.exam-question-navigation { display: flex; justify-content: space-between; gap: .65rem; }
.exam-question-navigation > button {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  min-width: 3rem;
  min-height: 3rem;
  padding: .65rem;
  border-radius: .9rem;
}
.exam-question-navigation .line-icon { width: 1.35rem; height: 1.35rem; }
.exam-question, .exam-sidebar { min-width: 0; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: 1.25rem; }
.exam-question { display: grid; gap: .85rem; }
.exam-question-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.exam-question h2 { margin: .25rem 0 .2rem; font-size: clamp(1.25rem, 3vw, 1.65rem); line-height: 1.4; }
.exam-option {
  display: grid;
  grid-template-columns: auto 2.25rem minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  min-height: 3.6rem;
  margin: 0;
  padding: .7rem .85rem;
  border: 1px solid #d5e2ef;
  border-radius: .95rem;
  color: var(--ink);
  background: white;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.exam-option:hover, .exam-option:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,121,223,.1); }
.exam-option input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--accent); }
.exam-option:has(input:checked) { color: var(--accent-dark); border-color: var(--accent); background: #edf6ff; box-shadow: inset 0 0 0 1px var(--accent); }
.option-letter { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .65rem; color: var(--accent-dark); background: #eaf3fb; font-weight: 800; }
.exam-option:has(input:checked) .option-letter { color: white; background: var(--accent); }
.option-text { min-width: 0; line-height: 1.45; }
.exam-sidebar h3 { margin-bottom: .85rem; }
.exam-counters span { min-height: 3.5rem; align-content: center; border: 1px solid #dce8f3; font-size: .73rem; font-weight: 700; }
.exam-counters .counter-answered { color: #17653e; border-color: #c6ead5; background: #e8f7ee; }
.exam-counters .counter-marked { color: #805100; border-color: #f0dfb8; background: #fff6df; }
.exam-counters .counter-unanswered { color: #59677a; border-color: #dce5ef; background: #f3f6fa; }
.exam-counters strong { font-size: 1.2rem; }
.question-palette { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.question-tile {
  min-width: 0;
  min-height: 2.75rem;
  aspect-ratio: 1;
  padding: .2rem;
  border: 1px solid #d0ddeb;
  border-radius: .75rem;
  color: #394c65;
  background: #f5f8fc;
  box-shadow: none;
}
.question-tile:hover { border-color: var(--accent); color: var(--accent-dark); background: #eaf5ff; }
.question-tile.answered { color: white; border-color: #168453; background: #168453; }
.question-tile.marked { color: #684300; border-color: #edbd61; background: #fff1cd; }
.question-tile.unanswered { color: #394c65; border-color: #d0ddeb; background: #f5f8fc; }
.question-tile.answered-marked { color: white; border-color: #6951c8; background: #6951c8; }
.question-tile[aria-current="step"] { outline: 3px solid #1688e5; outline-offset: 2px; }
.exam-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.exam-actions > button {
  min-width: 0;
  min-height: 3.25rem;
  padding: .65rem .8rem;
  border-radius: .95rem;
  font-weight: 760;
  box-shadow: 0 4px 12px rgba(24, 70, 120, .09);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.exam-actions > button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(24, 70, 120, .14); }
.exam-question-navigation .exam-prev-button { color: #35506d; border-color: #c9d8e8; background: #f5f8fc; }
.exam-question-navigation .exam-prev-button:hover { color: #193e68; border-color: #9eb9d4; background: #eaf3fb; }
.exam-question-navigation .exam-next-button { color: #fff; border-color: #0871cf; background: linear-gradient(135deg, #218be7, #0868c2); }
.exam-question-navigation .exam-next-button:hover { color: #fff; border-color: #0758a8; background: linear-gradient(135deg, #1678d0, #0758a8); }
.exam-actions .exam-mark-button { color: #805100; border-color: #edcc83; background: #fff8e7; }
.exam-actions .exam-mark-button:hover { color: #674000; border-color: #dcae4e; background: #fff0c8; }
.exam-actions .exam-mark-button.is-marked { color: #684100; border-color: #dba638; background: #ffedbd; box-shadow: inset 4px 0 #dba638, 0 4px 12px rgba(24, 70, 120, .09); }
.exam-actions .exam-submit-button { color: white; border-color: #126c58; background: linear-gradient(135deg, #17866b, #10624f); }
.exam-actions .exam-submit-button:hover { color: white; border-color: #0d5142; background: linear-gradient(135deg, #13765e, #0d5142); }
.exam-actions > button:disabled, .exam-question-navigation > button:disabled { opacity: .48; cursor: not-allowed; }
.exam-confirm-dialog {
  width: min(30rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  overflow: auto;
  border: 1px solid #d5e3f1;
  border-radius: 1.4rem;
  color: var(--ink);
  background: white;
  box-shadow: 0 24px 80px rgba(13, 35, 57, .25);
}
.exam-confirm-dialog::backdrop { background: rgba(10, 25, 45, .55); backdrop-filter: blur(4px); }
.exam-confirm-icon { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; margin-bottom: 1rem; border-radius: 1rem; color: #0d65bb; background: #eaf4ff; }
.exam-confirm-icon .line-icon { width: 1.6rem; height: 1.6rem; }
.exam-confirm-dialog h2 { margin: 0 0 .65rem; font-size: 1.35rem; }
.exam-confirm-dialog p { margin: 0; color: var(--muted); line-height: 1.6; }
.exam-confirm-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-block: 1.25rem; }
.exam-confirm-summary > div { display: grid; gap: .25rem; padding: .8rem .35rem; border: 1px solid #e0eaf4; border-radius: .8rem; background: #f5f9fe; text-align: center; }
.exam-confirm-summary strong { color: #144e86; font-size: 1.35rem; }
.exam-confirm-summary span { color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.exam-confirm-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.exam-confirm-actions > button { min-width: 0; min-height: 3rem; padding: .65rem .5rem; border-radius: .8rem; }
.exam-confirm-actions .exam-confirm-submit { border-color: #126c58; color: white; background: #13745e; }
.exam-confirm-actions .exam-confirm-submit:hover { background: #0d5c4a; }
@media (max-width: 700px) {
  .exam-topbar { align-items: flex-start; }
  .exam-scoring { flex: 1; }
  .score-chip { min-width: 0; }
  .exam-layout { grid-template-columns: minmax(0, 1fr); }
  .exam-sidebar { order: 2; }
  .exam-question { gap: .75rem; }
  .exam-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .exam-actions > button { width: 100%; }
}
.leaderboard-shell { display: grid; gap: 1rem; }
.leaderboard-summary {
  display: grid;
  grid-template-columns: 1.5fr repeat(2, minmax(0, 1fr));
  gap: .7rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #0d6fd6, #26a9ed);
  color: white;
  box-shadow: var(--shadow);
}
.leaderboard-summary > div { display: grid; gap: .12rem; }
.leaderboard-summary span { color: #dcefff; font-size: .73rem; }
.leaderboard-summary strong { font-size: 1rem; }
.leaderboard-you { grid-column: 1 / -1; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: .7rem; padding: .7rem 1rem; border-radius: .9rem; background: rgba(255,255,255,.15); }
.leaderboard-you strong { font-size: 1.45rem; }
.leaderboard-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: .65rem; min-height: 15rem; padding-inline: .5rem; }
.podium-place { display: grid; justify-items: center; align-content: start; gap: .35rem; padding: 1rem .55rem; border: 1px solid var(--line); border-radius: 1.15rem 1.15rem .5rem .5rem; background: white; box-shadow: var(--shadow); text-align: center; }
.podium-place.place-1 { min-height: 14rem; background: linear-gradient(#fff9e7, white); order: 2; border-color: #f1cf64; }
.podium-place.place-2 { min-height: 12rem; order: 1; }
.podium-place.place-3 { min-height: 11rem; order: 3; }
.podium-place.mine { outline: 3px solid rgba(23,121,223,.24); }
.podium-medal { font-size: 1.7rem; }
.podium-avatar { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%; color: white; background: linear-gradient(145deg, #1779df, #2aadee); font-weight: 850; }
.podium-place b { color: var(--accent-dark); font-size: 1.2rem; }
.podium-place small { color: var(--muted); }
.leaderboard-list { display: grid; gap: .55rem; }
.leaderboard-list h2 { margin-bottom: .2rem; }
.leaderboard-row { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface-raised); }
.leaderboard-row.mine { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.leaderboard-rank { color: var(--accent-dark); font-size: 1.05rem; font-weight: 850; }
.leaderboard-student, .leaderboard-score { display: grid; gap: .1rem; }
.leaderboard-student small, .leaderboard-score small { color: var(--muted); }
.leaderboard-score { justify-items: end; color: var(--accent-dark); }
.leaderboard-locked { padding: .75rem 1rem; border: 1px solid #efcd8f; border-radius: .85rem; color: #7a4a05; background: #fff7e8; font-weight: 700; text-align: center; }
.exam-result {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 1.5rem);
  border: 1px solid #dce8f4;
  border-radius: 1.4rem;
  background: linear-gradient(145deg, #fff, #f3f9ff);
  box-shadow: 0 12px 30px rgba(20, 92, 153, .08);
}
.exam-result > h2 { margin-bottom: .1rem; color: #173c62; text-align: center; }
.result-score {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .05rem;
  width: 10.5rem;
  aspect-ratio: 1;
  margin: .35rem auto;
  background: conic-gradient(from 0deg, #0c9a8d 0 var(--score-progress, 0%), #d9f1ee var(--score-progress, 0%) 100%);
  border-radius: 50%;
  color: var(--accent-dark);
}
.result-score::before {
  position: absolute;
  z-index: 0;
  inset: .65rem;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 1px 5px rgba(22, 57, 91, .08);
  content: "";
}
.result-score > * { position: relative; z-index: 1; }
.result-score strong { font-size: 2.6rem; line-height: 1.05; }
.result-score span { color: var(--muted); font-size: .9rem; font-weight: 750; }
.result-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .65rem; }
.result-stats > span { display: grid; justify-items: center; gap: .15rem; padding: .85rem .55rem; border: 1px solid #dce8f4; border-radius: .95rem; background: #f0f7fd; color: var(--accent-dark); text-align: center; }
.result-stats > span strong { font-size: 1.35rem; line-height: 1.1; }
.result-stats > span small { font-size: .75rem; font-weight: 700; }
.result-stats > .result-stat-correct { color: #116f43; border-color: #ccebd8; background: #e8f7ee; }
.result-stats > .result-stat-incorrect { color: #a22f35; border-color: #f1d2d4; background: #fff0f1; }
.question-review { margin-top: .15rem; padding-top: 1.1rem; border-top: 1px solid #dce8f4; }
.question-review-heading { margin-bottom: .85rem; }
.question-review-heading h3 { margin: 0 0 .25rem; color: #173c62; font-size: 1.15rem; }
.question-review-heading p { margin: 0; color: var(--muted); font-size: .9rem; }
.question-review-list { display: grid; gap: .75rem; }
.question-review-card {
  display: grid;
  gap: .7rem;
  min-width: 0;
  padding: clamp(.8rem, 3vw, 1rem);
  border: 1px solid #dce8f4;
  border-inline-start: .3rem solid #94a9bb;
  border-radius: 1rem;
  background: rgba(255,255,255,.92);
}
.question-review-card.is-correct { border-inline-start-color: #15925b; }
.question-review-card.is-incorrect { border-inline-start-color: #d34b52; }
.question-review-card.is-unattempted { border-inline-start-color: #d29325; }
.question-review-card-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem; }
.question-review-number { color: #173c62; font-weight: 800; }
.question-review-status, .question-review-section {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: .2rem .55rem;
  border: 1px solid #dce8f4;
  border-radius: 999px;
  background: #f0f7fd;
  color: #315776;
  font-size: .75rem;
  font-weight: 800;
}
.is-correct > .question-review-card-heading .question-review-status { border-color: #ccebd8; background: #e8f7ee; color: #116f43; }
.is-incorrect > .question-review-card-heading .question-review-status { border-color: #f1d2d4; background: #fff0f1; color: #a22f35; }
.is-unattempted > .question-review-card-heading .question-review-status { border-color: #efcd8f; background: #fff7e8; color: #7a4a05; }
.question-review-prompt { margin: 0; color: #203d57; font-weight: 700; line-height: 1.55; overflow-wrap: anywhere; }
.question-review-unanswered { margin: -.25rem 0 0; color: #7a4a05; font-size: .85rem; font-weight: 700; }
.question-review-options { display: grid; gap: .45rem; }
.question-review-option {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .4rem .6rem;
  min-width: 0;
  padding: .55rem .65rem;
  border: 1px solid #e0e9f1;
  border-radius: .75rem;
  background: #fbfdff;
}
.question-review-option.is-correct-answer { border-color: #b9e3ca; background: #f0faf4; }
.question-review-option.is-selected-incorrect { border-color: #efc3c6; background: #fff5f5; }
.question-review-letter { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: .55rem; background: #eaf2f8; color: #315776; font-size: .8rem; font-weight: 850; }
.is-correct-answer .question-review-letter { background: #d9f1e2; color: #116f43; }
.is-selected-incorrect .question-review-letter { background: #fbe0e1; color: #a22f35; }
.question-review-option-text { min-width: 0; color: #304b62; line-height: 1.45; overflow-wrap: anywhere; }
.question-review-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3rem; }
.question-review-tag { padding: .2rem .45rem; border-radius: 999px; background: #eaf2f8; color: #315776; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.question-review-tag.is-your-answer { background: #fbe0e1; color: #a22f35; }
.question-review-tag.is-correct-tag { background: #d9f1e2; color: #116f43; }
.is-correct .question-review-tag.is-your-answer { background: #d9f1e2; color: #116f43; }
.result-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .65rem; }
.result-actions > .button, .result-actions > button {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  gap: .75rem;
  min-width: 0;
  min-height: 3.2rem;
  padding: .7rem .85rem;
  border-radius: .95rem;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(24, 70, 120, .08);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.result-actions .line-icon { width: 1.8rem; height: 1.8rem; flex: none; padding: .3rem; border-radius: .55rem; }
.result-actions > .button:hover, .result-actions > button:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(24, 70, 120, .14); }
.result-actions .result-action-back { color: white; border-color: #126c58; background: linear-gradient(135deg, #17866b, #10624f); }
.result-actions .result-action-back:hover { color: white; border-color: #0d5142; background: linear-gradient(135deg, #13765e, #0d5142); }
.result-actions .result-action-back .line-icon { background: rgba(255,255,255,.17); }
.result-actions .result-action-download { color: #0d4ea6; border-color: #b7d4ee; background: #edf6ff; }
.result-actions .result-action-paper { color: #5138a2; border-color: #d3c8ef; background: #f5f0ff; }
.result-actions .result-action-leaderboard { color: #17653e; border-color: #c6ead5; background: #e8f7ee; }
.result-actions .result-action-download .line-icon { background: #dceeff; }
.result-actions .result-action-paper .line-icon { background: #e9e0ff; }
.result-actions .result-action-leaderboard .line-icon { background: #d4efdf; }
.result-actions .result-action-download:hover { background: #deefff; }
.result-actions .result-action-paper:hover { background: #ece3ff; }
.result-actions .result-action-leaderboard:hover { background: #d9f2e3; }
@media (max-width: 640px) {
  .result-stats { gap: .45rem; }
  .result-stats > span { padding: .7rem .35rem; }
  .question-review-option { grid-template-columns: 1.8rem minmax(0, 1fr); }
  .question-review-tags { grid-column: 2; justify-content: flex-start; }
  .result-actions { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .subject-question-manager .subject-question-toolbar { flex-direction: row; }
}
.publish-test-panel {
  padding: clamp(1rem, 3vw, 1.5rem);
}
.publish-test-panel > h2 {
  margin-bottom: 1rem;
  color: #173c66;
}
.publish-test-panel > .field {
  padding: .9rem;
  border: 1px solid #d5e4f2;
  border-radius: .9rem;
  background: #f5f9fe;
}
.publish-test-import {
  margin-top: .75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #f8fbff;
}
.publish-test-import h3,
.publish-test-review > h3 {
  margin: 0 0 .85rem;
  color: #23466c;
  font-size: 1rem;
}
.publish-test-import form { gap: .75rem; }
.publish-test-review {
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
.publish-test-form { display: grid; gap: 1rem; }
.publish-test-fields {
  display: grid;
  gap: .85rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.publish-test-fields > .field { margin: 0; }
.publish-test-fields .live-test-fields {
  gap: .85rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: #f8fbff;
}
.publish-test-fields textarea.json { min-height: 15rem; }
.publish-test-submit {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: .5rem;
  min-width: 12rem;
  border-radius: .9rem;
  box-shadow: 0 6px 16px rgba(23, 121, 223, .18);
}
.publish-test-submit .line-icon { width: 1.15rem; height: 1.15rem; }
.admin-edit-screen { min-width: 0; }
.admin-edit-screen > form {
  display: grid;
  gap: .85rem;
  margin: 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}
.admin-edit-screen > form > :is(h3, h4) { margin: 0; color: #173c66; }
.test-wizard-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  padding: 0;
  margin: 0 0 1.5rem;
  list-style: none;
}
.test-wizard-progress li { min-width: 0; }
.test-wizard-progress .test-wizard-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  width: 100%;
  min-height: 5rem;
  padding: .65rem .25rem;
  border: 1px solid #d5e4f2;
  border-radius: .85rem;
  background: #f5f9fe;
  color: #526981;
  font-size: .8rem;
  line-height: 1.35;
  box-shadow: none;
}
.test-wizard-indicator:disabled, .test-wizard-indicator:disabled:hover {
  opacity: 1;
  background: #f5f9fe;
  border-color: #d5e4f2;
  color: #526981;
}
.test-wizard-indicator[aria-current="step"], .test-wizard-indicator[aria-current="step"]:hover {
  border-color: #1779df;
  background: #eaf5ff;
  color: #0d4ea6;
  opacity: 1;
}
.test-wizard-number {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: #e0eaf4;
  color: #365574;
  font-weight: 700;
}
.test-wizard-indicator[aria-current="step"] .test-wizard-number { background: #1779df; color: white; }
.test-wizard-indicator.is-complete .test-wizard-number { background: #e3f7ed; color: #11683e; }
.test-wizard-title { color: #173c66; margin-bottom: .4rem; }
.test-wizard-title:focus { outline: none; }
.test-wizard-description { margin-top: 0; }
.test-wizard-step { display: grid; gap: .85rem; min-width: 0; }
.test-wizard-step > .field { margin: 0; }
.test-wizard-navigation { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.25rem; }
.test-wizard-navigation > button:last-child { margin-left: auto; }
.test-wizard-hint, .test-wizard-summary {
  padding: 1rem;
  border: 1px solid #d5e4f2;
  border-radius: .85rem;
  background: #f0f7ff;
  color: #23466c;
}
.test-subject-import, .test-json-draft {
  min-width: 0;
  padding: .9rem;
  border: 1px solid #d5e4f2;
  border-radius: .85rem;
  background: #f8fbff;
}
.test-subject-import > summary, .test-json-draft > summary { cursor: pointer; color: #23466c; font-weight: 600; }
.test-subject-import[open] > summary, .test-json-draft[open] > summary { margin-bottom: 1rem; }
@media (max-width: 480px) {
  .test-wizard-progress { gap: .3rem; }
  .test-wizard-indicator { font-size: .72rem; }
  .test-wizard-navigation > button { padding-inline: .8rem; font-size: .85rem; }
}
.manage-actions .icon-action .line-icon { margin: 0; }
.manual-question-list { gap: .85rem; }
.manual-question {
  display: grid;
  gap: .8rem;
  padding: 1rem;
  border: 1px solid #d5e4f2;
  border-radius: 1rem;
  background: linear-gradient(145deg, #fff, #f7fbff);
  box-shadow: 0 6px 18px rgba(26, 79, 128, .06);
}
.manual-question > legend { padding-inline: .5rem; color: #23466c; }
.manual-option {
  grid-template-columns: minmax(0, 1fr) 2.75rem;
  align-items: end;
  gap: .55rem;
}
.manual-option > button,
.manual-question > .actions > button,
.manual-add-question {
  display: grid;
  place-items: center;
  width: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: .55rem;
  border-radius: 50%;
}
.manual-option > button { margin: 0 0 .05rem; color: #a82b36; }
.manual-option > button .line-icon,
.manual-question > .actions > button .line-icon,
.manual-add-question .line-icon { width: 1.15rem; height: 1.15rem; }
.manual-question > .actions { justify-content: flex-start; }
.manual-question > .actions button { color: #a82b36; }
.manual-question > .actions:first-of-type button {
  color: var(--accent-dark);
  border-color: #b9cfe3;
}
.manual-questions > .actions { justify-content: center; }
.manual-add-question {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}
.manual-add-question:hover { background: var(--accent-dark); }
@media (max-width: 520px) {
  .publish-test-submit { width: 100%; }
}
.section-results article { display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .85rem; background: white; }
.section-results article small { grid-column: 1 / -1; color: var(--muted); }
.attempt-download { display: grid; justify-items: end; gap: .1rem; margin-top: .35rem; }
.attempt-download .button, .attempt-download button { min-height: 2.4rem; padding: .4rem .75rem; font-size: .78rem; }
.attempt-download .result-download-icon { display: inline-grid; place-items: center; width: 2.75rem; min-width: 2.75rem; height: 2.75rem; padding: 0; border-radius: .85rem; color: white; background: var(--accent); }
.attempt-download .result-download-icon svg { width: 1.15rem; height: 1.15rem; }
.receipt-list { display: grid; gap: .65rem; }
.receipt-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .5rem .8rem; align-items: center; padding: .8rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface-raised); }
.receipt-row > div:first-child { display: grid; gap: .15rem; min-width: 0; }
.receipt-row .status { grid-column: 1 / -1; }
.page-heading-row { display: flex; align-items: center; gap: .55rem; min-width: 0; margin-bottom: .35rem; }
.page-heading-row > h1 { flex: 1; min-width: 0; margin-block: 0; overflow-wrap: anywhere; }
.page-heading-row > .page-back, .page-heading-row > .back { flex: none; margin: 0; }
.page-back { display: inline-grid; place-items: center; width: 2.8rem; height: 2.8rem; min-height: 2.8rem; margin: -.45rem 0 .35rem; padding: 0; border: 1px solid transparent; border-radius: 50%; color: var(--accent-dark); text-decoration: none; }
.page-back:hover { border-color: var(--line); background: white; }
.page-back svg { width: 1.1rem; height: 1.1rem; }
.header-page { display: none; }
main:is([data-page="materials"], [data-page="test-series"], [data-page="current-affairs"], [data-page="course"]) :is(.course-folder-back, .affairs-back),
main:is([data-page="admin"], [data-page="admin-publish-test"]) .admin-section-toolbar .admin-back-button { display: none !important; }
@media (max-width: 700px) {
  body.has-page-header .site-header .brand { display: none; }
  body.has-page-header .header-page:not([hidden]) { display: flex; align-items: center; gap: .5rem; min-width: 0; flex: 1; }
  .header-page-back { flex: none; width: 2.75rem; min-height: 2.75rem; padding: 0; border-radius: .8rem; background: rgba(255,255,255,.15); }
  .header-page-back:hover { background: rgba(255,255,255,.25); }
  .header-page-back .line-icon { width: 1.2rem; height: 1.2rem; }
  .header-page-title { min-width: 0; margin: 0; color: white; font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
  body.has-page-header main .page-heading-row { display: none; }
  body.has-page-header main .admin-section-toolbar .admin-back-button { display: none; }
}
.ebook-payment .payment-choice { display: grid; justify-content: center; gap: .75rem; }
.ebook-payment .payment-choice .payment-methods { justify-content: center; }
.ebook-payment .payment-choice > div:last-child { width: min(100%, 20rem); margin-inline: auto; }
.ebook-payment .qr-card img { width: min(100%, 14rem); }
@media (max-width: 640px) {
  .receipt-row { grid-template-columns: 1fr; }
  .receipt-row button { justify-self: start; }
}
@media (max-width: 700px) {
  .leaderboard-summary { grid-template-columns: 1fr 1fr; }
  .leaderboard-summary > div:first-child { grid-column: 1 / -1; }
  .leaderboard-you { grid-template-columns: auto auto; }
  .leaderboard-you > span:last-child { grid-column: 1 / -1; }
  .leaderboard-podium { gap: .35rem; padding-inline: 0; }
  .podium-place { padding: .8rem .3rem; }
  .podium-place strong { font-size: .82rem; }
}

input:not([type="radio"], [type="checkbox"]), select, textarea, .phone-control {
  border-color: #a9bfd2;
  background: white;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: var(--focus); }
.auth-layout { background: transparent; }
.auth-story .eyebrow { color: var(--accent-dark); }
.auth-card { border-color: var(--line); }

.ebook-cover {
  background:
    radial-gradient(circle at 80% 15%, rgba(255,255,255,.28), transparent 24%),
    linear-gradient(145deg, #0868cf, #25a8eb);
}

@media (max-width: 700px) {
  body { background: linear-gradient(180deg, #eaf5ff 0, var(--bg) 14rem); }
  .header-inner { min-height: 4rem; }
  .site-header .brand { font-size: 1.02rem; }
  .brand-mark { width: 2.6rem; height: 2.6rem; }
  #nav {
    border-top-color: #d2e3f1;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -8px 26px rgba(21, 76, 126, .11);
  }
  #nav a[aria-current="page"] { color: var(--accent-dark); }
  #nav a[aria-current="page"] .nav-indicator {
    color: white;
    background: linear-gradient(145deg, #1779df, #2da8ed);
  }
  .hero, .dashboard-welcome, .referral-hero { border-radius: 1.35rem; }
  .dashboard-welcome { min-height: 0; padding: 1.2rem; grid-template-columns: minmax(0, 1fr); }
  .dashboard-welcome h1 { max-width: 12ch; font-size: clamp(2rem, 10.5vw, 2.65rem); }
  .dashboard-welcome .lead { font-size: .94rem; line-height: 1.55; }
  .dashboard-welcome::after { right: -4rem; bottom: -6rem; }
  .hero-quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
  .hero-quick-links .button { min-width: 0; padding-inline: .7rem; font-size: .76rem; white-space: normal; line-height: 1.25; }
  .dashboard-score { min-height: 0; grid-template-columns: minmax(0, 1fr) auto; padding: .75rem; }
  .dashboard-score small { grid-column: 1; }
  .dashboard-score strong { grid-column: 2; grid-row: 1 / 3; }
  .dashboard-score .button { grid-column: 1 / -1; width: 100%; }
  .dashboard-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .dashboard-highlights > span { padding: .65rem .75rem; border-radius: .85rem; }
  .shortcut-grid { gap: .65rem; }
  .shortcut { min-height: 8rem; border-radius: 1rem; }
  .shortcut::after { display: none; }
  .shortcut-grid .shortcut:nth-child(-n+4) { min-height: 8rem; }
  .shortcut strong { font-size: .9rem; }
  .shortcut small { font-size: .8rem; line-height: 1.4; }
  .panel { border-radius: 1.15rem; }
}

.admin-payment-panel {
  overflow: hidden;
  border: 1px solid #d5e5f4;
  background: linear-gradient(155deg, #fff, #f4f9ff);
}
.admin-payment-panel > h2 {
  margin-bottom: .85rem;
  color: #18395c;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
}
.admin-payment-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: .85rem;
}
.admin-payment-panel .payment-panel-description {
  max-width: 42rem;
  margin: 0;
  line-height: 1.5;
}
.admin-payment-toolbar > button {
  flex: none;
  min-height: 2.55rem;
  border-radius: .8rem;
}
.admin-payment-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: .9rem;
  margin-top: 1rem;
}
.admin-course-payment {
  display: block;
  min-width: 0;
  padding: 0;
  border: 1px solid #d8e6f4;
  border-radius: 1.05rem;
  background: linear-gradient(150deg, #fff 25%, #f6faff);
  box-shadow: 0 8px 22px rgba(20, 92, 153, .08);
}
.admin-course-payment > .manage-course-summary { min-height: 3.65rem; }
.admin-course-payment[open] > .manage-course-summary::after { transform: rotate(90deg); }
.admin-course-payment .payment-request-content { display: grid; gap: .8rem; padding: 0 1rem 1rem; }
.admin-payment-group {
  overflow: hidden;
  border: 1px solid #d5e5f4;
  border-left: 4px solid #1683e6;
  border-radius: 1rem;
  background: linear-gradient(145deg, #fff 20%, #f5faff 100%);
  box-shadow: 0 8px 20px rgba(20, 92, 153, .07);
}
.admin-payment-group-summary { min-height: 4rem; }
.admin-payment-group-title { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.admin-payment-group-title > span:last-child { display: grid; gap: .15rem; min-width: 0; }
.admin-payment-group-title strong { overflow-wrap: anywhere; }
.admin-payment-group-title small { color: var(--muted); font-size: .76rem; font-weight: 650; }
.payment-type-icon { display: grid; place-items: center; flex: none; width: 2.45rem; height: 2.45rem; border-radius: .8rem; color: #176bc0; background: #e8f3ff; }
.payment-type-icon.ebook { color: #7751b5; background: #f0eaff; }
.payment-type-icon .line-icon { width: 1.2rem; height: 1.2rem; }
.admin-payment-group-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.admin-payment-group-badges .badge { margin: 0; white-space: nowrap; }
.admin-payment-group-badges .pending-count { color: #805500; background: #fff0c8; }
.admin-payment-group-list { display: grid; gap: .55rem; padding: 0 .75rem .75rem; }
.admin-payment-group-list .payment-request { margin: 0; }
.payment-request-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .65rem; min-height: 4rem; padding: .65rem .8rem; cursor: pointer; list-style: none; }
.payment-request-summary::-webkit-details-marker { display: none; }
.payment-request-summary::after { content: "›"; color: var(--accent-dark); font-size: 1.35rem; transition: transform .15s ease; }
.payment-request[open] > .payment-request-summary::after { transform: rotate(90deg); }
.payment-request-summary-meta { display: grid; justify-items: end; gap: .25rem; }
.payment-request-summary-meta .request-state { white-space: nowrap; }
.payment-request-amount { color: #16704f; font-size: .92rem; }
.admin-course-payment .payment-request-head {
  align-items: center;
  margin: 0;
  padding-bottom: .75rem;
  border-bottom: 1px solid #e6eef7;
}
.payment-request-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  min-width: 0;
}
.payment-request-avatar {
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid #cfe2f5;
  border-radius: .85rem;
  color: #2164a1;
  background: linear-gradient(145deg, #e7f3ff, #f5faff);
  font-size: .82rem;
  font-weight: 850;
}
.payment-request-identity > div { min-width: 0; }
.payment-request-identity strong { display: block; overflow-wrap: anywhere; color: #1d3854; }
.payment-request-identity p { margin: .15rem 0 0; font-size: .8rem; }
.admin-course-payment .request-state { flex: none; padding: .3rem .6rem; }
.payment-request-course {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .35rem .65rem;
}
.payment-request-course .badge { grid-column: 1 / -1; width: fit-content; margin: 0; }
.payment-request-course h3 {
  min-width: 0;
  margin: 0;
  color: #18395c;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.payment-request-course .price {
  margin: 0;
  color: #16704f;
  font-size: 1.12rem;
  font-weight: 850;
  white-space: nowrap;
}
.admin-course-payment .payment-summary {
  gap: .55rem .75rem;
  margin: 0;
  padding: .75rem;
  border: 1px solid #e3edf7;
  border-radius: .8rem;
  background: #f3f8fe;
  font-size: .78rem;
}
.admin-course-payment .payment-summary dd { overflow-wrap: anywhere; }
.admin-course-payment .payment-request-content > .muted,
.admin-course-payment .payment-request-content > .rejection { margin: 0; }
.admin-course-payment .field { margin: 0; }
.admin-payment-grid .payment-request .actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  padding-top: .2rem;
}
.admin-payment-grid .payment-request .actions button {
  width: auto;
  min-width: 0;
  min-height: 2.7rem;
  padding: .55rem .65rem;
  border-radius: .75rem;
  font-size: .82rem;
  line-height: 1.25;
  white-space: normal;
}
.admin-payment-grid .payment-request .actions .payment-receipt-action { grid-column: 1 / -1; }
.admin-course-payment .payment-request-content > .status { margin: 0; }
.refresh-action { display: inline-flex; align-items: center; gap: .45rem; }
.refresh-action .line-icon { flex: none; width: 1.05rem; height: 1.05rem; }
.refresh-action:hover .line-icon { transform: rotate(45deg); }

@media (max-width: 420px) {
  .admin-payment-toolbar { align-items: stretch; flex-direction: column; }
  .admin-payment-toolbar > button { align-self: flex-start; }
  .payment-request-course { grid-template-columns: minmax(0, 1fr); }
  .payment-request-course .price { margin-top: .15rem; }
}

.my-course-card > .card-cover {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
}
.my-course-card > .cover-gallery {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
}
.my-course-cover:not(:has(.cover-controls)) { aspect-ratio: 16 / 9; }
.my-course-cover:has(.cover-controls) .cover-track { aspect-ratio: 16 / 9; }
.my-course-card > .cover-gallery .cover-photo { height: 100%; aspect-ratio: auto; object-fit: contain; }

/* One shared look for hovered and selected controls on every page. */
:root {
  --state-bg: linear-gradient(135deg, #1a73e8, #0b479e);
  --state-fg: #ffffff;
  --state-border: #0b479e;
}
:is(
  .tab, .course-tab, .my-course-tab, .exam-subject-tab, .chip,
  .admin-tabs button, .admin-subtabs button, .workspace-tabs .tab-button,
  .payment-methods button, .course-payment-dialog .payment-methods button
):is(:hover, [aria-selected="true"], [aria-pressed="true"], [aria-current="page"]):not(:disabled),
:is(.secondary, .text-button, .back, .page-back, .course-folder-entry, .affairs-nav-card):is(:hover, :focus-visible):not(:disabled, .danger) {
  color: var(--state-fg) !important;
  background: var(--state-bg) !important;
  border-color: var(--state-border) !important;
}
:is(.tab, .course-tab, .my-course-tab, .exam-subject-tab, .course-folder-entry, .affairs-nav-card):is(:hover, [aria-selected="true"], [aria-current="page"]) :is(strong, small, span, .tab-count, svg) {
  color: var(--state-fg) !important;
  border-color: transparent;
}
:is(.button, button):not(.secondary, .danger, .icon-action, .tab, .course-tab, .exam-option):hover:not(:disabled) {
  background: var(--state-bg);
  border-color: var(--state-border);
  color: var(--state-fg);
}
.admin-area-card:hover :is(small, .admin-area-arrow) { color: var(--state-fg); }

.affairs-archive { display: block; }
.affairs-archive > .affairs-back { width: auto; }
.affairs-navigation-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 28rem)); gap: 1rem; }
.affairs-year-card { min-height: 8rem; }
.affairs-year-card strong { font-size: 1.5rem; }
.affairs-nav-card { justify-items: center; align-content: center; gap: .5rem; min-height: 11rem; padding: 1.25rem 1rem; text-align: center; border-radius: 1rem; box-shadow: 0 6px 18px rgba(26, 60, 120, .1); }
.affairs-nav-card .affairs-nav-logo { width: 4.5rem; height: 4.5rem; border-radius: 50%; object-fit: cover; }
.affairs-nav-card strong { font-size: 1.15rem; }
.affairs-selection-title { margin: 1.25rem 0 .75rem; color: #17345d; }
.affairs-day { margin-top: 1.5rem; }
.affairs-day > h3 {
  display: inline-flex;
  align-items: center;
  margin: 0 0 .8rem;
  padding: .5rem .85rem;
  border-radius: 999px;
  color: #164b8e;
  background: #e7f1ff;
  font-size: .95rem;
}
.affairs-day-resources { gap: .85rem; }
.affairs-resource-card {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding: 1.1rem 1.2rem;
  border-left: 4px solid #1a73e8;
  border-radius: .9rem;
}
.affairs-resource-heading { align-items: center; }
.affairs-resource-heading h3 { color: #1b2f4d; font-size: 1.05rem; }
.affairs-resource-heading .actions { margin-left: auto; }
.affairs-resource-card > .muted { margin: 0; line-height: 1.55; }
.affairs-resource-card .affairs-media-card {
  width: 100%;
  margin: 0;
  padding: .7rem .8rem;
  border-radius: .7rem;
  background: #f3f7fc;
}
.affairs-resource-card > .button { width: auto; align-self: flex-start; }
.affairs-resource-card details { width: 100%; padding-top: .5rem; border-top: 1px solid #e6edf5; }
#main[data-page="test-series"] .test-series-course-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 28rem)); align-items: start;
}
#main[data-page="test-series"] .test-series-course-list:has(.materials-course-detail-head) { grid-template-columns: minmax(0, 1fr); }
#main[data-page="test-series"] .materials-course-card { min-height: 11rem; }
#main[data-page="test-series"] .test-folder-browser { padding: 0; }
.test-folder-card {
  display: grid; gap: .75rem; min-width: 0; padding: 1rem;
  border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); box-shadow: var(--shadow);
}
.test-folder-card-heading { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.test-folder-card-icon {
  display: grid; place-items: center; flex: none; width: 3.5rem; height: 3.5rem;
  border-radius: .75rem; color: var(--accent-dark); background: var(--accent-soft);
}
.test-folder-card-icon .line-icon { width: 1.7rem; height: 1.7rem; }
.test-folder-card-copy { display: grid; gap: .2rem; min-width: 0; }
.test-folder-card-copy h3 { margin: 0; overflow-wrap: anywhere; font-size: 1rem; }
.test-folder-card-copy .muted, .test-leaderboard-note { font-size: .8rem; }
.test-folder-detail-back { display: inline-flex; align-items: center; gap: .45rem; width: max-content; }
.test-folder-detail-back .line-icon { width: 1rem; height: 1rem; }
.test-folder-detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.test-folder-question-count {
  padding: .4rem .7rem; border-radius: 999px;
  color: var(--accent-dark); background: var(--accent-soft); font-size: .85rem; font-weight: 750;
}
.test-folder-actions { flex-wrap: wrap; }
.test-folder-actions .button, .test-folder-actions button { min-height: 2.75rem; padding: .5rem .85rem; }
.test-folder-actions .test-series-leaderboard:disabled { opacity: .6; cursor: not-allowed; }
.test-leaderboard-note { margin: 0; color: var(--muted); }
.tile-expandable { min-width: 0; width: 100%; }
.tile-summary { max-height: 4.2rem; overflow: hidden; }
.tile-summary h2, .tile-summary p { margin: 0; font-size: .95rem; line-height: 1.4rem; }
.tile-summary h2 { font-weight: 800; }
.tile-summary p { white-space: pre-wrap; }
.card .tile-summary .description { display: block; min-height: 0; max-height: none; }
.tile-expandable.is-expanded .tile-summary { max-height: none; }
#main .tile-expand-toggle {
  min-height: 1.65rem; padding: 0; border: 0; color: var(--accent-dark);
  background: transparent; box-shadow: none; font-size: .8rem; font-weight: 800;
}
#main .tile-expand-toggle:hover { text-decoration: underline; }
#main[data-page="test-series"] .library-preview {
  height: 11rem; min-height: 11rem; grid-template-rows: minmax(0, 1fr) auto;
  gap: .3rem .8rem; padding: .8rem 1rem;
}
#main[data-page="test-series"] .library-preview:has(.tile-expandable.is-expanded) { height: auto; }
#main[data-page="test-series"] .library-preview > .folder-icon { grid-row: 1 / 3; }
#main[data-page="test-series"] .library-preview > .button {
  grid-column: 2; width: auto; min-height: 2.5rem; margin: 0; padding: .4rem .8rem;
}
.free-material-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 28rem)); }
.free-material-card { height: 11rem; min-height: 11rem; }
.free-material-card:has(.tile-expandable.is-expanded), .free-material-card:has(.status:not(:empty)) { height: auto; }
.free-material-card .card-body { gap: .15rem; padding: .8rem 1rem; }
.free-material-card { position: relative; }
.free-material-card .free-material-view-action {
  position: absolute; top: .55rem; right: .75rem; flex: none;
  width: 2.5rem; min-width: 2.5rem; height: 2.5rem; min-height: 2.5rem; padding: .35rem;
}
.free-material-card .tile-summary { max-height: 2.8rem; }
.free-material-card .tile-expandable.is-expanded .tile-summary { max-height: none; }
.free-material-card .free-material-pages { margin: 0; font-size: .85rem; line-height: 1.25rem; }
.free-material-card .actions { align-self: stretch; margin-top: auto; flex-wrap: wrap; }
.free-material-card .actions .button, .free-material-card .actions button { min-height: 2.5rem; padding: .4rem .65rem; font-size: .85rem; }
.video-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 28rem)); align-items: start; }
.video-card {
  display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
  align-items: center; height: 11rem; min-height: 11rem;
}
.video-card:has(.tile-expandable.is-expanded), .video-card.video-playing,
.video-card:has(.status:not(:empty)) { height: auto; }
.video-frame { width: 100%; overflow: hidden; }
.video-preview { position: relative; display: block; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: #17243b; }
.video-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-preview-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: white; filter: drop-shadow(0 2px 4px rgba(0,0,0,.7));
}
.video-preview-play .line-icon { width: 2.75rem; height: 2.75rem; }
.video-card.video-playing .video-frame { grid-column: 1 / -1; }
.video-card.video-playing .video-copy { grid-column: 1 / -1; }
.video-copy { min-width: 0; padding: .75rem; }
.video-card-top { display: flex; align-items: center; justify-content: space-between; gap: .35rem; }
.video-card-top .badge { min-width: 0; max-width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#main .video-rotate { display: inline-grid; place-items: center; flex: none; width: 2.75rem; min-width: 2.75rem; height: 2.75rem; min-height: 2.75rem; padding: .55rem; }
.video-copy .status:not(:empty) { margin-top: .5rem; font-size: .8rem; }

#main[data-page="profile"] { max-width: 54rem; }
#main[data-page="profile"] > .section { margin-top: 1rem; }
.profile-account { background: linear-gradient(135deg, #fff, #edf7ff); }
.profile-identity p { margin: .2rem 0; }
.profile-exam { color: var(--accent-dark); font-size: .88rem; font-weight: 700; }
.profile-course-count { display: inline-block; margin-top: .35rem; padding: .2rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: .78rem; font-weight: 750; }
.profile-social .social-links { display: flex; justify-content: flex-start; }
@media (min-width: 701px) { .account-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.materials-course-card {
  grid-template-columns: minmax(7rem, 38%) minmax(0, 1fr) auto;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.materials-course-card:hover,
.materials-course-card:focus-visible { border-color: #9dc6e8; box-shadow: 0 9px 22px rgba(26, 79, 128, .12); outline: none; transform: translateY(-1px); }
.materials-course-card .catalog-course-info { min-width: 0; }
.materials-course-card h3 { margin: 0; }
.materials-course-card .catalog-course-bottom { margin: 0; font-size: .85rem; }
.course-material-chevron { color: #1768bd; font-size: 1.7rem; font-weight: 700; }
.materials-course-detail-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.materials-course-detail-head h2,
.materials-course-detail-head p { margin: 0; }
@media (max-width: 35rem) {
  .materials-course-card {
    grid-template-columns: minmax(5.5rem, 34%) minmax(0, 1fr) auto;
  }
}

body:has(#main[data-page="signin"]) .header-notifications { display: none; }

.auth-story {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 1.5rem;
  color: white;
  background:
    radial-gradient(circle at 88% 8%, rgba(111, 211, 255, .32), transparent 30%),
    linear-gradient(125deg, #10447f 0%, #126dca 58%, #2499df 100%);
  box-shadow: 0 16px 34px rgba(13, 78, 166, .18);
}
.auth-story::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -4rem;
  bottom: -7rem;
  width: 14rem;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 1.4rem rgba(255, 255, 255, .06), 0 0 0 3rem rgba(255, 255, 255, .04);
}
.auth-story .eyebrow { color: #cceeff; }
.auth-story h1 { color: white; }
.auth-story .lead { color: #e4f3ff; line-height: 1.65; }
.auth-card {
  border-color: #d6e6f4;
  border-radius: 1.5rem;
  box-shadow: 0 16px 38px rgba(25, 72, 117, .11);
}
.auth-card-title { border-bottom-color: #e5eef7; }
.auth-card-title h2 { color: #153a64; }
.auth-card-title .muted { line-height: 1.5; }
.auth-icon {
  padding: .3rem;
  border: 1px solid #d5e7f7;
  border-radius: 1rem;
  background: linear-gradient(145deg, #fff, #eaf5ff);
  box-shadow: 0 5px 14px rgba(24, 94, 157, .1);
}
#auth-form form { gap: 1rem; }
#auth-form .signup-target-exams {
  min-width: 0;
  margin: .15rem 0 0;
  padding: 0;
  border: 0;
}
#auth-form .signup-target-exams legend {
  margin-bottom: .65rem;
  color: #183d64;
  font-size: .9rem;
  font-weight: 800;
}
#auth-form .signup-target-exams .muted {
  display: block;
  margin-top: .55rem;
}
#auth-form .auth-alternatives {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin-top: .15rem;
}
#auth-form .auth-alternatives > button {
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding-inline: .55rem;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  font-size: .88rem;
}
#auth-form .field > label { color: #183d64; font-size: .9rem; }
#auth-form .field small { font-size: .78rem; line-height: 1.5; }
#auth-form .exam-choice-grid { gap: .6rem; }
#auth-form .exam-choice {
  border-color: #d9e7f3;
  border-radius: .95rem;
  box-shadow: 0 2px 6px rgba(31, 83, 130, .035);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
#auth-form .exam-choice:hover { border-color: #8dbce7; box-shadow: 0 4px 12px rgba(31, 83, 130, .08); }
#auth-form .exam-choice:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
#auth-form .exam-choice:has(input:checked) { box-shadow: inset 0 0 0 1px var(--accent), 0 4px 12px rgba(23, 121, 223, .1); }
#auth-form .exam-choice input { accent-color: var(--accent); }
#auth-form .dummy-login-note {
  border: 1px solid #c9e2f8;
  border-left: 4px solid var(--accent);
  border-radius: .85rem;
  background: linear-gradient(110deg, #f3f9ff, #eaf5ff);
  line-height: 1.55;
}
#auth-form .phone-control {
  min-height: 3.4rem;
  border-color: #c8dbea;
  border-radius: .95rem;
  box-shadow: 0 2px 7px rgba(31, 83, 130, .04);
}
#auth-form .country-prefix { background: #eef6ff; }
#auth-form .phone-control input { min-height: 3.4rem; }
#auth-form button[type="submit"] {
  min-height: 3.35rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(105deg, #126fd1, #1689e7 62%, #229de8);
  box-shadow: 0 7px 16px rgba(23, 121, 223, .22);
  transition: box-shadow .16s ease, transform .16s ease, background .16s ease;
}
#auth-form button[type="submit"]:hover {
  background: linear-gradient(105deg, #0d58ad, #126fc5 62%, #1685d0);
  box-shadow: 0 9px 20px rgba(23, 121, 223, .28);
  transform: translateY(-1px);
}
.auth-card #auth-form .otp-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
.auth-card #auth-form .otp-actions > button[type="submit"] {
  grid-column: 1 / -1;
  margin: 0;
}
.auth-card #auth-form .otp-actions .secondary {
  width: 100%;
  min-height: 3rem;
  padding-inline: .5rem;
  border: 1px solid #c2d9ed;
  border-radius: .9rem;
  color: #0d4ea6;
  background: linear-gradient(180deg, #fff, #edf6ff);
  box-shadow: 0 4px 12px rgba(19, 82, 143, .09);
  font-size: .9rem;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.auth-card #auth-form .otp-actions .secondary:hover {
  border-color: #83b7e5;
  background: linear-gradient(180deg, #f8fcff, #e1f1ff);
  box-shadow: 0 7px 16px rgba(19, 82, 143, .15);
  transform: translateY(-1px);
}
.auth-card #auth-form .otp-actions .secondary:focus-visible {
  outline: 3px solid rgba(23, 121, 223, .35);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .auth-layout { gap: .9rem; }
  .auth-story { padding: 1.05rem 1.1rem 1rem; border-radius: 1.25rem; }
  .auth-story .eyebrow { margin-bottom: .4rem; font-size: .68rem; }
  .auth-story h1 { max-width: none; margin-bottom: .45rem; font-size: clamp(1.7rem, 8vw, 2.1rem); }
  .auth-story .lead { display: block; margin: 0; font-size: .87rem; line-height: 1.5; }
  .auth-card { padding: 1rem; border-radius: 1.25rem; }
  .auth-card-title { gap: .75rem; margin-bottom: .95rem; padding-bottom: .85rem; }
  .auth-icon { width: 3.5rem; height: 3.5rem; }
  #auth-form form { gap: .9rem; }
  #auth-form .exam-choice-grid { gap: .5rem; }
  #auth-form .exam-choice { min-height: 3.1rem; gap: .45rem; padding: .55rem .65rem; }
  #auth-form .exam-choice span { font-size: .8rem; }
  #auth-form .dummy-login-note { padding: .7rem .75rem; font-size: .84rem; }
}
