:root {
  --blue-900: #0c2a60;
  --blue-700: #1e53b7;
  --blue-500: #2f7eff;
  --purple-500: #7f5dff;
  --gold-500: #f0b81f;
  --gold-400: #ffd24d;
  --green-500: #2f9e63;
  --red-500: #d14343;
  --bg: #f1f6ff;
  --surface: #ffffff;
  --text: #1a3561;
  --muted: #5a719b;
  --border: #d6e2f5;
  --shadow: 0 14px 30px rgba(27, 73, 153, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 0%, #fef4d8 0, var(--bg) 28%),
    radial-gradient(circle at 100% 20%, #e8efff 0, var(--bg) 34%), var(--bg);
  line-height: 1.6;
}

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

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

.section {
  padding: 4.5rem 0;
}

main .section:nth-of-type(odd) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(236, 245, 255, 0.7));
}

main .section:nth-of-type(even) {
  background: linear-gradient(180deg, rgba(245, 250, 255, 0.9), rgba(255, 250, 236, 0.65));
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 2.7vw, 2.2rem);
  color: var(--blue-900);
}

.section-subtitle {
  margin: 0 0 2rem;
  color: var(--muted);
  max-width: 760px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(130deg, var(--purple-500), var(--blue-500));
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  margin-bottom: 1rem;
}

header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  color: var(--blue-900);
}

.brand-logo {
  height: 68px;
  width: auto;
  object-fit: contain;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--blue-700), var(--purple-500));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  color: var(--nav-link-color, var(--muted));
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.3rem 0.18rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav-links a:nth-of-type(1) {
  --nav-link-color: #1e53b7;
}

.nav-links a:nth-of-type(2) {
  --nav-link-color: #0f2f68;
}

.nav-links a:nth-of-type(3) {
  --nav-link-color: #436aa8;
}

.nav-links a:nth-of-type(4) {
  --nav-link-color: #bd8b2f;
}

.nav-links a:nth-of-type(5) {
  --nav-link-color: #2c5da8;
}

.nav-links a:nth-of-type(6) {
  --nav-link-color: #163b7a;
}

.nav-links a:nth-of-type(7) {
  --nav-link-color: #8f6a1f;
}

.nav-links a:nth-of-type(8) {
  --nav-link-color: #5977a8;
}

.nav-links a:nth-of-type(9) {
  --nav-link-color: #0f2f68;
}

.nav-links a + a {
  position: relative;
  margin-left: 0.18rem;
}

.nav-links a + a::before {
  content: "";
  position: absolute;
  left: -0.32rem;
  top: 50%;
  width: 1px;
  height: 1rem;
  background: rgba(30, 83, 183, 0.22);
  transform: translateY(-50%);
}

.nav-links a.has-message-badge {
  position: relative;
  padding-right: 1.35rem;
}

.message-tab-badge {
  position: absolute;
  top: -0.45rem;
  right: -0.2rem;
  min-width: 18px;
  height: 18px;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #d92727;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  border: 2px solid #fff;
  line-height: 1;
}

.has-inline-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.inline-count-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #d92727;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--nav-link-color, var(--blue-700));
  border-color: var(--gold-500);
  text-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.notification-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notification-bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--blue-700);
  cursor: pointer;
  font-size: 1rem;
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 19px;
  height: 19px;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #d92727;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  border: 2px solid #fff;
}

.notification-panel {
  position: fixed;
  top: 76px;
  right: 4%;
  width: min(340px, 86vw);
  max-height: 420px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.45rem;
  z-index: 1000;
}

.notification-panel a,
.notification-panel p {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0.7rem;
  border-radius: 10px;
  color: var(--blue-900);
  border-bottom: 0;
  white-space: normal;
}

.notification-panel a:hover {
  background: #f6f9ff;
  border-bottom: 0;
}

.notification-panel span,
.notification-panel small {
  color: var(--muted);
}

.notification-modal {
  position: fixed;
  top: var(--notification-panel-top, 76px);
  right: var(--notification-panel-right, 1rem);
  z-index: 1200;
  width: min(520px, calc(100vw - 1.5rem));
}

.notification-modal[hidden] {
  display: none;
}

.notification-modal-backdrop {
  display: none;
}

.notification-modal-window {
  position: relative;
  width: 100%;
  max-height: min(620px, calc(100vh - var(--notification-panel-top, 76px) - 1rem));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.notification-modal-window::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 18px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

.notification-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.notification-modal-header h2 {
  margin: 0;
  color: var(--blue-900);
  font-size: 1.25rem;
}

.notification-modal-close {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--blue-900);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.notification-modal-list {
  overflow: auto;
  padding: 0.5rem;
}

.notification-modal-list p {
  margin: 0;
  padding: 1rem;
  color: var(--muted);
}

.notification-modal-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--blue-900);
  text-decoration: none;
}

