/* TOEFL 2026 materials pages: what only TOEFL uses.
 *
 * Loaded after assets/redesign/redesign.css (the shared design system) and
 * assets/toefl/toefl-tw.css (the utility classes the hand-written page content
 * still carries, compiled by scripts/toefl_redesign/build_css.py). Three parts:
 *
 * 1. The TOEFL chrome: a more compact hero, the course card in the sidebar,
 *    the author photo, the course popup, the lecture card.
 * 2. The content column (.tn-content): the design's adjustments to the
 *    content's own classes - text colour and sizes, rounder cards, grids that
 *    fit their columns, tables, code, and the speaking/writing sample widgets.
 *    Every rule here is scoped to .tn-content and targets the classes the
 *    pages use, so it outranks the utilities without touching anything else.
 * 3. The blocks other scripts generate: the overview extras
 *    (build_toefl_overview_extras.py) and the blog index (blog_index.py).
 */

/* --------------------------------------------------------------------------
   1. chrome
   -------------------------------------------------------------------------- */

body.tn .rd-side {
  width: 230px;
}

body.tn .rd-main {
  max-width: 880px;
}

body.tn .rd-hero {
  border-radius: 24px;
  padding: clamp(20px, 3vw, 32px);
  gap: 10px;
}

body.tn .rd-eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.tn .rd-h1 {
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.18;
  letter-spacing: -0.4px;
}

body.tn .rd-lead {
  font-size: 16.5px;
  line-height: 1.6;
}

body.tn .rd-lead strong,
body.tn .rd-lead b {
  color: var(--rd-ink);
}

.tn-hero__extra {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
}

.tn-hero__extra .text-lg {
  font-size: inherit;
}

@media (max-width: 759.98px) {
  body.tn .rd-main {
    gap: 40px;
  }
}

/* the design's header keeps its 18px padding around the 44px menu button */
@media (max-width: 1059.98px) {
  body.tn .rd-hdr__bar {
    min-height: 80px;
  }

  body.tn .rd-burger {
    top: 18px;
    font-size: 13.3333px;
  }

  body.tn .rd-testsel {
    gap: 8px;
    padding: 6px 12px;
  }

  body.tn .rd-testsel .rd-dot {
    width: 7px;
    height: 7px;
  }
}

/* designed pages: long words wrap as in the design, not mid-word */
body.tn .rd-main.tn-design {
  overflow-wrap: normal;
}

/* the course card: sidebar, and in the column on phones */
.tn-course {
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--rd-line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(29, 29, 58, 0.05);
}

.tn-course__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.tn-course__title {
  font-size: 15.5px;
  line-height: 1.3;
  color: #1e3a8a;
  font-weight: 700;
  text-decoration: none;
}

.tn-course__title:hover {
  text-decoration: underline;
}

/* the cover is a link, so it needs the pointer and the focus ring */
.tn-course__cover {
  display: block;
  border-radius: 12px;
}

.tn-course__cover:focus-visible {
  outline: 2px solid var(--rd-brand, #5e61f6);
  outline-offset: 2px;
}

.tn-course__sub {
  font-size: 13px;
  color: var(--rd-muted);
}

.tn-star {
  color: #f59e0b;
}

.tn-course__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.tn-course__text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--rd-prose);
  text-align: center;
}

.tn-course__text b {
  color: var(--rd-ink);
}

.rd .tn-course__preview {
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  color: var(--rd-brand);
}

.tn-course--inline {
  display: none;
}

@media (max-width: 759.98px) {
  .tn-course--inline {
    display: flex;
    padding: 18px 20px;
  }

  .tn-course--inline .tn-course__title {
    font-size: 17px;
  }

  .tn-course--inline .tn-course__sub,
  .tn-course--inline .tn-course__text {
    font-size: 14px;
  }

  .tn-course--inline .rd-btn {
    font-size: 15px;
    padding: 13px;
    border-radius: 12px;
  }
}

/* phone menu: the current entry's pages, indented under it */
.rd .rd-mnav__link.rd-mnav__sub {
  padding: 10px 14px 10px 30px;
  font-size: 15px;
  color: #4b4d55;
}

