/* =========================================================
   PrepMate Web — CELPIP-style UI (Poppins Edition)
   Complete stylesheet (dashboard v2 + CELPIP reading UI)
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400;500;600&family=Poppins:wght@400;500;600;700&display=swap");

:root {
  --pm-brand: #287bad;
  --pm-brand-dark: #1f6a99;
  --pm-ink: #0f172a;
  --pm-muted: #64748b;
  --pm-line: #e2e8f0;
  --pm-bg: #f5f7fb;

  --pm-panel-line: #c9d8e4;
  --pm-panel-bar-a: #f4f5f7;
  --pm-panel-bar-b: #e3e5e9;
  --pm-panel-blue: #287bad;
  --pm-panel-blue-dark: #1f6a99;
  --pm-panel-blue-line: #246da0;
  --pm-panel-bg: #eef5fa;

  --pm-accent-blue: #287bad;
  --pm-accent-blue-soft: #dbeeff;
  --pm-accent-teal: #14b8a6;
  --pm-accent-teal-soft: #ccfbf1;
  --pm-accent-violet: #8b5cf6;
  --pm-accent-violet-soft: #ede9fe;
  --pm-accent-amber: #f59e0b;
  --pm-accent-amber-soft: #fef3c7;

  --pm-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --pm-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --pm-shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.08);

  --pm-radius: 12px;
  --pm-radius-sm: 8px;

  /* Dark navy for instruction text (CELPIP-style) */
  --pm-instr-blue: #1f4a85;
  --pm-instr-icon: #2b5a8f;
}

* {
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--pm-bg);
  color: var(--pm-ink);
  font-family:
    "Poppins",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 14px;
  font-weight: 400;
}

/* =========================================================
   Header & Cards
   ========================================================= */
.pm-navbar {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--pm-line);
  padding: 0.6rem 0;
}
.pm-logo {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--pm-panel-blue);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 10px rgba(40, 123, 173, 0.3);
}
.pm-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.pm-brand-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--pm-ink);
}
.pm-brand-sub {
  font-size: 11px;
  color: var(--pm-muted);
  font-weight: 600;
}

.pm-user-chip,
.pm-section-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}
.pm-section-chip {
  background: var(--pm-accent-blue-soft);
  color: var(--pm-panel-blue-dark);
}
.pm-icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--pm-line);
  background: #fff;
  color: var(--pm-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.pm-icon-btn:hover {
  border-color: var(--pm-panel-blue);
  color: var(--pm-panel-blue);
  background: var(--pm-panel-bg);
}
.pm-listen-option .pm-listen-option-mark {
  display: none !important;
}

.pm-listen-option input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #1a1a1a;
  flex-shrink: 0;
  cursor: pointer;
}
.pm-card {
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-radius);
  background: #fff;
  box-shadow: var(--pm-shadow-sm);
}
.pm-card .card-body {
  padding: 1.25rem;
}

/* =========================================================
   Auth pages
   ========================================================= */
.pm-auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  overflow: hidden;
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-radius);
  background: #fff;
  box-shadow: var(--pm-shadow-lg);
}
.pm-auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 540px;
  padding: clamp(2rem, 5vw, 4rem);
  color: #fff;
  background:
    linear-gradient(145deg, rgba(16, 39, 89, 0.94), rgba(24, 84, 110, 0.92)),
    repeating-linear-gradient(
      135deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.06) 18px 19px
    );
}
.pm-auth-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.3rem;
}
.pm-auth-aside .pm-kicker {
  color: #c9e8ff;
}
.pm-auth-aside h1 {
  max-width: 12ch;
  margin: 0.4rem 0 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  font-weight: 700;
}
.pm-auth-copy {
  max-width: 38ch;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
  font-weight: 400;
}
.pm-auth-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
  font-weight: 400;
}
.pm-auth-modules i {
  margin-right: 0.4rem;
  color: #a8e3d5;
}
.pm-auth-panel {
  align-self: center;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 4vw, 3rem);
}
.pm-auth-page {
  display: grid;
  min-height: calc(100vh - 64px);
  align-items: center;
}
.pm-auth-link {
  margin: 1rem 0 0;
  color: var(--pm-muted);
  font-size: 0.85rem;
  font-weight: 400;
}
.pm-auth-link a {
  color: var(--pm-panel-blue);
  font-weight: 600;
}
.pm-auth-form {
  display: grid;
  gap: 0.55rem;
}
.pm-auth-form .form-control {
  min-height: 44px;
  margin-bottom: 0.35rem;
  border-radius: var(--pm-radius-sm);
  font-family: "Poppins", sans-serif;
}
.pm-auth-form .form-label {
  margin-bottom: 0;
  font-size: 0.85rem;
  font-weight: 600;
}
.pm-auth-message {
  min-height: 1.25rem;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 400;
}
.pm-auth-message.is-error {
  color: #b42318;
}
.pm-auth-message.is-success {
  color: #047857;
}
.pm-demo-credentials {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid #e1a83a;
  border-radius: var(--pm-radius-sm);
  background: #fff8e8;
  color: #5c4a22;
  font-size: 0.8rem;
  font-weight: 400;
}
.pm-demo-credentials code {
  color: #403518;
}
.pm-auth-disclaimer {
  margin: 0.75rem 0 0;
  color: var(--pm-muted);
  font-size: 0.72rem;
  line-height: 1.45;
  font-weight: 400;
}
@media (max-width: 767.98px) {
  .pm-auth-layout {
    grid-template-columns: 1fr;
  }
  .pm-auth-aside {
    min-height: auto;
    padding: 1.75rem;
  }
  .pm-auth-mark {
    margin-bottom: 1.25rem;
  }
  .pm-auth-aside h1 {
    max-width: 18ch;
    font-size: 2rem;
  }
  .pm-auth-modules {
    margin-top: 1.25rem;
  }
  .pm-auth-panel {
    max-width: none;
    padding: 1.5rem;
  }
}

/* =========================================================
   Dashboard v2 — flat, calm, same palette
   ========================================================= */
.pm-dash {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 1200px;
  margin: 0 auto;
}

.pm-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.75rem 2rem;
  border-radius: 10px;
  background: var(--pm-panel-blue);
  color: #fff;
}
.pm-hero-kicker {
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: #d6ecfa;
}
.pm-hero-title {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.6rem;
  font-weight: 600;
}
.pm-hero-sub {
  margin: 0;
  max-width: 46ch;
  color: #e6f3fb;
  font-size: 0.9rem;
  font-weight: 400;
}
.pm-hero-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.pm-btn-light,
.pm-btn-outline-light {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: "Poppins", sans-serif;
}
.pm-btn-light {
  background: #fff;
  color: var(--pm-panel-blue-dark);
  border: 1px solid #fff;
}
.pm-btn-light:hover {
  background: #eef5fa;
}
.pm-btn-outline-light {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.pm-btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

.pm-dash-cols {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr);
  gap: 1.75rem;
  align-items: start;
}
.pm-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--pm-line);
}
.pm-block-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--pm-ink);
}
.pm-block-head > span:not(.pm-dash-side-count) {
  font-size: 0.78rem;
  color: var(--pm-muted);
  font-weight: 400;
}

.pm-dash-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.pm-module-card {
  display: flex;
  flex-direction: column;
  padding: 1.1rem;
  background: #fff;
  border: 1px solid var(--pm-line);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}
.pm-module-card:hover {
  border-color: var(--pm-panel-blue);
}
.pm-module-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.pm-module-badge {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.pm-module-card--blue .pm-module-badge {
  background: var(--pm-accent-blue-soft);
  color: var(--pm-panel-blue-dark);
}
.pm-module-card--teal .pm-module-badge {
  background: var(--pm-accent-teal-soft);
  color: #0f766e;
}
.pm-module-card--violet .pm-module-badge {
  background: var(--pm-accent-violet-soft);
  color: #6d28d9;
}
.pm-module-card--amber .pm-module-badge {
  background: var(--pm-accent-amber-soft);
  color: #b45309;
}
.pm-module-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--pm-ink);
  line-height: 1.2;
}
.pm-module-meta {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--pm-muted);
  font-weight: 400;
}
.pm-module-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--pm-panel-blue);
  border-radius: 6px;
  background: #fff;
  color: var(--pm-panel-blue);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: "Poppins", sans-serif;
}
.pm-module-action:hover {
  background: var(--pm-panel-blue);
  color: #fff;
}

.pm-dash-side {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.pm-side-card {
  padding: 1.1rem;
  background: #fff;
  border: 1px solid var(--pm-line);
  border-radius: 10px;
}
.pm-dash-side-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--pm-panel-bg);
  color: var(--pm-panel-blue-dark);
  font-size: 0.72rem;
  font-weight: 700;
}
.pm-dash-history {
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
}
.pm-history-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--pm-line);
}
.pm-history-item:last-child {
  border-bottom: 0;
}
.pm-history-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--pm-panel-bg);
  color: var(--pm-panel-blue-dark);
  font-size: 0.72rem;
  font-weight: 700;
}
.pm-history-mid {
  flex: 1;
  min-width: 0;
}
.pm-history-date {
  font-size: 0.74rem;
  color: var(--pm-muted);
  margin-bottom: 0.3rem;
  font-weight: 400;
}
.pm-history-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--pm-line);
  overflow: hidden;
}
.pm-history-bar span {
  display: block;
  height: 100%;
  background: var(--pm-panel-blue);
  border-radius: 999px;
}
.pm-history-score {
  font-weight: 600;
  color: var(--pm-ink);
  font-size: 0.88rem;
}
.pm-history-item.is-empty {
  justify-content: center;
  padding: 1.5rem 0.5rem;
  border: 1px dashed var(--pm-line);
  border-radius: 8px;
  color: var(--pm-muted);
  font-size: 0.82rem;
  text-align: center;
}
.pm-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.55rem 0.9rem;
  background: #fff;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: "Poppins", sans-serif;
}
.pm-btn-danger:hover {
  background: #fef2f2;
}

.pm-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.pm-tips li {
  display: flex;
  gap: 0.6rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #475569;
}
.pm-tips i {
  color: var(--pm-panel-blue);
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.pm-footer-note {
  color: var(--pm-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

@media (max-width: 991.98px) {
  .pm-dash-cols {
    grid-template-columns: 1fr;
  }
  .pm-dash-side {
    position: static;
  }
}
@media (max-width: 575.98px) {
  .pm-hero {
    padding: 1.25rem;
  }
  .pm-dash-modules {
    grid-template-columns: 1fr;
  }
  .pm-hero-actions,
  .pm-hero-actions > button {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   Test picker
   ========================================================= */
.pm-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.pm-picker-card {
  display: flex;
  flex-direction: column;
  padding: 1.1rem;
  background: #fff;
  border: 1px solid var(--pm-line);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}
.pm-picker-card:hover {
  border-color: var(--pm-panel-blue);
}
.pm-picker-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.pm-picker-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--pm-ink);
  line-height: 1.3;
}
.pm-picker-card-meta {
  font-size: 0.78rem;
  color: var(--pm-muted);
  margin-top: 0.2rem;
  font-weight: 400;
}
.pm-picker-card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--pm-panel-bg);
  color: var(--pm-panel-blue-dark);
  white-space: nowrap;
  flex-shrink: 0;
}
.pm-picker-card-desc {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 1rem;
  flex: 1;
}
.pm-picker-card-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--pm-panel-blue);
  border-radius: 6px;
  background: #fff;
  color: var(--pm-panel-blue);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: "Poppins", sans-serif;
}
.pm-picker-card-btn:hover {
  background: var(--pm-panel-blue);
  color: #fff;
}
.pm-picker-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--pm-muted);
  border: 1px dashed var(--pm-line);
  border-radius: 10px;
  background: #fff;
  font-size: 0.9rem;
}
#screen-picker .pm-block-head {
  align-items: center;
}

/* =========================================================
   Exam screens (Base)
   ========================================================= */
.pm-screen {
  animation: pmFade 0.18s ease-out;
}
@keyframes pmFade {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.pm-choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-radius-sm);
  background: white;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.pm-choice:hover {
  border-color: var(--pm-panel-blue);
}
.pm-choice input {
  margin: 0;
}
.pm-choice.is-selected {
  border-color: var(--pm-panel-blue);
  background: var(--pm-panel-bg);
}
.pm-choice-mark {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--pm-line);
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--pm-panel-blue);
  background: #fff;
}
.pm-passage {
  background: #f9fafc;
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-radius-sm);
  padding: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-line;
  font-weight: 400;
}
.pm-counter {
  font-size: 0.8rem;
}
.pm-counter.in-range {
  color: #047857;
}
.pm-counter.out-range {
  color: var(--pm-muted);
}
.pm-record-timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--pm-panel-blue);
}
.pm-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 8px;
}
.pm-nav-btn {
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--pm-line);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pm-ink);
  font-family: "Poppins", sans-serif;
}
.pm-nav-btn:hover {
  border-color: var(--pm-panel-blue);
}
.pm-nav-btn.is-current {
  background: var(--pm-panel-blue);
  border-color: var(--pm-panel-blue);
  color: #fff;
}
.pm-nav-btn.is-answered {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}
.pm-nav-btn.is-current.is-answered {
  color: #fff;
  background: var(--pm-panel-blue-dark);
  border-color: var(--pm-panel-blue-dark);
}
.pm-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--pm-line);
  padding: 0.75rem 0;
  margin-top: 1rem;
  z-index: 5;
}
.pm-result-row + .pm-result-row {
  margin-top: 0.9rem;
}
.pm-result-bar {
  height: 8px;
  border-radius: 999px;
  background: #eceef2;
  overflow: hidden;
}
.pm-result-bar > span {
  display: block;
  height: 100%;
  background: var(--pm-panel-blue);
}
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(40, 123, 173, 0.35);
  border-radius: 8px;
}

