body[data-color-theme="downloads"] {
  --downloads-ink: #173042;
  --downloads-muted: #607588;
  --downloads-accent: #bb5a1d;
  --downloads-accent-dark: #84380f;
  --downloads-line: #dce5eb;
  --downloads-surface: #ffffff;
  --downloads-soft: #f4f8fa;
  background: #f6f9fb;
}

body[data-color-theme="downloads"] footer .footer-content {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

body.dark-mode[data-color-theme="downloads"] {
  --downloads-ink: #e7eef5;
  --downloads-muted: #aab9c7;
  --downloads-line: #344456;
  --downloads-surface: #111b29;
  --downloads-soft: #0c1522;
  background: #0b1220;
}

body.dark-mode[data-color-theme="downloads"] .downloads-library,
body.dark-mode[data-color-theme="downloads"] .downloads-related {
  background: #0b1220;
}

body.dark-mode[data-color-theme="downloads"] .downloads-howto {
  background: #0f1926;
  border-color: #263648;
}

body.dark-mode[data-color-theme="downloads"] .downloads-filters,
body.dark-mode[data-color-theme="downloads"] .worksheet-card,
body.dark-mode[data-color-theme="downloads"] .worksheet-design-card,
body.dark-mode[data-color-theme="downloads"] .downloads-empty-state,
body.dark-mode[data-color-theme="downloads"] .downloads-related a {
  border-color: var(--downloads-line);
  background: var(--downloads-surface);
}

body.dark-mode[data-color-theme="downloads"] .downloads-filters label,
body.dark-mode[data-color-theme="downloads"] .downloads-intro,
body.dark-mode[data-color-theme="downloads"] .downloads-result-count,
body.dark-mode[data-color-theme="downloads"]
  .worksheet-card-content
  > p:not(.worksheet-details),
body.dark-mode[data-color-theme="downloads"] .worksheet-details,
body.dark-mode[data-color-theme="downloads"] .downloads-empty-state p,
body.dark-mode[data-color-theme="downloads"] .downloads-steps p,
body.dark-mode[data-color-theme="downloads"] .downloads-related a {
  color: var(--downloads-muted);
}

body.dark-mode[data-color-theme="downloads"] .downloads-heading-row h2,
body.dark-mode[data-color-theme="downloads"] .downloads-howto-heading h2,
body.dark-mode[data-color-theme="downloads"] .worksheet-card h3,
body.dark-mode[data-color-theme="downloads"] .worksheet-design-copy h3,
body.dark-mode[data-color-theme="downloads"] .downloads-empty-state h3,
body.dark-mode[data-color-theme="downloads"] .downloads-steps h3,
body.dark-mode[data-color-theme="downloads"] .downloads-related strong {
  color: var(--downloads-ink);
}

body.dark-mode[data-color-theme="downloads"] .downloads-filters select,
body.dark-mode[data-color-theme="downloads"] .downloads-reset {
  border-color: #46596d;
  color: #e4edf5;
  background: #162334;
}

body.dark-mode[data-color-theme="downloads"] .downloads-steps article {
  border-color: #344456;
  background: #111b29;
}

.downloads-hero {
  --hero-accent: #d77a2d;
  --hero-accent-bright: #f3bb59;
  --hero-deep: #7d351d;
  background:
    linear-gradient(
      105deg,
      rgba(12, 45, 70, 0.76) 0%,
      rgba(16, 79, 111, 0.5) 52%,
      rgba(18, 83, 117, 0.24) 100%
    ),
    url("../downloads/image.png") center 48% / cover no-repeat;
}

body .downloads-hero {
  min-height: 480px;
  padding-top: clamp(5.5rem, 9vw, 7rem);
  padding-bottom: 4.25rem;
}

.downloads-hero .pillar-hero__subtitle {
  max-width: 720px;
}

.downloads-search {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: min(100%, 760px);
  min-height: 66px;
  margin: 0 auto;
  padding: 0.45rem 0.55rem 0.45rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(27, 35, 44, 0.24);
  color: #64748b;
}

.downloads-search > i {
  color: var(--downloads-accent);
  font-size: 1.1rem;
}

.downloads-search input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 0.8rem 0.2rem;
  border: 0;
  outline: 0;
  color: var(--downloads-ink);
  background: transparent;
  font: inherit;
}