/* sidebar list, as in the design */
.tn-nav {
  background: var(--rd-surface);
  border-radius: 20px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
}

.rd .tn-nav__link {
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--rd-ink);
}

.rd .tn-nav__link.is-active {
  background: #fff;
  font-weight: 700;
  color: var(--rd-brand);
  box-shadow: 0 1px 4px rgba(29, 29, 58, 0.06);
}

.tn-nav__sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px 14px;
  margin-left: 14px;
  border-left: 2px solid #e3e7f3;
}

.rd .tn-nav__sub-link {
  padding: 7px 12px;
  font-size: 14.5px;
  color: #4b4d55;
}

/* author box: the course cover, cropped round */
.tn-author {
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 22px;
  background: var(--rd-surface);
  padding: 20px 22px;
}

.tn-author__photo {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06), 0 0 0 2px #fff;
}

.tn-author__photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(circle, #000 62%, rgba(0, 0, 0, 0.72) 78%, transparent 100%);
  mask-image: radial-gradient(circle, #000 62%, rgba(0, 0, 0, 0.72) 78%, transparent 100%);
}

.tn-author__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: #4b5563;
}

.tn-author__name {
  color: #1f2937;
  font-size: 15.5px;
}

.tn-author__text a {
  color: #5a68f5;
  text-decoration: underline;
}

.tn-stars {
  color: #f59e0b;
  white-space: nowrap;
}

.tn-stars__num {
  color: #4b5563;
}

/* the course popup (#udemy-modal; the page's own script opens it) */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 17, 39, 0.55);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 26px 22px 22px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(29, 29, 58, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--rd-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--rd-chip);
  color: var(--rd-ink);
}

.tn-modal__title {
  margin: 0;
  padding: 0 24px;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--rd-title);
}

.tn-modal__sub,
.tn-modal__small {
  margin: 0;
  font-size: 13.5px;
  color: var(--rd-muted);
}

.tn-modal__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--rd-prose);
}

.course-cover {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.rd .tn-modal__cta {
  margin-top: 6px;
  font-size: 15px;
  padding: 13px;
  border-radius: 12px;
}

/* --------------------------------------------------------------------------
   the lecture card (scripts/add_toefl_course_preview.py, course-preview.js)
   -------------------------------------------------------------------------- */

.tn-lecture {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rd-line);
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  scroll-margin-top: 72px;
}

.tn-lecture .cp-player {
  position: relative;
  background: #0f1020;
}

.tn-lecture video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  max-width: none;
  background: #0f1020;
  object-fit: contain;
}

.tn-lecture__body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cp-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cp-eyebrow {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rd-teal);
}

.cp-play {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: var(--rd-chip-on);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rd-teal);
}

.cp-title {
  margin: 0;
  font-size: clamp(19px, 1.6vw, 22px);
  line-height: 1.25;
  color: var(--rd-title);
}

.cp-pts {
  margin: 0;
  font-size: 14px;
  color: var(--rd-muted);
}

.cp-offer {
  border-radius: 18px;
  background: linear-gradient(135deg, #f3eeff, #eaf3ff);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.cp-offer-text {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cp-offer-text b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: #4b3fd1;
}

.cp-offer-text svg {
  flex: none;
}

.cp-offer-text span {
  font-size: 14px;
  line-height: 1.45;
  color: var(--rd-soft);
}

.rd .cp-offer-cta,
.rd .cp-gate-cta {
  flex: none;
  background: var(--rd-grad);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 12px;
  white-space: nowrap;
}

.rd .cp-offer-cta:hover,
.rd .cp-gate-cta:hover {
  color: #fff;
  text-decoration: none;
  filter: brightness(1.05);
}

.cp-transcript {
  border-radius: 16px;
  background: var(--rd-surface);
  border: 1px solid var(--rd-line);
}

.cp-transcript > summary {
  cursor: pointer;
  padding: 13px 18px;
  font-weight: 700;
  font-size: 15px;
  color: var(--rd-brand);
}

.cp-transcript-body {
  padding: 2px 18px 18px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cp-transcript-body h3 {
  margin: 6px 0 0;
  font-size: 16px;
  line-height: 1.35;
  color: var(--rd-title);
}

.cp-transcript-body p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--rd-soft);
}