/* =========================================================
   Listening module (Base)
   ========================================================= */
.pm-listen-frame {
  overflow: hidden;
  border: 1px solid var(--pm-panel-line);
  background: #fff;
  box-shadow: 0 2px 12px rgba(22, 26, 34, 0.08);
}
.pm-listen-bar {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid var(--pm-panel-line);
  background: linear-gradient(var(--pm-panel-bar-a), var(--pm-panel-bar-b));
}
.pm-listen-bar-title {
  min-width: 0;
  color: #3f454d;
  font-size: 0.88rem;
  line-height: 1.35;
  font-weight: 600;
}
.pm-listen-bar-right {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.9rem;
}
.pm-listen-time {
  color: #4a4f57;
  font-size: 0.82rem;
  white-space: nowrap;
  font-weight: 400;
}
.pm-listen-time b {
  color: #000;
  font-weight: 500;
}
.pm-listen-next,
.pm-listen-back {
  min-width: 62px;
  min-height: 30px;
  padding: 0 0.75rem;
  border: 1px solid var(--pm-panel-blue-line);
  border-radius: 4px;
  background: var(--pm-panel-blue);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-family: "Poppins", sans-serif;
}
.pm-listen-next:hover,
.pm-listen-back:hover {
  background: var(--pm-panel-blue-dark);
}
.pm-listen-body {
  background: #fff;
}
.pm-listen-body--center {
  display: flex;
  min-height: 480px;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 2rem);
}
.pm-listen-stage {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.pm-listen-body--split {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.pm-listen-pane {
  min-width: 0;
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
  min-height: 0;
  overflow-y: auto;
}
.pm-listen-pane--audio {
  border-right: 1px solid #dfe3e8;
}
@media (max-width: 767.98px) {
  .pm-listen-body--split {
    grid-template-columns: 1fr;
  }
  .pm-listen-pane--audio {
    border-right: 0;
    border-bottom: 1px solid #dfe3e8;
  }
}
.pm-listen-info {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  color: #1f4a85;
  font-size: 0.92rem;
  line-height: 1.5;
  font-weight: 400;
}
.pm-listen-info i {
  margin-top: 0.1rem;
  flex-shrink: 0;
  color: #2b5a8f;
}
.pm-listen-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  width: 100%;
}
.pm-listen-soundbox {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 360px;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  background: #e9ecf1;
}
.pm-listen-soundicon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: #fff;
  color: #4a5560;
  font-size: 1.5rem;
}
.pm-listen-soundmeta {
  flex: 1;
  min-width: 0;
}
.pm-listen-soundstatus {
  margin-bottom: 0.45rem;
  color: #3f454d;
  font-size: 0.85rem;
  font-weight: 600;
}
.pm-listen-track {
  height: 9px;
  border-radius: 999px;
  background: #d3d8df;
  overflow: hidden;
}
.pm-listen-track > span {
  display: block;
  width: 0;
  height: 100%;
  background: #7fb2d6;
  transition: width 0.2s linear;
}
.pm-listen-player {
  display: block;
  width: min(100%, 420px);
  margin: 1.5rem auto 1rem;
}
.pm-listen-playbar-note {
  display: none;
}
.pm-listen-body--center .pm-listen-player {
  margin-top: 0.5rem;
}
.pm-listen-scene {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}
.pm-listen-stage--instructions {
  align-items: stretch;
  justify-content: flex-start;
  padding: clamp(1rem, 3vw, 2rem) clamp(1.25rem, 4vw, 3rem);
}
.pm-listen-instructions {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}
.pm-listen-instructions-title {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #2b3a4a;
}
.pm-listen-instructions-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.pm-listen-instructions-list li {
  position: relative;
  padding: 0.85rem 0 0.85rem 1.4rem;
  color: #1f4a85;
  font-size: 0.92rem;
  line-height: 1.55;
  border-bottom: 1px solid #eef1f4;
  font-weight: 400;
}
.pm-listen-instructions-list li:last-child {
  border-bottom: 0;
}
.pm-listen-instructions-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.25rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cfd6dd;
}
.pm-listen-stage--scene {
  align-items: stretch;
  justify-content: flex-start;
  padding: clamp(1rem, 3vw, 2rem) clamp(1.25rem, 4vw, 3rem);
}
.pm-listen-scene-wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.pm-listen-scene-body {
  margin: 0 0 1.25rem;
  color: #3f454d;
  font-size: 0.92rem;
  line-height: 1.55;
  font-weight: 400;
}
.pm-listen-qhead {
  margin-bottom: 0.85rem;
  color: #3f454d;
  font-size: 0.88rem;
  font-weight: 600;
}
.pm-listen-questions {
  min-width: 0;
}
.pm-listen-question + .pm-listen-question {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e6e9ee;
}
.pm-listen-prompt {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: 600;
}
.pm-listen-options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.pm-listen-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--pm-line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  min-height: 48px;
}
.pm-listen-option:hover {
  background: #f4f8fc;
  border-color: #b6d3e8;
}
.pm-listen-option.is-selected {
  border-color: #7ba7d4;
  background: #dceaf5;
}
.pm-listen-option input {
  margin: 0;
  flex-shrink: 0;
}
.pm-listen-option-mark {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  border: 1px solid var(--pm-line);
  border-radius: 999px;
  background: #fff;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
.pm-listen-option.is-selected .pm-listen-option-mark {
  background: #2c7fb8;
  border-color: #2c7fb8;
  box-shadow: inset 0 0 0 3px #fff;
}
.pm-listen-option-text {
  font-size: 0.88rem;
  line-height: 1.45;
  font-weight: 400;
}
.pm-listen-options--pictures {
  gap: 0.6rem;
}
.pm-listen-option--picture {
  padding: 0.6rem 0.75rem;
  border-color: transparent;
  border-radius: 4px;
  align-items: center;
}
.pm-listen-option--picture.is-selected {
  background: #d9e8f3;
  border-color: #b6d3e8;
}
.pm-listen-thumb {
  display: block;
  width: 190px;
  max-width: 62%;
  border: 1px solid #d7dce2;
  background: #f2f4f7;
}
.pm-listen-thumb img {
  display: block;
  width: 100%;
  height: auto;
}
.pm-listen-questions.is-answer-key .pm-listen-option.is-correct {
  border-color: #10b981;
  background: #ecfdf5;
}
.pm-listen-questions.is-answer-key
  .pm-listen-option.is-correct
  .pm-listen-option-mark {
  border-color: #10b981;
  background: #10b981;
}
.pm-listen-questions.is-answer-key
  .pm-listen-option.is-correct
  .pm-listen-thumb {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
}
.pm-listen-body--dropdown {
  align-items: stretch;
  background: var(--pm-panel-bg);
}
.pm-listen-stage--dropdown {
  align-items: stretch;
  justify-content: flex-start;
  padding: 0.5rem 0 0;
  background: var(--pm-panel-bg);
}
.pm-listen-dropdowns {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.pm-listen-dropdown-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: #161a22;
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 400;
}
.pm-listen-dropdown-number {
  flex: 0 0 auto;
  min-width: 1.35rem;
  color: #161a22;
  font-weight: 400;
}
.pm-listen-dropdown-stem {
  flex: 0 1 auto;
  min-width: 0;
  margin-right: 0.5rem;
}
.pm-listen-select {
  flex: 0 0 auto;
  width: 110px;
  height: 22px;
  padding: 0 1.1rem 0 0.3rem;
  border: 1px solid #b9bfc7;
  border-radius: 2px;
  background: #fff
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%233f454d' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E")
    no-repeat right 0.25rem center;
  background-size: 8px 5px;
  color: #161a22;
  font-family: "Poppins", sans-serif;
  font-size: 0.8rem;
  line-height: 1;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  font-weight: 400;
}
.pm-listen-select:focus {
  outline: none;
  border-color: #7ba7d4;
  box-shadow: 0 0 0 2px rgba(123, 167, 212, 0.35);
}
.pm-listen-select.is-correct {
  border-color: #10b981;
  background-color: #ecfdf5;
}
.pm-listen-bottom {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--pm-panel-line);
  background: linear-gradient(var(--pm-panel-bar-b), #dfe2e7);
}
.pm-listen-key {
  margin-right: auto;
  padding: 0.35rem 0.85rem;
  border: 1px solid #b9bfc7;
  border-radius: 4px;
  background: #fff;
  color: #3f454d;
  font-size: 0.75rem;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
}
.pm-listen-key.is-active {
  border-color: #7ba7d4;
  background: #eef4ff;
  color: #1c4f7c;
  font-weight: 700;
}

@media (max-width: 575.98px) {
  .pm-listen-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.6rem 0.85rem;
  }
  .pm-listen-bar-right {
    width: 100%;
    justify-content: space-between;
  }
  .pm-listen-body--center {
    min-height: 360px;
    padding: 1.2rem 1rem;
  }
  .pm-listen-thumb {
    width: 130px;
  }
  .pm-listen-dropdown-row {
    font-size: 0.9rem;
    gap: 0.4rem;
  }
  .pm-listen-select {
    width: 90px;
  }
}

/* =========================================================
   Click NEXT to continue card + hide question prompt
   ========================================================= */

.pm-listen-click-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  padding: 18px 22px;
  background: #e3e6ea;
  border: 1px solid #d5d5d5;
  border-radius: 10px;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  color: #2b2b2b;
}

.pm-listen-click-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #cfd4d9;
  color: #6b7280;
  font-size: 20px;
  flex-shrink: 0;
}

.pm-listen-click-text {
  font-weight: 500;
}

.pm-listen-question .pm-listen-prompt {
  display: none;
}

/* =========================================================
   Custom TTS progress player (questions stage)
   ========================================================= */

.pm-listen-audio--question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  width: 100%;
}

.pm-listen-custom-player {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 460px;
  padding: 10px 14px;
  background: #e6e9ed;
  border-radius: 999px;
  box-sizing: border-box;
}

.pm-listen-custom-play {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #333;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.pm-listen-custom-play:hover {
  background: rgba(0, 0, 0, 0.06);
}

.pm-listen-custom-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  flex-shrink: 0;
}

.pm-listen-custom-bar {
  flex: 1;
  height: 4px;
  background: #c9cdd2;
  border-radius: 999px;
  overflow: hidden;
  min-width: 80px;
}

.pm-listen-custom-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: #1a1a1a;
  border-radius: 999px;
  transition: width 0.1s linear;
}

/* =========================================================
   EXACT CELPIP UI OVERRIDES
   ========================================================= */
body.pm-exam-mode {
  background-color: #f2f2f2 !important;
}
body.pm-exam-mode .pm-navbar {
  display: none !important;
}
body.pm-exam-mode .pm-footer-note {
  color: #666;
  font-size: 11px;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
}

