:root {
  --primary: #2563EB;
  --secondary: #1E40AF;
  --accent: #06B6D4;
  --background: #F8FAFC;
  --surface: #FFFFFF;
  --surface-soft: #EEF6FF;
  --text: #111827;
  --muted: #64748B;
  --success: #22C55E;
  --border: #DCE8F5;
  --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 18px 50px rgba(37, 99, 235, 0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --header-height: 74px;
  --container: 1160px;
  --transition: 220ms ease;
}

[data-theme="dark"] {
  --background: #08111F;
  --surface: #101B2D;
  --surface-soft: #132843;
  --text: #F8FAFC;
  --muted: #A8B3C7;
  --border: #24344A;
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.32);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body.nav-open {
  overflow: hidden;
}

img,
svg {
  display: block;
}

svg {
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.section {
  padding: 56px 0;
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.section-heading {
  max-width: 700px;
  margin: 0 auto 24px;
  text-align: center;
}

.section-heading h2,
.newsletter-panel h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.75rem, 4vw, 2.45rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.section-heading p,
.newsletter-panel p,
.hero-subtitle {
  color: var(--muted);
  margin: 0;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 800;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn-primary {
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow-md);
}

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

.btn-small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.92rem;
}

.text-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--primary);
  font-weight: 800;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--secondary);
}

.danger-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  color: #B91C1C;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-sm);
  font-weight: 800;
}

/* Loading screen */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: var(--background);
  transition: opacity 300ms ease, visibility 300ms ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

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

/* Header and navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(248, 250, 252, 0.86);
  border-bottom: 1px solid rgba(220, 232, 245, 0.8);
  backdrop-filter: blur(18px);
}

[data-theme="dark"] .site-header {
  background: rgba(8, 17, 31, 0.86);
  border-bottom-color: rgba(36, 52, 74, 0.8);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  gap: 10px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  flex: 0 0 auto;
}

.logo-image {
  width: 46px;
  height: 46px;
  object-fit: contain;
  object-position: center;
  background: transparent;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.logo-text {
  font-size: 1.18rem;
}

.nav-links {
  position: fixed;
  inset: var(--header-height) 16px auto;
  display: grid;
  gap: 8px;
  padding: 16px;
  margin: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
}

.nav-links.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-link {
  display: block;
  padding: 12px 14px;
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-weight: 800;
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
  color: var(--primary);
  background: var(--surface-soft);
}

.nav-search-item {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 290px;
  list-style: none;
}

.global-nav-search {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.global-nav-search input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 8px 0 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.92rem;
}

.global-nav-search button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: 0;
  border-radius: 999px;
}

.menu-toggle,
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.menu-toggle {
  gap: 4px;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  min-height: auto;
  display: grid;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(6, 182, 212, 0.1), transparent 55%);
}

.hero.section {
  padding: 64px 0 52px;
}

.hero-grid {
  display: grid;
  gap: 34px;
  align-items: center;
  max-width: 880px;
  margin-inline: auto;
  text-align: center;
}

.hero h1 {
  max-width: 760px;
  margin: 12px 0 16px;
  font-size: clamp(2.65rem, 8vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 620px;
  margin-inline: auto;
  font-size: clamp(1.08rem, 3.5vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.hero-trust span {
  padding: 8px 12px;
  color: var(--secondary);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
}

[data-theme="dark"] .hero-trust span {
  color: #BFDBFE;
  background: rgba(16, 27, 45, 0.82);
}

.landing-hero {
  min-height: calc(100svh - 76px);
  background:
    radial-gradient(circle at 18% 18%, rgba(37, 99, 235, 0.18), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(6, 182, 212, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(239, 246, 255, 0.72));
}

[data-theme="dark"] .landing-hero {
  background:
    radial-gradient(circle at 18% 18%, rgba(37, 99, 235, 0.22), transparent 30%),
    radial-gradient(circle at 82% 22%, rgba(6, 182, 212, 0.16), transparent 28%),
    linear-gradient(180deg, #0B1220, #101B2D);
}

.landing-hero.section {
  padding: 74px 0 58px;
}

.landing-hero-inner {
  display: grid;
  justify-items: center;
  gap: 26px;
  max-width: 940px;
  min-height: min(640px, calc(100svh - 180px));
  margin-inline: auto;
  text-align: center;
}

.landing-copy {
  align-self: end;
}

.landing-copy .eyebrow {
  justify-content: center;
}

.landing-copy h1 {
  max-width: 820px;
  margin: 12px auto 16px;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 0.95;
}

.landing-copy .hero-subtitle {
  max-width: 720px;
}

.study-icon-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(100%, 820px);
}

.study-icon-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 850;
  backdrop-filter: blur(14px);
  transition: transform var(--transition), color var(--transition), border-color var(--transition), background var(--transition);
}

[data-theme="dark"] .study-icon-link {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.18);
}

.study-icon-link svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.study-icon-link:hover,
.study-icon-link:focus-visible {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
}

.landing-helper {
  align-self: start;
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 750;
}

.hero-panel {
  position: relative;
  width: min(100%, 440px);
  margin-inline: auto;
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

[data-theme="dark"] .hero-panel {
  background: rgba(16, 27, 45, 0.92);
}

.panel-top,
.study-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-top {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 999px;
  box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.14);
}

.study-progress {
  margin-top: 24px;
}

.study-kit-card {
  margin-top: 22px;
  padding: 20px;
  color: #FFFFFF;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(135deg, var(--secondary), var(--primary) 58%, var(--accent));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.study-kit-card h2 {
  margin: 10px 0 8px;
  font-size: clamp(1.45rem, 5vw, 2rem);
  line-height: 1.1;
}

.study-kit-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
}

.kit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  color: #DBEAFE;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kit-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.kit-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  color: var(--secondary);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 900;
}

.kit-actions a:hover,
.kit-actions a:focus-visible {
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
  transform: translateY(-2px);
}

.study-progress strong,
.panel-list strong {
  display: block;
  line-height: 1.2;
}

.study-progress small,
.panel-list small {
  color: var(--muted);
}

.study-progress > span {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 900;
}

.progress-bar {
  height: 10px;
  margin: 16px 0 22px;
  overflow: hidden;
  background: var(--surface-soft);
  border-radius: 999px;
}

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

.panel-list {
  display: grid;
  gap: 12px;
}

.panel-list article {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.mini-icon {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--primary);
  background: var(--surface-soft);
  border-radius: 12px;
}

.hero-shape {
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(2px);
  animation: float 8s ease-in-out infinite;
}

.shape-one {
  top: 18%;
  right: 9%;
  width: 110px;
  height: 110px;
  background: rgba(6, 182, 212, 0.18);
}

.shape-two {
  bottom: 16%;
  left: 7%;
  width: 78px;
  height: 78px;
  background: rgba(37, 99, 235, 0.16);
  animation-delay: 1.4s;
}

.shape-three {
  top: 68%;
  right: 28%;
  width: 46px;
  height: 46px;
  background: rgba(34, 197, 94, 0.16);
  animation-delay: 2.8s;
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -18px, 0);
  }
}

/* Search */
.search-section {
  background: var(--surface);
}