.downloads-search input::placeholder {
  color: #8795a2;
}

.downloads-search button,
.worksheet-download {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--downloads-accent-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.downloads-search button:hover,
.worksheet-download:hover {
  transform: translateY(-1px);
  background: #692b0b;
  box-shadow: 0 6px 16px rgba(105, 43, 11, 0.2);
}

.downloads-search button:focus-visible,
.worksheet-download:focus-visible,
.downloads-reset:focus-visible,
.downloads-filters select:focus-visible {
  outline: 3px solid #123f67;
  outline-offset: 3px;
}

.downloads-hero-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 1.2rem 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
}

.downloads-hero-note i {
  color: #ffe4a3;
}

.downloads-container {
  width: min(100% - 2.5rem, 1160px);
  margin: 0 auto;
}

.downloads-library {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
  background: #f6f9fb;
}

.downloads-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.downloads-kicker {
  margin: 0 0 0.45rem;
  color: var(--downloads-accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.downloads-heading-row h2,
.downloads-howto-heading h2 {
  margin: 0;
  color: var(--downloads-ink);
  font-family: "Poppins", "Inter", sans-serif;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  line-height: 1.2;
}

.downloads-intro {
  margin: 0.65rem 0 0;
  color: var(--downloads-muted);
}

.downloads-result-count {
  margin: 0 0 0.3rem;
  color: #526879;
  font-size: 0.94rem;
  font-weight: 650;
}

.downloads-filters {
  display: flex;
  align-items: end;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.25rem;
  border: 1px solid var(--downloads-line);
  border-radius: 18px;
  background: var(--downloads-surface);
  box-shadow: 0 8px 26px rgba(31, 57, 72, 0.06);
}

.downloads-filters label {
  display: grid;
  flex: 1;
  gap: 0.45rem;
  color: #334e60;
  font-size: 0.85rem;
  font-weight: 700;
}

.downloads-filters select {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 2.25rem 0.65rem 0.8rem;
  border: 1px solid #c8d5de;
  border-radius: 10px;
  color: #263f50;
  background: #fff;
  font: inherit;
  font-size: 0.94rem;
}

.downloads-reset {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid #cad7df;
  border-radius: 10px;
  color: #3e5868;
  background: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.downloads-reset:hover {
  border-color: var(--downloads-accent);
  color: var(--downloads-accent-dark);
  background: #fff8f1;
}

.downloads-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.worksheet-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--downloads-line);
  border-radius: 18px;
  background: var(--downloads-surface);
  box-shadow: 0 8px 24px rgba(31, 57, 72, 0.055);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.worksheet-card:hover {
  transform: translateY(-3px);
  border-color: #e6b38e;
  box-shadow: 0 14px 30px rgba(31, 57, 72, 0.11);
}

.worksheet-card-preview {
  padding: 0.9rem;
  background: var(--downloads-soft);
}

.worksheet-card-page {
  display: flex;
  min-height: 224px;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem 1.05rem;
  border: 1px solid #e0e7eb;
  border-top: 4px solid #217b80;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(31, 48, 62, 0.08);
}

.worksheet-card-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #dfe8eb;
}

.worksheet-card-page-mark {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: #217b80;
  font-size: 0.65rem;
  font-weight: 850;
}

.worksheet-card-page-level {
  color: #54717c;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

.worksheet-card-page-title {
  display: -webkit-box;
  overflow: hidden;
  color: #1b3347;
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.worksheet-card-page-sections {
  display: grid;
  gap: 0.42rem;
}

.worksheet-card-page-section {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.45rem;
  color: #394f5b;
  font-size: 0.66rem;
  font-weight: 700;
}

.worksheet-card-page-number {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 6px;
  color: #216b70;
  background: #e9f4f4;
  font-size: 0.55rem;
  font-weight: 850;
}

.worksheet-card-page-task {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worksheet-card-page-writing {
  min-height: 31px;
  margin-top: auto;
  border: 1px solid #dce5ea;
  border-radius: 5px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 10px,
    #e4e9ec 10px 11px
  );
}

.worksheet-card-content {
  min-width: 0;
  flex: 1;
  padding: 1rem 1.1rem 0.8rem;
}

.worksheet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
}

.worksheet-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.35;
}

.worksheet-level {
  color: #154e63;
  background: #dff3f6;
}

.worksheet-skill {
  color: #784018;
  background: #fff0de;
}

.worksheet-card h3 {
  margin: 0;
  color: #1c3445;
  font-size: 1.08rem;
  line-height: 1.35;
}

.worksheet-card-content > p:not(.worksheet-details) {
  margin: 0.45rem 0 0;
  color: #5e7180;
  font-size: 0.9rem;
  line-height: 1.55;
}

.worksheet-details {
  margin: 0.7rem 0 0;
  color: #718392;
  font-size: 0.78rem;
}

.worksheet-download {
  align-self: flex-start;
  min-height: 42px;
  margin: 0 1.1rem 1.1rem;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-size: 0.87rem;
}

.downloads-empty-state {
  max-width: 650px;
  margin: 1rem auto 0;
  padding: clamp(2rem, 5vw, 3.25rem);
  border: 1px dashed #c5d4de;
  border-radius: 22px;
  background: #fff;
  text-align: center;
}

.downloads-empty-state[hidden] {
  display: none;
}

.downloads-empty-icon {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  margin: 0 auto 1rem;
  border-radius: 22px;
  color: #a84c1b;
  background: #fff0e3;
  font-size: 1.7rem;
}

.downloads-empty-state h3 {
  margin: 0;
  color: #20394a;
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 1.35rem;
}

.downloads-empty-state p {
  max-width: 480px;
  margin: 0.6rem auto 0;
  color: #617687;
  line-height: 1.65;
}

.worksheet-designs {
  padding: clamp(2.75rem, 6vw, 4.5rem) 0;
  border-top: 1px solid #e7edf1;
  background: #fff;
}

.worksheet-designs[hidden] {
  display: none;
}

.worksheet-designs-heading {
  margin-bottom: 1.5rem;
}

.worksheet-designs-heading > div {
  max-width: 720px;
}

.worksheet-design-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 1.1rem;
}