body.pm-exam-mode .pm-listen-frame {
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid #ccc;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  height: calc(100vh - 40px);
  min-height: 640px;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.pm-exam-mode .pm-listen-body--center {
  flex: 1;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.pm-exam-mode .pm-listen-stage--instructions {
  padding: 30px 40px;
  align-items: stretch;
  justify-content: flex-start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
body.pm-exam-mode .pm-listen-instructions {
  max-width: 100%;
}
body.pm-exam-mode .pm-listen-instructions-title {
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #000;
  margin-bottom: 20px;
}
body.pm-exam-mode .pm-listen-instructions-list {
  padding-left: 20px;
  list-style-type: disc;
}
body.pm-exam-mode .pm-listen-instructions-list li {
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  color: #1f4a85;
  padding: 15px 0;
  border-bottom: 1px solid #ddd;
  line-height: 1.6;
  font-weight: 500;
  min-height: 56px;
  display: flex;
  align-items: center;
}
body.pm-exam-mode .pm-listen-instructions-list li:last-child {
  border-bottom: none;
}
body.pm-exam-mode .pm-listen-instructions-list li::before {
  content: none !important;
  display: none !important;
}

body.pm-exam-mode .pm-listen-stage--scene {
  padding: 30px 40px;
  align-items: stretch;
  justify-content: flex-start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
body.pm-exam-mode .pm-listen-scene-wrap {
  max-width: 100%;
  margin: 0;
}
body.pm-exam-mode .pm-listen-info {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 0 20px 0 !important;
  font-family: "Poppins", sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #1f4a85 !important;
  padding: 0 !important;
  border-bottom: none !important;
  background: transparent !important;
}
body.pm-exam-mode .pm-listen-info i {
  font-size: 16px;
  color: #2b5a8f !important;
}
body.pm-exam-mode .pm-listen-scene-body {
  margin: 0 0 20px 0;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  color: #000;
  line-height: 1.5;
  font-weight: 400;
  padding-left: 24px;
  min-height: 66px;
  display: flex;
  align-items: center;
}
body.pm-exam-mode .pm-listen-scene {
  display: block;
  width: 100%;
  height: 420px;
  max-height: 420px;
  min-height: 420px;
  object-fit: contain;
  border: none;
  margin: 0;
  background: #fafafa;
}

body.pm-exam-mode .pm-listen-body--audio {
  background: #f2f2f2;
  flex: 1;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.pm-exam-mode .pm-listen-body--audio .pm-listen-info {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 16px 22px !important;
  margin: 30px 40px 0 !important;
  border: 1px solid #d5d5d5 !important;
  border-radius: 10px !important;
  background: #e3e6ea !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #2b2b2b !important;
  justify-content: flex-start !important;
}
body.pm-exam-mode .pm-listen-body--audio .pm-listen-info i {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #a6adb7;
  color: #ffffff !important;
  font-size: 18px;
  margin: 0;
  flex-shrink: 0;
}

body.pm-exam-mode .pm-listen-stage--audio {
  padding: 40px 20px 0;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  height: auto;
  max-height: none;
}

body.pm-exam-mode .pm-listen-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0;
  flex: 0 0 auto;
  width: 100%;
  max-width: 460px;
}

body.pm-exam-mode .pm-listen-soundbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 460px;
  min-width: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.pm-exam-mode .pm-listen-soundicon {
  display: none;
}
body.pm-exam-mode .pm-listen-soundmeta {
  display: none;
}
body.pm-exam-mode .pm-listen-soundstatus {
  display: none;
}
body.pm-exam-mode .pm-listen-track {
  display: none;
}

body.pm-exam-mode .pm-listen-player {
  display: block;
  width: 100%;
  max-width: 460px;
  height: 48px;
  margin: 0;
  border-radius: 999px;
  background: #e6e9ed;
  padding: 4px 8px;
  box-sizing: border-box;
  outline: none;
  accent-color: #6b7280;
}

body.pm-exam-mode .pm-listen-playbar-note {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1.5px solid #1a1a1a;
  background: #ffffff;
  color: #333333;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  min-height: 48px;
  max-height: 48px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  box-sizing: border-box;
}

body.pm-exam-mode .pm-listen-bottom {
  background: linear-gradient(#f2f2f4, #dcdde1);
  border-top: 1px solid #ccc;
  padding: 12px 24px;
  min-height: 60px;
  max-height: 60px;
  flex-shrink: 0;
}
body.pm-exam-mode .pm-listen-back,
body.pm-exam-mode .pm-listen-next {
  background: #3f77b4;
  border: 1px solid #3f77b4;
  border-radius: 2px;
  padding: 4px 16px;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: #fff;
  min-height: auto;
  min-width: 0;
}
body.pm-exam-mode .pm-listen-back:hover,
body.pm-exam-mode .pm-listen-next:hover {
  background: #2f639a;
  border-color: #2f639a;
}

body.pm-exam-mode .pm-listen-bar {
  background: linear-gradient(#f2f2f4, #dcdde1);
  border-bottom: 1px solid #ccc;
  padding: 12px 24px;
  min-height: 56px;
  max-height: 56px;
  flex-shrink: 0;
}
body.pm-exam-mode .pm-listen-bar-title {
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #444;
}

body.pm-exam-mode .pm-listen-click-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 460px;
  padding: 18px 22px;
  background: #e3e6ea;
  border: 1px solid #d5d5d5;
  border-radius: 10px;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  color: #2b2b2b;
  margin: 0 auto;
}

body.pm-exam-mode .pm-listen-click-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #cfd4d9;
  color: #6b7280;
  font-size: 20px;
  flex-shrink: 0;
}

body.pm-exam-mode .pm-listen-click-text {
  font-weight: 500;
}

body.pm-exam-mode .pm-listen-question .pm-listen-prompt {
  display: none;
}

body.pm-exam-mode .pm-listen-audio--question {
  padding: 20px 0 0;
  align-items: center;
  width: 100%;
}

body.pm-exam-mode .pm-listen-custom-player {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 460px;
  padding: 10px 14px;
  background: #e6e9ed;
  border-radius: 999px;
  box-sizing: border-box;
  margin: 0 auto;
}

body.pm-exam-mode .pm-listen-custom-play {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #333;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

body.pm-exam-mode .pm-listen-custom-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  flex-shrink: 0;
}

body.pm-exam-mode .pm-listen-custom-bar {
  flex: 1;
  height: 4px;
  background: #c9cdd2;
  border-radius: 999px;
  overflow: hidden;
  min-width: 80px;
}

body.pm-exam-mode .pm-listen-custom-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: #1a1a1a;
  border-radius: 999px;
  transition: width 0.1s linear;
}

@media (max-width: 575.98px) {
  body.pm-exam-mode .pm-listen-body--audio .pm-listen-info {
    margin: 20px 20px 0 !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
  }
  body.pm-exam-mode .pm-listen-body--audio .pm-listen-info i {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
  body.pm-exam-mode .pm-listen-player {
    height: 44px;
  }
  body.pm-exam-mode .pm-listen-playbar-note {
    font-size: 13px;
    max-width: 100%;
  }
  body.pm-exam-mode .pm-listen-click-card {
    padding: 14px 16px;
    font-size: 14px;
  }
  body.pm-exam-mode .pm-listen-click-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  body.pm-exam-mode .pm-listen-custom-player {
    padding: 8px 12px;
    gap: 8px;
  }
  body.pm-exam-mode .pm-listen-custom-time {
    font-size: 12px;
  }
}

/* =========================================================
   Parts 4, 5, 6 — Exact CELPIP Dropdown Layout
   ========================================================= */

.pm-listen-time,
body.pm-exam-mode .pm-listen-time {
  color: #4a4f57;
  font-size: 14px;
  font-weight: 400;
}
.pm-listen-time b {
  color: #000;
  font-weight: 500;
}

body.pm-exam-mode .pm-listen-body--celpip-dropdown {
  background: #eef6f8;
  align-items: stretch;
  justify-content: flex-start;
  padding: 22px 24px !important;
  overflow-y: auto;
}

body.pm-exam-mode .pm-listen-body--celpip-dropdown .pm-listen-info {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 0 28px 0 !important;
  font-family: "Poppins", sans-serif !important;
  font-size: 17px !important;
  font-weight: 500 !important;
  color: #1f4a85 !important;
}
body.pm-exam-mode .pm-listen-body--celpip-dropdown .pm-listen-info i {
  font-size: 18px;
  color: #2b5a8f !important;
}
.pm-listen-info .pm-hl {
  color: #1f4a85;
}
.pm-listen-info .pm-caret {
  font-size: 11px;
  vertical-align: middle;
}

.pm-listen-celpip-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: none;
  margin: 0;
}
.pm-listen-celpip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}
.pm-listen-celpip-number {
  flex: 0 0 auto;
  min-width: 0;
  font-weight: 400;
}
.pm-listen-celpip-text {
  flex: 0 1 auto;
  min-width: 0;
  margin-right: 2px;
}
.pm-listen-celpip-select-wrap {
  flex: 0 0 auto;
  width: auto;
}

.pm-listen-celpip-select {
  width: 92px;
  height: 26px;
  padding: 0 24px 0 6px;
  border: 1px solid #e3eaef;
  border-radius: 0;
  background: #f6f9fb
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%231f3f93' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E")
    no-repeat right 8px center;
  background-size: 10px 6px;
  color: #161a22;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  line-height: 1;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}
.pm-listen-celpip-select:focus {
  outline: none;
  border-color: #7ba7d4;
  box-shadow: 0 0 0 2px rgba(123, 167, 212, 0.35);
}
.pm-listen-celpip-list.is-answer-key .pm-listen-celpip-select.is-correct {
  border-color: #10b981;
  background-color: #ecfdf5;
}

body.pm-exam-mode .pm-listen-next {
  background: #2f5d9b;
  border: 1px solid #1f3f73;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 3px #4a7bc0;
}

body.pm-exam-mode .pm-listen-key {
  background: #fff;
  border: 1px solid #cfd4da;
  border-radius: 2px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #3f454d;
}

@media (max-width: 767.98px) {
  .pm-listen-celpip-row {
    font-size: 13px;
  }
  .pm-listen-celpip-select {
    width: 110px;
  }
}

/* =========================================================
   History item — clickable + hover feedback
   ========================================================= */

.pm-history-item {
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}
.pm-history-item:hover {
  background: var(--pm-panel-bg, #eef5fa);
  transform: translateX(1px);
}
.pm-history-item:hover .pm-history-chev {
  transform: translateX(3px);
  color: var(--pm-panel-blue, #287bad);
}

.pm-history-title {
  font-size: 0.72rem;
  color: var(--pm-ink, #0f172a);
  margin: 0.15rem 0 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.pm-history-band {
  margin-left: 6px;
  font-weight: 600;
  color: var(--pm-panel-blue, #287bad);
}

.pm-history-chev {
  font-size: 12px;
  color: #cbd5e1;
  transition:
    transform 0.15s ease,
    color 0.15s ease;
  flex-shrink: 0;
  margin-left: 4px;
}

/* =========================================================
   READING MODULE — exact CELPIP two-column layout
   ========================================================= */

/* Frame is wider for reading (matches screenshots) */
body.pm-exam-mode .pm-read-frame {
  max-width: 1160px;
  font-family: "Fira Sans", "Poppins", system-ui, sans-serif;
}

.pm-read-frame {
  background: #fff;
  font-family: "Fira Sans", "Poppins", system-ui, sans-serif;
}

.pm-read-bar,
body.pm-exam-mode .pm-read-bar {
  padding: 10px 24px;
  background: linear-gradient(#f4f5f7, #dcdee2);
  border-bottom: 1px solid #c9ccd1;
}
.pm-read-bar .pm-listen-bar-title {
  font-family: "Fira Sans", "Poppins", sans-serif;
  font-size: 17px;
  font-weight: 500;
  color: #4a4f57;
}
.pm-read-bar .pm-listen-time {
  font-family: "Fira Sans", "Poppins", sans-serif;
  font-size: 15px;
  color: #4a4f57;
}
.pm-read-bar .pm-listen-time b {
  color: #000;
  font-weight: 500;
}

.pm-read-bottom,
body.pm-exam-mode .pm-read-bottom {
  padding: 10px 24px;
  background: linear-gradient(#f4f5f7, #dcdee2);
  border-top: 1px solid #c9ccd1;
}
.pm-read-key,
body.pm-exam-mode .pm-read-key {
  font-family: "Fira Sans", "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #333;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #d3d6da;
  border-radius: 2px;
}
.pm-read-back,
body.pm-exam-mode .pm-read-back,
.pm-read-bar .pm-listen-next,
body.pm-exam-mode .pm-read-bar .pm-listen-next {
  font-family: "Fira Sans", "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 500;
  background: #3a74b0;
  border: 1px solid #2f639a;
  border-radius: 2px;
  box-shadow: none;
  padding: 5px 16px;
}

/* ---------- Two-column body ---------- */
.pm-read-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-height: 0;
  background: #fff;
}

.pm-read-col {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 20px 24px;
  font-family: "Fira Sans", "Poppins", system-ui, sans-serif;
}

/* LEFT = light gray passage pane (official CELPIP) */
.pm-read-col--left {
  background: #f5f5f6 !important;
  border-right: 1px solid #c8ccd0;
}

/* RIGHT = light blue question pane (official CELPIP) */
.pm-read-col--right {
  background: #e8f4f9 !important;
}

/* ---------- Big blue info lines ---------- */
.pm-read-info-line,
.pm-read-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 26px;
  font-family: "Fira Sans", "Poppins", sans-serif;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 500;
  color: #2b5a8f;
}
.pm-read-info-line i,
.pm-read-info-box i {
  flex-shrink: 0;
  margin-top: 3px;
  font-size: 18px;
  color: #4a6f9e;
}
.pm-read-best {
  color: #3f7fae;
}
/* second info line between boxes needs a bit more space above */
.pm-read-qbox + .pm-read-info-box {
  margin-top: 34px;
}

/* ---------- Passage (left) ---------- */
.pm-read-passage-body {
  font-family: "Fira Sans", "Poppins", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #3d4046;
  white-space: pre-wrap;
  word-break: break-word;
  padding-top: 8px;
}

.pm-read-diagram {
  display: block;
  max-width: 100%;
  height: auto;
  margin-top: 12px;
  background: #fff;
}
.pm-read-diagram-instructions {
  font-size: 15px;
  line-height: 1.5;
  color: #3d4046;
  margin: 0 0 14px;
}

/* ---------- Comparison table (Part 2 left) ---------- */
.pm-read-diagram-table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0 14px;
  font-size: 14.5px;
  color: #3d4046;
}
.pm-read-diagram-table td {
  background: #fff;
  border: 1px solid #e3e5e8;
  vertical-align: top;
  padding: 10px 12px;
}
.pm-read-diagram-table td.pm-read-opt-visual {
  position: relative;
  width: 40%;
  height: 130px;
  text-align: center;
  border-right: 0;
}
.pm-read-diagram-table td.pm-read-opt-text {
  white-space: pre-line;
  line-height: 1.55;
}
.pm-read-diagram-table img {
  display: block;
  max-width: 130px;
  max-height: 100px;
  margin: 0 auto;
}
.pm-read-opt-label {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 14.5px;
  font-weight: 500;
  color: #c0281c;
}

/* ---------- Question boxes (right) ---------- */
.pm-read-qbox {
  margin: 0 0 4px;
  padding: 22px 22px 14px;
  background: #f4fbfd;
  border: 1px solid #1c1c1c;
  border-radius: 3px;
}

.pm-read-qrow {
  display: block;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  font-family: "Fira Sans", "Poppins", sans-serif;
  font-size: 15px;
  line-height: 2.15;
  color: #333;
}
.pm-read-qrow-num {
  font-weight: 400;
}
.pm-read-qrow-stem {
  display: inline;
}

/* Part 3: dropdown first, statement flows after / wraps under */
.pm-read-qrow--select-first {
  line-height: 2.1;
}
.pm-read-qrow--select-first .pm-read-select {
  margin-left: 0;
  margin-right: 2px;
}

/* ---------- Inline response paragraph (Part 1, 2 & 4) ---------- */
.pm-read-qbox--response {
  padding: 22px 22px 18px;
}
.pm-read-response-para {
  font-family: "Fira Sans", "Poppins", sans-serif;
  font-size: 15px;
  line-height: 2.3;
  color: #333;
  white-space: pre-wrap;
}
.pm-read-inline-blank {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0 3px;
  vertical-align: middle;
  line-height: 1;
}
.pm-read-inline-num {
  font-weight: 400;
  font-size: 15px;
  color: #333;
}

/* ---------- Dropdown (borderless light, navy arrow) ---------- */
.pm-read-select {
  display: inline-block;
  vertical-align: middle;
  width: 92px;
  height: 26px;
  margin: 0 0 0 4px;
  padding: 0 24px 0 6px;
  border: 0;
  border-bottom: 1px solid #dde7ec;
  border-radius: 0;
  background: #eaf3f7
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='%231f3f93' d='M0 0l6 7 6-7z'/%3E%3C/svg%3E")
    no-repeat right 8px center;
  background-size: 12px 7px;
  color: #0f172a;
  font-family: "Fira Sans", "Poppins", sans-serif;
  font-size: 14px;
  line-height: 1;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.pm-read-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(123, 167, 212, 0.45);
}
.pm-read-select.is-correct {
  background-color: #dcfce7;
  border-bottom-color: #10b981;
}
.pm-read-select--inline {
  flex: 0 0 auto;
}

/* ---------- Thick gray scrollbars (like CELPIP) ---------- */
.pm-read-col {
  scrollbar-width: auto;
  scrollbar-color: #c2c2c4 transparent;
}
.pm-read-col::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}
.pm-read-col::-webkit-scrollbar-track {
  background: transparent;
}
.pm-read-col::-webkit-scrollbar-thumb {
  background: #c2c2c4;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 10px;
}
.pm-read-col::-webkit-scrollbar-thumb:hover {
  background-color: #a9a9ac;
}

/* ---------- Mobile ---------- */
@media (max-width: 767.98px) {
  .pm-read-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .pm-read-col {
    overflow-y: visible;
  }
  .pm-read-info-line,
  .pm-read-info-box {
    font-size: 17px;
  }
  .pm-read-select {
    width: 110px;
  }
}
/* =========================================================
   WRITING MODULE — CELPIP layout
   ========================================================= */
.pm-write-instructions {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 46px;
  background: #fff;
  font-family: "Fira Sans", "Poppins", system-ui, sans-serif;
}
.pm-write-instructions .pm-read-info-line {
  margin: 0 0 26px;
}
.pm-write-instr-list {
  max-width: 880px;
  margin: 0;
  padding-left: 34px;
  list-style: disc;
  color: #2b5a8f;
  font-size: 20px;
  line-height: 2;
  font-weight: 400;
}
.pm-write-instr-list li {
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px dotted #ccc;
}
.pm-write-instr-list li::marker {
  color: #999;
}
.pm-write-instr-list li:last-child {
  border-bottom: 0;
}
.pm-write-here {
  color: #000;
  font-weight: 500;
}

.pm-write-bullets {
  margin: 28px 0 40px;
  padding-left: 36px;
  font-size: 15px;
  line-height: 1.8;
  color: #3d4046;
}

.pm-write-textarea {
  display: block;
  width: 100%;
  height: 515px;
  min-height: 200px;
  padding: 10px 12px;
  border: 1px solid #1c1c1c;
  border-radius: 0;
  background: #fff;
  color: #222;
  font-family: "Fira Sans", "Poppins", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
}
.pm-write-textarea:focus {
  outline: none;
  box-shadow: none;
}
.pm-write-note {
  margin-top: 4px;
  font-size: 15px;
  color: #444;
}

.pm-write-options {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 26px 0 28px;
}
.pm-write-option {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  padding-left: 8px;
  font-size: 15px;
  line-height: 1.8;
  color: #3d4046;
  cursor: pointer;
}
.pm-write-option input[type="radio"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 6px;
  accent-color: #3a74b0;
}
.pm-write-frame .pm-read-info-box {
  margin-bottom: 14px;
}

@media (max-width: 767.98px) {
  .pm-write-instructions {
    padding: 18px;
  }
  .pm-write-instr-list {
    font-size: 17px;
    padding-left: 22px;
  }
  .pm-write-textarea {
    height: 320px;
  }
  .pm-write-option {
    gap: 16px;
  }
}
/* =========================================================
   SPEAKING MODULE — exact CELPIP layout (font-matched)
   ========================================================= */
body.pm-exam-mode .pm-speak-frame {
  max-width: 1160px;
}

.pm-speak-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  padding: 18px 26px 24px;
  font-family: "Fira Sans", "Poppins", system-ui, sans-serif;
  scrollbar-width: auto;
  scrollbar-color: #c2c2c4 transparent;
}
.pm-speak-body::-webkit-scrollbar {
  width: 14px;
}
.pm-speak-body::-webkit-scrollbar-track {
  background: transparent;
}
.pm-speak-body::-webkit-scrollbar-thumb {
  background: #c2c2c4;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 10px;
}

/* ===== blue info line ===== */
.pm-speak-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
  color: #2b5a8f;
}
.pm-speak-info i {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 15px;
  color: #4a6f9e;
}
.pm-speak-info.is-small i {
  margin-top: 3px;
}
.pm-speak-info.is-second {
  padding-left: 26px;
  margin-bottom: 22px;
}
.pm-speak-info.is-second i {
  display: none;
}

/* ===== instruction screens ===== */
.pm-speak-body--instr {
  padding: 22px 40px;
}
.pm-speak-instr-list {
  max-width: 880px;
  margin: 14px 0 0;
  padding-left: 30px;
  font-size: 15px;
  line-height: 1.7;
  color: #2b5a8f;
}
.pm-speak-instr-list li {
  padding: 0 0 12px;
  margin-bottom: 12px;
}
.pm-speak-instr-list li::marker {
  color: #4a6f9e;
}
.pm-speak-intro {
  padding: 8px 0 0 30px;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
}
.pm-speak-intro p {
  margin: 0 0 20px;
}
.pm-speak-intro ol {
  margin: 0 0 30px;
  padding-left: 26px;
  line-height: 1.6;
}

/* ===== text under info line (Tasks 6 / 7) ===== */
.pm-speak-head {
  padding-bottom: 14px;
  border-bottom: 1px solid #ececec;
}
.pm-speak-bodytext {
  margin: 20px 0 0 26px;
  font-size: 15px;
  line-height: 1.55;
  color: #333;
  white-space: pre-line;
}
.pm-speak-body--image .pm-speak-head {
  border-bottom: 0;
  padding-bottom: 6px;
}

/* ===== preparation / recording card (shared shell) ===== */
.pm-speak-card {
  display: flex;
  align-items: center;
  width: 440px;
  max-width: 100%;
  height: 120px;
  margin-top: 22px;
  background: #dcdde1;
  border-radius: 12px;
  box-sizing: border-box;
}
.pm-speak-card.is-center {
  margin-left: auto;
  margin-right: auto;
}
.pm-speak-card-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 74px;
  height: 74px;
  margin-left: 24px;
  background: #eeeeee;
  border-radius: 4px;
  color: #9a9a9a;
  font-size: 42px;
  line-height: 1;
}
.pm-speak-card-text {
  flex: 1;
  text-align: center;
  padding-right: 18px;
}
.pm-speak-card-label {
  font-size: 17px;
  font-weight: 500;
  color: #000;
  letter-spacing: 0.01em;
}
.pm-speak-card-value {
  margin-top: 10px;
  font-size: 18px;
  color: #1f4fbf;
  font-weight: 500;
}
.pm-speak-note {
  margin-top: 16px;
  font-size: 14px;
  color: #444;
}

/* ===== RECORDING layout — mic icon on left, centered "Recording…" + progress bar ===== */
.pm-speak-card.is-recording .pm-speak-card-icon {
  color: #9a9a9a;
  font-size: 38px;
}
.pm-speak-card.is-recording .pm-speak-card-text {
  text-align: center; /* centers the "Recording…" label */
  padding: 0 26px 0 20px; /* 20px = gap between icon and bar, 26px = right edge */
}
.pm-speak-recording-label {
  font-size: 17px;
  font-weight: 500;
  color: #000;
  text-align: center;
  margin-bottom: 10px;
}
.pm-speak-recording-track {
  position: relative;
  width: 100%;
  height: 24px;
  background: #ececec;
  border-radius: 0;
  overflow: hidden;
}
.pm-speak-recording-track > span {
  display: block;
  height: 100%;
  width: 0;
  background: #5bc8fb;
  transition: width 0.25s linear;
}

/* ===== image layout (Tasks 3, 4, 8) ===== */
.pm-speak-row {
  display: grid;
  grid-template-columns: 56% minmax(0, 1fr);
  gap: 26px;
  margin-top: 22px;
  align-items: start;
}
.pm-speak-image {
  display: block;
  width: 100%;
  max-width: 723px;
  height: auto;
}
.pm-speak-row-left .pm-speak-note {
  margin-top: 6px;
  font-size: 13px;
}
.pm-speak-row-right .pm-speak-card {
  margin-top: 12px;
}

/* ===== Task 5 option boxes ===== */
.pm-speak-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 22px 0 32px;
}
.pm-speak-choices--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 625px;
}
.pm-speak-choice {
  padding: 20px;
  background: #fff;
  border: 1px solid #1c1c1c;
  border-radius: 3px;
  box-sizing: border-box;
  cursor: pointer;
  transition:
    box-shadow 0.15s,
    background 0.15s;
}
.pm-speak-choice:hover {
  background: #f7fbfe;
}
.pm-speak-choice.is-selected {
  background: #eef5fb;
  box-shadow: 0 0 0 3px #3a74b0;
}
.pm-speak-choice img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  margin-bottom: 8px;
}
.pm-speak-choice-text {
  font-size: 14px;
  line-height: 1.5;
  color: #444;
  white-space: pre-line;
  min-height: 120px;
}