.notification-modal-item.unread {
  border-color: var(--gold-500);
  background: #fffaf0;
}

.notification-modal-item:hover {
  background: #f6f9ff;
  border-color: #9eb8ea;
}

.notification-modal-item span,
.notification-modal-item small {
  color: var(--muted);
}

.target-highlight {
  outline: 3px solid var(--gold-500);
  outline-offset: 4px;
  transition: outline-color 0.2s ease;
}

.member-welcome {
  color: var(--blue-900);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
}

.menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--blue-700);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--blue-700), var(--purple-500));
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: #fff;
  color: var(--blue-700);
  border-color: #9eb8ea;
}

.btn-accent {
  background: linear-gradient(130deg, var(--gold-500), var(--gold-400));
  color: #1c2b47;
}

.btn-secondary:hover {
  background: #f5f9ff;
}

.hero {
  padding: 1rem 0 3.5rem;
  background: linear-gradient(125deg, #edf3ff 0%, #fdf2cc 52%, #eff6ff 100%);
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.hero::before {
  width: 340px;
  height: 340px;
  top: -120px;
  right: -90px;
  background: rgba(128, 95, 255, 0.18);
}

.hero::after {
  width: 280px;
  height: 280px;
  bottom: -120px;
  left: -70px;
  background: rgba(240, 184, 31, 0.2);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: start;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  color: var(--blue-900);
}

.hero p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.hero-actions {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.hero-subscribe {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(30, 83, 183, 0.18);
}

.hero-subscribe h2 {
  margin: 0 0 0.4rem;
  color: var(--blue-900);
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

.price-highlight {
  color: #d92727;
  display: inline-block;
}

.hero-subscribe p {
  max-width: 620px;
}

.hero-subscribe .hero-actions {
  margin-top: 0.9rem;
}

.hero-card {
  background: linear-gradient(160deg, #ffffff, #f2f6ff);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.3rem;
}

.hero-carousel {
  position: relative;
  margin-top: 0.8rem;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.carousel-track {
  position: relative;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #eef4ff;
  aspect-ratio: 3 / 4;
}

.carousel-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}

.carousel-image.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 42, 96, 0.8);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.carousel-btn.prev {
  left: 0.6rem;
}

.carousel-btn.next {
  right: 0.6rem;
}

.carousel-dots {
  margin-top: 0.65rem;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
}

.carousel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 0;
  background: #b7c8ea;
  cursor: pointer;
  padding: 0;
}

.carousel-dot.active {
  background: var(--blue-700);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.stat {
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  padding: 0.7rem;
  background: linear-gradient(145deg, #ffffff, #eef4ff);
}

.stat strong {
  display: block;
  font-size: 1.25rem;
  color: var(--blue-900);
}

.grid-3,
.grid-4,
.grid-2 {
  display: grid;
  gap: 1rem;
}

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

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

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

.card {
  background: linear-gradient(160deg, #ffffff, #f8fbff);
  border: 1px solid #d8e5fb;
  border-radius: 16px;
  padding: 1.05rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(36, 87, 182, 0.18);
}

.card h3 {
  margin: 0 0 0.5rem;
  color: var(--blue-900);
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.level-card img,
.book-cover {
  border-radius: 12px;
  border: 1px solid var(--border);
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #eef4ff;
}

.level-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.list {
  margin: 0;
  padding-left: 1.05rem;
  color: var(--muted);
}

.list li {
  margin-bottom: 0.35rem;
}

form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem;
  box-shadow: var(--shadow);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: 0.35rem;
  display: block;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd8e8;
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.help-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  display: inline-block;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(130deg, #e5eeff, #ffecc3);
  color: #335ca8;
  font-size: 0.8rem;
  margin: 0.2rem 0.18rem 0 0;
}

.resources-ad-strip {
  margin-top: 1cm;
}

.resources-ad-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.9fr) minmax(220px, 0.75fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 2px solid #ffd24d;
  border-radius: 14px;
  background: linear-gradient(135deg, #0c2a60 0%, #1e53b7 52%, #d14343 100%);
  color: #fff;
  box-shadow: 0 18px 36px rgba(12, 42, 96, 0.28);
}

.resources-ad-card h2,
.resources-ad-card p,
.resources-ad-card ul {
  margin: 0;
}

.resources-ad-card h2 {
  color: #fff;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.18;
}

.resources-ad-card p {
  margin-top: 0.35rem;
  color: #fff;
  font-weight: 750;
  line-height: 1.45;
}

.resources-ad-card p strong {
  color: #ffe680;
  font-weight: 950;
}

.resources-payment-line {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.25rem;
}

.resources-payment-numbers {
  display: grid;
  gap: 0.05rem;
  text-align: left;
}

.resources-ad-list {
  display: grid;
  gap: 0.3rem;
  padding-left: 1.1rem;
  color: #fff;
  font-weight: 760;
}

.resources-ad-action {
  display: grid;
  gap: 0.55rem;
  justify-items: end;
  text-align: right;
}

.resources-ad-action .btn {
  min-width: 150px;
  justify-content: center;
  background: #ffd24d;
  color: #0c2a60;
}

.audio-item {
  display: grid;
  gap: 0.55rem;
}

.audio-item audio {
  width: 100%;
}

.resource-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.7rem 0 0.45rem;
}

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

.resource-tab {
  --resource-tab-color: var(--blue-700);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--resource-tab-color);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.resource-tab[href*="category=latest"] {
  --resource-tab-color: var(--blue-700);
}

.resource-tab[href*="category=bepc"] {
  --resource-tab-color: #b8872a;
}

.resource-tab[href*="category=bac"] {
  --resource-tab-color: #2f9e63;
}

.resource-tab[href*="category=grammar"] {
  --resource-tab-color: #7f5dff;
}

.resource-tab[href*="category=vocabulary"] {
  --resource-tab-color: #d14343;
}

.resource-tab[href*="category=resources"] {
  --resource-tab-color: #436aa8;
}

.resource-tab.active {
  background: var(--resource-tab-color);
  color: #fff;
  border-color: transparent;
}

.resource-tab[data-free-resources-tab] {
  background: var(--red-500);
  border-color: var(--red-500);
  color: #fff;
}

.resource-tab[data-free-resources-tab]:hover,
.resource-tab[data-free-resources-tab]:focus-visible {
  background: #b93131;
  border-color: #b93131;
}

.resource-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  color: var(--blue-900);
  font-weight: 700;
  white-space: nowrap;
}

.resource-search input {
  width: min(280px, 48vw);
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.resource-search-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.resource-search-modal[hidden] {
  display: none;
}

.resource-search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 22, 38, 0.48);
}

.resource-search-modal-window {
  position: relative;
  width: min(980px, 95vw);
  max-height: min(760px, 88vh);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.resource-search-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.resource-search-modal-header h2 {
  margin: 0;
  color: var(--blue-900);
  font-size: 1.25rem;
}

.resource-search-modal-close {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--blue-900);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.resource-search-modal-list {
  overflow: auto;
  padding: 1rem;
}

.resource-search-summary {
  margin: 0 0 1rem;
  color: var(--muted);
  font-weight: 700;
}

.resource-search-modal [data-animate] {
  opacity: 1;
  transform: none;
}

.resource-available-list {
  display: grid;
  gap: 0.55rem;
}

.resource-public-list {
  display: grid;
  gap: 0.6rem;
  width: 100%;
}

.resource-carousel-list.resource-public-list,
.resource-featured-list.resource-public-list {
  display: grid;
  max-height: min(70vh, 720px);
  overflow-y: auto;
  padding-right: 0.35rem;
  transform: none !important;
}

.resource-carousel-list.resource-public-list .resource-list-item {
  min-width: 0;
}

.resource-available-item,
.resource-list-item {
  --resource-type-color: var(--blue-700);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--resource-type-color) 32%, var(--border));
  border-left: 5px solid var(--resource-type-color);
  border-radius: 10px;
  background: #fff;
  color: var(--blue-900);
  text-align: left;
  cursor: pointer;
}

.resource-available-item:hover,
.resource-available-item:focus-visible,
.resource-list-item:hover,
.resource-list-item:focus-visible {
  border-color: var(--resource-type-color);
  background: #fff8df;
}

.resource-list-item-latest {
  --resource-type-color: var(--blue-700);
}

.resource-list-item-bepc {
  --resource-type-color: #b8872a;
}

.resource-list-item-bac {
  --resource-type-color: #2f9e63;
}

.resource-list-item-grammar {
  --resource-type-color: #7f5dff;
}

.resource-list-item-vocabulary {
  --resource-type-color: #d14343;
}

.resource-list-item-resources {
  --resource-type-color: #436aa8;
}

.resource-available-item strong,
.resource-available-item small,
.resource-list-item strong,
.resource-list-item span,
.resource-list-item small {
  display: block;
}

.resource-list-content {
  flex: 1 1 auto;
  min-width: 0;
}

.resource-list-content strong {
  color: var(--resource-type-color);
}

.resource-free-label {
  display: inline-block;
  color: var(--red-500);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: right;
}

.resource-list-page-count {
  color: var(--red-500);
  font-weight: 900;
}

.resource-list-side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-left: auto;
}

.resource-like-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--blue-700);
  padding: 0.38rem 0.62rem;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1.2;
  min-height: 34px;
}