.worksheet-design-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--downloads-line);
  border-radius: 18px;
  background: var(--downloads-surface);
  box-shadow: 0 10px 28px rgba(31, 57, 72, 0.07);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.worksheet-design-card:hover {
  transform: translateY(-3px);
  border-color: #e6b38e;
  box-shadow: 0 15px 32px rgba(31, 57, 72, 0.12);
}

.design-thumb {
  display: flex;
  min-height: 236px;
  flex-direction: column;
  gap: 0.55rem;
  margin: 1rem 1rem 0;
  padding: 1.05rem 1.1rem;
  border: 1px solid #e1e7eb;
  border-top: 4px solid #217b80;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(31, 48, 62, 0.07);
}

.worksheet-design-card--timeline .design-thumb {
  border-top-color: #3b71a3;
}

.worksheet-design-card--mission .design-thumb {
  border-top-color: #cf7b2c;
}

.design-thumb__eyebrow {
  color: #677989;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.design-thumb__title {
  margin: 0.15rem 0 0;
  color: #1b3347;
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.design-thumb__line {
  display: block;
  width: 82%;
  height: 6px;
  border-radius: 4px;
  background: #e7edf1;
}

.design-thumb__line--short {
  width: 55%;
  height: 4px;
}

.design-thumb__line--medium {
  width: 68%;
}

.design-thumb__task,
.design-thumb__clue {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #304651;
  font-size: 0.69rem;
  font-weight: 750;
}

.design-thumb__task b {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
  border-radius: 6px;
  color: #216b70;
  background: #e9f4f4;
  font-size: 0.58rem;
}

.design-thumb__writing {
  min-height: 35px;
  border: 1px solid #dce5ea;
  border-radius: 5px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 11px,
    #e4e9ec 11px 12px
  );
}