/* ===== mobile ===== */
@media (max-width: 767.98px) {
  .pm-speak-body {
    padding: 14px 16px 20px;
  }
  .pm-speak-info,
  .pm-speak-info i {
    font-size: 14px;
  }
  .pm-speak-row {
    grid-template-columns: 1fr;
  }
  .pm-speak-choices {
    grid-template-columns: 1fr;
  }
  .pm-speak-choice img {
    height: 220px;
  }
  .pm-speak-card {
    height: 100px;
  }
  .pm-speak-card-icon {
    width: 60px;
    height: 60px;
    margin-left: 16px;
    font-size: 34px;
  }
  .pm-speak-instr-list,
  .pm-speak-intro {
    font-size: 14px;
  }
}

/* ===== Task 5: compact layout, no scrolling ===== */
.pm-speak-body--choose {
  padding: 14px 26px 16px;
}
.pm-speak-body--choose .pm-speak-info {
  font-size: 15px;
  margin-bottom: 6px;
}
.pm-speak-body--choose .pm-speak-info i {
  font-size: 15px;
}
.pm-speak-body--choose .pm-speak-info.is-second {
  margin-bottom: 10px;
}
.pm-speak-body--choose .pm-speak-choices {
  gap: 16px;
  margin: 10px 0 12px;
  max-width: none;
}
.pm-speak-body--choose .pm-speak-choice {
  padding: 12px 14px;
  min-height: 0;
}
.pm-speak-body--choose .pm-speak-choice img {
  height: clamp(120px, 25vh, 240px);
  margin-bottom: 8px;
}
.pm-speak-body--choose .pm-speak-choice-text {
  font-size: 13px;
  line-height: 1.4;
  min-height: 0;
}
.pm-speak-body--choose .pm-speak-card {
  height: 90px;
  margin-top: 0;
}
.pm-speak-body--choose .pm-speak-card-icon {
  width: 56px;
  height: 56px;
  margin-left: 20px;
  font-size: 32px;
}
.pm-speak-body--choose .pm-speak-card-label,
.pm-speak-body--choose .pm-speak-card-value {
  font-size: 16px;
}
.pm-speak-body--choose .pm-speak-card-value {
  margin-top: 6px;
}
.pm-speak-body--choose .pm-speak-note {
  margin-top: 8px;
  font-size: 13px;
}