.resource-like-btn.active {
  border-color: var(--gold-500);
  background: #fff8df;
  color: var(--blue-900);
}

.resource-list-content > span {
  margin-top: 0.25rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.resource-available-item small,
.resource-list-item small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-weight: 700;
}

.resource-list-reactions {
  color: var(--blue-700);
  font-weight: 800;
}

.resource-available-arrow {
  color: var(--blue-700);
  font-size: 1.6rem;
  line-height: 1;
}

.resource-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.resource-featured {
  margin: 1.4rem 0;
}

.resource-featured h2 {
  margin: 0 0 0.8rem;
  color: var(--blue-900);
  font-size: 1.25rem;
}

.resource-featured-list {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 0.4rem;
}

.resource-featured-list .resource-card {
  min-width: min(340px, 82vw);
  scroll-snap-align: start;
  gap: 0.9rem;
}

.resource-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.resource-carousel.resource-list-mode {
  display: block;
}

.resource-carousel-track {
  overflow: hidden;
}

.resource-carousel.resource-list-mode .resource-carousel-track {
  max-height: min(70vh, 720px);
  overflow-y: auto;
  padding-right: 0.35rem;
}

.resource-carousel-list {
  display: flex;
  gap: 0.9rem;
  transition: transform 0.3s ease;
}