.design-thumb__timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.5rem;
  border-radius: 8px;
  color: #256d70;
  background: #eef6f5;
  font-size: 0.62rem;
  font-weight: 800;
}

.design-thumb__timeline i {
  flex: 1;
  height: 2px;
  background: #7db6b2;
}

.design-thumb__numbers {
  display: flex;
  gap: 0.4rem;
}

.design-thumb__numbers i {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid #d8e2e7;
  border-radius: 50%;
  color: #728391;
  font-size: 0.6rem;
  font-style: normal;
}

.design-thumb__clue b {
  padding: 0.22rem 0.35rem;
  border-radius: 4px;
  color: #8d5a11;
  background: #fff2dd;
  font-size: 0.52rem;
  letter-spacing: 0.04em;
}

.worksheet-design-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.1rem 1.25rem 1.2rem;
}

.worksheet-design-status {
  margin: 0 0 0.4rem;
  color: #758594;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.worksheet-design-copy h3 {
  margin: 0;
  color: #1c3445;
  font-size: 1.08rem;
  line-height: 1.35;
}

.worksheet-design-copy > p:not(.worksheet-design-status) {
  margin: 0.45rem 0 1rem;
  color: var(--downloads-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.worksheet-design-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--downloads-line);
  color: var(--downloads-accent-dark);
  font-size: 0.83rem;
  font-weight: 800;
  text-decoration: none;
}

.worksheet-design-link:hover {
  color: #692b0b;
  text-decoration: underline;
}

body.dark-mode[data-color-theme="downloads"] .worksheet-designs {
  border-color: #263648;
  background: #0f1926;
}

body.dark-mode[data-color-theme="downloads"]
  .worksheet-design-copy
  > p:not(.worksheet-design-status) {
  color: var(--downloads-muted);
}

body.dark-mode[data-color-theme="downloads"] .worksheet-design-link {
  border-color: var(--downloads-line);
  color: #efb17f;
}

.downloads-howto {
  padding: clamp(3rem, 7vw, 5rem) 0;
  background: #fff;
  border-top: 1px solid #e8eef2;
}

.downloads-howto-heading {
  margin-bottom: 1.7rem;
  text-align: center;
}

.downloads-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.downloads-steps article {
  padding: 1.4rem;
  border: 1px solid #e0e8ed;
  border-radius: 16px;
  background: #f8fafb;
}

.downloads-steps article > span {
  color: #ad4d1a;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.downloads-steps h3 {
  margin: 0.5rem 0 0.25rem;
  color: #20394a;
  font-size: 1.04rem;
}

.downloads-steps p {
  margin: 0;
  color: #617687;
  font-size: 0.92rem;
  line-height: 1.55;
}

.downloads-related {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  width: min(100% - 2.5rem, 1160px);
  margin: 0 auto;
  padding: 2.5rem 0;
}

.downloads-related a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid #dfe8ed;
  border-radius: 14px;
  color: #526a79;
  background: #fff;
  text-decoration: none;
}

.downloads-related a:hover {
  border-color: #e2a577;
  background: #fffaf6;
}

.downloads-related > a > i {
  color: #ad4d1a;
  font-size: 1.25rem;
}

.downloads-related span {
  display: grid;
  gap: 0.15rem;
  font-size: 0.82rem;
}

.downloads-related strong {
  color: #20394a;
  font-size: 0.9rem;
}

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

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