/* =========================================================
   UI polish — auth, dashboard, logout, forms (2026)
   ========================================================= */

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

/* Auth form polish */
.pm-auth-form .btn-primary {
  background: var(--pm-panel-blue);
  border-color: var(--pm-panel-blue);
  border-radius: 10px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  min-height: 48px;
  letter-spacing: 0.01em;
  transition:
    background 0.15s ease,
    transform 0.1s ease,
    box-shadow 0.15s ease;
}
.pm-auth-form .btn-primary:hover {
  background: var(--pm-panel-blue-dark);
  border-color: var(--pm-panel-blue-dark);
  box-shadow: 0 8px 20px rgba(40, 123, 173, 0.28);
}
.pm-auth-form .btn-primary:active {
  transform: translateY(1px);
}
.pm-auth-form .form-control {
  border: 1px solid var(--pm-line);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.pm-auth-form .form-control:focus {
  border-color: var(--pm-panel-blue);
  box-shadow: 0 0 0 3px rgba(40, 123, 173, 0.18);
}
.pm-auth-form .form-control::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.pm-auth-layout {
  max-width: 980px;
  margin: 0 auto;
}

.pm-auth-aside h1 {
  letter-spacing: -0.02em;
}

.pm-auth-panel h2 {
  font-weight: 600;
  color: var(--pm-ink);
}

/* Shared auth header */
.pm-auth-topbar {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--pm-line);
  padding: 0.55rem 0;
}

/* Logout hover */
#btnLogout:hover,
.pm-icon-btn#btnLogout:hover {
  border-color: #fecaca;
  color: #dc2626;
  background: #fef2f2;
}

/* Soft module card lift */
.pm-module-card {
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
.pm-module-card:hover {
  border-color: var(--pm-panel-blue);
  box-shadow: var(--pm-shadow-md);
  transform: translateY(-2px);
}

.pm-picker-card {
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
.pm-picker-card:hover {
  border-color: var(--pm-panel-blue);
  box-shadow: var(--pm-shadow-md);
  transform: translateY(-2px);
}

/* Hero depth */
.pm-hero {
  box-shadow: 0 12px 28px rgba(40, 123, 173, 0.22);
  position: relative;
  overflow: hidden;
}
.pm-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

/* Demo fill button */
.pm-demo-fill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.65rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid #f0d78a;
  border-radius: 6px;
  background: #fff;
  color: #7a5c16;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  transition: background 0.15s ease;
}
.pm-demo-fill:hover {
  background: #fff8e8;
}

/* Auth page vertical rhythm */
.pm-auth-page {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
}

@media (max-width: 767.98px) {
  .pm-auth-layout {
    border-radius: 10px;
  }
}

/* =========================================================
   AUTH REDESIGN v2 — full-bleed split layout
   ========================================================= */

.pm-auth-body {
  margin: 0;
  min-height: 100vh;
  background: #0b1220;
  font-family: "Poppins", system-ui, sans-serif;
}

.pm-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  min-height: 100vh;
}

.pm-auth-brand {
  position: relative;
  display: flex;
  align-items: center;
  padding: clamp(2rem, 5vw, 4.5rem);
  color: #fff;
  background:
    radial-gradient(
      ellipse 80% 60% at 20% 20%,
      rgba(56, 189, 248, 0.25),
      transparent 55%
    ),
    radial-gradient(
      ellipse 70% 50% at 80% 80%,
      rgba(99, 102, 241, 0.28),
      transparent 50%
    ),
    linear-gradient(155deg, #0f172a 0%, #123a5c 45%, #0b4a6e 100%);
  overflow: hidden;
}
.pm-auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.06) 1px,
    transparent 1px
  );
  background-size: 22px 22px;
  opacity: 0.5;
  pointer-events: none;
}
.pm-auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.pm-auth-logo-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}
.pm-logo--lg {
  width: 48px;
  height: 48px;
  font-size: 20px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(40, 123, 173, 0.45);
}
.pm-auth-logo-name {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.pm-auth-logo-sub {
  font-size: 0.75rem;
  color: #a8d4f0;
  font-weight: 500;
}

.pm-auth-headline {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.2vw, 2.85rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.pm-auth-lead {
  margin: 0 0 1.75rem;
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(226, 240, 255, 0.85);
  max-width: 36ch;
}

.pm-auth-features {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.pm-auth-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  color: #e8f4ff;
  font-weight: 500;
}
.pm-auth-features i {
  color: #5eead4;
  font-size: 1.05rem;
}

.pm-auth-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pm-auth-pills span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.78rem;
  font-weight: 500;
  color: #e0f2fe;
}
.pm-auth-pills i {
  opacity: 0.9;
}

/* Right column */
.pm-auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: #f1f5f9;
}

.pm-auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.75rem 1.75rem;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 20px 40px rgba(15, 23, 42, 0.08);
}

.pm-auth-card-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.pm-auth-card-head p {
  margin: 0 0 1.5rem;
  color: #64748b;
  font-size: 0.9rem;
}

.pm-auth-form {
  display: grid;
  gap: 0.9rem;
}
.pm-field .form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}
.pm-input-wrap {
  position: relative;
}
.pm-input-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
}
.pm-input-wrap .form-control {
  min-height: 48px;
  padding-left: 2.55rem;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  font-family: "Poppins", sans-serif;
  font-size: 0.92rem;
  background: #f8fafc;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.pm-input-wrap .form-control:focus {
  background: #fff;
  border-color: #287bad;
  box-shadow: 0 0 0 4px rgba(40, 123, 173, 0.15);
  outline: none;
}

.pm-auth-message {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.82rem;
}
.pm-auth-message.is-error {
  color: #dc2626;
}
.pm-auth-message.is-success {
  color: #059669;
}

.pm-auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 50px;
  margin-top: 0.25rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #287bad 0%, #1a5f8a 100%);
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(40, 123, 173, 0.35);
  transition:
    transform 0.12s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}
.pm-auth-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 28px rgba(40, 123, 173, 0.42);
}
.pm-auth-submit:active {
  transform: translateY(1px);
}

.pm-demo-box {
  margin-top: 1.35rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
}
.pm-demo-box-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 0.45rem;
}
.pm-demo-box-title i {
  color: #d97706;
}
.pm-demo-box-creds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.78rem;
  color: #78350f;
  margin-bottom: 0.65rem;
}
.pm-demo-box-creds code {
  background: rgba(255, 255, 255, 0.7);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #78350f;
}

.pm-demo-fill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #f59e0b;
  background: #fff;
  color: #b45309;
  font-family: "Poppins", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.pm-demo-fill:hover {
  background: #fff7ed;
}

.pm-auth-switch {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: #64748b;
}
.pm-auth-switch a {
  color: #287bad;
  font-weight: 600;
  text-decoration: none;
}
.pm-auth-switch a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .pm-auth-shell {
    grid-template-columns: 1fr;
  }
  .pm-auth-brand {
    min-height: auto;
    padding: 1.75rem 1.5rem 2rem;
  }
  .pm-auth-headline {
    max-width: none;
    font-size: 1.75rem;
  }
  .pm-auth-features {
    display: none;
  }
  .pm-auth-main {
    padding: 1.25rem 1rem 2rem;
  }
  .pm-auth-card {
    border-radius: 16px;
  }
}
/* =========================================================================
   Listening — AUDIO stage (CELPIP-style "Playing..." card)
   ========================================================================= */

/* top instruction line: plain dark-navy text with a navy info icon, left aligned */
.pm-listen-frame .pm-listen-body--audio .pm-listen-info {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 4px 0;
  margin: 0 0 8px;
  justify-content: flex-start;
  text-align: left;
  gap: 10px;
  color: #1f4a85;
  font-size: 1.05rem;
}
.pm-listen-frame .pm-listen-body--audio .pm-listen-info i {
  color: #2b5a8f;
  font-size: 1.35rem;
}

/* stack everything in the centre */
.pm-listen-body--audio .pm-listen-stage--audio {
  display: flex;
  justify-content: center;
  padding-top: 28px;
}
.pm-listen-body--audio .pm-listen-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* the grey card */
.pm-audio-card {
  display: flex;
  align-items: center;
  gap: 26px;
  width: 500px;
  max-width: 100%;
  padding: 26px 28px;
  background: #dcdde3;
  border-radius: 16px;
}

/* speaker tile */
.pm-audio-card-icon {
  flex: 0 0 86px;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  background: #efeff1;
  border-radius: 8px;
}
.pm-audio-card-icon i {
  font-size: 2.8rem;
  line-height: 1;
  color: #a4a4a9;
}

/* label + progress bar */
.pm-audio-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pm-audio-card-label {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 500;
  color: #111;
  line-height: 1.2;
}
.pm-audio-card-track {
  height: 24px;
  background: #efeff1;
  overflow: hidden;
}
.pm-audio-card-track > span {
  display: block;
  height: 100%;
  width: 0;
  background: #5bc8fb;
  transition: width 0.25s linear;
}

/* native playbar + note, centred under the card */
.pm-listen-body--audio .pm-listen-player {
  width: 360px;
  max-width: 100%;
}
.pm-listen-body--audio .pm-listen-playbar-note {
  width: 436px;
  max-width: 100%;
  padding: 14px 16px;
  text-align: center;
  background: transparent;
  border: 2px solid #111;
  color: #444;
  font-size: 0.95rem;
}

@media (max-width: 560px) {
  .pm-audio-card {
    gap: 16px;
    padding: 18px;
  }
  .pm-audio-card-icon {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
  }
  .pm-audio-card-icon i {
    font-size: 2.1rem;
  }
  .pm-audio-card-label {
    font-size: 1.1rem;
  }
}

/* =========================================================
   FINAL OVERRIDE — dark navy instruction text (CELPIP-style)
   ========================================================= */
.pm-listen-instructions-list li,
body.pm-exam-mode .pm-listen-instructions-list li {
  color: var(--pm-instr-blue);
}

.pm-listen-info,
.pm-listen-info .pm-hl,
body.pm-exam-mode .pm-listen-info,
.pm-listen-frame .pm-listen-body--audio .pm-listen-info,
body.pm-exam-mode .pm-listen-body--celpip-dropdown .pm-listen-info {
  color: var(--pm-instr-blue) !important;
}

.pm-listen-info i,
body.pm-exam-mode .pm-listen-info i,
.pm-listen-frame .pm-listen-body--audio .pm-listen-info i,
body.pm-exam-mode .pm-listen-body--celpip-dropdown .pm-listen-info i {
  color: var(--pm-instr-icon) !important;
}

/* Keep the grey "click NEXT" card in exam mode as it was (grey text + white icon) */
body.pm-exam-mode .pm-listen-body--audio .pm-listen-info {
  color: #2b2b2b !important;
}
body.pm-exam-mode .pm-listen-body--audio .pm-listen-info i {
  color: #ffffff !important;
}

/* =========================================================================
   Parts 1–3 INNER content only (does not change outer page / frame size)
   ========================================================================= */

/* Split panes colors + equal columns (content area only) */
.pm-listen-body--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
}
.pm-listen-body--split .pm-listen-pane {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 28px 24px;
  font-family: "Fira Sans", "Poppins", system-ui, sans-serif;
}
.pm-listen-body--split .pm-listen-pane--audio {
  background: #f7f8f9;
  border-right: 1px solid #d0d4d9;
}
.pm-listen-body--split .pm-listen-pane--questions {
  background: #f0f7f9;
}

/* Info lines */
.pm-listen-body--split .pm-read-info-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 17px;
  line-height: 1.35;
  color: #1f4a85;
  font-weight: 500;
}
.pm-listen-body--split .pm-read-info-line i {
  color: #2b5a8f;
  font-size: 1.1rem;
  margin-top: 2px;
  flex-shrink: 0;
}
.pm-listen-body--split .pm-read-best {
  color: #1f4a85;
  font-weight: 700;
}

