/**
 * Prepti Lab - scoped styles for the [prepti_lab] shortcode output.
 * Everything is namespaced under .prepti-lab so the active theme is untouched.
 * All state is in-session only; this file carries no tracking or external assets.
 */

.prepti-lab,
.prepti-lab *,
.prepti-lab *::before,
.prepti-lab *::after {
  box-sizing: border-box;
}

.prepti-lab {
  --pl-navy: #16324f;
  --pl-ink: #22384e;
  --pl-muted: #5b7186;
  --pl-blue: #1f6fd6;
  --pl-blue-dark: #185bb4;
  --pl-panel: #eaf3fb;
  --pl-line: #d4e2ee;
  --pl-good: #18794e;
  --pl-good-bg: #e6f6ee;
  --pl-bad: #b42318;
  --pl-bad-bg: #fdecea;
  --pl-accent: #ffd21f;
  --pl-radius: 12px;

  color: var(--pl-ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.55;
  max-width: 720px;
  margin: 0 auto;
}

/* Accessible-only text (question text for screen readers when a visual carries it) */
.prepti-lab-sronly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Cards and headings */
.prepti-lab-card {
  background: #fff;
  border: 1px solid var(--pl-line);
  border-radius: var(--pl-radius);
  padding: 24px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(22, 50, 79, 0.07);
}

.prepti-lab-kicker {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pl-blue);
  margin-bottom: 6px;
}

.prepti-lab-h {
  color: var(--pl-navy);
  font-size: 24px;
  line-height: 1.25;
  margin: 0 0 12px;
}

.prepti-lab-h3 {
  color: var(--pl-navy);
  font-size: 19px;
  margin: 28px 0 10px;
}

.prepti-lab p,
.prepti-lab-notice {
  margin: 0 0 14px;
}

.prepti-lab-notice {
  background: var(--pl-panel);
  border: 1px solid var(--pl-line);
  border-radius: var(--pl-radius);
  padding: 14px 16px;
  font-size: 15px;
}

.prepti-lab-small {
  font-size: 13.5px;
  color: var(--pl-muted);
}