.search-box {
  display: grid;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto;
  padding: 10px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.search-box input,
.newsletter-form input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border var(--transition), box-shadow var(--transition);
}

.search-box input:focus,
.newsletter-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-message {
  min-height: 24px;
  margin: 12px auto 0;
  color: var(--muted);
  text-align: center;
}

/* Cards and categories */
.category-grid,
.card-grid,
.why-grid,
.pdf-grid,
.article-strip {
  display: grid;
  gap: 14px;
}

.category-grid {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.home-quick {
  background: var(--surface);
}

.quick-access-grid {
  display: grid;
  gap: 12px;
}

.quick-access-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.quick-access-card:hover,
.quick-access-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: var(--shadow-md);
}

.quick-access-card span {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quick-access-card strong {
  font-size: 1.08rem;
  line-height: 1.2;
}

.quick-access-card small {
  color: var(--muted);
  font-weight: 700;
}

.compact-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.compact-section-head h2 {
  margin: 6px 0 0;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.1;
}

.home-cta {
  padding-top: 32px;
}

.home-cta-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.16), transparent 36%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.home-cta-panel h2 {
  margin: 8px 0 8px;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.12;
}

.home-cta-panel p {
  margin: 0;
  color: var(--muted);
}

.category-card,
.resource-card,
.pdf-card,
.why-card,
.article-card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.category-card:hover,
.resource-card:hover,
.pdf-card:hover,
.why-card:hover,
.article-card:hover {
  transform: translateY(-6px);
  border-color: rgba(37, 99, 235, 0.44);
  box-shadow: var(--shadow-md);
}

.category-card {
  padding: 16px;
}

.category-icon,
.why-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  color: var(--primary);
  background: var(--surface-soft);
  border-radius: 16px;
}

.category-card h3,
.resource-card h3,
.pdf-card h3,
.why-card h3,
.article-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.25;
}

.category-card p,
.resource-card p,
.pdf-card p,
.why-card p,
.article-card p {
  margin: 0;
  color: var(--muted);
}

.resource-card {
  overflow: hidden;
}

.media-placeholder {
  position: relative;
  display: grid;
  min-height: 118px;
  place-items: center;
  overflow: hidden;
  color: #FFFFFF;
  font-weight: 900;
}

.media-placeholder::before,
.media-placeholder::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
}

.media-placeholder::before {
  width: 130px;
  height: 130px;
  right: -35px;
  top: -35px;
}

.media-placeholder::after {
  width: 86px;
  height: 86px;
  left: -24px;
  bottom: -24px;
}