/* Left stack */
.pm-listen-body--split .pm-listen-audio--question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 0;
}

/* Click NEXT card */
.pm-listen-body--split .pm-listen-click-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 440px;
  min-height: 110px;
  padding: 18px 24px;
  box-sizing: border-box;
  background: #e1e4e8;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
}
.pm-listen-body--split .pm-listen-click-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #c8cdd3;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
}
.pm-listen-body--split .pm-listen-click-icon i {
  color: #fff;
}
.pm-listen-body--split .pm-listen-click-text {
  font-size: 17px;
  font-weight: 400;
  color: #111;
  line-height: 1.4;
}

/* Pill player */
.pm-listen-body--split .pm-listen-custom-player {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 440px;
  background: #e1e4e8;
  padding: 10px 16px;
  gap: 12px;
  border-radius: 999px;
  margin: 0 auto;
  box-sizing: border-box;
}
.pm-listen-body--split .pm-listen-custom-play {
  color: #111;
  font-size: 17px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  line-height: 1;
}
.pm-listen-body--split .pm-listen-custom-time {
  font-size: 13px;
  color: #111;
  min-width: 84px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pm-listen-body--split .pm-listen-custom-bar {
  flex: 1;
  height: 4px;
  background: #111;
  border-radius: 2px;
  overflow: hidden;
}
.pm-listen-body--split .pm-listen-custom-bar > span {
  display: block;
  height: 100%;
  background: #111;
  width: 0;
}
.pm-listen-body--split .pm-listen-custom-icon {
  font-size: 15px;
  color: #111;
}

/* Playbar note */
.pm-listen-body--split .pm-listen-playbar-note {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 440px;
  min-height: 48px;
  padding: 10px 14px;
  box-sizing: border-box;
  background: transparent;
  border: 1.5px solid #111;
  color: #222;
  font-size: 14px;
  text-align: center;
  border-radius: 0;
  margin: 0 auto;
}

/* Question head + options */
.pm-listen-body--split .pm-listen-qhead {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 400;
  color: #333;
}
.pm-listen-body--split .pm-listen-questions,
.pm-listen-body--split .pm-listen-question {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
}
.pm-listen-body--split .pm-listen-options:not(.pm-listen-options--pictures) {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 4px;
  margin: 0;
}
.pm-listen-body--split .pm-listen-option:not(.pm-listen-option--picture) {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0 10px 2px;
  margin: 0;
  border: 0;
  border-bottom: 1px dotted #a8b4bc;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
.pm-listen-body--split .pm-listen-option:not(.pm-listen-option--picture):hover,
.pm-listen-body--split
  .pm-listen-option.is-selected:not(.pm-listen-option--picture) {
  background: transparent;
}
.pm-listen-body--split .pm-listen-option-mark {
  display: none !important;
}
.pm-listen-body--split .pm-listen-option-text {
  font-size: 16px;
  color: #111;
  font-weight: 400;
  line-height: 1.35;
}
.pm-listen-body--split .pm-listen-option input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid #8e989f;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  cursor: pointer;
}
.pm-listen-body--split .pm-listen-option input[type="radio"]:checked {
  border-color: #3a74b0;
  background: radial-gradient(circle, #3a74b0 0 42%, #fff 46%);
}
.pm-listen-body--split .pm-listen-option.is-correct {
  background: #dcfce7 !important;
}

.pm-listen-time--red,
.pm-listen-time--red b {
  color: #e0291d !important;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .pm-listen-body--split {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .pm-listen-body--split .pm-listen-pane {
    overflow-y: visible;
    padding: 16px;
  }
  .pm-listen-body--split .pm-listen-pane--audio {
    border-right: 0;
    border-bottom: 1px solid #d0d4d9;
  }
}

/* Keep surrounding chrome visible (navbar + footer) — do not change box size */
body.pm-exam-mode .pm-navbar {
  display: flex !important;
}
body.pm-exam-mode .pm-footer-note {
  display: block !important;
}

/* =========================================================================
   EXACT official CELPIP Reading UI — every color sampled from the real
   Paragon screenshot (pixel-measured).

   page bg ............ #fafafa        frame border ....... #cccccc
   top bar gradient ... #eeeef2 → #d8dbdf
   bottom bar gradient  #eeeef3 → #d8dbe0
   left pane .......... #f5f5f5        right pane ......... #f0f8f9
   question box ....... #f0f8f9 (same as pane) + 1px #000 border
   dropdown fill ...... #ffffff        dropdown arrow ..... #113293
   body / title text .. #54565a        heading blue ....... #2c5686
   "best" word ........ #5888a9        info icon .......... #5a77a0
   buttons ............ #4779b2        scrollbar thumb .... #c1c1c1
   scrollbar track .... #fafafa        pane edge .......... #e8e8e8
   ========================================================================= */

body.pm-exam-mode {
  background-color: #fafafa !important;
}

/* Fit the test on one screen: the frame's height leaves room for the navbar,
   #main padding and compact footer. Short windows still scroll, thanks to the
   frame's min-height. */
body.pm-exam-mode #main {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}
body.pm-exam-mode .pm-footer-note {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}
body.pm-exam-mode .card:has(> #questionHost) {
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.pm-exam-mode #questionHost {
  padding: 0;
}
/* Scale the whole test (text, spacing, images) to the window height. Sizes
   divided by --pm-exam-scale come back out at their intended on-screen size. */
@media (min-width: 768px) {
  body.pm-exam-mode {
    --pm-exam-scale: 0.9;
  }
  body.pm-exam-mode .pm-listen-frame,
  body.pm-exam-mode .pm-listen-frame.pm-read-frame,
  body.pm-exam-mode .pm-read-frame {
    zoom: var(--pm-exam-scale);
  }
}
@media (min-width: 768px) and (max-height: 900px) {
  body.pm-exam-mode {
    --pm-exam-scale: 0.8;
  }
}
/* Picture answers: 2x2 grid, with thumbnails sized to the window height. */
body.pm-exam-mode .pm-listen-options--pictures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
body.pm-exam-mode .pm-listen-option--picture {
  min-width: 0;
  width: auto;
  box-sizing: border-box;
}
body.pm-exam-mode .pm-listen-option--picture .pm-listen-thumb {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: 100%;
}
body.pm-exam-mode .pm-listen-option--picture .pm-listen-thumb img {
  width: 100%;
  height: auto;
  max-height: max(70px, calc((100dvh - 390px) / 2));
  object-fit: contain;
}
/* Speaking image: keep the prompt, image and timer visible together. */
body.pm-exam-mode .pm-speak-image {
  width: auto;
  max-width: 100%;
  max-height: max(120px, calc(100dvh - 510px));
  object-fit: contain;
}
/* Let the scene image shrink to the space left instead of a fixed 420px. */
body.pm-exam-mode .pm-listen-stage--scene {
  display: flex;
  flex-direction: column;
  padding: 16px 40px !important;
}
body.pm-exam-mode .pm-listen-scene-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
body.pm-exam-mode .pm-listen-scene {
  flex: 1 1 0;
  height: auto !important;
  min-height: 180px !important;
  max-height: 420px !important;
}

/* ---------- Frame (shared by listening / reading) ---------- */
body.pm-exam-mode .pm-listen-frame,
body.pm-exam-mode .pm-listen-frame.pm-read-frame,
body.pm-exam-mode .pm-read-frame {
  display: flex !important;
  flex-direction: column !important;
  width: min(960px, calc((100vw - 32px) / var(--pm-exam-scale, 1))) !important;
  max-width: 960px !important;
  height: calc((100dvh - 122px) / var(--pm-exam-scale, 1)) !important; /* navbar + #main padding + footer */
  min-height: 420px !important;
  max-height: 820px !important;
  margin: 0 auto !important;
  border: 1px solid #cccccc !important;
  border-radius: 0 !important;
  background: #f5f5f5 !important;
  overflow: hidden !important;
  box-shadow: none !important;
  font-family: "Fira Sans", "Poppins", system-ui, sans-serif;
}

/* ---------- Top bar ---------- */
body.pm-exam-mode .pm-listen-bar,
body.pm-exam-mode .pm-read-bar {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  max-height: 56px;
  padding: 0 24px !important;
  background: linear-gradient(#eeeef2, #d8dbdf) !important;
  border-bottom: 1px solid #cccccc !important;
  flex-shrink: 0;
}
body.pm-exam-mode .pm-listen-bar-title,
body.pm-exam-mode .pm-read-bar .pm-listen-bar-title {
  font-family: "Fira Sans", "Poppins", sans-serif !important;
  font-size: 17px !important;
  font-weight: 400 !important;
  color: #54565a !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}
body.pm-exam-mode .pm-listen-time,
body.pm-exam-mode .pm-read-bar .pm-listen-time {
  font-family: "Fira Sans", "Poppins", sans-serif !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  color: #54565a !important;
}
body.pm-exam-mode .pm-listen-time b {
  color: #000000 !important;
  font-weight: 500 !important;
}

/* ---------- Bottom bar ---------- */
body.pm-exam-mode .pm-listen-bottom,
body.pm-exam-mode .pm-read-bottom {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  max-height: 72px;
  padding: 0 24px !important;
  background: linear-gradient(#eeeef3, #d8dbe0) !important;
  border-top: 1px solid #cccccc !important;
  flex-shrink: 0;
}

/* ---------- Buttons (NEXT / BACK) ---------- */
body.pm-exam-mode .pm-listen-next,
body.pm-exam-mode .pm-listen-back,
body.pm-exam-mode .pm-read-back,
body.pm-exam-mode .pm-read-bar .pm-listen-next {
  font-family: "Fira Sans", "Poppins", sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-transform: uppercase;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 5px 16px !important;
  background: #4779b2 !important;
  border: 1px solid #3d6a9e !important;
  border-radius: 2px !important;
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  box-shadow: none !important;
  cursor: pointer;
}
body.pm-exam-mode .pm-listen-next:hover,
body.pm-exam-mode .pm-listen-back:hover,
body.pm-exam-mode .pm-read-back:hover {
  background: #3d6a9e !important;
}

/* ---------- Answer Key button ---------- */
body.pm-exam-mode .pm-listen-key,
body.pm-exam-mode .pm-read-key {
  font-family: "Fira Sans", "Poppins", sans-serif !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  padding: 10px 14px !important;
  background: #ffffff !important;
  border: 1px solid #d3d6da !important;
  border-radius: 2px !important;
  color: #54565a !important;
  cursor: pointer;
}

/* ---------- Body grid ---------- */
body.pm-exam-mode .pm-read-body,
.pm-read-frame .pm-read-body {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: #f5f5f5 !important;
  gap: 0 !important;
}

body.pm-exam-mode .pm-read-col,
.pm-read-frame .pm-read-col {
  min-width: 0;
  min-height: 0;
  overflow-y: auto !important;
  padding: 22px 14px 20px 24px !important;
  font-family: "Fira Sans", "Poppins", system-ui, sans-serif;
  color: #54565a;
}

/* LEFT pane */
.pm-read-col--left,
body.pm-exam-mode .pm-read-col--left,
.pm-read-frame .pm-read-col--left,
.pm-listen-frame.pm-read-frame .pm-read-col--left {
  background-color: #f5f5f5 !important;
  border-right: 1px solid #cccccc !important;
}

/* RIGHT pane */
.pm-read-col--right,
body.pm-exam-mode .pm-read-col--right,
.pm-read-frame .pm-read-col--right,
.pm-listen-frame.pm-read-frame .pm-read-col--right {
  background-color: #f0f8f9 !important;
}

/* ---------- Scrollbars: wide #fafafa track, slim #c1c1c1 thumb ---------- */
body.pm-exam-mode .pm-read-col::-webkit-scrollbar {
  width: 28px;
  height: 28px;
}
body.pm-exam-mode .pm-read-col::-webkit-scrollbar-track {
  background: #fafafa;
  border-left: 2px solid #e8e8e8;
}
body.pm-exam-mode .pm-read-col::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border: 8px solid #fafafa;
  border-radius: 14px;
}
body.pm-exam-mode .pm-read-col::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
body.pm-exam-mode .pm-read-col {
  scrollbar-width: auto;
  scrollbar-color: #c1c1c1 #fafafa;
}

/* ---------- Instruction headings ---------- */
.pm-read-info-line,
.pm-read-info-box,
body.pm-exam-mode .pm-read-info-line,
body.pm-exam-mode .pm-read-info-box {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 22px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: "Fira Sans", "Poppins", sans-serif !important;
  font-size: 20px !important;
  line-height: 1.25 !important;
  font-weight: 400 !important;
  color: #2c5686 !important;
}
.pm-read-info-line i,
.pm-read-info-box i,
body.pm-exam-mode .pm-read-info-line i,
body.pm-exam-mode .pm-read-info-box i {
  color: #5a77a0 !important;
  font-size: 20px !important;
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}
.pm-read-best,
body.pm-exam-mode .pm-read-best {
  color: #5888a9 !important;
  font-weight: 400 !important;
}
body.pm-exam-mode .pm-read-qbox + .pm-read-info-box {
  margin-top: 34px !important;
}
body.pm-exam-mode .pm-read-col--left .pm-read-info-line {
  margin-bottom: 28px !important;
}

/* ---------- Passage text (left) ---------- */
body.pm-exam-mode .pm-read-passage-body {
  font-family: "Fira Sans", "Poppins", sans-serif !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  color: #54565a !important;
  white-space: pre-wrap;
}

/* ---------- Question boxes: SAME color as the pane, 1px black border ---------- */
.pm-read-qbox,
body.pm-exam-mode .pm-read-qbox,
.pm-read-frame .pm-read-qbox {
  background-color: #f0f8f9 !important;
  border: 1px solid #000000 !important;
  border-radius: 4px !important;
  padding: 22px 23px 34px !important;
  margin: 0 0 4px !important;
  box-shadow: none !important;
}
.pm-read-qbox--response,
body.pm-exam-mode .pm-read-qbox--response {
  padding: 22px 23px 18px !important;
}

/* ---------- Rows: inline flow ---------- */
body.pm-exam-mode .pm-read-qrow,
.pm-read-qrow {
  display: block !important;
  margin: 0 0 22px !important;
  font-family: "Fira Sans", "Poppins", sans-serif !important;
  font-size: 15px !important;
  line-height: 2.15 !important;
  color: #54565a !important;
}
body.pm-exam-mode .pm-read-response-para,
.pm-read-response-para {
  font-family: "Fira Sans", "Poppins", sans-serif !important;
  font-size: 15px !important;
  line-height: 2.4 !important;
  color: #54565a !important;
  white-space: pre-wrap;
}
body.pm-exam-mode .pm-read-inline-num {
  color: #54565a !important;
}

/* ---------- Dropdowns: white fill, no border, navy #113293 arrow ---------- */
body.pm-exam-mode .pm-read-select,
body.pm-exam-mode .pm-read-qbox select,
body.pm-exam-mode .pm-read-col--right select,
.pm-read-select {
  display: inline-block !important;
  vertical-align: middle;
  width: 92px !important;
  min-width: 0 !important;
  height: 26px !important;
  margin: 0 0 0 4px !important;
  padding: 0 24px 0 6px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='%23113293' d='M0 0l6 7 6-7z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 9px center !important;
  background-size: 12px 7px !important;
  font-family: "Fira Sans", "Poppins", sans-serif !important;
  font-size: 14px !important;
  color: #54565a !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: none !important;
  cursor: pointer;
}
body.pm-exam-mode .pm-read-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(71, 121, 178, 0.45) !important;
}
.pm-read-select.is-correct,
body.pm-exam-mode .pm-read-select.is-correct {
  background-color: #dcfce7 !important;
}

/* Inline blanks inside the response paragraph */
.pm-read-inline-blank {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0 3px;
  vertical-align: middle;
  line-height: 1;
}

body.pm-exam-mode .pm-navbar {
  display: flex !important;
}
body.pm-exam-mode .pm-footer-note {
  display: block !important;
  color: #54565a !important;
  font-size: 12px !important;
  text-align: center;
  padding: 8px 0 16px;
}

@media (max-width: 767.98px) {
  body.pm-exam-mode .pm-listen-frame,
  body.pm-exam-mode .pm-read-frame {
    width: calc(100vw - 12px) !important;
    height: calc(100vh - 90px) !important;
    min-height: 480px !important;
    max-height: none !important;
  }
  body.pm-exam-mode .pm-read-body {
    grid-template-columns: 1fr !important;
    overflow-y: auto !important;
  }
  body.pm-exam-mode .pm-read-col {
    overflow-y: visible !important;
  }
  body.pm-exam-mode .pm-read-col--left {
    border-right: 0 !important;
    border-bottom: 1px solid #cccccc !important;
  }
}

/* =========================================================================
   READING — type scale tuned for the 960px frame (Fira Sans, like CELPIP)
   Fira Sans is loaded by the @import at the top of this file; Poppins is much
   wider, which is why the text looked oversized before.
   ========================================================================= */
body.pm-exam-mode .pm-read-frame,
body.pm-exam-mode .pm-read-frame * {
  font-family: "Fira Sans", "Segoe UI", system-ui, sans-serif !important;
}
body.pm-exam-mode .pm-read-frame i,
body.pm-exam-mode .pm-read-frame .bi {
  font-family: "bootstrap-icons" !important;
}

/* top bar: single line */
body.pm-exam-mode .pm-read-bar .pm-listen-bar-title {
  font-size: 15px !important;
  line-height: 1.3 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.pm-exam-mode .pm-read-bar .pm-listen-time {
  font-size: 13px !important;
}
body.pm-exam-mode .pm-read-bar .pm-listen-next,
body.pm-exam-mode .pm-read-back {
  font-size: 12px !important;
  padding: 4px 14px !important;
}
body.pm-exam-mode .pm-read-key {
  font-size: 13px !important;
  padding: 8px 12px !important;
}

/* panes */
body.pm-exam-mode .pm-read-col,
.pm-read-frame .pm-read-col {
  padding: 18px 10px 18px 20px !important;
}

/* headings */
body.pm-exam-mode .pm-read-info-line,
body.pm-exam-mode .pm-read-info-box {
  font-size: 17px !important;
  line-height: 1.25 !important;
  gap: 8px;
  margin-bottom: 18px !important;
}
body.pm-exam-mode .pm-read-info-line i,
body.pm-exam-mode .pm-read-info-box i {
  font-size: 16px !important;
  margin-top: 2px;
}
body.pm-exam-mode .pm-read-col--left .pm-read-info-line {
  margin-bottom: 22px !important;
}
body.pm-exam-mode .pm-read-qbox + .pm-read-info-box {
  margin-top: 26px !important;
}

/* passage */
body.pm-exam-mode .pm-read-passage-body {
  font-size: 14px !important;
  line-height: 1.6 !important;
}

/* question boxes / rows */
body.pm-exam-mode .pm-read-qbox {
  padding: 18px 20px 24px !important;
}
body.pm-exam-mode .pm-read-qbox--response {
  padding: 18px 20px 14px !important;
}
body.pm-exam-mode .pm-read-qrow {
  font-size: 14px !important;
  line-height: 2 !important;
  margin: 0 0 16px !important;
}
body.pm-exam-mode .pm-read-response-para {
  font-size: 14px !important;
  line-height: 2.2 !important;
}
body.pm-exam-mode .pm-read-inline-num {
  font-size: 14px !important;
}

/* dropdowns */
body.pm-exam-mode .pm-read-select,
body.pm-exam-mode .pm-read-qbox select,
body.pm-exam-mode .pm-read-col--right select {
  width: 88px !important;
  height: 24px !important;
  font-size: 13px !important;
  padding: 0 22px 0 6px !important;
  background-position: right 8px center !important;
}

/* slimmer scrollbars for the narrower frame */
body.pm-exam-mode .pm-read-col::-webkit-scrollbar {
  width: 22px;
}
body.pm-exam-mode .pm-read-col::-webkit-scrollbar-thumb {
  border-width: 6px;
}

/* =========================================================================
   WRITING — real CELPIP layout: narrow prompt on the left (~1/3),
   wide answer area on the right (~2/3) so test takers have room to type.
   ========================================================================= */
@media (min-width: 768px) {
  body.pm-exam-mode .pm-write-frame .pm-read-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) !important;
  }
}

/* panes scroll only when needed (the real writing screen shows no scrollbar) */
body.pm-exam-mode .pm-write-frame .pm-read-col {
  overflow-y: auto !important;
  padding: 20px 22px 20px 24px !important;
}
body.pm-exam-mode .pm-write-frame .pm-read-col--left {
  padding-right: 18px !important;
}

/* prompt headings a touch smaller so long prompts fit in the narrow column */
body.pm-exam-mode .pm-write-frame .pm-read-info-line,
body.pm-exam-mode .pm-write-frame .pm-read-info-box {
  font-size: 17px !important;
  margin-bottom: 14px !important;
}

/* left prompt text */
body.pm-exam-mode .pm-write-frame .pm-read-passage-body {
  font-size: 14px !important;
  line-height: 1.55 !important;
  padding-top: 6px;
}

/* bullets under the right heading */
body.pm-exam-mode .pm-write-frame .pm-write-bullets {
  margin: 18px 0 26px !important;
  padding-left: 40px !important;
  font-size: 14px !important;
  line-height: 1.75 !important;
  color: #54565a !important;
}

/* option radios (Task 2) */
body.pm-exam-mode .pm-write-frame .pm-write-options {
  margin: 18px 0 20px !important;
  gap: 16px !important;
}
body.pm-exam-mode .pm-write-frame .pm-write-option {
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: #54565a !important;
}

/* big answer box: white, 1px black border, user-resizable */
body.pm-exam-mode .pm-write-frame .pm-write-textarea {
  display: block;
  width: 100% !important;
  height: 430px !important;
  min-height: 220px !important;
  padding: 10px 12px !important;
  background: #ffffff !important;
  border: 1px solid #000000 !important;
  border-radius: 2px !important;
  color: #222 !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  resize: vertical;
  box-sizing: border-box;
}

body.pm-exam-mode .pm-write-frame .pm-write-note {
  margin-top: 4px !important;
  font-size: 14px !important;
  color: #54565a !important;
}

/* instructions screen: full width, same palette */
body.pm-exam-mode .pm-write-frame .pm-write-instructions {
  background: #f5f5f5 !important;
  padding: 22px 28px !important;
}
body.pm-exam-mode .pm-write-frame .pm-write-instr-list {
  font-size: 16px !important;
  line-height: 1.7 !important;
  color: #2c5686 !important;
}

@media (max-width: 767.98px) {
  body.pm-exam-mode .pm-write-frame .pm-write-textarea {
    height: 320px !important;
  }
}

/* =========================================================================
   WRITING — Task 2: option-gated answer area + live word count
   ========================================================================= */
.pm-write-area[hidden] {
  display: none !important;
}

/* divider + spacing between the options and the "Explain the reasons…" line */
body.pm-exam-mode .pm-write-frame .pm-write-area--after-options {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid #dfe9ee;
}
body.pm-exam-mode
  .pm-write-frame
  .pm-write-area--after-options
  .pm-read-info-box {
  margin-bottom: 14px !important;
}

/* Task 2 has less vertical room (heading + options above), so slightly shorter box */
body.pm-exam-mode
  .pm-write-frame
  .pm-write-area--after-options
  .pm-write-textarea {
  height: 330px !important;
}

/* "N words" centred under the box, like the real exam */
body.pm-exam-mode .pm-write-frame .pm-write-wordcount {
  margin-top: 6px;
  text-align: center;
  font-size: 14px;
  color: #54565a;
}

@media (max-width: 767.98px) {
  body.pm-exam-mode
    .pm-write-frame
    .pm-write-area--after-options
    .pm-write-textarea {
    height: 260px !important;
  }
}

/* =========================================================================
   SPEAKING — align the blue info text with its "i" icon
   Tweak --pm-speak-info-nudge (px) to move the text: + moves it down,
   − moves it up. Currently 2px down.
   ========================================================================= */
body.pm-exam-mode .pm-speak-info {
  --pm-speak-info-nudge: 2px;
  align-items: flex-start;
  line-height: 1.5;
}
/* icon fills exactly one text line and is centred inside it */
body.pm-exam-mode .pm-speak-info i,
body.pm-exam-mode .pm-speak-info.is-small i {
  display: inline-flex;
  align-items: center;
  height: 1.5em;
  margin-top: 0 !important;
  line-height: 1;
}
/* text nudge */
body.pm-exam-mode .pm-speak-info > span {
  position: relative;
  top: var(--pm-speak-info-nudge);
}

/* =========================================================================
   DASHBOARD v3 — premium shell (navbar, hero, stats, modules, history,
   picker, footer). Exam screens are untouched: footer rules are scoped to
   body:not(.pm-exam-mode) and nothing here targets #screen-exam.
   ========================================================================= */

:root {
  --pm-navy: #0c2a4a;
  --pm-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --pm-ring: 0 0 0 3px rgba(40, 123, 173, 0.28);
}

body:not(.pm-exam-mode) {
  background:
    radial-gradient(1200px 420px at 85% -120px, rgba(40, 123, 173, 0.09), transparent 70%),
    var(--pm-bg) !important;
}

/* Accessibility */
.pm-skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 2000;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  background: var(--pm-ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.pm-skip:focus {
  top: 0.75rem;
  color: #fff;
}
.pm-dash :focus-visible,
.pm-navbar :focus-visible,
.pm-footer-note :focus-visible {
  outline: none;
  box-shadow: var(--pm-ring);
}

/* ---------- Navbar ---------- */
body:not(.pm-exam-mode) .pm-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0.65rem 0;
}
.pm-logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(140deg, #3a95c9, var(--pm-brand-dark));
  box-shadow:
    0 6px 14px rgba(40, 123, 173, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.pm-brand-name {
  font-size: 16px;
  letter-spacing: -0.01em;
}
.pm-brand-sub {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pm-user-chip {
  gap: 0.5rem;
  padding: 0.22rem 0.8rem 0.22rem 0.25rem;
  background: #fff;
  border: 1px solid var(--pm-line);
  color: var(--pm-ink);
}
.pm-section-chip:empty {
  display: none !important;
}
.pm-avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(140deg, #3a95c9, var(--pm-brand-dark));
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---------- Layout ---------- */
.pm-dash {
  gap: 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 2rem;
}

/* ---------- Hero ---------- */
.pm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem;
  padding: clamp(1.5rem, 3.5vw, 2.5rem) clamp(1.25rem, 4vw, 2.75rem);
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(520px 260px at 100% 0%, rgba(120, 200, 255, 0.28), transparent 70%),
    radial-gradient(420px 240px at 0% 120%, rgba(20, 184, 166, 0.22), transparent 70%),
    linear-gradient(135deg, #1f6a99 0%, var(--pm-navy) 100%);
  box-shadow:
    0 24px 48px -20px rgba(12, 42, 74, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  isolation: isolate;
}
.pm-hero::after {
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 100%);
  mask-image: linear-gradient(100deg, transparent 35%, #000 100%);
  z-index: -1;
}
.pm-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e3f2fc;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.pm-hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5eead4;
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.25);
}
.pm-hero-title {
  margin: 0.85rem 0 0.5rem;
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.pm-hero-title #heroName {
  background: linear-gradient(90deg, #ffffff, #a5e4ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pm-hero-sub {
  max-width: 52ch;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(230, 243, 251, 0.88);
}
.pm-hero-actions {
  margin-top: 1.5rem;
  gap: 0.7rem;
}
.pm-btn-light,
.pm-btn-outline-light {
  padding: 0.75rem 1.3rem;
  border-radius: 12px;
  font-size: 0.9rem;
  transition:
    background 0.18s ease,
    transform 0.18s var(--pm-ease),
    box-shadow 0.18s ease;
}
.pm-btn-light {
  color: var(--pm-navy);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.45);
}
.pm-btn-light:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -8px rgba(0, 0, 0, 0.5);
}
.pm-btn-light i {
  font-size: 1.1rem;
}
.pm-btn-outline-light {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
}
.pm-btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.6);
}
.pm-btn-light:active,
.pm-btn-outline-light:active {
  transform: translateY(1px);
}

/* Score ring */
.pm-hero-score {
  position: relative;
  width: 168px;
  height: 168px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}
.pm-hero .pm-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.pm-hero .pm-ring circle {
  fill: none;
  stroke-width: 9;
}
.pm-hero .pm-ring-track {
  stroke: rgba(255, 255, 255, 0.14);
}
.pm-hero .pm-ring-fill {
  stroke: #5eead4;
  stroke-linecap: round;
  transition: stroke-dasharray 0.9s var(--pm-ease);
  filter: drop-shadow(0 0 6px rgba(94, 234, 212, 0.55));
}
.pm-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.pm-ring-label span {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pm-ring-label small {
  margin-top: 0.4rem;
  max-width: 110px;
  font-size: 11px;
  color: rgba(230, 243, 251, 0.8);
  line-height: 1.3;
}

/* ---------- Stats strip ---------- */
.pm-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}
.pm-stat {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid var(--pm-line);
  border-radius: 14px;
  box-shadow: var(--pm-shadow-sm);
}
.pm-stat > i {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--pm-accent-blue-soft);
  color: var(--pm-brand-dark);
  font-size: 1.1rem;
}
.pm-stat:nth-child(2) > i {
  background: var(--pm-accent-amber-soft);
  color: #b45309;
}
.pm-stat:nth-child(3) > i {
  background: var(--pm-accent-teal-soft);
  color: #0f766e;
}
.pm-stat:nth-child(4) > i {
  background: var(--pm-accent-violet-soft);
  color: #6d28d9;
}
.pm-stat > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pm-stats .pm-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pm-ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-stats .pm-stat-label {
  font-size: 0.75rem;
  color: var(--pm-muted);
}