.resource-carousel-list .card {
  min-width: min(320px, 80vw);
  min-height: 620px;
}

.resource-carousel-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue-700);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
}

.resource-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.resource-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(3.8rem, auto) auto auto;
  gap: 0.65rem;
  align-content: start;
  height: 100%;
}

.resource-card-pills {
  min-height: 4.3rem;
}

.resource-card h3 {
  min-height: 3.4rem;
}

.resource-card > p:not(.resource-meta) {
  min-height: 3.6rem;
}

.resource-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  align-self: end;
  margin-top: auto;
}

.resource-card .btn,
.resource-card-actions .btn {
  justify-self: start;
  min-height: 42px;
}

.resource-social {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.resource-social-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.resource-social-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--blue-700);
  padding: 0.42rem 0.68rem;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.88rem;
}

.resource-social-btn.active {
  border-color: var(--gold-500);
  background: #fff8df;
  color: var(--blue-900);
}

.resource-comment-count {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.resource-comment-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.resource-comment-form input {
  flex: 1 1 180px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
}

.resource-comment-form .btn {
  padding: 0.52rem 0.75rem;
}

.resource-comments {
  display: grid;
  gap: 0.4rem;
}

.resource-comment,
.resource-comments-empty {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
}

.resource-comment p {
  margin: 0.18rem 0;
  color: var(--text);
  font-size: 0.9rem;
}

.resource-comment small {
  color: var(--muted);
  font-size: 0.78rem;
}

.resource-preview-frame {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  height: 300px;
}

.resource-preview-frame[data-resource-preview-modal] {
  cursor: zoom-in;
}

.resource-preview-frame[data-resource-preview-modal]:focus-visible {
  outline: 3px solid rgba(184, 135, 42, 0.45);
  outline-offset: 3px;
}

.resource-preview-frame[data-resource-preview-modal]:hover {
  box-shadow: 0 0 0 2px rgba(184, 135, 42, 0.25);
}

.resource-preview-frame > .book-cover,
.resource-preview-frame > .pdf-preview,
.resource-preview-frame > .resource-placeholder,
.resource-preview-frame > .resource-preview-skeleton {
  height: 100%;
  aspect-ratio: auto;
}

.capture-protected-page .resource-preview-frame::after {
  content: "ENGLISH PROGRESS";
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: rgba(12, 42, 96, 0.18);
  font-size: clamp(1rem, 2.7vw, 1.8rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-18deg);
  pointer-events: none;
  user-select: none;
}

.capture-protected-page .resource-member-preview-frame::after {
  content: none;
}

.capture-protected-page .pdf-canvas-preview {
  position: relative;
}

.capture-protected-page .screen-capture-warning .resource-preview-frame {
  filter: blur(8px);
}

.resource-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(145deg, #eef4ff, #fff7da);
  color: var(--blue-700);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.resource-preview-skeleton {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(145deg, #eef4ff, #fff7da);
}

.resource-preview-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
  animation: resource-skeleton-shimmer 1.25s ease-in-out infinite;
}

@keyframes resource-skeleton-shimmer {
  to {
    transform: translateX(100%);
  }
}

.pdf-preview {
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #eef4ff;
}

.pdf-canvas-preview {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.45rem;
  display: block;
}

.pdf-canvas-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 0.55rem;
  border-radius: 8px;
  background: #fff;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.pdf-page-placeholder {
  display: grid;
  place-items: center;
  margin: 0 0 0.55rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.pdf-canvas-preview p {
  margin: 0;
  padding: 1rem;
  color: var(--muted);
}

.protected-preview {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.pdf-preview.protected-preview,
.pdf-canvas-preview.protected-preview {
  pointer-events: auto;
}

.resource-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.resource-preview-modal[hidden] {
  display: none;
}

.resource-preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 22, 38, 0.55);
}

.resource-preview-modal-window {
  position: relative;
  width: min(1080px, 96vw);
  max-height: min(900px, 94vh);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.resource-preview-modal-header,
.resource-preview-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.resource-preview-modal-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.resource-preview-modal-header h2 {
  margin: 0;
  color: var(--blue-900);
  font-size: 1.25rem;
}

.resource-preview-modal-close {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--blue-900);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.resource-preview-modal-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  background: #eef4ff;
}

.resource-preview-page-count {
  margin: 0 auto 0.75rem;
  max-width: 820px;
  color: var(--red-500);
  font-weight: 900;
}

.resource-preview-modal-view {
  position: relative;
  height: min(68vh, 680px);
  max-width: 820px;
  margin: 0 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #dbe5f5;
}

.resource-preview-html-view {
  width: min(100%, 920px);
  height: auto;
  min-height: min(72vh, 760px);
  max-width: 920px;
  overflow: visible;
  background: #fff;
}

.resource-preview-modal-view::before {
  content: "ENGLISH PROGRESS";
  position: sticky;
  top: 46%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 100%;
  height: 0;
  color: rgba(12, 42, 96, 0.18);
  font-size: clamp(1.1rem, 3vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-18deg);
  pointer-events: none;
  user-select: none;
}

.resource-preview-modal-view::after {
  content: "https://englishprogress.zynote.site";
  position: sticky;
  bottom: 0.8rem;
  z-index: 3;
  display: block;
  width: 100%;
  height: 0;
  color: rgba(12, 42, 96, 0.42);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.resource-preview-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

.resource-preview-html-iframe {
  height: var(--html-preview-frame-height, 72vh);
  min-height: min(72vh, 760px);
}

.resource-preview-modal-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: #fff;
}

.resource-preview-reactions {
  color: var(--muted);
  font-weight: 800;
  margin-right: auto;
}

.btn-disabled,
.btn-disabled:hover {
  opacity: 0.48;
  cursor: not-allowed;
  pointer-events: none;
}

.auth-card {
  max-width: 720px;
  margin: 0 auto;
}

.notice {
  border: 1px solid #c9d8f3;
  background: #eef4ff;
  color: var(--blue-700);
  border-radius: 12px;
  padding: 0.8rem;
  margin: 0.8rem 0;
}

.notice-success {
  border-color: #79c29d;
  background: #eaf8ef;
  color: #1d7a45;
}

.table-wrap {
  overflow: auto;
}

.table-basic {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table-basic th,
.table-basic td {
  border: 1px solid var(--border);
  padding: 0.55rem;
  text-align: left;
  vertical-align: top;
}

.table-basic th {
  background: #f6f9ff;
}

.stack {
  display: grid;
  gap: 0.7rem;
}

.message-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  background: #fff;
}

.message-item.unread {
  border-color: var(--gold-500);
  background: #fffaf0;
}

.message-item h4 {
  margin: 0 0 0.4rem;
}

.notification-row {
  cursor: pointer;
}

.notification-row:hover {
  border-color: #9eb8ea;
  background: #f6f9ff;
}

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

.check-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.check-line input,
input[type="checkbox"] {
  width: auto;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.resource-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f6f9ff;
}

.admin-resource-panels > .resource-admin-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.resource-admin-tab {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--blue-700);
  cursor: pointer;
  font-weight: 900;
  padding: 0.7rem 0.95rem;
}