/* the popup at the end of the 30-second preview, above the app banner (1200)
   and the course popup (1000) */
.cp-gate {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 17, 39, 0.7);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.cp-gate[hidden] {
  display: none;
}

.cp-gate-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 28px 22px 24px;
  border-radius: 22px;
  background: #fff;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.cp-gate-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--rd-title);
}

.cp-gate-text {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--rd-muted);
}

.cp-gate-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: #999;
  cursor: pointer;
}

.cp-gate-replay {
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--rd-brand);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   2. the content column
   -------------------------------------------------------------------------- */

.tn-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  color: var(--rd-ink);
  overflow-wrap: break-word;
}

.tn-content > .tn-main {
  min-width: 0;
}

:where(.tn-content) a {
  color: var(--rd-brand);
}

:where(.tn-content) a:hover {
  color: var(--rd-brand-deep);
  text-decoration: underline;
}

/* the pages' own text classes, at the design's values */
.tn-content .text-color {
  color: #4b4d55;
}

.tn-content .third-font {
  font-size: clamp(15px, 0.6vw + 11px, 18px);
  line-height: 1.6;
}

.tn-content .second-font {
  font-size: clamp(21px, 1.8vw, 24px);
  line-height: 1.2;
}

.tn-content .medium-font {
  font-size: 19px;
  line-height: 1.3;
}

.tn-content .small-font {
  font-size: 14px;
}

.tn-content .first-font {
  font-size: clamp(20px, 2vw, 28px);
}

.tn-content .light-blue {
  color: #5e61f6;
}

.tn-content .blue-green {
  color: var(--rd-teal);
}

.tn-content strong {
  color: var(--rd-ink);
}

.tn-content :is(.text-white, .text-white *) strong {
  color: inherit;
}

/* headings: one size and colour for every section title */
.tn-content h2:is(.second-font, .text-\[24px\], .md\:text-\[24px\]) {
  font-size: clamp(21px, 1.8vw, 24px);
  line-height: 1.2;
  color: var(--rd-title);
}

.tn-content h3:is(.text-base, .medium-font) {
  color: var(--rd-title);
  line-height: 1.3;
}

.tn-content :is(h2, h3, h4, span).leading-\[100\%\] {
  line-height: 1.25;
}

.tn-content .font-semibold {
  font-weight: 700;
}

.tn-content .text-sm {
  font-size: 14.5px;
}

.tn-content .text-xs {
  font-size: 13px;
}

.tn-content .leading-snug {
  line-height: 1.4;
}

/* rounder corners */
.tn-content .rounded-\[12px\] {
  border-radius: 20px;
}

.tn-content .md\:rounded-\[14px\] {
  border-radius: 22px;
}

.tn-content .rounded-\[8px\] {
  border-radius: 10px;
}

.tn-content .rounded-\[6px\] {
  border-radius: 8px;
}

.tn-content .rounded-lg {
  border-radius: 12px;
}

.tn-content .rounded-\[10px\] {
  border-radius: 14px;
}

/* cards and boxes stack their parts with a little air */
.tn-content :is(.px-4.py-3.border, .p-4.bg-\[\#f8f8f8\].rounded-\[12px\], .p-6.bg-\[\#f1f5ff\], .bg-\[\#f1f5ff\].p-4, .bg-white.p-6.border) {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tn-content .px-4.py-3.border {
  border-color: #d8e2ec;
}

.tn-content .border-\[rgba\(110\2c 112\2c 113\2c 0\.2\)\],
.tn-content .border-\[\#e5e7eb\] {
  border-color: var(--rd-line);
}

.tn-content section:is(.mb-8, .mb-10, .mb-12, .mb-16) {
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-margin-top: 72px;
}

.tn-content section[id] {
  scroll-margin-top: 72px;
}

/* On the kinds of page the design shows (overviews, task guides, samples,
   FAQ, tips) it stacks blocks without the old vertical gaps: its own pages
   drop every gap-y-*. Lists keep their 6px (below). */
.tn-flat [class*='gap-y-'] {
  row-gap: 0;
}

/* lists: bullets and numbers, spaced */
.tn-content :is(ul.list-disc, ol.list-decimal) {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tn-content ul.columns-2 {
  columns: auto;
}

/* grids fit as many columns as the column has room for */
.tn-content .grid.md\:grid-cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}

.tn-content .grid.md\:grid-cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

/* the card icons the design leaves out */
.tn-content .ts-ico {
  display: none;
}

.tn-content code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: var(--rd-tint);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.92em;
}

