.pau-main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.orient-box {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.orient-box__title {
  margin: 0 0 0.75rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.orient-box__grid {
  display: grid;
  gap: 0.75rem 1.25rem;
}

@media (min-width: 40rem) {
  .orient-box__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.orient-box__block {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.orient-box__block--full {
  grid-column: 1 / -1;
}

.orient-box__block h3 {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.orient-box__block ul {
  margin: 0;
  padding-left: 1.1rem;
}

.orient-box__block li {
  margin-bottom: 0.25rem;
}

.orient-box__block p {
  margin: 0;
}

.orient-box__pdf-links {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.orient-box__pdf-links a {
  font-weight: 600;
  color: var(--accent);
}

.orient-box__pdf-links a:hover {
  text-decoration: underline;
}

.orient-box__pdf-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

.pau-official-exams {
  margin: 0 0 1.35rem;
  padding: 0.65rem 0.85rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  background: var(--surface-elevated, rgba(255, 255, 255, 0.04));
}

.pau-official-exams__title {
  margin: 0 0 0.35rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 0.98rem;
  font-weight: 700;
}

.pau-official-exams__intro {
  margin: 0 0 0.5rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
}

.pau-official-exams__list {
  margin: 0;
  padding: 0.35rem 0 0;
  list-style: none;
  display: grid;
  gap: 0.3rem 1.25rem;
  border-top: 1px solid var(--hit-line);
}

@media (min-width: 44rem) {
  .pau-official-exams__list {
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1.5rem;
  }
}

.pau-official-exams__list li {
  margin: 0;
  padding: 0.2rem 0;
  border-bottom: none;
}

.pau-official-exams__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.3rem;
  font-size: 0.84rem;
  line-height: 1.35;
}

.pau-official-exams__sep {
  color: var(--muted);
  user-select: none;
  font-size: 0.85em;
}

.pau-official-exams__list a {
  display: inline;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.pau-official-exams__list a:hover {
  text-decoration: underline;
}

.pau-official-exams__criterios {
  font-weight: 500;
  font-size: 0.92em;
}

.pau-official-exams__meta {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
}

.pau-session-bar {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid var(--line);
  background: var(--surface-elevated, rgba(255, 255, 255, 0.03));
}

.pau-session-bar__label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.pau-session-bar__label select {
  max-width: 100%;
  font-size: 0.84rem;
}

.pau-session-bar__hint {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 400;
}

.pau-criteria-note {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px dashed var(--line);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.pau-criteria-note summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text, inherit);
}

.pau-criteria-note__src {
  margin: 0.4rem 0 0.35rem;
  font-size: 0.72rem;
}

.pau-criteria-note__body {
  margin: 0;
}

.pau-criteria-note__body p {
  margin: 0.35rem 0 0;
}

.pau-criteria-note__body p:first-child {
  margin-top: 0;
}

.pau-criteria-note--uoe {
  margin-bottom: 0.65rem;
}

.pau-criteria-note--writing {
  margin-bottom: 0.75rem;
}

.pau-intro {
  margin-bottom: 1.75rem;
}

.reading-range-note {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.extra-practice {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.extra-practice__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.extra-practice__title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.extra-practice__hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.btn-new-examples {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 0.4rem;
  border: none;
  background: var(--accent);
  color: var(--text-on-accent);
  cursor: pointer;
}

.btn-new-examples:hover {
  opacity: 0.92;
}

.pau-intro__meta {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.pau-intro__meta strong {
  color: var(--ink);
}

.pau-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding: 0.2rem;
  border-radius: 0.65rem;
  background: var(--tab-rail);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pau-tabs::-webkit-scrollbar {
  display: none;
}

.pau-tab {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.pau-tab:hover {
  color: var(--ink);
}

.pau-tab[aria-selected="true"] {
  background: var(--tab-active-bg);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.pau-tab--extra {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pau-tab__extra-pill {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.12rem 0.35rem;
  border-radius: 0.25rem;
  background: var(--accent-soft);
  color: var(--accent);
  line-height: 1.2;
}

.pau-tab--extra[aria-selected="true"] .pau-tab__extra-pill {
  background: rgba(255, 255, 255, 0.35);
  color: inherit;
}

html[data-theme="dark"] .pau-tab--extra[aria-selected="true"] .pau-tab__extra-pill,
html[data-theme="midnight"] .pau-tab--extra[aria-selected="true"] .pau-tab__extra-pill {
  background: rgba(0, 0, 0, 0.2);
}

.pau-panel-note {
  margin: 0 0 1.15rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
}

.pau-panel-note--extra {
  border-left: 3px solid var(--accent);
}

.pau-panel-note p {
  margin: 0;
}

.pau-panel-note strong {
  color: var(--ink);
}

.pau-panel {
  display: none;
}

.pau-panel.is-active {
  display: block;
}

.pau-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.pau-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.pau-toolbar select {
  min-width: min(14rem, 100%);
  font-size: 0.875rem;
}

.reading-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.reading-head h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
}

.word-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 0.35rem;
  background: var(--accent-soft);
  color: var(--ink);
}

.word-badge--ok {
  background: var(--ok-bg);
  color: var(--state-ok, #1f7a45);
}

.word-badge--warn {
  background: var(--bad-bg);
  color: var(--state-bad, #a02828);
}

.reading-source {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.writing-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 40rem) {
  .writing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.writing-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.writing-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-family: "Fraunces", Georgia, serif;
}

.writing-card .topic {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.45;
}

.writing-card textarea {
  width: 100%;
  min-height: 10rem;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.55rem 0.65rem;
  border-radius: 0.4rem;
  border: 1px solid var(--line);
  background: var(--writing-field);
  color: var(--ink);
  resize: vertical;
}

.writing-card .wc-line {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.wc-line--ok {
  color: var(--state-ok, #1f7a45);
}

.wc-line--mid {
  color: var(--state-warn, #a65d1a);
}

.wc-line--bad {
  color: var(--state-bad, #b03030);
}

.writing-card__actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.writing-card__actions .btn-check:disabled {
  opacity: 0.65;
  cursor: wait;
}

.writing-feedback {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink);
}

.writing-feedback__loading,
.writing-feedback__err {
  margin: 0;
  color: var(--muted);
}

.writing-feedback__err {
  color: var(--state-bad, #b03030);
}

.writing-feedback__block {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.45rem;
  background: var(--card-subtle);
  border: 1px solid var(--line);
}

.writing-feedback__block--warn {
  background: var(--card-warn);
  border-color: var(--warn-border, #e8c9a8);
}

.writing-feedback__block--muted {
  background: var(--card-muted);
  font-size: 0.82rem;
  color: var(--muted);
}

.writing-feedback__h {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.writing-feedback__meta {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.writing-feedback__penalty {
  margin: 0.5rem 0 0;
  font-weight: 600;
  color: var(--state-warn, #a65d1a);
}

.writing-feedback__hits {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.6rem 0 0;
  padding: 0;
}

.writing-feedback__hit {
  margin: 0;
  padding: 0.65rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 1px 0 var(--hit-line);
}

.writing-feedback__hit--lt {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.writing-feedback__hit-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.writing-feedback__hit-msg {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.writing-feedback__hit-msg strong {
  font-weight: 700;
}

.writing-feedback__hit-suggestions {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.writing-feedback__suggestions-label {
  font-weight: 600;
  color: var(--ink);
  margin-right: 0.15em;
}

.writing-feedback__hit-tip {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.writing-feedback__hits-more {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.writing-feedback__hit--lt .writing-feedback__code {
  margin: 0;
}

.writing-feedback__code {
  margin: 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  font-family: ui-monospace, monospace;
  line-height: 1.45;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.writing-rubric {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.writing-rubric summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

.writing-rubric__src,
.writing-rubric__rel {
  margin: 0.5rem 0 0;
}

.writing-rubric__band {
  margin-top: 0.75rem;
}

.writing-rubric__band h4 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
}

.writing-rubric__band ul {
  margin: 0;
  padding-left: 1.1rem;
}

.writing-rubric__band li {
  margin-bottom: 0.35rem;
}

/* ── Exam timer ───────────────────────────────────────────────────────────── */
.exam-timer-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.exam-timer-bar:not(.is-running) .exam-timer-bar__time {
  opacity: 0.45;
}

.exam-timer-bar__label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.exam-timer-bar__time {
  font-family: ui-monospace, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}

.exam-timer-bar--warn .exam-timer-bar__time {
  color: var(--state-warn);
}

.exam-timer-bar--danger .exam-timer-bar__time {
  color: var(--state-bad);
}

.exam-timer-bar__stop {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 0.35rem;
  border: 1px solid var(--btn-ghost-border);
  background: var(--btn-ghost-bg);
  color: var(--btn-ghost-text);
  cursor: pointer;
}

.exam-timer-bar__stop:hover {
  border-color: var(--state-bad);
  color: var(--state-bad);
}

/* ── Tab progress badges ──────────────────────────────────────────────────── */
.pau-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 0.85rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--ok-bg);
  color: var(--state-ok);
  line-height: 1.4;
  vertical-align: middle;
}

/* Exercise blocks (reading, Use of English, etc.) */
.reading-passage {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.1rem 1.15rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.reading-passage h3 {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.reading-passage p {
  margin: 0;
}

.ex-block-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1.5rem 0 0.75rem;
}

.ex-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
}

.ex-item__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.65rem 0.75rem;
}

.ex-item__label {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--accent);
  min-width: 1.75rem;
}

.ex-item__body {
  flex: 1 1 12rem;
  min-width: 0;
}

.ex-prompt p {
  margin: 0 0 0.65rem;
}

.ex-prompt p:last-child {
  margin-bottom: 0;
}

.ex-pick {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.65rem 0 0.5rem;
}

.ex-pick--tf {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ex-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.4rem;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ex-choice:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ex-choice input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.ex-choice__text {
  flex: 1;
  min-width: 0;
}

.ex-choice--ok {
  border-color: #2a9d5c;
  background: var(--ok-bg-soft);
}

.ex-choice--bad {
  border-color: #c94c4c;
  background: var(--bad-bg-soft);
}

.ex-choice--miss {
  opacity: 0.55;
}

.ex-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin-top: 0.35rem;
}

.btn-check {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 0.4rem;
  border: none;
  background: var(--btn-filled-bg);
  color: var(--btn-filled-text);
  cursor: pointer;
}

.btn-check:hover:not(:disabled) {
  opacity: 0.92;
}

.btn-check--answered {
  cursor: not-allowed;
  opacity: 1;
  background: var(--ok-bg);
  color: var(--state-ok);
  border: 1px solid rgba(42, 157, 92, 0.35);
  box-shadow: none;
}

html[data-theme="dark"] .btn-check--answered,
html[data-theme="midnight"] .btn-check--answered {
  border-color: rgba(109, 216, 154, 0.35);
}

.btn-check:disabled:not(.btn-check--answered) {
  opacity: 0.65;
  cursor: wait;
}

.ex-feedback {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.ex-feedback--ok {
  color: var(--state-ok, #1f7a45);
}

.ex-feedback--bad {
  color: var(--state-bad, #b03030);
}

.ex-feedback--warn {
  color: var(--state-warn, #a65d1a);
}

.ex-open-input {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0.65rem 0 0.5rem;
  padding: 0.55rem 0.65rem;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--writing-field);
  resize: vertical;
  min-height: 4.5rem;
}

.ex-open-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.btn-solucion {
  flex: 0 0 auto;
  align-self: flex-start;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 0.4rem;
  border: 1px solid var(--accent);
  background: var(--btn-ghost-bg);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-solucion:hover {
  background: var(--accent-soft);
}

.btn-solucion[aria-expanded="true"] {
  background: var(--accent);
  color: var(--text-on-accent);
}

.ex-item__solution {
  display: none;
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.45rem;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.5;
}

.ex-item__solution.is-visible {
  display: block;
}

.ex-item__solution strong {
  color: var(--ink);
}

@media (max-width: 36rem) {
  .ex-item__row {
    flex-direction: column;
  }

  .btn-solucion {
    width: 100%;
  }
}

/* ── Exam mode, history, examiner tips ─────────────────────────────────────── */
.pau-toolbar--options {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid var(--line);
  background: var(--card);
}

/* Must not match `body.pau-exam-mode` (exam mode on) — only the settings row is a div. */
div.pau-exam-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  width: 100%;
}

@media (max-width: 28rem) {
  .pau-exam-mode__text {
    flex: 1 1 100%;
  }

  .pau-exam-toggle {
    margin-left: auto;
  }
}

.pau-exam-mode__text {
  flex: 1 1 12rem;
  min-width: 0;
}

.pau-exam-mode__title {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.pau-exam-mode__hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
}

.pau-exam-toggle {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0.15rem;
}

/* Visually hidden native checkbox — keyboard & screen-reader accessible */
.pau-exam-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Toggle track */
.pau-exam-toggle__track {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--btn-ghost-border, #c8c8c8);
  border: 1px solid var(--line);
  transition: background 0.2s ease, border-color 0.2s ease;
}

/* Toggle thumb */
.pau-exam-toggle__thumb {
  position: absolute;
  left: 3px;
  width: calc(1.35rem - 8px);
  height: calc(1.35rem - 8px);
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

/* Checked state */
.pau-exam-toggle input:checked ~ .pau-exam-toggle__track {
  background: var(--accent);
  border-color: transparent;
}

.pau-exam-toggle input:checked ~ .pau-exam-toggle__track .pau-exam-toggle__thumb {
  transform: translateX(1.15rem);
}

/* Focus ring on the track (keyboard navigation) */
.pau-exam-toggle input:focus-visible ~ .pau-exam-toggle__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pau-history {
  margin-bottom: 1.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px dashed var(--line);
  background: var(--card);
  font-size: 0.82rem;
}

.pau-history summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

.pau-history__hint {
  margin: 0.35rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.pau-history__body {
  margin-top: 0.5rem;
}

.pau-history__empty {
  margin: 0;
  color: var(--muted);
}

.pau-history__sub {
  margin: 0.65rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.pau-history__sub:first-child {
  margin-top: 0;
}

.pau-history__ul {
  margin: 0 0 0.5rem;
  padding-left: 1.1rem;
}

.pau-history__ul li {
  margin-bottom: 0.5rem;
}

.pau-history__ul time {
  font-weight: 600;
  color: var(--muted);
}

.pau-history__snip {
  display: inline-block;
  margin-top: 0.15rem;
  font-style: italic;
  color: var(--ink);
  word-break: break-word;
}

.btn-history-clear {
  margin-top: 0.5rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 0.35rem;
  border: 1px solid var(--btn-ghost-border);
  background: var(--btn-ghost-bg);
  color: var(--btn-ghost-text);
  cursor: pointer;
}

.btn-history-clear:hover {
  border-color: var(--state-bad);
  color: var(--state-bad);
}

.ex-feedback--exam {
  color: var(--muted);
  font-weight: 600;
}

.writing-feedback__block--exam {
  border-color: var(--line);
}

.writing-feedback__block--examiner {
  border-left: 3px solid var(--accent);
}

.writing-feedback__examiner-list {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  line-height: 1.5;
}

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

.ex-examiner-criteria {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.45rem;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink);
}

.ex-examiner-criteria__title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.ex-examiner-criteria ul {
  margin: 0;
  padding-left: 1.1rem;
}

.ex-examiner-criteria li {
  margin-bottom: 0.3rem;
}

body.pau-exam-mode .btn-solucion,
body.pau-exam-mode .ex-item__solution {
  display: none !important;
}

body.pau-exam-mode .writing-rubric {
  display: none !important;
}

/* Keep tab row height stable (do not use display:none — it reflows the bar and shifts the header). */
body.pau-exam-mode .pau-tab__badge {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .exam-timer-bar,
  .exam-timer-bar__time,
  .ex-choice,
  .btn-solucion,
  .btn-check {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Layout (TOC rail) ───────────────────────────────────────────────────── */
.pau-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pau-toc-wrap {
  order: 0;
}

.pau-layout__content {
  order: 1;
  min-width: 0;
}

.pau-toc {
  padding: 0.55rem 0.65rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  background: var(--card-subtle);
  box-shadow: 0 1px 0 var(--hit-line);
}

.pau-toc__label {
  margin: 0 0 0.45rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pau-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.55rem;
}

.pau-toc__list a {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: 0.22rem 0.4rem;
  border-radius: 0.35rem;
  line-height: 1.25;
}

.pau-toc__list a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.pau-toc__sub a {
  font-weight: 500;
  font-size: 0.74rem;
  color: var(--muted);
  padding-left: 0.45rem;
  border-left: 2px solid var(--accent-soft);
  border-radius: 0 0.35rem 0.35rem 0;
}

.pau-practice-tools {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.15rem;
}

@media (min-width: 64rem) {
  .pau-main:has(.pau-layout) {
    max-width: 66rem;
  }

  .pau-layout {
    display: grid;
    grid-template-columns: 11.75rem minmax(0, 1fr);
    gap: 1.25rem 1.75rem;
    align-items: start;
  }

  .pau-toc-wrap {
    position: sticky;
    top: 1rem;
    z-index: 5;
  }

  .pau-layout__content {
    max-width: 52rem;
  }

  .pau-toc__list {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.05rem;
  }

  .pau-toc__list a {
    display: block;
    padding: 0.28rem 0.35rem;
  }

  .pau-toc__sub a {
    padding-left: 0.55rem;
  }
}

/* ── Comfortable reading measure (long prose) ───────────────────────────── */
.pau-layout__content .reading-passage {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.pau-layout__content .ex-prompt {
  max-width: 42rem;
}

.writing-card .topic,
.writing-card > h3 {
  max-width: 65ch;
}

/* ── <details> open polish (PAU) ─────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  details.pau-history > summary,
  details.pau-criteria-note > summary,
  details.writing-rubric > summary {
    transition: color 0.2s ease, background-color 0.2s ease;
  }

  details.pau-history[open] > summary,
  details.pau-criteria-note[open] > summary,
  details.writing-rubric[open] > summary {
    color: var(--accent);
  }

  details.pau-history[open] > :not(summary),
  details.pau-criteria-note[open] > :not(summary),
  details.writing-rubric[open] > :not(summary) {
    animation: pau-details-body-in 0.22s ease-out;
  }
}

@keyframes pau-details-body-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Print: worksheets (all tab panels visible) ─────────────────────────── */
@media print {
  .skip-link,
  .bg-pattern,
  .site-header,
  .site-footer,
  .theme-picker,
  .pau-toc-wrap,
  .pau-practice-tools,
  .pau-tabs,
  .pau-history,
  .btn-history-clear,
  .btn-new-examples,
  .btn-check,
  .btn-solucion,
  .pau-exam-toggle,
  #pau-exam-mode,
  .writing-card__actions,
  .ex-actions,
  .pau-tab__badge {
    display: none !important;
  }

  body,
  .pau-main {
    background: #fff !important;
    color: #000 !important;
  }

  .pau-main {
    max-width: none !important;
    padding: 0.4rem !important;
  }

  .pau-layout,
  .pau-layout__content {
    display: block !important;
    max-width: none !important;
  }

  .pau-toolbar {
    display: none !important;
  }

  .pau-panel {
    display: block !important;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 1.75rem !important;
    padding-top: 0.5rem !important;
    border-top: 2px solid #bbb !important;
  }

  #panel-lectura.pau-panel {
    border-top: none !important;
    padding-top: 0 !important;
  }

  .reading-passage,
  .ex-item,
  .writing-card,
  .orient-box,
  .pau-official-exams {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  details.pau-history,
  details.pau-criteria-note,
  details.writing-rubric {
    border: 1px solid #ddd !important;
  }

  details.pau-history[open] > summary,
  details.pau-criteria-note[open] > summary,
  details.writing-rubric[open] > summary {
    color: #000 !important;
  }
}