@media (max-width: 640px) {
  body .downloads-hero {
    min-height: auto;
    padding-top: 6rem;
    padding-bottom: 3.25rem;
  }

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

  .downloads-search {
    gap: 0.45rem;
    padding-left: 0.9rem;
  }

  .downloads-search input {
    font-size: 0.9rem;
  }

  .downloads-search button {
    min-height: 42px;
    padding: 0.55rem 0.75rem;
  }

  .downloads-heading-row {
    align-items: start;
    flex-direction: column;
    gap: 0.5rem;
  }

  .downloads-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .downloads-card-grid,
  .downloads-steps,
  .downloads-related {
    grid-template-columns: 1fr;
  }

  .downloads-hero-note {
    align-items: flex-start;
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  body[data-color-theme="downloads"] footer .footer-content {
    grid-template-columns: 1fr;
  }

  body[data-color-theme="downloads"] footer .footer-brand {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .worksheet-card,
  .worksheet-design-card,
  .downloads-search button,
  .worksheet-download {
    transition: none;
  }
}

/* Library refresh: clearer hierarchy, stronger worksheet previews, and a
   more inviting set of cards without changing the catalog's behavior. */
body[data-color-theme="downloads"] {
  --downloads-accent: #147d78;
  --downloads-accent-dark: #11635f;
  --downloads-line: #dce8e8;
  --downloads-soft: #eff7f6;
  background: #f3f7f8;
}

.downloads-library {
  position: relative;
  isolation: isolate;
  padding-top: clamp(3.5rem, 6vw, 5rem);
  padding-bottom: clamp(3.5rem, 6vw, 5rem);
  background:
    radial-gradient(
      ellipse at 12% 18%,
      rgba(20, 125, 120, 0.055),
      transparent 28rem
    ),
    #f3f7f8;
}

.downloads-heading-row {
  align-items: end;
  margin-bottom: 1.5rem;
}

.downloads-kicker {
  color: #147d78;
}

.downloads-intro {
  max-width: 46rem;
  line-height: 1.65;
}

.downloads-result-count {
  flex: 0 0 auto;
  margin: 0 0 0.15rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #d5e7e5;
  border-radius: 999px;
  color: #286461;
  background: #fff;
  box-shadow: 0 4px 14px rgba(20, 73, 78, 0.05);
  font-size: 0.82rem;
  font-weight: 750;
}

.downloads-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding: 1.15rem;
  border-color: rgba(195, 216, 219, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(31, 57, 72, 0.065);
  backdrop-filter: blur(12px);
}

.downloads-filters label {
  gap: 0.5rem;
  color: #3a5660;
  font-size: 0.78rem;
  letter-spacing: 0.025em;
}

.downloads-filters select {
  min-height: 50px;
  border-color: #d7e3e5;
  border-radius: 12px;
  color: #24424c;
  background-color: #f9fbfb;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.downloads-filters select:hover {
  border-color: #91c5c1;
  background-color: #fff;
}

.downloads-filters select:focus-visible {
  border-color: #147d78;
  box-shadow: 0 0 0 4px rgba(20, 125, 120, 0.13);
  outline: 0;
}

.downloads-reset {
  align-self: end;
  min-height: 50px;
  justify-content: center;
  border-color: #d7e3e5;
  border-radius: 12px;
  color: #45616a;
  background: #fff;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.downloads-reset:hover {
  transform: translateY(-1px);
  border-color: #9dcac7;
  color: #11635f;
  background: #eff9f7;
}

.downloads-card-grid {
  align-items: stretch;
  gap: 1.25rem;
}

.worksheet-card {
  position: relative;
  border-color: #dce7e9;
  border-radius: 22px;
  background: #fff;
  box-shadow:
    0 2px 6px rgba(28, 54, 65, 0.025),
    0 12px 30px rgba(28, 54, 65, 0.065);
}

.worksheet-card::before {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 1.25rem;
  left: 1.25rem;
  height: 3px;
  border-radius: 0 0 99px 99px;
  background: linear-gradient(90deg, #147d78, #67b9b0 55%, #f0b86f);
  content: "";
}

.worksheet-card:hover {
  transform: translateY(-5px);
  border-color: #a9ceca;
  box-shadow:
    0 5px 12px rgba(28, 54, 65, 0.035),
    0 20px 42px rgba(28, 54, 65, 0.12);
}

.worksheet-card-preview {
  position: relative;
  padding: 1.1rem 1.1rem 1rem;
  border-bottom: 1px solid #e8efef;
  background:
    radial-gradient(
      ellipse at 90% 10%,
      rgba(255, 255, 255, 0.9),
      transparent 48%
    ),
    linear-gradient(145deg, #eff8f6, #eaf1f5);
}

.worksheet-card-page {
  position: relative;
  min-height: 210px;
  gap: 0.65rem;
  padding: 1rem 1.1rem 0.95rem;
  border-color: #e2e9e9;
  border-top: 3px solid #18847e;
  border-radius: 12px;
  box-shadow:
    0 2px 4px rgba(29, 55, 66, 0.035),
    0 8px 18px rgba(29, 55, 66, 0.075);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.worksheet-card:hover .worksheet-card-page {
  transform: translateY(-2px) rotate(-0.25deg);
  box-shadow: 0 12px 22px rgba(29, 55, 66, 0.11);
}

.worksheet-card-page-header {
  padding-bottom: 0.55rem;
  border-color: #e8eeee;
}

.worksheet-card-page-mark {
  width: 23px;
  height: 23px;
  flex-basis: 23px;
  border-radius: 7px;
  background: linear-gradient(145deg, #16857e, #10645f);
  box-shadow: 0 3px 7px rgba(20, 125, 120, 0.2);
  font-size: 0.68rem;
}

.worksheet-card-page-level {
  color: #53747a;
  font-size: 0.59rem;
}

.worksheet-card-page-title {
  max-width: 95%;
  color: #183844;
  font-size: 1.04rem;
  line-height: 1.25;
}

.worksheet-card-page-sections {
  gap: 0.5rem;
  margin-top: 0.1rem;
}

.worksheet-card-page-section {
  gap: 0.55rem;
  color: #405b62;
  font-size: 0.69rem;
}

.worksheet-card-page-number {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  border-radius: 7px;
  color: #116a64;
  background: #e7f4f1;
  font-size: 0.58rem;
}

.worksheet-card-page-writing {
  min-height: 26px;
  border-color: #e2e9eb;
  border-radius: 7px;
  background: repeating-linear-gradient(
    to bottom,
    #fff 0 9px,
    #e8eeee 9px 10px
  );
}

.worksheet-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.05rem 1.2rem 0.9rem;
}

.worksheet-tags {
  gap: 0.42rem;
  margin-bottom: 0.72rem;
}

.worksheet-tag {
  padding: 0.27rem 0.62rem;
  font-size: 0.68rem;
  font-weight: 800;
}

.worksheet-level {
  color: #0e625e;
  background: #e2f3f0;
}

.worksheet-skill {
  color: #80552b;
  background: #fff3e4;
}

.worksheet-card h3 {
  color: #183844;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.worksheet-card-content > p:not(.worksheet-details) {
  margin-top: 0.5rem;
  color: #61757b;
  font-size: 0.88rem;
  line-height: 1.6;
}

.worksheet-details {
  margin-top: auto;
  padding-top: 0.8rem;
  color: #778a8e;
  font-size: 0.74rem;
  line-height: 1.45;
}

.worksheet-download {
  align-self: stretch;
  min-height: 46px;
  justify-content: center;
  margin: 0 1.2rem 1.2rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #147d78, #11635f);
  box-shadow: 0 5px 12px rgba(17, 99, 95, 0.16);
  font-size: 0.88rem;
  letter-spacing: 0.005em;
}

.worksheet-download:hover {
  background: linear-gradient(135deg, #116d68, #0d5552);
  box-shadow: 0 8px 18px rgba(17, 99, 95, 0.24);
}

.downloads-howto {
  position: relative;
  padding-top: clamp(3.5rem, 6vw, 5rem);
  padding-bottom: clamp(3.5rem, 6vw, 5rem);
  background:
    radial-gradient(
      ellipse at 80% 10%,
      rgba(20, 125, 120, 0.07),
      transparent 30rem
    ),
    #fff;
}

.downloads-howto-heading {
  margin-bottom: 2rem;
}

.downloads-steps {
  gap: 1.15rem;
}

.downloads-steps article {
  position: relative;
  min-height: 170px;
  padding: 1.5rem;
  border-color: #e0e9e9;
  border-radius: 20px;
  background: linear-gradient(145deg, #fff, #f8fbfb);
  box-shadow: 0 8px 24px rgba(31, 57, 72, 0.055);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.downloads-steps article:hover {
  transform: translateY(-3px);
  border-color: #a9ceca;
  box-shadow: 0 14px 28px rgba(31, 57, 72, 0.09);
}

.downloads-steps article > span {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #d4e9e6;
  border-radius: 12px;
  color: #116d68;
  background: #e9f6f3;
  font-size: 0.74rem;
}

.downloads-steps h3 {
  margin-top: 0.85rem;
  color: #203d47;
  font-size: 1.02rem;
}

.downloads-steps p {
  color: #687d82;
  font-size: 0.88rem;
}

.downloads-related {
  padding-top: 2rem;
  padding-bottom: 2.75rem;
}

.downloads-related a {
  min-height: 82px;
  padding: 1.1rem 1.2rem;
  border-color: #dce8e8;
  border-radius: 17px;
  color: #647a7f;
  background: linear-gradient(145deg, #fff, #f8fbfb);
  box-shadow: 0 5px 18px rgba(31, 57, 72, 0.045);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.downloads-related a:hover {
  transform: translateY(-3px);
  border-color: #a9ceca;
  background: #fff;
  box-shadow: 0 12px 24px rgba(31, 57, 72, 0.09);
}

.downloads-related > a > i {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 13px;
  color: #116d68;
  background: #e9f6f3;
  font-size: 1.05rem;
}

.downloads-related strong {
  color: #203d47;
  font-size: 0.88rem;
}

body.dark-mode[data-color-theme="downloads"] {
  --downloads-accent: #63c4bb;
  --downloads-accent-dark: #218c84;
  --downloads-line: #30454f;
  --downloads-soft: #162a32;
  background: #0b1420;
}

body.dark-mode[data-color-theme="downloads"] .downloads-library {
  background:
    radial-gradient(
      ellipse at 12% 18%,
      rgba(37, 143, 135, 0.12),
      transparent 28rem
    ),
    #0b1420;
}

body.dark-mode[data-color-theme="downloads"] .downloads-result-count,
body.dark-mode[data-color-theme="downloads"] .downloads-filters,
body.dark-mode[data-color-theme="downloads"] .downloads-related a {
  border-color: #30454f;
  color: #bed0d3;
  background: #13212c;
}

body.dark-mode[data-color-theme="downloads"] .downloads-filters select,
body.dark-mode[data-color-theme="downloads"] .downloads-reset {
  border-color: #3d5961;
  color: #e1ecec;
  background: #172a35;
}

body.dark-mode[data-color-theme="downloads"] .downloads-reset:hover {
  border-color: #438d87;
  color: #dff7f2;
  background: #1c3b40;
}

body.dark-mode[data-color-theme="downloads"] .worksheet-card {
  border-color: #30454f;
  background: #13212c;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

body.dark-mode[data-color-theme="downloads"] .worksheet-card:hover {
  border-color: #438d87;
}

body.dark-mode[data-color-theme="downloads"] .worksheet-card-preview {
  border-color: #2a424a;
  background: linear-gradient(145deg, #19343a, #172b3a);
}

.worksheet-format {
  color: #5b4b8b;
  background: #f0edfb;
}

.worksheet-card--flashcards .worksheet-card-page {
  border-top-color: #8a73c8;
  background: linear-gradient(145deg, #fff, #fcfbff);
}

.worksheet-card--flashcards .worksheet-card-page-mark {
  background: linear-gradient(145deg, #8972c7, #6651a4);
  box-shadow: 0 3px 7px rgba(102, 81, 164, 0.2);
}

.worksheet-card-flashcard-samples {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
  margin-top: 0.28rem;
}

.worksheet-card-flashcard-sample {
  display: flex;
  min-width: 0;
  min-height: 43px;
  flex-direction: column;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.4rem 0.45rem;
  overflow: hidden;
  border: 1px solid #e8e3f3;
  border-radius: 8px;
  color: #403c56;
  background: #f7f5fc;
  font-size: 0.63rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-number {
  color: #8972c7;
  font-size: 0.48rem;
  font-weight: 850;
  letter-spacing: 0.07em;
}

.worksheet-card-flashcard-count {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.55rem;
  color: #746b91;
  font-size: 0.58rem;
  font-weight: 750;
}

.worksheet-card-flashcard-count .fa-scissors {
  color: #806bbd;
}

.worksheet-card--speaking-cards .worksheet-card-page {
  border-top-color: #26828d;
  background: linear-gradient(145deg, #fff, #f1f9f9);
}

.worksheet-card--speaking-cards .worksheet-card-page-mark {
  background: linear-gradient(145deg, #328f98, #176b78);
  box-shadow: 0 3px 7px rgba(32, 117, 128, 0.2);
}

.worksheet-card-speaking-samples .worksheet-card-speaking-sample {
  border-color: #d7e9e9;
  color: #31555d;
  background: #f2f9f9;
  white-space: normal;
}

.worksheet-card-speaking-sample .sample-number {
  color: #25808a;
}

.worksheet-card-speaking-count {
  color: #557a7e;
}

.worksheet-card-speaking-count .fa-scissors {
  color: #25808a;
}

.worksheet-format--speaking {
  color: #176b78;
  background: #e5f3f4;
}

body.dark-mode[data-color-theme="downloads"] .worksheet-format {
  color: #d3c7f7;
  background: #342d4c;
}

body.dark-mode[data-color-theme="downloads"]
  .worksheet-card--flashcards
  .worksheet-card-page {
  border-top-color: #9882d0;
  background: #fbfaff;
}

body.dark-mode[data-color-theme="downloads"] .worksheet-card-flashcard-sample {
  border-color: #e4dff0;
  color: #403c56;
  background: #f7f5fc;
}

body.dark-mode[data-color-theme="downloads"] .worksheet-format--speaking {
  color: #b7e5e6;
  background: #24434a;
}

body.dark-mode[data-color-theme="downloads"] .worksheet-card-page {
  border-color: #3a4e56;
  border-top-color: #58b8af;
  background: #f8fbfa;
}

body.dark-mode[data-color-theme="downloads"] .worksheet-card h3,
body.dark-mode[data-color-theme="downloads"] .downloads-steps h3,
body.dark-mode[data-color-theme="downloads"] .downloads-related strong {
  color: #e3eeee;
}

body.dark-mode[data-color-theme="downloads"]
  .worksheet-card-content
  > p:not(.worksheet-details),
body.dark-mode[data-color-theme="downloads"] .worksheet-details,
body.dark-mode[data-color-theme="downloads"] .downloads-steps p,
body.dark-mode[data-color-theme="downloads"] .downloads-related a {
  color: #a9bdc2;
}

body.dark-mode[data-color-theme="downloads"] .worksheet-level {
  color: #b7eee8;
  background: #1c4545;
}

body.dark-mode[data-color-theme="downloads"] .worksheet-skill {
  color: #f3c996;
  background: #463529;
}

body.dark-mode[data-color-theme="downloads"] .downloads-howto {
  background:
    radial-gradient(
      ellipse at 80% 10%,
      rgba(37, 143, 135, 0.11),
      transparent 30rem
    ),
    #101c27;
  border-color: #263a45;
}

body.dark-mode[data-color-theme="downloads"] .downloads-steps article {
  border-color: #30454f;
  background: linear-gradient(145deg, #152631, #13212c);
}

body.dark-mode[data-color-theme="downloads"] .downloads-steps article > span,
body.dark-mode[data-color-theme="downloads"] .downloads-related > a > i {
  border-color: #315d5d;
  color: #8cdbd1;
  background: #1b3c40;
}

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

  .downloads-reset {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .downloads-result-count {
    align-self: flex-start;
  }

  .downloads-filters {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 17px;
  }

  .downloads-reset {
    grid-column: auto;
  }

  .downloads-card-grid {
    gap: 1rem;
  }

  .worksheet-card-flashcard-sample {
    min-height: 48px;
  }

  .worksheet-card {
    border-radius: 19px;
  }

  .worksheet-card-preview {
    padding: 0.9rem;
  }

  .worksheet-card-page {
    min-height: 196px;
  }

  .downloads-steps article {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .worksheet-card-page,
  .downloads-reset,
  .downloads-steps article,
  .downloads-related a {
    transition: none;
  }
}