.tn-content code.block {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.6;
}

/* tables: rounded, bordered, a header row */
.tn-content table:not([class]),
.tn-content table:is(.min-w-full, .w-full, .table-auto) {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

.tn-content .overflow-x-auto:has(> table:not([class])),
.tn-content .overflow-x-auto:has(> table:is(.min-w-full, .w-full, .table-auto)) {
  border: 1px solid var(--rd-line);
  border-radius: 20px;
  background: #fff;
}

.tn-content table:is(:not([class]), .min-w-full, .w-full, .table-auto) th {
  white-space: nowrap;
  text-align: left;
  padding: 13px 16px;
  background: #f6f8fd;
  font-weight: 700;
  color: var(--rd-ink);
}

.tn-content table:is(:not([class]), .min-w-full, .w-full, .table-auto) td {
  padding: 13px 16px;
  border-top: 1px solid var(--rd-line-soft);
  color: var(--rd-soft);
  vertical-align: top;
}

.tn-content table.border-separate {
  border-collapse: collapse;
}

/* inputs (reading samples) */
.tn-content input[type='text'],
.tn-content textarea {
  background: #fff;
}

.tn-content textarea {
  border-color: #d6dcef;
  border-radius: 16px;
  padding: 14px 16px;
  line-height: 1.6;
  resize: vertical;
}

/* the old in-content "take the test" bars */
.tn-content a.bg-\[linear-gradient\(90deg\2c _\#634bf6\2c _\#4baef6_100\%\)\] {
  border-radius: 20px;
}

/* --------------------------------------------------------------------------
   speaking and listening samples: one card per question, the audio and the
   transcript in a tinted panel (audio.js and speaking-sample.js unchanged)
   -------------------------------------------------------------------------- */

.tn-content .lg\:pr-\[136px\] {
  border: 1px solid var(--rd-line);
  border-radius: 22px;
  padding: 20px 22px;
  background: #fff;
  gap: 14px;
}

/* the "Check your response" link, as a pill in the card's top corner */
.tn-content .lg\:pr-\[136px\] > .absolute:first-child {
  position: absolute;
  top: 16px;
  right: 18px;
  left: auto;
  width: auto;
  flex-direction: row;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: var(--rd-grad);
  box-shadow: 0 6px 16px rgba(99, 75, 246, 0.22);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.tn-content .lg\:pr-\[136px\] > .absolute:first-child img {
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  filter: brightness(0) invert(1);
}

.tn-content .lg\:pr-\[136px\] > .absolute:first-child .text-color {
  color: #fff;
}

.tn-content .lg\:pr-\[136px\] > h3 {
  padding-right: 220px;
}

.tn-content .lg\:pr-\[136px\] q {
  font-style: italic;
  font-size: 16px;
  line-height: 1.6;
  color: var(--rd-soft);
  quotes: none;
}

.tn-content .lg\:pr-\[136px\] > .flex.flex-col:not(.absolute) {
  border-radius: 16px;
  background: #f6f8fc;
  padding: 14px 16px;
  gap: 10px;
}

/* the audio bar */
.tn-content .audio-player + div {
  border-radius: 999px;
  padding: 10px 18px;
  background: #eef1f6;
  gap: 14px;
}

.tn-content .audio-player + div .blue-green {
  color: var(--rd-ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.tn-content .audio-progress {
  background: rgba(29, 29, 58, 0.15);
}

.tn-content .audio-progress > div {
  background: var(--rd-ink);
}

/* transcript and sample-answer toggles, as disclosure rows */
.tn-content .transcript-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 11px 16px;
  border: 1px solid var(--rd-line);
  border-radius: 14px;
  background: #fff;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--rd-brand);
  text-align: left;
}

.tn-content .transcript-toggle::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 6px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}

.tn-content .transcript-toggle:has(+ .transcript[style*='block']) {
  border-radius: 14px 14px 0 0;
  border-bottom-color: transparent;
}

.tn-content .transcript-toggle:has(+ .transcript[style*='block'])::before {
  transform: rotate(90deg);
}

.tn-content .transcript {
  margin-top: -10px;
  padding: 0 16px 14px;
  border: 1px solid var(--rd-line);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: #fff;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--rd-soft);
}

@media (max-width: 1023.98px) {
  .tn-content .lg\:pr-\[136px\] > .absolute:first-child {
    position: static;
    align-self: flex-start;
    order: 2;
  }

  .tn-content .lg\:pr-\[136px\] > h3 {
    padding-right: 0;
  }
}

/* --------------------------------------------------------------------------
   3a. overview extras (scripts/build_toefl_overview_extras.py)
   -------------------------------------------------------------------------- */

.tn-extras {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.tn-x {
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-margin-top: 72px;
}

.tn-x__h2 {
  margin: 0;
  font-size: clamp(21px, 1.8vw, 24px);
  line-height: 1.2;
  font-weight: 700;
  color: var(--rd-title);
}

.tn-x__intro {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.6;
  color: #4b4d55;
  text-wrap: pretty;
}

.tn-x__note {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--rd-muted);
}

.tn-glance {
  border-radius: 22px;
  background: var(--rd-tint);
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 6px;
}

.tn-glance__cell {
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tn-glance__v {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.3px;
  color: var(--rd-title);
}

.tn-glance__l {
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--rd-muted);
}

.tn-bands {
  border: 1px solid var(--rd-line);
  border-radius: 22px;
  overflow: hidden;
}

.tn-band {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 20px;
  align-items: start;
}

.tn-band + .tn-band {
  border-top: 1px solid var(--rd-line-soft);
}

.tn-band__score {
  background: var(--rd-tint);
  border-radius: 14px;
  padding: 10px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tn-band__v {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
  color: var(--rd-brand-deep);
}

.tn-band__cefr {
  font-size: 12px;
  font-weight: 700;
  color: var(--rd-muted);
}

.tn-band__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15.5px;
  line-height: 1.55;
}

.tn-band__can {
  color: var(--rd-soft);
}

.tn-band__next {
  color: var(--rd-teal);
  font-weight: 700;
}

.tn-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--rd-muted);
}

.tn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d9defa;
  background: #fff;
  color: #4b4d55;
  font-size: 13px;
  white-space: nowrap;
}

