:root {
  --navy: oklch(0.33 0.09 264);
  --navy-hover: oklch(0.28 0.08 264);
  --color-blue: #2F5FEE;
  --color-blue-dark: #1E46C4;
  --color-ink: #1B2237;
  --color-ink-soft: #5B6478;
  --color-panel: #EFF4FC;
  --color-border: #E4E9F2;
  --radius-md: 16px;
  --radius-lg: 22px;
}

/* Scoped Reset & Typography */
html {
  scroll-behavior: smooth;
}

body, button, input, select, textarea {
  font-family: var(--smw-font-stack);
  -webkit-font-smoothing: antialiased;
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-ink-soft);
  margin: 0 0 16px 0;
  padding: 0;
}

.breadcrumb a {
  color: var(--color-blue);
  font-weight: 600;
  text-decoration: none;
  transition: color .15s ease;
}

.breadcrumb a:hover {
  text-decoration: underline;
  color: var(--color-blue-dark);
}

.breadcrumb svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.breadcrumb span:not(.sep) {
  color: var(--color-ink);
  font-weight: 600;
}

/* ============================================================
   HERO HEADER PANEL
   ============================================================ */
.tn-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 0;
  margin-bottom: 1.25rem;
  padding: 1.375rem 1.75rem;
  background: oklch(0.95 0.03 264);
  border: 2px solid oklch(0.75 0.12 264);
  border-radius: 1rem;
  box-shadow: 0 1px 2px oklch(0.2 0.035 274 / .03), 0 6px 18px oklch(0.54 0.22 266 / .05);
  box-sizing: border-box;
}

.tn-hero-text {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.tn-title {
  text-align: center;
  margin: 0 0 0.5rem 0;
  font-family: var(--smw-font-stack);
  font-size: 1.875rem; /* 30px */
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #0e2770;
}

.tn-desc {
  margin: 0;
  width: 100%;
  text-align: left;
  font-family: var(--smw-font-stack);
  font-size: 0.9375rem; /* 15px */
  line-height: 1.5;
  color: #0b205f;
  font-weight: 500;
}

/* ============================================================
   FILTER WIDGET CARDS / BUTTONS (CLEAN CLASSIC DESIGN)
   ============================================================ */
.wk-filter-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 24px;
  padding: 0;
}

.wk-card {
  flex: 1 1 200px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  cursor: pointer;
  font-family: var(--smw-font-stack);
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(20, 30, 60, 0.03);
  position: relative;
  outline: none;
  min-height: 54px;
  box-sizing: border-box;
}

.wk-card:hover {
  border-color: var(--color-blue);
  background: #f8fafc;
}

.wk-card:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

.wk-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* "All Worksheets" Card */
.wk-card--all {
  border-color: var(--color-border);
  background: #ffffff;
  color: var(--color-ink);
}

.wk-card--all .wk-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--color-panel);
  color: var(--color-blue);
  flex-shrink: 0;
}

.wk-card--all strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.2;
}

.wk-card--all small {
  font-size: 11.5px;
  color: var(--color-ink-soft);
}

.wk-card--all.is-active {
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: #ffffff;
}

.wk-card--all.is-active .wk-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.wk-card--all.is-active strong,
.wk-card--all.is-active small {
  color: #ffffff;
}

/* Number Set Filter Cards */
.wk-card--num {
  background: #ffffff;
}

.wk-card--num .wk-num {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
  min-width: 24px;
  text-align: center;
}

.wk-card--num .wk-num--blue   { color: var(--color-blue); }
.wk-card--num .wk-num--green  { color: #16a34a; }
.wk-card--num .wk-num--purple { color: #7c3aed; }

.wk-card--num strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.2;
}

.wk-card--num small {
  font-size: 11px;
  color: var(--color-ink-soft);
  line-height: 1.2;
}

.wk-badge {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  width: fit-content;
}

.wk-badge--blue   { background: #e2ecff; color: #2f6ff0; }
.wk-badge--green  { background: #e2f8e9; color: #16a34a; }
.wk-badge--purple { background: #efe6fd; color: #7c3aed; }

/* Active States */
.wk-card--num.is-active {
  border-color: var(--color-blue);
  background: var(--color-panel);
}

/* ============================================================
   WORKSHEET GRIDS
   ============================================================ */
.tn-section {
  margin-bottom: 34px;
}

.tn-scroll-target {
  scroll-margin-top: 85px;
}

.tn-section-title {
  font-size: 20px;
  font-weight: 800;
  color: #0e2770;
  margin: 0 0 16px;
}

.tn-section-subtitle {
  font-size: 18px;
  font-weight: 800;
  color: #0e2770;
  margin: 24px 0 12px;
}

.tn-section-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink-soft);
}

.tn-group-description {
  margin-top: 16px;
}

.tn-grid { display: grid; gap: 18px; }
.tn-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tn-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(20, 30, 60, .04);
  padding: 14px;
  min-width: 0;
}

.tn-card-thumb {
  position: relative;
  border: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1.28;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Silver Glossy Shimmer Placeholder */
.tn-card-thumb.is-loading {
  background: linear-gradient(90deg, #f0f4f8 25%, #e1e7f0 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: tn-shimmer 1.5s infinite linear;
}

@keyframes tn-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.tn-card-thumb.is-loading img {
  opacity: 0;
}

.tn-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  max-width: 100%;
  transition: opacity 0.3s ease;
  opacity: 1;
}

.tn-card-body {
  padding: 12px 2px 2px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.tn-card-title {
  font-size: 14px;
  font-weight: 500;
  color: #0b205f;
  margin: 0 0 4px;
  line-height: 1.3;
}

.tn-card-sub {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--color-ink-soft);
}

.tn-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 0;
  margin-top: auto;
  border-radius: 10px;
  background: var(--color-blue);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  transition: background .15s ease, gap .15s ease;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.tn-card-link:hover,
.tn-card-link:focus-visible {
  background: var(--color-blue-dark);
  gap: 8px;
}

/* The Download control is a real <a href="...pdf">. Keep its text white and
   undecorated in every link state so global a:visited / a:hover rules cannot
   change it. */
a.tn-card-link,
a.tn-card-link:visited,
a.tn-card-link:hover,
a.tn-card-link:focus-visible {
  color: #fff;
  text-decoration: none;
}

a.tn-card-link:focus-visible {
  outline: 2px solid var(--color-blue-dark);
  outline-offset: 2px;
}

/* ============================================================
   FEATURE STRIP
   ============================================================ */
.tn-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0 10px;
}

.tn-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: var(--color-panel);
  border-radius: var(--radius-md);
  min-width: 0;
}

.tn-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex: none;
  background: #fff;
}

.tn-feature-icon--blue { color: var(--color-blue); }

.tn-feature-text h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0 0 3px;
}

.tn-feature-text p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-ink-soft);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .tn-grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tn-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .tn-hero {
    margin-bottom: 1rem;
    padding: 1rem;
  }
  .tn-title {
    font-size: 1.5rem;
    text-align: left;
  }
  .tn-desc {
    font-size: 0.875rem;
  }

  .wk-filter-wrap {
    gap: 8px;
  }

  .wk-card {
    flex: 1 1 calc(50% - 8px);
    min-height: 50px;
    padding: 8px 12px;
  }

  .tn-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tn-features { grid-template-columns: 1fr; gap: 12px; }

}

@media (max-width: 480px) {
  .wk-card {
    flex: 1 1 100%;
  }

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

}