.prepti-lab-link {
  color: var(--pl-blue);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Buttons */
.prepti-lab-btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  color: var(--pl-blue);
  background: #fff;
  border: 2px solid var(--pl-blue);
  border-radius: 10px;
  padding: 10px 22px;
  margin: 6px 8px 6px 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.prepti-lab-btn:hover {
  background: var(--pl-panel);
}

.prepti-lab-btn-primary {
  background: var(--pl-blue);
  border-color: var(--pl-blue);
  color: #fff;
}

.prepti-lab-btn-primary:hover {
  background: var(--pl-blue-dark);
  border-color: var(--pl-blue-dark);
}

.prepti-lab-btn-ghost {
  border-color: transparent;
  color: var(--pl-muted);
  font-weight: 600;
}

.prepti-lab-btn-ghost:hover {
  background: transparent;
  color: var(--pl-navy);
}

.prepti-lab-btn:focus-visible,
.prepti-lab-mode:focus-visible,
.prepti-lab-link:focus-visible,
.prepti-lab-option input:focus-visible + .prepti-lab-option-text {
  outline: 3px solid rgba(31, 111, 214, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Mode picker */
.prepti-lab-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 8px;
}

.prepti-lab-mode {
  text-align: left;
  font: inherit;
  background: #fff;
  border: 2px solid var(--pl-line);
  border-radius: var(--pl-radius);
  padding: 16px;
  cursor: pointer;
  color: var(--pl-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.prepti-lab-mode:hover {
  border-color: var(--pl-blue);
  box-shadow: 0 2px 8px rgba(22, 50, 79, 0.1);
}

@media (max-width: 560px) {
  .prepti-lab-modes {
    grid-template-columns: 1fr;
  }
}

/* Question header: skill chip, progress, clock */
.prepti-lab-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.prepti-lab-skill {
  display: inline-block;
  background: var(--pl-panel);
  border: 1px solid var(--pl-line);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--pl-navy);
}

.prepti-lab-clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--pl-navy);
  background: #fff7d6;
  border: 1px solid #f0e2a0;
  border-radius: 8px;
  padding: 3px 10px;
}

.prepti-lab-progress {
  font-size: 13.5px;
  color: var(--pl-muted);
}

.prepti-lab-bar {
  height: 6px;
  background: var(--pl-line);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0 18px;
}

.prepti-lab-bar-fill {
  display: block;
  height: 100%;
  background: var(--pl-blue);
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* Prompt and visual figure */
.prepti-lab-prompt {
  color: var(--pl-navy);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}

.prepti-lab-prompt-small {
  font-size: 14px;
  color: var(--pl-muted);
  margin: 0 0 16px;
}

.prepti-lab-visual {
  margin: 14px 0;
  padding: 12px;
  background: #fbfdff;
  border: 1px solid var(--pl-line);
  border-radius: var(--pl-radius);
  text-align: center;
}

.prepti-lab-visual svg {
  max-width: 100%;
  height: auto;
}

/* Options: native radios inside label rows */
.prepti-lab-options {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 8px;
}

.prepti-lab-options legend {
  padding: 0;
}

.prepti-lab-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 2px solid var(--pl-line);
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.prepti-lab-option:hover {
  border-color: var(--pl-blue);
}

.prepti-lab-option input[type="radio"] {
  margin: 4px 0 0;
  width: 18px;
  height: 18px;
  accent-color: var(--pl-blue);
  flex: 0 0 auto;
}

.prepti-lab-option-text {
  flex: 1 1 auto;
}

/* Feedback block after Check answer (untimed mode) */
.prepti-lab-feedback {
  border-radius: var(--pl-radius);
  padding: 14px 16px;
  margin: 6px 0 14px;
  border: 1px solid var(--pl-line);
  background: #f7fafc;
}

.prepti-lab-verdict {
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
}

.prepti-lab-feedback.is-correct {
  background: var(--pl-good-bg);
  border-color: #b7e4cd;
}

.prepti-lab-feedback.is-correct .prepti-lab-verdict {
  color: var(--pl-good);
}

.prepti-lab-feedback.is-wrong {
  background: var(--pl-bad-bg);
  border-color: #f5c6c0;
}

.prepti-lab-feedback.is-wrong .prepti-lab-verdict {
  color: var(--pl-bad);
}

.prepti-lab-expl {
  margin: 0 0 8px;
}

.prepti-lab-trap {
  font-size: 14.5px;
  color: var(--pl-muted);
  margin: 0;
}

.prepti-lab-nav {
  margin-top: 10px;
}

/* Review screen */
.prepti-lab-skills {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 15px;
}

.prepti-lab-skills th,
.prepti-lab-skills td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--pl-line);
}

.prepti-lab .prepti-lab-skills thead th {
  background: none;
  color: var(--pl-navy);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--pl-line);
}

.prepti-lab-skills td:last-child,
.prepti-lab-skills th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.prepti-lab-revitem {
  border: 1px solid var(--pl-line);
  border-radius: var(--pl-radius);
  padding: 14px 16px;
  margin: 0 0 12px;
  background: #fff;
}

.prepti-lab-revitem.is-correct {
  border-left: 4px solid var(--pl-good);
}

.prepti-lab-revitem.is-wrong {
  border-left: 4px solid var(--pl-bad);
}

.prepti-lab-revbody {
  margin: 6px 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .prepti-lab-bar-fill,
  .prepti-lab-btn,
  .prepti-lab-mode,
  .prepti-lab-option {
    transition: none;
  }
}

/* Review table: full table on wide screens, stacked cards on narrow */
@media (max-width: 600px) {
  .prepti-lab-skills thead {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .prepti-lab-skills,
  .prepti-lab-skills tbody,
  .prepti-lab-skills tr {
    display: block;
    width: 100%;
  }
  .prepti-lab-skills tr {
    border: 1px solid var(--pl-line);
    border-radius: var(--pl-radius);
    padding: 12px 14px;
    margin: 0 0 10px;
  }
  .prepti-lab-skills th[scope="row"] {
    display: block;
    border: 0;
    padding: 0 0 6px;
    font-size: 16px;
  }
  .prepti-lab-skills td {
    display: inline-block;
    border: 0;
    padding: 0 14px 0 0;
    text-align: left;
    font-size: 15px;
  }
  .prepti-lab-skills td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--pl-navy);
  }
}