.media-placeholder span {
  position: relative;
  z-index: 1;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.biology {
  background: linear-gradient(135deg, #2563EB, #22C55E);
}

.chemistry {
  background: linear-gradient(135deg, #1E40AF, #06B6D4);
}

.physics {
  background: linear-gradient(135deg, #0F766E, #2563EB);
}

.math {
  background: linear-gradient(135deg, #2563EB, #14B8A6);
}

.bed {
  background: linear-gradient(135deg, #0369A1, #22C55E);
}

.exam {
  background: linear-gradient(135deg, #1D4ED8, #0891B2);
}

.card-body {
  padding: 13px;
}

.resource-type,
.article-date {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* PDF and article sections */
.pdfs,
.why,
.newsletter {
  background: var(--surface);
}

.pdf-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 18px;
}

.pdf-thumb {
  display: grid;
  place-items: center;
  width: 76px;
  height: 92px;
  color: #FFFFFF;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.pdf-thumb span {
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.pdf-card .btn {
  margin-top: 14px;
}

.article-card,
.why-card {
  padding: 18px;
}

.why-card {
  min-height: 170px;
}

/* Stats */
.stats {
  padding: 54px 0;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 24px 16px;
  color: #FFFFFF;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.stat-card strong {
  display: block;
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1;
}

.stat-card strong::after {
  content: "+";
}

.stat-card span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 800;
}

/* Newsletter */
.newsletter-panel {
  display: grid;
  gap: 24px;
  padding: 28px;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.16), transparent 34%),
    var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.newsletter-form {
  display: grid;
  gap: 12px;
}

.newsletter-form .form-message {
  margin: 0;
  text-align: left;
}

/* Inner pages and upload-ready content */
.page-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(37, 99, 235, 0.1), transparent 68%);
}

.page-hero-grid {
  display: grid;
  gap: 28px;
  align-items: center;
}

.page-hero h1 {
  max-width: 780px;
  margin: 10px 0 14px;
  font-size: clamp(2.1rem, 6vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.page-hero p {
  max-width: 680px;
  color: var(--muted);
  margin: 0;
}

.page-stat-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.page-stat-card strong {
  display: block;
  color: var(--primary);
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: 0.95;
}

.page-stat-card span {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 700;
}

.compact-page-hero.section {
  padding: 42px 0 34px;
}

.compact-hero-wrap {
  display: grid;
  gap: 14px;
}

.compact-page-hero h1 {
  max-width: 860px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.05;
}

.compact-page-hero p {
  max-width: 760px;
}

.compact-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.compact-hero-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  color: var(--secondary);
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 850;
}

.paper-hero {
  padding: 34px 0;
  background:
    radial-gradient(circle at 84% 28%, rgba(37, 99, 235, 0.14), transparent 24%),
    linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(248, 250, 252, 0.98));
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .paper-hero {
  background:
    radial-gradient(circle at 84% 28%, rgba(37, 99, 235, 0.22), transparent 24%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), var(--background));
}

.paper-hero-inner {
  display: grid;
  gap: 20px;
  align-items: center;
}

.paper-hero-icon {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.paper-hero-icon svg {
  width: 58px;
  height: 58px;
  stroke-width: 1.5;
}

.paper-hero-copy h1 {
  margin: 8px 0 10px;
  font-size: clamp(2.35rem, 6vw, 4.15rem);
  line-height: 1;
}

.paper-hero-copy p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.03rem;
}

.paper-hero-art {
  position: relative;
  display: none;
  min-height: 170px;
}

.paper-stack {
  position: absolute;
  right: 24px;
  top: 8px;
  width: 210px;
  height: 140px;
  transform: rotate(8deg);
}

.paper-stack span {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #FFFFFF, #EAF2FF);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

.paper-stack span:nth-child(2) {
  transform: translate(-18px, 18px) rotate(-4deg);
}

.paper-stack span:nth-child(3) {
  transform: translate(-34px, 34px) rotate(-7deg);
}

.paper-stack span::before {
  position: absolute;
  top: 22px;
  left: 24px;
  width: 120px;
  height: 10px;
  content: "";
  background: var(--surface-soft);
  border-radius: 999px;
  box-shadow: 0 24px 0 var(--surface-soft), 0 48px 0 var(--surface-soft);
}

.paper-pen {
  position: absolute;
  right: 76px;
  bottom: 26px;
  width: 140px;
  height: 14px;
  background: linear-gradient(90deg, var(--secondary), var(--primary), var(--accent));
  border-radius: 999px;
  transform: rotate(-32deg);
  box-shadow: var(--shadow-md);
}

.paper-pen::after {
  position: absolute;
  right: -20px;
  width: 28px;
  height: 14px;
  content: "";
  background: #0F172A;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.paper-group-grid {
  display: grid;
  gap: 12px;
}

.paper-group-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.paper-group-card:hover,
.paper-group-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: var(--shadow-md);
}

.paper-group-card span {
  width: fit-content;
  padding: 4px 9px;
  color: var(--primary);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.paper-group-card strong {
  font-size: 1.08rem;
  line-height: 1.2;
}

.paper-group-card small {
  color: var(--muted);
  font-weight: 750;
}

.paper-filter-bar {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.paper-filter-bar label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 850;
}

.paper-filter-bar label span {
  font-size: 0.86rem;
}

.paper-filter-bar select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: 0;
  box-shadow: var(--shadow-sm);
}

.paper-count {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.paper-table-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.paper-table-scroll {
  overflow-x: auto;
}

.paper-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.paper-table th,
.paper-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.paper-table th {
  color: var(--text);
  background: var(--surface-soft);
  font-weight: 950;
}

.paper-table tr:last-child td {
  border-bottom: 0;
}

.paper-year {
  font-size: 1.18rem;
  font-weight: 950;
}

.paper-file-cell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.paper-file-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 46px;
  color: #EF4444;
  background: #FFF5F5;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 950;
}

.paper-file-icon.answer {
  color: #16A34A;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.22);
}

.paper-file-cell strong {
  display: block;
  max-width: 320px;
  overflow: hidden;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paper-file-cell span:last-child,
.paper-missing {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.paper-file-cell a {
  color: var(--primary);
  font-weight: 850;
}

.paper-type {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 12px;
  color: var(--secondary);
  background: rgba(37, 99, 235, 0.1);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 900;
}

.paper-note {
  display: flex;
  max-width: 720px;
  align-items: center;
  gap: 10px;
  margin: 18px auto 0;
  padding: 12px 16px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  font-weight: 750;
}

.paper-note span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: #FFFFFF;
  background: var(--primary);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 950;
}

@media (max-width: 699px) {
  .paper-hero {
    padding: 22px 0;
  }

  .paper-hero-icon {
    width: 82px;
    height: 82px;
    border-radius: 16px;
  }

  .paper-hero-icon svg {
    width: 46px;
    height: 46px;
  }

  .paper-filter-bar .btn {
    width: 100%;
  }

  .paper-table-card {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .paper-table-scroll {
    overflow: visible;
  }

  .paper-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .paper-table thead {
    display: none;
  }

  .paper-table tbody,
  .paper-table tr,
  .paper-table td {
    display: block;
    width: 100%;
  }

  .paper-table tr {
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
  }

  .paper-table td {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .paper-table td:last-child {
    border-bottom: 0;
  }

  .paper-table td::before {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .paper-table td:nth-child(1)::before { content: "Year"; }
  .paper-table td:nth-child(2)::before { content: "Question"; }
  .paper-table td:nth-child(3)::before { content: "Answer Key"; }
  .paper-table td:nth-child(4)::before { content: "Type"; }
  .paper-table td:nth-child(5)::before { content: "Size"; }
  .paper-table td:nth-child(6)::before { content: "Downloads"; }
  .paper-table td:nth-child(7)::before { content: "Action"; }

  .paper-file-cell {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .paper-file-icon {
    width: 34px;
    height: 40px;
    font-size: 0.6rem;
  }

  .paper-file-cell strong {
    max-width: none;
    white-space: normal;
  }

  .paper-table td .btn {
    width: 100%;
  }

  .paper-note {
    align-items: flex-start;
    margin-top: 14px;
  }
}

.upload-panel {
  display: grid;
  gap: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.upload-copy h2,
.contact-card h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  line-height: 1.1;
}

.upload-copy p,
.contact-card p,
.contact-info p,
.roadmap-card p {
  margin: 0;
  color: var(--muted);
}

.upload-form,
.contact-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.upload-form label,
.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
}

.upload-form label span,
.contact-form label span {
  font-size: 0.92rem;
}

.upload-form input,
.upload-form select,
.upload-form textarea,
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border var(--transition), box-shadow var(--transition);
}

.upload-form textarea,
.contact-form textarea {
  min-height: 130px;
  padding-top: 12px;
  resize: vertical;
}

.upload-form input[type="file"] {
  padding: 12px;
}

.upload-form input:focus,
.upload-form select:focus,
.upload-form textarea:focus,
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.list-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 34px 0 18px;
}

.list-head h3 {
  margin: 0;
  font-size: 1.3rem;
}

.list-head p {
  margin: 0;
  color: var(--muted);
}

.dynamic-grid:empty::before {
  content: "No server uploads yet. Add your first resource from the protected admin panel.";
  display: block;
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.uploaded-thumb {
  width: 100%;
  height: 118px;
  object-fit: cover;
  background: var(--surface-soft);
}

.pdf-card .uploaded-thumb {
  width: 74px;
  height: 92px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

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

.material-grid {
  gap: 12px;
}

.material-grid .resource-card h3 {
  font-size: 0.98rem;
}

.material-grid .resource-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.92rem;
}

.material-grid .badge-row {
  margin-top: 10px;
}

.material-grid .badge-row span {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.76rem;
}

.material-grid .btn-small,
.material-grid .danger-link {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.resource-list {
  display: grid;
  gap: 10px;
}

.pagination {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 20px;
}

.pagination:empty {
  display: none;
}

.pagination-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pagination-controls button {
  min-width: 40px;
  min-height: 38px;
  padding: 0 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 850;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), color var(--transition), border-color var(--transition), background var(--transition);
}

.pagination-controls button:hover:not(:disabled),
.pagination-controls button:focus-visible:not(:disabled),
.pagination-controls button[aria-current="page"] {
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
  transform: translateY(-1px);
}

.pagination-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.library-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.library-toolbar h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  line-height: 1.1;
}

.library-toolbar p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.library-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.library-row:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: var(--shadow-md);
}

.library-row-main {
  display: grid;
  grid-template-columns: 86px 50px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.list-thumb {
  width: 86px;
  height: 64px;
  min-height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-soft);
}

.list-thumb.media-placeholder {
  font-size: 0.72rem;
}

.pdf-file-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  color: #EF4444;
  background: #FFF5F5;
  border: 1px solid rgba(239, 68, 68, 0.14);
  border-radius: 10px;
  font-weight: 900;
}

.pdf-file-icon svg {
  width: 24px;
  height: 24px;
}

.pdf-file-icon small {
  margin-top: -6px;
  font-size: 0.66rem;
  line-height: 1;
}

.library-row-copy {
  min-width: 0;
}

.library-row-copy h3 {
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-row-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.library-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.library-tags span {
  min-height: 26px;
  padding: 4px 9px;
  color: var(--primary);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.library-tags span:nth-child(2) {
  color: #047857;
  background: rgba(34, 197, 94, 0.12);
}

.library-tags span:nth-child(3) {
  color: #5B21B6;
  background: rgba(124, 58, 237, 0.12);
}

.library-row-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.library-row-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.library-row-meta svg,
.library-row-actions svg {
  width: 17px;
  height: 17px;
}

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

.article-list {
  display: grid;
  gap: 10px;
}

.article-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.article-row:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: var(--shadow-md);
}

.article-row-main {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.article-row-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  font-weight: 900;
}

.article-row-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.article-row h3 {
  margin: 3px 0 5px;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-row p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

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

.study-article-hero {
  padding: 34px 0 24px;
  background:
    radial-gradient(circle at 88% 12%, rgba(6, 182, 212, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(239, 246, 255, 0.98), var(--background));
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .study-article-hero {
  background:
    radial-gradient(circle at 88% 12%, rgba(6, 182, 212, 0.18), transparent 26%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), var(--background));
}

.study-article-hero-grid {
  display: grid;
  gap: clamp(18px, 4vw, 34px);
  align-items: center;
  margin-top: 16px;
}

.study-article-hero h1 {
  max-width: 820px;
  margin: 8px 0 12px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.study-article-hero .hero-subtitle {
  max-width: 760px;
}

.article-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.article-meta-line span {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border);
  border-radius: 999px;
}

[data-theme="dark"] .article-meta-line span {
  background: rgba(15, 23, 42, 0.72);
}

.article-hero-media,
.article-inline-image {
  margin: 0;
}

.article-hero-media img,
.article-inline-image img {
  display: block;
  width: 100%;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.article-hero-media img {
  aspect-ratio: 16 / 10;
  max-height: 430px;
}

.article-inline-image {
  display: grid;
  gap: 10px;
  margin: 30px 0;
}

.article-inline-image img {
  aspect-ratio: 16 / 9;
}

.article-inline-image figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.article-shell {
  display: grid;
  gap: 24px;
  align-items: start;
}

.article-shell .article-prose {
  order: 1;
}

.article-shell .article-aside {
  order: 2;
}

.article-aside {
  display: grid;
  gap: 14px;
}

.article-summary-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.article-summary-card h2,
.article-summary-card p,
.article-summary-card ul {
  margin: 0;
}

.article-summary-card ul {
  padding-left: 20px;
}

.article-summary-card a {
  color: var(--primary);
  font-weight: 850;
}

.article-prose {
  width: 100%;
  min-width: 0;
  padding: clamp(20px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.article-prose > *:first-child {
  margin-top: 0;
}

.article-prose h2 {
  margin: 34px 0 10px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.18;
}

.article-prose p,
.article-prose li {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.82;
}

.article-prose ul {
  padding-left: 22px;
}

.article-table {
  width: 100%;
  margin: 18px 0;
  overflow-x: auto;
}

.article-table table {
  min-width: 560px;
}

.article-faq {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.article-faq summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.article-cta {
  display: grid;
  gap: 16px;
  margin-top: 34px;
  padding: clamp(18px, 3vw, 24px);
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  border-radius: var(--radius-md);
}

.article-cta h2,
.article-cta p {
  margin: 0;
  color: #FFFFFF;
}

.article-cta .eyebrow {
  color: #BFDBFE;
}

@media (min-width: 820px) {
  .article-row {
    grid-template-columns: minmax(0, 1fr) 190px auto;
  }

  .article-row-actions {
    justify-content: flex-end;
  }

  .article-aside {
    position: sticky;
    top: calc(var(--header-height) + 18px);
  }

  .article-cta {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

@media (min-width: 920px) {
  .study-article-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  }

  .article-shell {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .article-shell .article-prose {
    grid-column: 1;
  }

  .article-shell .article-aside {
    grid-column: 2;
  }
}

@media (min-width: 900px) {
  .library-row {
    grid-template-columns: minmax(0, 1fr) 300px auto;
    padding: 10px 14px;
  }

  .library-row-main {
    grid-template-columns: 74px 44px minmax(0, 1fr);
  }

  .list-thumb {
    width: 74px;
    height: 56px;
    min-height: 56px;
  }

  .pdf-file-icon {
    width: 44px;
    height: 44px;
  }

  .library-row-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
  }

  .library-row-actions {
    justify-content: flex-end;
    min-width: 188px;
  }
}

@media (max-width: 560px) {
  .resource-list {
    gap: 8px;
  }

  .library-row {
    gap: 9px;
    padding: 10px;
    border-radius: 12px;
  }

  .library-row-main {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
  }

  .list-thumb {
    width: 56px;
    height: 50px;
    min-height: 50px;
  }

  .pdf-file-icon {
    display: none;
  }

  .library-row-copy h3 {
    display: -webkit-box;
    margin-bottom: 6px;
    font-size: 0.92rem;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .library-row-copy p {
    display: none;
  }

  .library-tags {
    gap: 4px;
  }

  .library-tags span {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 0.68rem;
  }

  .library-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.76rem;
  }

  .library-row-meta span:first-child {
    display: none;
  }

  .library-row-meta svg,
  .library-row-actions svg {
    width: 15px;
    height: 15px;
  }

  .library-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .library-row-actions .btn {
    min-height: 34px;
    justify-content: center;
    padding: 0 8px;
    font-size: 0.8rem;
  }
}

.article-body-preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 12px;
  border-radius: 12px;
}

.roadmap-grid,
.contact-grid {
  display: grid;
  gap: 14px;
}

.roadmap-card,
.contact-card,
.contact-info article {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.roadmap-card h3,
.contact-info h3 {
  margin: 0 0 8px;
}

.contact-info {
  display: grid;
  gap: 14px;
}

.contact-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

.contact-request-card {
  padding: 20px;
}

.contact-request-card > p {
  margin-bottom: 18px;
}

.contact-side-panel {
  display: grid;
  gap: 14px;
}

.support-card,
.contact-methods article {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.support-card h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.1;
}

.support-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.support-list li {
  position: relative;
  padding-left: 26px;
  color: var(--muted);
  font-weight: 750;
}

.support-list li::before {
  position: absolute;
  top: 8px;
  left: 6px;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--success), var(--accent));
  border-radius: 999px;
  content: "";
}

.contact-methods {
  display: grid;
  gap: 10px;
}

.contact-methods article {
  display: grid;
  gap: 5px;
}

.contact-methods span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-methods a,
.contact-methods p {
  margin: 0;
  color: var(--text);
  font-weight: 850;
}

.contact-methods a:hover,
.contact-methods a:focus-visible {
  color: var(--primary);
}

.planner-shell {
  display: grid;
  gap: 16px;
  align-items: start;
}

.planner-main,
.planner-side {
  display: grid;
  gap: 16px;
}

.planner-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.planner-card h2 {
  margin: 8px 0 14px;
  font-size: clamp(1.45rem, 4vw, 2.15rem);
  line-height: 1.12;
}

.planner-card p {
  color: var(--muted);
}

.planner-form {
  display: grid;
  gap: 12px;
}

.planner-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 850;
}

.planner-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
}

.planner-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.planner-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.planner-list-head h2 {
  margin-bottom: 0;
}

.planner-list-head > span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 850;
}

.planner-task-list {
  display: grid;
  gap: 10px;
}

.planner-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.planner-task label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.planner-task input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.planner-task span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.planner-task strong {
  color: var(--text);
  line-height: 1.25;
}

.planner-task small {
  color: var(--muted);
  font-weight: 750;
}

.planner-task.is-done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.planner-progress-card,
.planner-timer-card {
  text-align: center;
}

.planner-progress-ring {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin: 14px auto;
  color: #FFFFFF;
  background:
    radial-gradient(circle at 50% 50%, var(--primary) 0 48%, transparent 49%),
    conic-gradient(var(--accent), var(--primary), var(--success), var(--accent));
  border-radius: 999px;
  font-size: 2rem;
  font-weight: 950;
  box-shadow: var(--shadow-md);
}

.planner-timer-card h2 {
  margin: 10px 0;
  color: var(--primary);
  font-size: clamp(2.4rem, 9vw, 4rem);
  line-height: 1;
}

.planner-timer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.planner-tips {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

/* Footer */
.footer {
  color: #EAF2FF;
  background: #0B1730;
}

.footer-grid {
  display: grid;
  gap: 28px;
  padding: 56px 0 36px;
}

.footer-logo {
  margin-bottom: 14px;
}

.footer-logo .logo-image {
  width: 52px;
  height: 52px;
}

.footer p,
.footer li,
.footer a {
  color: #B8C7DD;
}

.footer h2 {
  margin: 0 0 14px;
  color: #FFFFFF;
  font-size: 1rem;
}

.footer ul {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer a:hover,
.footer a:focus-visible {
  color: #FFFFFF;
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  transition: transform var(--transition), background var(--transition);
}

.social-links a:hover,
.social-links a:focus-visible {
  transform: translateY(-2px);
  background: var(--primary);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  margin: 0;
}

/* Utility interactions */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #FFFFFF;
  background: var(--primary);
  border: 0;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 120;
  width: min(calc(100% - 32px), 460px);
  padding: 14px 16px;
  color: #FFFFFF;
  text-align: center;
  background: #0F172A;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 16px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 640px) {
  .navbar {
    gap: 8px;
  }

  .logo-text {
    display: none;
  }

  .logo-image {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .nav-search-item {
    flex: 1 1 auto;
    max-width: none;
  }

  .global-nav-search {
    padding: 4px;
  }

  .global-nav-search input {
    height: 32px;
    padding-inline: 8px;
    font-size: 0.86rem;
  }

  .global-nav-search button {
    width: 32px;
    height: 32px;
  }
}

@media (min-width: 560px) {
  .search-box,
  .newsletter-form {
    grid-template-columns: 1fr auto;
  }

  .newsletter-form .form-message {
    grid-column: 1 / -1;
  }

  .category-grid,
  .card-grid,
  .why-grid,
  .article-strip,
  .roadmap-grid,
  .quick-access-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 760px) {
  .section {
    padding: 64px 0;
  }

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

  .page-hero-grid,
  .upload-panel,
  .contact-grid {
    grid-template-columns: 1fr 0.95fr;
  }

  .library-toolbar {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .library-toolbar .btn {
    flex: 0 0 auto;
  }

  .contact-layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.72fr);
  }

  .planner-shell {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  }

  .planner-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planner-form .form-wide,
  .planner-form .btn,
  .planner-form .form-message {
    grid-column: 1 / -1;
  }

  .pdf-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .newsletter-panel {
    grid-template-columns: 1fr 0.9fr;
    align-items: center;
    padding: 42px;
  }

  .home-cta-panel {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 0.8fr 1fr 0.8fr;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 980px) {
  .menu-toggle {
    display: none;
  }

  .nav-links {
    position: static;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    margin-left: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-link {
    padding: 10px 12px;
    font-size: 0.94rem;
  }

  .nav-search-item {
    flex: 0 1 min(24vw, 300px);
    min-width: 210px;
    max-width: 300px;
  }

  .global-nav-search {
    padding: 4px;
  }

  .category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quick-access-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .why-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .roadmap-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .article-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reader-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .related-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .container {
    width: min(100% - 24px, var(--container));
  }

  .landing-hero.section {
    padding: 48px 0 38px;
  }

  .landing-hero-inner {
    gap: 20px;
    min-height: auto;
  }

  .study-icon-strip {
    gap: 8px;
  }

  .study-icon-link {
    min-height: 40px;
    padding: 9px 11px;
    font-size: 0.86rem;
  }

  .planner-task {
    align-items: flex-start;
    flex-direction: column;
  }

  .planner-task .danger-link {
    align-self: flex-end;
  }

  .hero h1 {
    font-size: 2.7rem;
  }

  .hero-actions .btn,
  .search-box .btn,
  .newsletter-form .btn,
  .upload-form .btn,
  .contact-form .btn {
    width: 100%;
  }

  .pdf-card {
    grid-template-columns: 1fr;
  }
}

/* Minor improvements */
.hero-subtitle {
  font-size: clamp(1.02rem, 2.5vw, 1.2rem);
  line-height: 1.5;
}

.category-card p {
  font-size: 0.95rem;
}

.why-grid {
  gap: 14px;
}

.stat-card strong {
  font-size: 2.2rem;
  line-height: 1;
}

/* Better mobile spacing */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  
  .category-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

.hero-panel-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
  border: 1px solid #E0E7FF;
}

.dark .hero-panel-card {
  background: #1E2937;
  border-color: #334155;
}

.panel-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 0.95rem;
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #22C55E;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.featured-resource h3 {
  font-size: 1.35rem;
  margin-bottom: 8px;
  line-height: 1.3;
}

.resource-desc {
  color: #64748B;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.dark .resource-desc { color: #94A3B8; }

.subject-tag {
  background: #EFF6FF;
  color: #2563EB;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 12px;
}

.resource-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.download-info strong {
  display: block;
  font-size: 1.4rem;
  color: var(--primary);
}

.download-info small {
  color: #64748B;
  font-size: 0.85rem;
}

.btn-small {
  padding: 10px 20px;
  font-size: 0.95rem;
}

/* HB StudyHub v1.5 expansion */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.breadcrumb a {
  color: var(--primary);
}

.feature-band {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 34%),
    var(--surface);
}

.split-grid {
  display: grid;
  gap: 14px;
}

.mini-stat-grid,
.testimonial-grid,
.subject-grid,
.class-grid,
.policy-grid,
.sitemap-grid,
.seo-link-grid {
  display: grid;
  gap: 14px;
}

.mini-stat,
.testimonial-card,
.subject-card,
.class-card,
.policy-card,
.sitemap-card,
.seo-link-card,
.filter-panel,
.admin-panel {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.mini-stat strong {
  display: block;
  color: var(--primary);
  font-size: 1.65rem;
  line-height: 1;
}

.mini-stat span,
.testimonial-card span,
.subject-card p,
.class-card p,
.policy-card p,
.sitemap-card p,
.seo-link-card small {
  color: var(--muted);
}

.seo-link-card {
  display: grid;
  gap: 8px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.seo-link-card:hover,
.seo-link-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-md);
}

.seo-link-card span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.seo-link-card strong {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.25;
}

.filter-panel {
  margin-bottom: 16px;
}

.filter-grid {
  display: grid;
  gap: 12px;
}

.simple-filter-grid {
  grid-template-columns: 1fr;
}

.filter-grid label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.filter-grid input,
.filter-grid select,
.global-search-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
}

.filter-panel .btn {
  min-height: 44px;
}

.page-hero.section {
  padding: 48px 0;
}

.filter-grid input:focus,
.filter-grid select:focus,
.global-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.badge-row span,
.pill-list a,
.pill-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--secondary);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

[data-theme="dark"] .badge-row span,
[data-theme="dark"] .pill-list a,
[data-theme="dark"] .pill-list span {
  color: #BFDBFE;
}

.bookmark-btn.is-active {
  color: #FFFFFF;
  background: var(--success);
  border-color: var(--success);
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.62);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.preview-modal.show {
  opacity: 1;
  visibility: visible;
}

.preview-dialog {
  width: min(100%, 640px);
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.preview-dialog h2 {
  margin: 10px 0;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.1;
}

.preview-close {
  float: right;
  min-height: 36px;
  padding: 0 12px;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 28px;
}

.suggestion-list button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--primary);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 800;
}

.home-search-results {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin: 16px auto 0;
  text-align: left;
}

.home-search-item,
.home-search-empty {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.home-search-item {
  display: grid;
  gap: 4px;
  color: var(--text);
}

.home-search-item span {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-search-item small,
.home-search-empty {
  color: var(--muted);
}

.home-search-item:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.35);
}

.search-result-card {
  min-height: 100%;
}

.highlight-card {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.22);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-state p {
  color: var(--muted);
}

.compact-empty {
  padding: 22px;
  border-radius: var(--radius-md);
}

.compact-empty h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.compact-empty p {
  max-width: 520px;
  margin: 0 auto;
}

.article-detail-hero h1 {
  max-width: 980px;
}

.article-detail-meta {
  margin-top: 22px;
}

.reader-layout {
  display: grid;
  gap: 24px;
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}

.article-body,
.resource-detail-card,
.reader-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.article-body,
.resource-detail-card {
  padding: clamp(22px, 5vw, 42px);
}

.article-body.compact {
  padding: 0;
  margin-top: 22px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.article-body p,
.article-body li {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.85;
}

.article-body h2 {
  margin: 30px 0 12px;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1.15;
}

.article-detail-image,
.resource-detail-image {
  width: 100%;
  max-height: 420px;
  margin-bottom: 24px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.resource-detail-image.media-placeholder {
  height: 260px;
  max-height: none;
}

.reader-sidebar {
  padding: 22px;
}

.reader-sidebar.article-aside {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.reader-sidebar h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
}

.reader-sidebar p {
  color: var(--muted);
}

.reader-download {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.related-section {
  padding-top: 0;
}

.related-grid {
  display: grid;
  gap: 12px;
}

.related-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.related-card:hover,
.related-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: var(--shadow-md);
}

.related-card span {
  width: fit-content;
  padding: 4px 9px;
  color: var(--primary);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.related-card strong {
  font-size: 1rem;
  line-height: 1.25;
}

.related-card small {
  color: var(--muted);
  font-weight: 750;
}

.resource-view-section {
  min-height: calc(100vh - var(--header-height));
  padding: 44px 0 64px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), var(--background));
}

[data-theme="dark"] .resource-view-section {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34%),
    var(--background);
}

.resource-view-breadcrumb {
  margin-bottom: 18px;
}

.resource-view-card {
  display: grid;
  gap: 28px;
  padding: clamp(22px, 4vw, 38px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.resource-view-media {
  min-width: 0;
}

.resource-cover-image,
.resource-cover-generated {
  width: 100%;
  min-height: 420px;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.resource-cover-image {
  object-fit: cover;
  background: var(--surface-soft);
}

.resource-cover-generated {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  overflow: hidden;
  padding: 34px 24px 96px;
  color: #FFFFFF;
  text-align: center;
  background:
    radial-gradient(circle at 70% 30%, rgba(6, 182, 212, 0.34), transparent 28%),
    radial-gradient(circle at 30% 70%, rgba(37, 99, 235, 0.48), transparent 34%),
    linear-gradient(145deg, #06162E, #0B4F86);
}

.resource-cover-generated::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.24;
}

.resource-cover-ribbon,
.resource-cover-class,
.resource-cover-generated strong,
.resource-cover-generated small,
.resource-cover-footer {
  position: relative;
  z-index: 1;
}

.resource-cover-ribbon {
  position: absolute;
  top: 0;
  left: 28px;
  padding: 16px 12px 20px;
  background: #EF4444;
  border-radius: 0 0 8px 8px;
  font-weight: 900;
}

.resource-cover-class {
  padding: 8px 14px;
  background: rgba(6, 182, 212, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  font-weight: 900;
}

.resource-cover-generated strong {
  max-width: 90%;
  font-size: clamp(2.4rem, 9vw, 4.7rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.resource-cover-generated small {
  max-width: 82%;
  color: #BAE6FD;
  font-size: 1rem;
  font-weight: 800;
}

.resource-cover-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 18px;
  background: rgba(3, 105, 161, 0.65);
  backdrop-filter: blur(12px);
}

.resource-cover-footer span {
  font-size: 0.78rem;
  font-weight: 800;
}

.resource-view-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  padding: 6px 12px;
  color: var(--primary);
  background: var(--surface-soft);
  border-radius: 8px;
  font-weight: 900;
}

.resource-view-content h1 {
  margin: 20px 0 12px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08;
}

.resource-view-summary {
  max-width: 760px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.22rem);
}

.resource-info-list {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--border);
}

.resource-info-list div {
  display: grid;
  grid-template-columns: minmax(110px, 0.45fr) minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.resource-info-list dt {
  color: var(--text);
  font-weight: 900;
}

.resource-info-list dd {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.resource-view-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn-share {
  color: #16A34A;
  background: var(--surface);
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.pdf-preview-card {
  display: grid;
  gap: 18px;
  margin-top: 24px;
  padding: clamp(18px, 4vw, 28px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--header-height) + 20px);
}

.pdf-preview-head {
  display: grid;
  gap: 14px;
}

.pdf-preview-head h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.12;
}

.pdf-preview-head p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
}

.pdf-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pdf-preview-frame-wrap {
  height: min(78vh, 760px);
  min-height: 440px;
  overflow: hidden;
  background: #F1F5F9;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

[data-theme="dark"] .pdf-preview-frame-wrap {
  background: #020617;
}

.pdf-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.resource-notes-body {
  margin-top: 24px;
}

@media (min-width: 900px) {
  .resource-view-card {
    grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.18fr);
    align-items: center;
  }

  .pdf-preview-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

@media (max-width: 560px) {
  .resource-cover-image,
  .resource-cover-generated {
    min-height: 330px;
  }

  .resource-info-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pdf-preview-frame-wrap {
    height: 66vh;
    min-height: 360px;
  }

  .pdf-preview-actions .btn {
    width: 100%;
  }

  .resource-view-actions .btn {
    width: 100%;
  }
}

.legal-content {
  max-width: 900px;
  margin-inline: auto;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.legal-content h2 {
  margin-top: 28px;
}

.legal-content p,
.legal-content li {
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-list details {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.faq-list summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
}

.faq-list p {
  color: var(--muted);
}

.admin-shell {
  display: grid;
  gap: 22px;
}

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.admin-section {
  display: grid;
  gap: 18px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.admin-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-section-head h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.12;
}

.admin-section-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.admin-section .upload-form {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.table-wrap caption {
  padding: 14px;
  color: var(--text);
  text-align: left;
  font-weight: 900;
}

.table-wrap th,
.table-wrap td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table-wrap th {
  color: var(--text);
  background: var(--surface-soft);
}

.form-help {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.admin-edit-thumb {
  width: 120px;
  height: 86px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.error-page {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  align-items: center;
  text-align: center;
}

.error-code-large {
  color: var(--primary);
  font-size: clamp(5rem, 22vw, 10rem);
  font-weight: 950;
  line-height: 0.9;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

@media (min-width: 560px) {
  .paper-group-grid,
  .paper-filter-bar,
  .mini-stat-grid,
  .testimonial-grid,
  .subject-grid,
  .class-grid,
  .policy-grid,
  .sitemap-grid,
  .seo-link-grid,
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .paper-hero-inner {
    grid-template-columns: 140px minmax(0, 1fr) 330px;
  }

  .paper-hero-art {
    display: block;
  }

  .paper-group-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .paper-filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
  }

  .split-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }

  .mini-stat-grid,
  .testimonial-grid,
  .subject-grid,
  .class-grid,
  .policy-grid,
  .sitemap-grid,
  .seo-link-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-grid {
    grid-template-columns: 1.4fr repeat(4, 1fr) auto;
    align-items: end;
  }
}

@media (min-width: 700px) {
  .simple-filter-grid {
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: end;
  }
}