.resource-admin-tab.active {
  border-color: var(--gold-500);
  background: #fff;
  color: var(--blue-900);
  box-shadow: 0 6px 18px rgba(12, 42, 96, 0.08);
}

.admin-resource-panels {
  gap: 0.85rem;
}

.admin-resource-panel {
  min-height: 0;
}

.admin-resource-panel[hidden] {
  display: none;
}

.admin-resource-table-wrap {
  max-height: min(640px, 68vh);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.admin-resource-table-wrap .table-basic th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.html-resource-admin {
  display: grid;
  gap: 0.65rem;
}

.html-resource-admin[hidden] {
  display: none;
}

.html-resource-admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.html-resource-admin-section {
  display: grid;
  gap: 0.65rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.html-resource-admin-toolbar .btn {
  min-height: 36px;
  padding: 0.45rem 0.7rem;
}

.wysiwyg-editor,
.html-code-input {
  min-height: 220px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--blue-900);
  padding: 0.85rem;
  line-height: 1.65;
}

.wysiwyg-editor {
  overflow: auto;
}

.wysiwyg-editor:empty::before {
  content: "Rédigez votre ressource ici...";
  color: var(--muted);
}

.html-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}

.html-resource-page {
  background: #eef4ff;
}

.html-resource-main {
  width: min(980px, calc(100% - 2rem));
  margin: 1.2rem auto 2rem;
}