.tn-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--rd-brand-deep);
}

.tn-chip--core {
  padding: 5px 10px;
  border: 0;
  background: #ece9fe;
  color: #4b3fd1;
  font-weight: 700;
}

.tn-chip--core i {
  border: 0;
  background: var(--rd-brand-deep);
}

.tn-skills,
.tn-plan,
.tn-mistakes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 12px;
}

.tn-skill {
  border: 1px solid var(--rd-line);
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}

.tn-skill__name,
.tn-mistake__title {
  font-size: 16.5px;
  line-height: 1.35;
  color: var(--rd-title);
}

.tn-skill__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tn-skill__train {
  border-radius: 14px;
  background: #e8f8fa;
  padding: 10px 12px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--rd-teal);
}

.tn-skill__train > span:first-child {
  font-weight: 700;
}

.tn-table {
  border: 1px solid var(--rd-line);
  border-radius: 20px;
  overflow-x: auto;
  background: #fff;
}

.tn-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

.tn-table th {
  text-align: left;
  padding: 13px 16px;
  background: #f6f8fd;
  font-weight: 700;
  color: var(--rd-ink);
  white-space: nowrap;
}

.tn-table td {
  padding: 13px 16px;
  border-top: 1px solid var(--rd-line-soft);
  color: var(--rd-soft);
  vertical-align: top;
}