/* Fix pass: advancing keeps the question below the sticky site header */
.prepti-lab-card {
  scroll-margin-top: 96px;
}


/* Passage + section-rule card (Watson Glaser-style sets) */
.prepti-lab-passage {
  background: #f4f8fc;
  border: 1px solid var(--pl-line);
  border-radius: var(--pl-radius);
  padding: 14px 16px;
  margin: 12px 0;
  font-size: 15.5px;
  line-height: 1.55;
}

.prepti-lab-rule {
  border-left: 4px solid var(--pl-blue);
  background: #eef4fb;
  border-radius: 0 var(--pl-radius) var(--pl-radius) 0;
  padding: 12px 16px;
  margin: 0 0 16px;
}

.prepti-lab-rule-h {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pl-navy);
  margin: 0 0 6px;
}

.prepti-lab-rule-body {
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0;
}

/* Dataset chart + visible data table */
.prepti-lab-dataset {
  border: 1px solid var(--pl-line);
  border-radius: var(--pl-radius);
  padding: 16px;
  margin: 0 0 16px;
  background: #fbfdfe;
}

.prepti-lab-ds-title {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--pl-navy);
}

.prepti-lab-chart {
  margin: 12px 0;
  overflow-x: auto;
}

.prepti-lab-chart svg {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
}

.prepti-lab-dtable {
  width: 100%;
  max-width: 560px;
  border-collapse: collapse;
  font-size: 14.5px;
  margin: 4px 0 0;
}

.prepti-lab-dtable caption {
  text-align: left;
  font-size: 13px;
  color: var(--pl-navy);
  font-weight: 600;
  margin-bottom: 4px;
}

.prepti-lab-dtable th,
.prepti-lab-dtable td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--pl-line);
}

.prepti-lab-dtable td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.prepti-lab .prepti-lab-dtable thead th {
  background: none;
  color: var(--pl-navy);
  border-bottom: 2px solid var(--pl-line);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prepti-lab-dtable thead th:not(:first-child) {
  text-align: right;
}

/* Optional base/unit declaration */
.prepti-lab-baseunit {
  border: 1px dashed var(--pl-line);
  border-radius: var(--pl-radius);
  padding: 12px 14px;
  margin: 14px 0 4px;
}

.prepti-lab-bu-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.prepti-lab-bu-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--pl-navy);
}

.prepti-lab-bu-select {
  display: block;
  margin-top: 4px;
  font-size: 14.5px;
  padding: 6px 8px;
  border: 1px solid var(--pl-line);
  border-radius: 8px;
  max-width: 240px;
}

/* Dataset data tables: full table on wide screens, stacked cards on narrow */
@media (max-width: 600px) {
  .prepti-lab .prepti-lab-dtable thead {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .prepti-lab .prepti-lab-dtable,
  .prepti-lab .prepti-lab-dtable tbody,
  .prepti-lab .prepti-lab-dtable tr {
    display: block;
    width: 100%;
  }
  .prepti-lab .prepti-lab-dtable tbody tr {
    border: 1px solid var(--pl-line);
    border-radius: var(--pl-radius);
    padding: 10px 12px;
    margin: 0 0 10px;
  }
  .prepti-lab .prepti-lab-dtable th[scope="row"] {
    display: block;
    border: 0;
    padding: 0 0 4px;
    font-size: 15px;
  }
  .prepti-lab .prepti-lab-dtable td {
    display: inline-block;
    border: 0;
    padding: 0 12px 0 0;
    text-align: left;
    font-size: 14px;
  }
  .prepti-lab .prepti-lab-dtable td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--pl-navy);
  }
  .prepti-lab .prepti-lab-dtable caption {
    display: block;
    width: 100%;
    text-align: left;
    font-weight: 600;
    margin-bottom: 6px;
  }
}