.html-resource-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.html-resource-document {
  min-height: 70vh;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 2.2rem);
}

.html-resource-preview-page {
  background: #fff;
}

.html-resource-preview-page .html-resource-main {
  width: 100%;
  margin: 0;
}

.html-resource-preview-page .html-resource-document {
  min-height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.html-resource-document-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.html-resource-document-header h1,
.html-resource-login h1 {
  margin: 0 0 0.45rem;
  color: var(--blue-900);
}

.html-resource-document-header p,
.html-resource-login p {
  color: var(--muted);
  font-weight: 700;
}

.html-resource-content {
  color: #17294f;
  line-height: 1.75;
}

.html-resource-content img,
.html-resource-content table {
  max-width: 100%;
}

.html-resource-content table {
  border-collapse: collapse;
}

.html-resource-content th,
.html-resource-content td {
  border: 1px solid var(--border);
  padding: 0.45rem;
}

.html-resource-login {
  display: grid;
  place-items: center;
  min-height: 54vh;
  text-align: center;
}

.html-resource-restricted-preview-content {
  position: relative;
  max-height: 55vh;
  overflow: hidden;
}

.html-resource-restricted-preview-content::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 9rem;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 82%);
  pointer-events: none;
}

.html-resource-preview-restriction {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  padding: 1.1rem;
  border: 1px solid #f1c453;
  border-radius: 12px;
  background: #fff8df;
  color: var(--blue-900);
  text-align: center;
}

.html-resource-preview-restriction h2 {
  margin: 0;
  font-size: 1.1rem;
}

.html-resource-preview-restriction p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.html-resource-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.html-resource-print-watermark .html-resource-document {
  position: relative;
}

.html-resource-print-watermark .html-resource-document::before {
  content: "APERÇU GRATUIT - ENGLISH PROGRESS";
  position: fixed;
  top: 48%;
  left: 50%;
  z-index: 8;
  width: 110%;
  color: rgba(12, 42, 96, 0.16);
  font-size: clamp(1.4rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%) rotate(-18deg);
  pointer-events: none;
  user-select: none;
}

.html-resource-print-watermark .html-resource-content,
.html-resource-print-watermark .html-resource-document-header {
  position: relative;
  z-index: 1;
}

.html-resource-print-footer {
  display: none;
}

.html-resource-print-watermark-layer {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 9mm 11mm;
  }

  body.html-resource-page {
    background: #fff;
    color: #10224a;
    font-size: 10pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .html-resource-page header,
  .html-resource-toolbar {
    display: none !important;
  }

  .html-resource-main {
    width: 100%;
    margin: 0;
  }

  .html-resource-document {
    min-height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 0.75cm;
  }

  .html-resource-document-header {
    margin-bottom: 0.22cm;
    padding-bottom: 0.14cm;
  }

  .html-resource-document-header h1 {
    margin: 0 0 0.08cm;
    font-size: 15pt;
    line-height: 1.12;
  }

  .html-resource-document-header p {
    margin: 0;
    font-size: 9.5pt;
    line-height: 1.22;
  }

  .html-resource-content {
    line-height: 1.28;
  }

  .html-resource-content p,
  .html-resource-content ul,
  .html-resource-content ol,
  .html-resource-content table,
  .html-resource-content blockquote {
    margin-top: 0;
    margin-bottom: 0.18cm;
  }

  .html-resource-content h1,
  .html-resource-content h2,
  .html-resource-content h3,
  .html-resource-content h4 {
    margin-top: 0.24cm;
    margin-bottom: 0.1cm;
    line-height: 1.12;
    break-after: avoid;
  }

  .html-resource-content h1 {
    font-size: 15pt;
  }

  .html-resource-content h2 {
    font-size: 13pt;
  }

  .html-resource-content h3,
  .html-resource-content h4 {
    font-size: 11pt;
  }

  .html-resource-content img {
    max-height: 20cm;
    object-fit: contain;
  }

  .html-resource-content th,
  .html-resource-content td {
    padding: 0.12cm;
  }

  .html-resource-content * {
    break-inside: auto;
  }

  .html-resource-content table,
  .html-resource-content img {
    break-inside: avoid;
  }

  .html-resource-print-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10000;
    display: block;
    padding: 0.12cm 0;
    border-top: 1px solid #c9d8f3;
    background: #fff;
    color: #0c2a60;
    font-size: 8pt;
    font-weight: 800;
    text-align: center;
  }

  .html-resource-print-watermark .html-resource-document::before {
    content: none;
  }

  body.html-resource-print-watermark::before {
    content: none;
  }

  .html-resource-print-watermark-layer {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 9999;
    display: block;
    pointer-events: none;
  }

  .html-resource-print-watermark-layer span {
    position: absolute;
    left: 50%;
    width: 115%;
    color: rgba(12, 42, 96, 0.2);
    font-size: 26pt;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
    transform: translate(-50%, -50%) rotate(-18deg);
    user-select: none;
  }

  .html-resource-content,
  .html-resource-document-header {
    position: relative;
    z-index: 1;
  }
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}