/* ---------- Section heads ---------- */
.pm-dash-cols {
  gap: 1.5rem;
}
.pm-block-head {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.pm-block-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- Module cards ---------- */
.pm-dash-modules {
  gap: 1rem;
}
.pm-module-card {
  --tone: var(--pm-brand);
  --tone-soft: var(--pm-accent-blue-soft);
  position: relative;
  padding: 1.25rem;
  border-radius: 16px;
  box-shadow: var(--pm-shadow-sm);
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.25s var(--pm-ease);
}
.pm-module-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tone);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.pm-module-card--teal {
  --tone: var(--pm-accent-teal);
  --tone-soft: var(--pm-accent-teal-soft);
}
.pm-module-card--violet {
  --tone: var(--pm-accent-violet);
  --tone-soft: var(--pm-accent-violet-soft);
}
.pm-module-card--amber {
  --tone: var(--pm-accent-amber);
  --tone-soft: var(--pm-accent-amber-soft);
}
.pm-module-card:hover {
  border-color: color-mix(in srgb, var(--tone) 45%, var(--pm-line));
  box-shadow: 0 18px 36px -18px rgba(15, 23, 42, 0.28);
  transform: translateY(-3px);
}
.pm-module-card:hover::before {
  opacity: 1;
}
.pm-module-header {
  margin-bottom: 0.75rem;
}
.pm-module-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 1.2rem;
}
.pm-module-title {
  font-size: 1.02rem;
  font-weight: 700;
}
.pm-module-description {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pm-module-progress {
  margin-bottom: 1rem;
}
.pm-module-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  color: var(--pm-muted);
}
.pm-module-progress-top b {
  font-size: 0.85rem;
  color: var(--pm-ink);
  font-variant-numeric: tabular-nums;
}
.pm-module-bar {
  height: 6px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}