.tn-table td:first-child {
  font-weight: 700;
  color: var(--rd-ink);
}

.tn-week {
  border: 1px solid var(--rd-line);
  border-radius: 22px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tn-week__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tn-week__n {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #634bf6, #4baef6);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tn-week__title {
  font-size: 16.5px;
  line-height: 1.3;
  color: var(--rd-title);
}

.tn-week__list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--rd-soft);
}

.tn-mistake {
  border-radius: 22px;
  background: var(--rd-surface);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tn-mistake__why,
.tn-mistake__fix {
  font-size: 14.5px;
  line-height: 1.55;
  color: #4b4d55;
}

.tn-mistake__why > span:first-child {
  font-weight: 700;
  color: var(--rd-ink);
}

.tn-mistake__fix {
  color: var(--rd-teal);
}

.tn-mistake__fix > span:first-child {
  font-weight: 700;
}

.tn-check {
  border-radius: 22px;
  background: var(--rd-tint);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 12px 24px;
}

.tn-check__item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--rd-ink);
}

.tn-check__ico {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--rd-chip-on);
  color: var(--rd-teal);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   3b. blog index (scripts/toefl_redesign/blog_index.py)
   -------------------------------------------------------------------------- */

.tn-content--blog {
  gap: 40px;
}

.tn-bsec {
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-margin-top: 72px;
}

.tn-bsec__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tn-bsec__h2 {
  margin: 0;
  font-size: clamp(21px, 1.8vw, 24px);
  line-height: 1.2;
  color: var(--rd-title);
}

.tn-bsec__intro {
  margin: 0;
  font-size: 15.5px;
  color: var(--rd-muted);
}

.tn-bgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 16px;
}

.rd .tn-bcard {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rd-line);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  color: var(--rd-ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rd .tn-bcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(29, 29, 58, 0.1);
  text-decoration: none;
  color: var(--rd-ink);
}

.tn-bcard__art {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 18px 20px;
}

.tn-bcard__art--vs {
  align-items: center;
  justify-content: center;
  padding: 34px 16px 16px;
}

.tn-bcard__blob,
.tn-bcard__art::after {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.tn-bcard__blob {
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.12);
}

.tn-bcard__art::after {
  content: '';
  left: -30px;
  bottom: -50px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.08);
}

.tn-bcard__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tn-bcard__art--image .tn-bcard__blob,
.tn-bcard__art--image::after {
  display: none;
}

.tn-bcard__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 17, 40, 0) 40%, rgba(17, 17, 40, 0.55) 100%);
}

.tn-bcard__tag {
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 1;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tn-bcard__big {
  position: relative;
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.3px;
  text-wrap: balance;
}

.tn-bcard__vs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}