.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue-700);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.filter-btn.active {
  background: linear-gradient(130deg, var(--blue-700), var(--purple-500));
  border-color: transparent;
  color: #fff;
}

.contact-strip {
  background: linear-gradient(120deg, #0d2d62, #2a61cb, #2f9e63);
  color: #fff;
  border-radius: 16px;
  padding: 1rem;
}

.whatsapp-btn {
  background: #25d366;
  color: #fff;
}

footer {
  margin-top: 3.4rem;
  background: linear-gradient(120deg, #0b2248, #163a78);
  color: #e8eefb;
  padding: 2.2rem 0;
}

.footer-credits {
  margin-top: 1.1rem;
  color: #cddaf2;
  font-size: 0.9rem;
}

.footer-credits p {
  margin: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 1rem;
}

.footer-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.footer-link {
  display: block;
  color: #cddaf2;
  margin-bottom: 0.4rem;
}

.flag-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red {
  background: var(--red-500);
}

.dot.green {
  background: var(--green-500);
}

.dot.gold {
  background: var(--gold-500);
}

[data-animate] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .carousel-track {
    max-width: none;
    margin: 0;
  }
}

@media (max-width: 780px) {
  html,
  body {
    overflow-x: hidden;
  }

  .container {
    width: min(100% - 1.5rem, 1140px);
  }

  .section {
    padding: 2.2rem 0;
  }

  .section-title {
    font-size: 1.75rem;
    line-height: 1.15;
  }

  .section-subtitle {
    margin-bottom: 1.2rem;
  }

  .nav-wrap {
    min-height: 64px;
  }

  .brand-logo {
    height: 52px;
  }

  .menu-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--blue-900);
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    display: none;
    box-shadow: 0 16px 28px rgba(27, 73, 153, 0.12);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .nav-links a {
    width: 100%;
    font-size: 0.98rem;
    padding: 0.8rem 0.75rem;
    border-bottom: 1px solid rgba(30, 83, 183, 0.12);
  }

  .nav-links a + a {
    margin-left: 0;
  }

  .nav-links a + a::before {
    display: none;
  }

  .nav-links a.active {
    background: #f6f9ff;
    border-radius: 10px;
  }

  .nav-links.open {
    display: flex;
  }

  .member-welcome {
    padding: 0.75rem;
    white-space: normal;
  }

  .notification-wrap {
    margin: 0.65rem 0 0.2rem;
  }

  .notification-modal {
    top: calc(var(--notification-panel-top, 76px) + 0.25rem);
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .notification-modal-window {
    max-height: min(560px, calc(100vh - var(--notification-panel-top, 76px) - 1rem));
  }

  .hero {
    padding: 1.3rem 0 2rem;
  }

  .hero-grid {
    gap: 1.2rem;
  }

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

  .hero-actions,
  .form-actions,
  .message-actions,
  .resource-top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn,
  .form-actions .btn,
  .message-actions .btn,
  .hero-actions .btn,
  .resource-top-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-card {
    padding: 1rem;
  }

  .hero-carousel {
    max-width: min(280px, 82vw);
  }

  .grid-2,
  .field-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .card {
    border-radius: 12px;
    padding: 0.95rem;
  }

  .card:hover {
    transform: none;
  }

  form {
    padding: 0.95rem;
    border-radius: 12px;
  }

  .resource-tools {
    align-items: stretch;
  }

  .resources-ad-strip {
    margin-top: 0.7cm;
  }

  .resources-ad-card {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.9rem;
  }

  .resources-ad-action {
    justify-items: stretch;
    text-align: left;
  }

  .resources-ad-action .btn {
    width: 100%;
  }

  .resource-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .resource-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 0.58rem 0.8rem;
    font-size: 0.9rem;
  }

  .resource-search {
    width: 100%;
    margin-left: 0;
    display: grid;
    gap: 0.35rem;
    white-space: normal;
  }

  .resource-search input {
    width: 100%;
  }

  .resource-featured-list {
    gap: 0.75rem;
    padding-bottom: 0.6rem;
  }

  .resource-featured-list .resource-card,
  .resource-carousel-list .card {
    min-width: min(88vw, 360px);
    min-height: 590px;
  }

  .resource-carousel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .resource-carousel-track {
    grid-column: 1 / -1;
    order: 1;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    scroll-snap-type: x proximity;
  }

  .resource-carousel-list {
    transition: none;
  }

  .resource-carousel-list .card {
    scroll-snap-align: start;
  }

  .resource-carousel-btn {
    order: 2;
    width: 100%;
    height: 42px;
    border-radius: 12px;
  }

  .pdf-canvas-preview {
    height: min(320px, 52vh);
  }

  .resource-preview-frame {
    height: 280px;
  }

  .resource-card-pills {
    min-height: 4rem;
  }

  .resource-card h3 {
    min-height: 3.2rem;
  }

  .resource-card > p:not(.resource-meta) {
    min-height: 3.4rem;
  }

  .resource-search-modal {
    padding: 0.65rem;
    align-items: end;
  }

  .resource-search-modal-window {
    width: 100%;
    max-height: 88vh;
    border-radius: 14px 14px 0 0;
  }

  .resource-search-modal-header {
    padding: 0.85rem;
  }

  .resource-search-modal-list {
    padding: 0.85rem;
  }

  .resource-preview-modal {
    padding: 0.65rem;
    align-items: end;
  }

  .resource-preview-modal-window {
    width: 100%;
    max-height: 92vh;
    border-radius: 14px 14px 0 0;
  }

  .resource-preview-modal-header,
  .resource-preview-modal-actions {
    padding: 0.85rem;
  }

  .resource-preview-modal-body {
    padding: 0.75rem;
  }

  .resource-preview-modal-view {
    height: 64vh;
  }

  .resource-preview-html-view {
    height: auto;
    min-height: 66vh;
  }

  .resource-preview-html-iframe {
    min-height: 66vh;
  }

  .resource-preview-modal-actions .btn {
    flex: 1 1 220px;
    justify-content: center;
  }

  .resource-preview-modal-actions .resource-like-btn {
    flex: 1 1 220px;
    justify-content: center;
  }

  .resource-preview-reactions {
    width: 100%;
    text-align: center;
    margin-right: 0;
  }

  .table-wrap {
    margin-inline: -0.25rem;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  .table-basic {
    min-width: 760px;
    font-size: 0.86rem;
  }

  .footer-grid {
    gap: 1.4rem;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 1rem, 1140px);
  }

  .section {
    padding: 1.75rem 0;
  }

  .section-title {
    font-size: 1.55rem;
  }

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

  .hero-subscribe h2 {
    font-size: 1.18rem;
  }

  .price-highlight {
    display: block;
    margin-top: 0.2rem;
  }

  .resource-tab {
    max-width: 78vw;
    white-space: normal;
    text-align: center;
  }

  .resource-card .btn {
    justify-self: stretch;
    min-height: 46px;
  }

  .resource-comment-form input,
  .resource-comment-form .btn {
    flex-basis: 100%;
  }

  .resource-preview-frame {
    height: 250px;
  }

  .resource-featured-list .resource-card,
  .resource-carousel-list .card {
    min-height: 560px;
  }

  .resource-preview-modal-actions .btn {
    flex-basis: 100%;
  }

  .message-item {
    padding: 0.7rem;
  }

  .notification-modal {
    left: 0.5rem;
    right: 0.5rem;
  }

  .notification-modal-header,
  .notification-modal-item {
    padding: 0.75rem;
  }
}

@media print {
  header,
  footer,
  .hero-actions,
  .carousel-btn,
  .carousel-dots,
  .capture-protected-page [data-resources-page] {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .section,
  main .section:nth-of-type(odd),
  main .section:nth-of-type(even) {
    background: #fff !important;
    padding: 1rem 0 !important;
  }

}
