.resource-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(250px, .75fr); gap: 40px; align-items: end; padding: 35px 0 34px; }
.resource-hero h1 { max-width: 700px; margin: 8px 0 14px; font-size: clamp(38px, 5vw, 62px); line-height: 1; letter-spacing: -.065em; }
.resource-hero h1 span { color: var(--rp-blue); }
.resource-hero > div > p:last-child { max-width: 630px; margin: 0; color: var(--rp-muted); font-size: 15px; line-height: 1.6; }
.resource-hero__aside { padding: 20px; background: var(--rp-surface); border: 1px solid var(--rp-line); border-radius: 15px; box-shadow: var(--rp-shadow); }
.resource-hero__aside h2 { margin: 6px 0 8px; font-size: 19px; letter-spacing: -.04em; }
.resource-hero__aside p { margin: 0; color: var(--rp-muted); font-size: 12px; line-height: 1.5; }
.resource-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.resource-toolbar h2 { margin: 0; font-size: 27px; letter-spacing: -.055em; }
.resource-toolbar p { margin: 5px 0 0; color: var(--rp-muted); font-size: 12px; }
.resource-filter { display: flex; gap: 7px; flex-wrap: wrap; }
.resource-filter button { padding: 8px 10px; color: var(--rp-muted); background: #fff; border: 1px solid var(--rp-line); border-radius: 8px; font-size: 11px; font-weight: 800; cursor: pointer; }
.resource-filter button.is-active, .resource-filter button:hover { color: var(--rp-blue); background: var(--rp-blue-soft); border-color: #bdd4fa; }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.resource-card { align-self: start; display: flex; flex-direction: column; min-height: 178px; padding: 16px; background: #fff; border: 1px solid var(--rp-line); border-radius: 14px; box-shadow: 0 5px 16px rgba(25,49,88,.035); }
.resource-card[hidden] { display: none; }
.resource-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--rp-blue); font-size: 10px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.resource-card h3 { margin: 12px 0 7px; font-size: 16px; letter-spacing: -.04em; }
.resource-card p { margin: 0; color: var(--rp-muted); font-size: 12px; line-height: 1.55; }
.resource-card__actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; padding-top: 15px; }
.resource-card__actions button, .resource-card__actions a { min-height: 33px; padding: 8px 10px; color: var(--rp-blue); background: #fff; border: 1px solid #bed2f4; border-radius: 8px; font-size: 11px; font-weight: 800; text-decoration: none; cursor: pointer; }
.resource-card__actions .is-primary { color: #fff; background: var(--rp-blue); border-color: var(--rp-blue); }
.resource-card__actions button:hover, .resource-card__actions a:hover { filter: brightness(.97); }
.resource-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(20,32,51,.32); }
.resource-modal__panel { width: min(660px, 100%); max-height: min(680px, 90vh); overflow: auto; padding: 25px; background: #fff; border-radius: 16px; box-shadow: 0 24px 70px rgba(20,32,51,.22); }
.resource-modal__head { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.resource-modal__head h2 { margin: 5px 0 0; font-size: 26px; letter-spacing: -.05em; }
.resource-modal__close { padding: 5px; color: var(--rp-blue); background: transparent; border: 0; font-size: 12px; font-weight: 800; cursor: pointer; }
.resource-story { margin-top: 22px; padding: 19px; background: #f8faff; border: 1px solid #dce8fb; border-radius: 12px; }
.resource-story p { margin: 0 0 14px; color: var(--rp-text); font-size: 15px; line-height: 1.7; }
.resource-story p:last-child { margin-bottom: 0; }
.game-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .7fr); gap: 15px; }
.game-card { padding: 22px; background: #fff; border: 1px solid var(--rp-line); border-radius: 14px; }
.game-card h3 { margin: 0 0 9px; font-size: 20px; letter-spacing: -.04em; }
.game-card p { margin: 0 0 16px; color: var(--rp-muted); font-size: 12px; line-height: 1.55; }
.game-question { padding: 16px; background: #f8faff; border: 1px solid #dce8fb; border-radius: 11px; }
.game-question strong { display: block; margin-bottom: 12px; font-size: 14px; line-height: 1.45; }
.game-options { display: flex; flex-wrap: wrap; gap: 8px; }
.game-options button { padding: 9px 11px; color: var(--rp-text); background: #fff; border: 1px solid #cfdced; border-radius: 8px; font-size: 12px; font-weight: 800; cursor: pointer; }
.game-options button.is-correct { color: var(--rp-green); background: var(--rp-green-soft); border-color: #a9e3ce; }
.game-options button.is-wrong { color: #b42318; background: #fff0ee; border-color: #f2bbb5; }
.game-feedback { min-height: 19px; margin: 12px 0 0; color: var(--rp-muted); font-size: 11px; font-weight: 700; }
.game-score { padding: 20px; background: var(--rp-blue-soft); border: 1px solid #cfe0ff; border-radius: 14px; }
.game-score strong { display: block; margin: 5px 0 8px; color: var(--rp-blue); font-size: 34px; letter-spacing: -.06em; }
.game-score p { margin: 0; color: var(--rp-muted); font-size: 12px; line-height: 1.5; }
.worksheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.worksheet-card { align-self: start; display: flex; flex-direction: column; min-height: 164px; padding: 16px; background: #fff; border: 1px solid var(--rp-line); border-radius: 14px; }
.worksheet-card h3 { margin: 12px 0 7px; font-size: 16px; letter-spacing: -.035em; }
.worksheet-card p { margin: 0; color: var(--rp-muted); font-size: 12px; line-height: 1.55; }
.worksheet-card button { margin-top: 14px; align-self: start; padding: 8px 10px; color: #fff; background: var(--rp-blue); border: 0; border-radius: 8px; font-size: 11px; font-weight: 800; cursor: pointer; }
.print-sheet { display: none; }
@media (max-width: 820px) { .resource-hero, .game-board { grid-template-columns: 1fr; } .resource-grid, .worksheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .resource-hero { padding-top: 10px; } .resource-hero h1 { font-size: 43px; } .resource-grid, .worksheet-grid { grid-template-columns: 1fr; } .resource-toolbar { display: grid; } .resource-modal { padding: 12px; } .resource-modal__panel { padding: 18px; } }
@media print { .rp-header, .rp-footer, .resource-hero, .resource-toolbar, .resource-grid, .game-board, .rp-drawer, .rp-drawer-backdrop { display: none !important; } .rp-main { width: 100%; padding: 0; } .print-sheet { display: block !important; min-height: 100vh; padding: 36px; color: #111; } .print-sheet h1 { margin: 0 0 12px; font-size: 30px; } .print-sheet p { line-height: 1.6; } .print-lines { display: grid; gap: 25px; margin-top: 32px; } .print-lines div { height: 38px; border-bottom: 1px solid #777; } }

/* Shared TTS transport: one visible stop action for every learning route. */
.dia-voice-stop {
  position: fixed;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 99990;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .7rem 1rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: #c9173f;
  color: #fff;
  box-shadow: 0 10px 28px rgba(20, 27, 61, .28);
  font: 700 .875rem/1.1 Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}
.dia-voice-stop[hidden] { display: none; }
.dia-voice-stop:hover, .dia-voice-stop:focus-visible { background: #a90f32; transform: translateY(-2px); }
.dia-voice-stop:focus-visible { outline: 3px solid #f8d66d; outline-offset: 3px; }
.is-voice-playing { outline: 3px solid rgba(201,23,63,.25); outline-offset: 2px; }
@media (max-width: 600px) {
  .dia-voice-stop { right: .75rem; left: .75rem; bottom: max(.75rem, env(safe-area-inset-bottom)); width: calc(100% - 1.5rem); }
}