.tn-bcard__pill {
  background: #fff;
  color: var(--rd-ink);
  font-weight: 700;
  font-size: 15px;
  padding: 9px 14px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(17, 17, 40, 0.15);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tn-bcard__x {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tn-bcard__body {
  flex: 1;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tn-bcard__title {
  font-size: 17px;
  line-height: 1.35;
  color: var(--rd-title);
  text-wrap: pretty;
}

.tn-bcard__meta {
  font-size: 13.5px;
  color: var(--rd-muted);
}

.tn-bcard__more {
  margin-top: auto;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--rd-brand);
}

/* blog articles keep their own styles; only their tables scroll inside the
   column instead of widening the page */
.tn-content--blog table {
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   the app card (mobile-app-banner.js, shared with the other tests): on TOEFL
   pages it takes the design's layout - a phone icon beside the title and
   line, the button underneath. The script's own styles are injected after
   this file, hence the body.tn prefix.
   -------------------------------------------------------------------------- */

body.tn .ts-app-banner .ts-app-banner__inner {
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(29, 29, 58, 0.18);
}

body.tn .ts-app-banner .ts-app-banner__inner:has(> .ts-app-banner__cta) {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
}

body.tn .ts-app-banner .ts-app-banner__inner:has(> .ts-app-banner__cta)::before {
  content: '';
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM11 18h2'/%3E%3C/svg%3E") center / 22px 22px no-repeat,
    linear-gradient(135deg, #634bf6, #4baef6);
}

body.tn .ts-app-banner .ts-app-banner__title {
  margin: 0;
  margin-inline-end: 36px;
  padding: 0;
  font-size: 15px;
  line-height: normal;
  color: #111;
}

body.tn .ts-app-banner .ts-app-banner__subtitle {
  margin: 0 0 6px;
  max-width: none;
  font-size: 13px;
  line-height: 1.4;
  color: #4b4d55;
}

body.tn .ts-app-banner .ts-app-banner__inner:has(> .ts-app-banner__cta) > .ts-app-banner__title {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 2px;
}

body.tn .ts-app-banner .ts-app-banner__inner:has(> .ts-app-banner__cta) > .ts-app-banner__subtitle {
  grid-column: 2;
  grid-row: 2;
  margin: 0 36px 0 0;
}

body.tn .ts-app-banner .ts-app-banner__inner > .ts-app-banner__cta {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 14px;
  box-shadow: none;
}

body.tn .ts-app-banner .ts-app-banner__close {
  color: #6e7071;
}

body.tn .ts-app-banner .ts-app-banner__close:hover {
  background: #f2f4f7;
}

/* the design's close cross, drawn with the same path as its inline SVG */
body.tn .ts-app-banner .ts-app-banner__close-icon {
  background: #6e7071;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

body.tn .ts-app-banner .ts-app-banner__close-icon::before,
body.tn .ts-app-banner .ts-app-banner__close-icon::after {
  content: none;
}

/* --------------------------------------------------------------------------
   Sample switcher (.tn-car) on the listening samples page
   --------------------------------------------------------------------------
   Twelve sample sets one under the other meant scrolling past three full
   transcripts to reach the fourth conversation. One chip per sample, arrows
   and an "i / n" counter, with one panel on screen at a time - the same
   component the IELTS listening page uses, in TOEFL's colours.

   Written by scripts/toefl_listening_carousel.py. Every panel is in the HTML;
   only the script hides the ones that are not current, so without JavaScript
   the page reads as a plain stack and the chips are jump links. */

.tn-content .tn-car,
.tn-content .tn-car__panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* display:flex above would otherwise beat the browser's own [hidden] rule,
   and every panel but the current one is hidden by the script. */
.tn-content .tn-car__panel[hidden] {
  display: none;
}

.tn-content .tn-car__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: #f1f5ff;
}

.tn-content .tn-car__arrow {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111128;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tn-content .tn-car__arrow:hover {
  color: #5e61f6;
}

/* The arrows and the counter only mean anything once the script is switching
   panels; until then every panel is simply on the page. */
.tn-content .tn-car:not(.is-js) .tn-car__arrow,
.tn-content .tn-car:not(.is-js) .tn-car__pos {
  visibility: hidden;
}

.tn-content .tn-car__chips {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tn-content .tn-car__chips::-webkit-scrollbar {
  display: none;
}

.tn-content .tn-car__chip {
  flex: none;
  white-space: nowrap;
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff;
  color: #111128;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.tn-content .tn-car__chip:hover {
  color: #5e61f6;
  text-decoration: none;
}

.tn-content .tn-car__chip.is-active,
.tn-content .tn-car__chip.is-active:hover {
  background: linear-gradient(135deg, #634bf6, #4baef6);
  color: #fff;
}

.tn-content .tn-car__pos {
  flex: none;
  padding: 0 4px;
  font-size: 14px;
  color: #6e7071;
  font-variant-numeric: tabular-nums;
}

/* A phone has no room for the counter next to the chips. */
@media (max-width: 759.98px) {
  .tn-content .tn-car__bar {
    gap: 6px;
  }

  .tn-content .tn-car__pos {
    display: none;
  }

  .tn-content .tn-car__chip {
    padding: 9px 13px;
    font-size: 14px;
  }
}