.pm-module-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tone);
  transition: width 0.8s var(--pm-ease);
}
.pm-module-action {
  padding: 0.65rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--tone-soft);
  color: var(--pm-ink);
  font-size: 0.84rem;
}
.pm-module-action i {
  transition: transform 0.2s var(--pm-ease);
}
.pm-module-action:hover {
  background: var(--tone);
  color: #fff;
}
.pm-module-card:hover .pm-module-action i {
  transform: translateX(3px);
}

/* Featured full-test card (rendered last) */
.pm-dash-modules > .pm-module-card:last-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "head action"
    "desc action";
  column-gap: 1.5rem;
  align-items: center;
  border-color: transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(120deg, #3a95c9, var(--pm-accent-teal), var(--pm-accent-violet)) border-box;
  border: 1.5px solid transparent;
}
.pm-dash-modules > .pm-module-card:last-child .pm-module-header {
  grid-area: head;
}
.pm-dash-modules > .pm-module-card:last-child .pm-module-description {
  grid-area: desc;
  margin: 0;
}
.pm-dash-modules > .pm-module-card:last-child .pm-module-action {
  grid-area: action;
  width: auto;
  gap: 0.75rem;
  padding: 0.75rem 1.2rem;
  background: var(--pm-ink);
  color: #fff;
}
.pm-dash-modules > .pm-module-card:last-child .pm-module-action:hover {
  background: var(--pm-brand-dark);
}
.pm-dash-modules > .pm-module-card:last-child .pm-module-badge {
  background: linear-gradient(140deg, #3a95c9, var(--pm-brand-dark));
  color: #fff;
}

/* ---------- Sidebar ---------- */
.pm-dash-side {
  top: 84px;
}
.pm-side-card {
  padding: 1.25rem;
  border-radius: 16px;
  box-shadow: var(--pm-shadow-sm);
}
.pm-dash-history {
  margin: 0 -0.5rem 1rem;
}
.pm-history-item {
  padding: 0.65rem 0.5rem;
  border-bottom: 0;
  border-radius: 10px;
}
.pm-history-item:hover {
  transform: none;
}
.pm-history-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.pm-history-bar span {
  background: linear-gradient(90deg, #3a95c9, var(--pm-accent-teal));
}
.pm-history-score {
  font-variant-numeric: tabular-nums;
}
.pm-history-item.is-empty {
  margin: 0 0.5rem;
  padding: 1.75rem 1rem;
  background: #f8fafc;
  cursor: default;
}
.pm-history-item.is-empty:hover {
  background: #f8fafc;
}
.pm-btn-danger {
  border-color: transparent;
  background: transparent;
  color: var(--pm-muted);
  border-radius: 10px;
}
.pm-btn-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}
.pm-tips li {
  align-items: flex-start;
}
.pm-tips i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -0.1rem;
  border-radius: 8px;
  background: var(--pm-panel-bg);
}

/* ---------- Test picker ---------- */
.pm-picker-head {
  align-items: center;
  margin-bottom: 1.25rem;
}
.pm-picker-head h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
}
#btnPickerBack {
  border-radius: 10px;
  font-weight: 600;
}
.pm-picker-list {
  gap: 1rem;
}
.pm-picker-card {
  padding: 1.25rem;
  border-radius: 16px;
  box-shadow: var(--pm-shadow-sm);
}
.pm-picker-card:hover {
  box-shadow: 0 18px 36px -18px rgba(15, 23, 42, 0.28);
}
.pm-picker-card-title {
  font-weight: 700;
}
.pm-picker-card-btn {
  padding: 0.65rem 0.95rem;
  border: 0;
  border-radius: 10px;
  background: var(--pm-panel-bg);
  color: var(--pm-brand-dark);
}
.pm-picker-card-btn:hover {
  background: var(--pm-brand);
  color: #fff;
}
.pm-picker-empty {
  border-radius: 16px;
}

/* Skeleton loading */
.pm-skeleton,
.pm-skeleton:hover {
  gap: 0.6rem;
  transform: none;
  box-shadow: var(--pm-shadow-sm);
  border-color: var(--pm-line);
}
.pm-skel {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
  background-size: 200% 100%;
  animation: pmShimmer 1.3s linear infinite;
}
.pm-skel--title {
  width: 60%;
  height: 16px;
}
.pm-skel--meta {
  width: 35%;
  margin-bottom: 0.4rem;
}
.pm-skel--line.short {
  width: 75%;
}
.pm-skel--btn {
  height: 38px;
  margin-top: 0.6rem;
  border-radius: 10px;
}
@keyframes pmShimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- Footer ---------- */
body:not(.pm-exam-mode) .pm-footer-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.6rem;
  margin-top: 1rem;
  padding: 1.5rem 1rem 2rem !important;
  border-top: 1px solid var(--pm-line);
  color: var(--pm-muted);
}
.pm-footer-note a {
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
}
.pm-footer-note a:hover {
  color: var(--pm-brand);
}
.pm-footer-sep {
  opacity: 0.5;
}

/* ---------- Entrance motion ---------- */
#screen-dashboard:not(.d-none) .pm-hero,
#screen-dashboard:not(.d-none) .pm-stat,
#screen-dashboard:not(.d-none) .pm-module-card,
#screen-dashboard:not(.d-none) .pm-side-card {
  animation: pmRise 0.5s var(--pm-ease) both;
}
#screen-dashboard .pm-stat:nth-child(2) { animation-delay: 0.04s; }
#screen-dashboard .pm-stat:nth-child(3) { animation-delay: 0.08s; }
#screen-dashboard .pm-stat:nth-child(4) { animation-delay: 0.12s; }
#screen-dashboard .pm-module-card:nth-child(1) { animation-delay: 0.1s; }
#screen-dashboard .pm-module-card:nth-child(2) { animation-delay: 0.15s; }
#screen-dashboard .pm-module-card:nth-child(3) { animation-delay: 0.2s; }
#screen-dashboard .pm-module-card:nth-child(4) { animation-delay: 0.25s; }
#screen-dashboard .pm-module-card:nth-child(5) { animation-delay: 0.3s; }
#screen-dashboard .pm-side-card { animation-delay: 0.2s; }
@keyframes pmRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pm-dash *,
  .pm-dash *::before,
  .pm-skel {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .pm-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767.98px) {
  .pm-hero {
    grid-template-columns: 1fr;
  }
  .pm-hero-score {
    display: none;
  }
  .pm-dash-modules > .pm-module-card:last-child {
    display: flex;
  }
  .pm-dash-modules > .pm-module-card:last-child .pm-module-description {
    margin-bottom: 1rem;
  }
  .pm-dash-modules > .pm-module-card:last-child .pm-module-action {
    width: 100%;
    justify-content: space-between;
  }
}
@media (max-width: 575.98px) {
  main.container-fluid.px-4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .pm-stat {
    padding: 0.8rem;
    gap: 0.65rem;
  }
  .pm-stat > i {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
  .pm-stats .pm-stat-value {
    font-size: 1.05rem;
  }
}
