.lwa-quiz-wrapper {
    max-width: 960px;
    margin: 0 auto;
    box-sizing: border-box;
}

.lwa-quiz-inner {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Header */
.lwa-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    margin: 0 0 1rem 0;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.lwa-quiz-header-results {
    margin-bottom: 1.5rem;
}

.lwa-quiz-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.lwa-quiz-meta {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.8rem;
    align-items: center;
}

.lwa-quiz-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background: #f5f5f5;
}

.lwa-icon-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #2e7d32;
}

.lwa-quiz-meta-label {
    opacity: 0.7;
}

.lwa-quiz-meta-value {
    font-weight: 600;
}

/* Timer & header buttons */
.lwa-quiz-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lwa-quiz-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
}

/* Pill-shaped timer with red outline */



.lwa-quiz-timer-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c62828;
}

/* Start test button – green pill like timer */
.lwa-quiz-start-btn {
    border-radius: 999px;
    padding: 0.45rem 2rem;
    border: 2px solid #2e7d32;
    background: #ffffff;
    color: #2e7d32;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Top submit button (header) – initially hidden & disabled */
.lwa-quiz-submit-top {
    display: none;
    border-radius: 999px;
    padding: 0.35rem 1.1rem;
    border: 2px solid #888;
    background: #f5f5f5;
    color: #888;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: not-allowed;
    white-space: nowrap;
}

/* Enabled state for header submit */
.lwa-quiz-submit-top.enabled {
    border-color: #2e7d32;
    color: #2e7d32;
    background: #ffffff;
    cursor: pointer;
}

/* Rules panel */
.lwa-quiz-rules {
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
}

.lwa-quiz-rules-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.lwa-quiz-rules-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
}

.lwa-quiz-rules-list li {
    margin-bottom: 0.25rem;
}

/* Form layout */
.lwa-quiz-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Question area */
.lwa-quiz-questions {
    margin-top: 1rem;
    position: relative;
    min-height: 260px;
    width: 100%;
    box-sizing: border-box;
}

/* Question box */
.lwa-quiz-question {
    width: 100%;
    max-width: 100%;
    margin: 0 0 0.75rem 0;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    background: #fff;
    box-sizing: border-box;
}

.lwa-quiz-question-inner {
    width: 100%;
    box-sizing: border-box;
}

/* Question header */
.lwa-quiz-question-header {
    margin-bottom: 0.75rem;
}

.lwa-quiz-question-topline {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.lwa-quiz-question-number {
    font-weight: 800;
    font-size: 1.15rem;
    color: #222;
}

.lwa-quiz-question-category {
    font-size: 0.8rem;
    opacity: 0.7;
    text-align: right;
}

.lwa-quiz-question-text {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.lwa-quiz-question-image {
    margin: 0.5rem 0 0.75rem;
    text-align: center;
}

.lwa-quiz-question-image img {
    max-width: 100%;
    height: auto;
}

/* Answers grid */
.lwa-quiz-answers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.6rem;
}

@media (max-width: 600px) {
    .lwa-quiz-answers {
        grid-template-columns: 1fr;
    }
}

.lwa-quiz-answer {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    border-radius: 999px;
    border: 1px solid #ccc;
    padding: 0.25rem 0.55rem;
    cursor: pointer;
    font-size: 0.9rem;
    background: #fafafa;
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.lwa-quiz-answer input[type="radio"] {
    margin: 0.25rem 0.35rem 0.25rem 0.25rem;
}

.lwa-quiz-answer-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
}

.lwa-quiz-answer-letter {
    font-weight: 600;
    font-size: 0.9rem;
}

.lwa-quiz-answer-text {
    flex: 1;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Selected state */
.lwa-quiz-answer.selected {
    border-color: #9ca3af;
    background: #f3f4f6;
    box-shadow: 0 0 0 1px rgba(156,163,175,0.35);
}

/* Pagination nav */
.lwa-quiz-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    gap: 0.75rem;
}

.lwa-quiz-nav-btn {
    border-radius: 999px;
    padding: 0.45rem 1.4rem;
    border: 2px solid #f4a300;
    background: #fff;
    color: #f4a300;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.lwa-quiz-nav-btn:hover {
    opacity: 0.85;
}

.lwa-quiz-nav-btn[disabled] {
    opacity: 0.4;
    border-color: #ccc;
    color: #ccc;
    cursor: default;
}

.lwa-quiz-nav-status {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    color: #111 !important;
    letter-spacing: 0.3px;
}

/* Try again button on results */
.lwa-quiz-submit-wrap {
    text-align: center;
    margin-top: 1.25rem;
}

.lwa-quiz-try-again {
    display: inline-block;
    padding: 0.6rem 1.6rem;
    border-radius: 999px;
    border: 2px solid #222;
    background: #222;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.lwa-quiz-try-again:hover {
    opacity: 0.9;
}

/* Notices */
.lwa-quiz-notice {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 4px;
}

.lwa-quiz-notice-error {
    background: #ffe5e5;
    border-left: 4px solid #e53935;
}

.lwa-quiz-notice-success {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
}

/* Results */
.lwa-quiz-results-summary {
    margin-bottom: 1rem;
}

.lwa-quiz-result-pass {
    color: #2e7d32;
    font-weight: 600;
}

.lwa-quiz-result-fail {
    color: #c62828;
    font-weight: 600;
}

.lwa-quiz-results-details {
    margin-top: 1rem;
}

.lwa-quiz-results-details summary {
    cursor: pointer;
    font-weight: 600;
}

.lwa-quiz-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.lwa-quiz-results-table th,
.lwa-quiz-results-table td {
    border: 1px solid #ddd;
    padding: 0.4rem 0.5rem;
    vertical-align: top;
}

.lwa-quiz-row-correct {
    background: #e8f5e9;
}

.lwa-quiz-row-incorrect {
    background: #ffebee;
}

/* Responsive */
@media (max-width: 700px) {
    .lwa-quiz-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lwa-quiz-header-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .lwa-quiz-question-topline {
        flex-direction: column;
        align-items: flex-start;
    }

    .lwa-quiz-question-category {
        text-align: left;
    }
}

/* Panels under quiz (stats, attempts, leaderboard, test details) */
.lwa-quiz-panel {
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
}

.lwa-quiz-panel h2 {
    margin-top: 0;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Style ONLY the Test Details panel to blend with widget border */
.lwa-quiz-panel-test-details {
    border: none;
    border-radius: 12px;
    padding: 1rem 0;
    background: transparent;
    box-sizing: border-box;
}

.lwa-quiz-panel-test-details form p {
    margin-bottom: 0.6rem;
}

.lwa-quiz-panel-test-details label {
    font-size: 0.9rem;
}

.lwa-quiz-panel-test-details input[type="date"],
.lwa-quiz-panel-test-details input[type="text"] {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.lwa-quiz-panel-test-details button {
    border-radius: 999px;
    padding: 0.4rem 1.2rem;
    border: 2px solid #2e7d32;
    background: #2e7d32;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.lwa-quiz-panel-test-details button:hover {
    opacity: 0.9;
}

/* Green pill Edit details button */
.lwa-quiz-test-details-edit {
    display: inline-block;
    padding: 8px 22px;
    border-radius: 999px;
    background: #fff !important;
    color: #3abf00 !important;
    font-weight: 700 !important;
    border: 2px solid #3abf00 !important;
    cursor: pointer;
    font-size: 0.95rem;
    transition: 0.2s ease-in-out;
}

.lwa-quiz-test-details-edit:hover {
    background: #3abf00 !important;
    color: #fff !important;
}

.lwa-quiz-question-inner .lwa-quiz-navigation { margin-top:25px; }

/* Increase gap between answers and navigation inside question box */
.lwa-quiz-question-inner .lwa-quiz-answers {
    margin-bottom: 24px;
}
.lwa-quiz-question-inner .lwa-quiz-navigation {
    margin-top: 24px; /* ensure spacing in case margin-bottom is overridden */
}

/* Unified button styling for theory test details */
.lwa-quiz-panel-test-details button,
.lwa-quiz-panel-test-details input[type="submit"] {
    background: #1FAF54;
    color: #fff;
    border: none;
    border-radius: 40px;
    padding: 10px 26px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    transition: 0.2s ease;
    text-align: center;
}
.lwa-quiz-panel-test-details button:hover,
.lwa-quiz-panel-test-details input[type="submit"]:hover {
    background: #159645;
}
.lwa-quiz-panel-test-details .lwa-quiz-test-details-actions {
    width: 100%;
    text-align: center;
    margin-top: 15px;
}
.lwa-quiz-test-details button:focus,
.lwa-quiz-test-details input[type="submit"]:focus {
    outline: none;
    box-shadow: none;
}

/* Enhance theory test details panel styling */
.lwa-quiz-panel-test-details {
    position: relative;
}

/* Shared row layout for date/centre */
.lwa-quiz-panel-test-details .lwa-quiz-test-details-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Icons beside labels/date/centre */
.lwa-quiz-test-details-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(31, 175, 84, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
}

/* Simple icon shapes using pseudo elements */
.lwa-quiz-icon-calendar::before {
    content: "\1F4C5"; /* calendar emoji */
}
.lwa-quiz-icon-location::before {
    content: "\1F4CD"; /* location pin emoji */
}

/* Countdown badge */
.lwa-quiz-test-countdown {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lwa-quiz-test-countdown-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(31, 175, 84, 0.08);
    border: 1px solid rgba(31, 175, 84, 0.3);
    font-weight: 700;
    font-size: 16px;
}

.lwa-quiz-test-countdown-label {
    font-weight: 500;
    font-size: 13px;
    text-transform: lowercase;
}

.lwa-quiz-test-countdown-text {
    font-size: 14px;
}

/* Animate button hover (subtle lift + shadow) */
.lwa-quiz-panel-test-details button,
.lwa-quiz-panel-test-details input[type="submit"] {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.lwa-quiz-panel-test-details button:hover,
.lwa-quiz-panel-test-details input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Center actions container if not already */
.lwa-quiz-panel-test-details .lwa-quiz-test-details-actions {
    display: flex;
    justify-content: center;
}

/* "Take another test" button styled like timer pill */
.lwa-quiz-submit-wrap {
    margin-top: 1.25rem;
    text-align: center;
}

.lwa-quiz-try-again {
    display: inline-block;
    border-radius: 999px;
    padding: 0.45rem 1.4rem;
    border: 2px solid #1FAF54;
    background: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

.lwa-quiz-try-again:hover {
    background: #1FAF54;
    color: #ffffff;
}

/* Email results note styling and layout within rules */
.lwa-quiz-rules {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Ensure title, email note, and rules list appear in the right order */
.lwa-quiz-rules-title {
    order: 0;
}
.lwa-quiz-email-note {
    order: 1;
}
.lwa-quiz-rules-list {
    order: 2;
}

/* Email note block styling */
.lwa-quiz-email-note {
    background: #ffffff;
    border-radius: 16px;
    padding: 12px 16px 14px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    margin: 4px 0 2px;
}

/* Label text */
.lwa-quiz-email-note label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Email input styling */
.lwa-quiz-email-note input[type="email"] {
    width: 100%;
    max-width: 320px;
    padding: 8px 14px;
    font-size: 15px;
    border-radius: 40px;
    border: 1px solid #d0d0d0;
    outline: none;
    transition: 0.18s ease-in-out;
}

/* Focus state */
.lwa-quiz-email-note input[type="email"]:focus {
    border-color: #1FAF54;
    box-shadow: 0 0 0 3px rgba(31,175,84,0.18);
}


/* Quiz tips box under the question */
.lwa-quiz-tips-wrap {
    margin-top: 16px;
    font-size: 0.9rem;
}

.lwa-quiz-tip-rotator {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(0,0,0,0.05);
}

.lwa-quiz-tip {
    display: none;
    line-height: 1.5;
}

.lwa-quiz-tip.is-active {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}



/* Tip icon */
.lwa-quiz-tip-icon {
    font-size: 1.2rem;
    margin-right: 6px;
    vertical-align: middle;
}


/* Tip icon SVG (two-tone bulb) */
.lwa-quiz-tip-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22none%22%3E%3Cpath%20fill%3D%22%23F9C74F%22%20d%3D%22M12%202a7%207%200%200%200-4.9%2011.9c.5.5.9%201.1%201.1%201.8l.3.8h7l.3-.8c.2-.7.6-1.3%201.1-1.8A7%207%200%200%200%2012%202z%22/%3E%3Crect%20x%3D%229%22%20y%3D%2216.5%22%20width%3D%226%22%20height%3D%221.5%22%20rx%3D%22.75%22%20fill%3D%22%23CED4DA%22/%3E%3Crect%20x%3D%229.5%22%20y%3D%2218.5%22%20width%3D%225%22%20height%3D%221.5%22%20rx%3D%22.75%22%20fill%3D%22%23ADB5BD%22/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Fix: ensure tip icon and text align properly */

/* Review flagged button – styled like timer/start pill */
.lwa-quiz-review-flagged {
    display: none;
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    border: 2px solid #111827;
    background: #ffffff;
    color: #111827;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
}

.lwa-quiz-review-flagged:hover {
    background: #111827;
    color: #ffffff;
}

/* Inline flag notice when a flagged question is answered */
.lwa-flag-notice {
  margin-top: 12px;
}

.lwa-flag-notice-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #FEF3C7; /* amber-100 */
  border: 1px solid #F59E0B; /* amber-500 */
  color: #92400E; /* amber-800 */
  font-size: 0.9rem;
}

.lwa-flag-notice-inner strong {
  font-weight: 700;
}

.lwa-flag-notice-inner button {
  border-radius: 999px;
  padding: 4px 10px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
}

.lwa-flag-notice-inner .lwa-flag-remove-btn {
  background: #DC2626;
  color: #ffffff;
}

.lwa-flag-notice-inner .lwa-flag-remove-btn:hover {
  filter: brightness(1.05);
}

.lwa-flag-notice-inner .lwa-flag-keep-btn {
  background: #E5E7EB;
  color: #111827;
}

.lwa-flag-notice-inner .lwa-flag-keep-btn:hover {
  filter: brightness(1.05);
}

/* Mobile: prevent header row from causing horizontal scroll */
@media (max-width: 600px) {
  .lwa-quiz-header-right {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .lwa-quiz-timer-pill,
  .lwa-quiz-start-btn,
  .lwa-quiz-submit-top,
  .lwa-quiz-review-flagged {
    max-width: 100%;
  }
}

/* --- v7u9: Strong mobile overflow fixes for header row --- */
@media (max-width: 640px) {

  .lwa-quiz-wrapper {
    overflow-x: hidden;
  }

  .lwa-quiz-header {
    flex-wrap: wrap;
  }

  .lwa-quiz-header-right {
    display: block;
    width: 100%;
  }

  .lwa-quiz-header-right > * {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 0.4rem 0;
    text-align: center;
  }

  .lwa-quiz-header-right > *:last-child {
    margin-bottom: 0;
  }
}

/* v7u10: Mobile layout for Previous / Flag / Next */
@media (max-width: 600px) {

  .lwa-quiz-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
  }

  /* All three buttons flexible */
  .lwa-quiz-nav > * {
    flex: 0 0 48%;
    max-width: 48%;
    text-align: center;
  }

  /* Middle button (Flag question) goes full-width on its own row */
  .lwa-quiz-nav > *:nth-child(2) {
    flex: 0 0 100%;
    max-width: 100%;
    order: 2;
  }

  /* Previous + Next stay on the first row */
  .lwa-quiz-nav > *:nth-child(1),
  .lwa-quiz-nav > *:nth-child(3) {
    order: 1;
  }
}

/* v7u10: Timer / Review flagged pills back to normal size on mobile */
@media (max-width: 640px) {
  .lwa-quiz-header-right {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .lwa-quiz-header-right > * {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    margin: 0;
    text-align: center;
  }
}


/* v7u12: ensure flag notice sits just under answers */
.lwa-flag-notice { margin-top: 0.5rem; }

/* Inline auth gate on quiz page */
.lwa-quiz-gate {
  max-width: 960px;
  margin: 1.5rem auto 1.5rem;
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(15,23,42,0.08);
  box-sizing: border-box;
}

.lwa-quiz-gate-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #b91c1c; /* LWA red */
}

.lwa-quiz-gate-subtitle {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: #4b5563;
}

.lwa-quiz-gate-error {
  margin-bottom: 1rem;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.9rem;
}

.lwa-quiz-gate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.lwa-quiz-gate-heading {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #111827;
}

.lwa-quiz-gate-text {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 0.9rem;
}

.lwa-quiz-gate-field {
  margin-bottom: 0.75rem;
}

.lwa-quiz-gate-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: #374151;
}

.lwa-quiz-gate-field input[type="text"],
.lwa-quiz-gate-field input[type="tel"],
.lwa-quiz-gate-field input[type="password"] {
  width: 100%;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.lwa-quiz-gate-field input:focus {
  outline: none;
  border-color: #f4a300; /* LWA amber */
  box-shadow: 0 0 0 2px rgba(244,163,0,0.25);
}

.lwa-quiz-gate-remember {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #4b5563;
}

.lwa-quiz-gate-remember input[type="checkbox"] {
  margin-right: 0.4rem;
}

.lwa-quiz-gate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.lwa-quiz-gate-btn-primary {
  background: #2e7d32; /* LWA green like Start test */
  border-color: #2e7d32;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(46,125,50,0.25);
}

.lwa-quiz-gate-btn-secondary {
  background: #ffffff;
  border-color: #f4a300; /* LWA amber like nav pills */
  color: #92400e;
  box-shadow: 0 6px 14px rgba(244,163,0,0.25);
}

.lwa-quiz-gate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(15,23,42,0.12);
  opacity: 0.96;
}

/* Wrapper for the widget/summary boxes under the quiz */
.lwa-quiz-boxes-wrap {
  max-width: 960px;
  margin: 1.5rem auto 0;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .lwa-quiz-gate {
    margin: 1rem 0.5rem 1.5rem;
    padding: 1.2rem 1rem;
  }
  .lwa-quiz-gate-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Theme My Login inline gate on quiz page */
.lwa-quiz-gate--tml-inline {
  margin: 1.5rem auto;
  max-width: 960px;
  padding: 1.75rem 1.5rem;
  border-radius: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.lwa-quiz-gate--tml-inline .lwa-quiz-gate-inner {
  max-width: 100%;
}

.lwa-quiz-gate--tml-inline .lwa-quiz-gate-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}

.lwa-quiz-gate--tml-inline .lwa-quiz-gate-subtitle {
  margin: 0 0 1.5rem;
  font-size: 0.98rem;
  text-align: center;
  color: #4b5563;
}

.lwa-quiz-gate--tml-inline .lwa-quiz-gate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.lwa-quiz-gate--tml-inline .lwa-quiz-gate-column {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid #e5e7eb;
}

.lwa-quiz-gate--tml-inline .lwa-quiz-gate-heading {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.lwa-quiz-gate--tml-inline .lwa-quiz-gate-text {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #4b5563;
}

/* Make TML forms adopt quiz styling */
.lwa-quiz-gate--tml-inline .tml {
  max-width: 100%;
}

.lwa-quiz-gate--tml-inline .tml form {
  margin: 0;
}

.lwa-quiz-gate--tml-inline .tml label {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.lwa-quiz-gate--tml-inline .tml .input,
.lwa-quiz-gate--tml-inline .tml input[type="text"],
.lwa-quiz-gate--tml-inline .tml input[type="password"],
.lwa-quiz-gate--tml-inline .tml input[type="email"] {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 0.45rem 0.6rem;
  box-sizing: border-box;
  font-size: 0.9rem;
}

.lwa-quiz-gate--tml-inline .tml .tml-rememberme-wrap,
.lwa-quiz-gate--tml-inline .tml .tml-user-login-wrap,
.lwa-quiz-gate--tml-inline .tml .tml-user-pass1-wrap,
.lwa-quiz-gate--tml-inline .tml .tml-user-email-wrap {
  margin-bottom: 0.75rem;
}

/* Buttons */
.lwa-quiz-gate--tml-inline .tml input[type="submit"] {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  border: none;
  background: #16a34a;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.lwa-quiz-gate--tml-inline .tml input[type="submit"]:hover {
  filter: brightness(1.05);
}

/* Links (lost password, etc.) */
.lwa-quiz-gate--tml-inline .tml-links {
  margin-top: 0.75rem;
  padding-left: 0;
  list-style: none;
  font-size: 0.85rem;
}

.lwa-quiz-gate--tml-inline .tml-links li {
  display: inline-block;
  margin-right: 0.75rem;
}

.lwa-quiz-gate--tml-inline .tml-links a {
  color: #2563eb;
  text-decoration: none;
}

.lwa-quiz-gate--tml-inline .tml-links a:hover {
  text-decoration: underline;
}

/* Error / message styling */
.lwa-quiz-gate--tml-inline .tml-error,
.lwa-quiz-gate--tml-inline .tml-message {
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-size: 0.88rem;
}

.lwa-quiz-gate--tml-inline .tml-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.lwa-quiz-gate--tml-inline .tml-message {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

/* Mobile: stack login/register columns */
@media (max-width: 768px) {
  .lwa-quiz-gate--tml-inline .lwa-quiz-gate-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Leaderboard three-column layout */
.lwa-quiz-panel-leaderboard .lwa-quiz-leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.lwa-quiz-panel-leaderboard .lwa-quiz-leaderboard-col h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1rem;
  font-weight: 600;
}

.lwa-quiz-panel-leaderboard .lwa-quiz-leaderboard-col p,
.lwa-quiz-panel-leaderboard .lwa-quiz-leaderboard-col li {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: #374151;
}

.lwa-quiz-panel-leaderboard .lwa-quiz-leaderboard-col ol,
.lwa-quiz-panel-leaderboard .lwa-quiz-leaderboard-col ul {
  padding-left: 1.1rem;
}

/* Stack leaderboard columns on mobile */
@media (max-width: 768px) {
  .lwa-quiz-panel-leaderboard .lwa-quiz-leaderboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Leaderboard avatar circles + medals */
.lwa-quiz-leaderboard-list {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.lwa-quiz-leaderboard-item {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0;
  border-bottom: 1px dashed #e5e7eb;
}

.lwa-quiz-leaderboard-item:last-child {
  border-bottom: none;
}

.lwa-quiz-leaderboard-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lwa-quiz-leaderboard-medal {
  min-width: 2.1rem;
  text-align: center;
  font-size: 0.95rem;
}

.lwa-quiz-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: #e5f6ff;
  color: #0369a1;
}

.lwa-quiz-leaderboard-name {
  font-weight: 600;
}

.lwa-quiz-leaderboard-meta {
  margin-left: 2.6rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.lwa-quiz-leaderboard-latest .lwa-quiz-leaderboard-meta {
  margin-left: 2.3rem;
}

@media (max-width: 640px) {
  .lwa-quiz-leaderboard-meta {
    margin-left: 2.4rem;
  }
}

/* Row for Submit / Review buttons above nav when quiz is complete */
.lwa-quiz-actions-row {
  display: flex;
  margin: 1rem 0 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Quiz Roadmap panel styling */
.lwa-quiz-panel-roadmap .lwa-quiz-roadmap-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lwa-quiz-panel-roadmap .lwa-quiz-roadmap-item {
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.lwa-quiz-panel-roadmap .lwa-quiz-roadmap-item:last-child {
  border-bottom: none;
}
.lwa-quiz-roadmap-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.1rem;
}
.lwa-quiz-roadmap-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.lwa-quiz-roadmap-status-planned {
  background: #fef3c7;
  color: #92400e;
}
.lwa-quiz-roadmap-status-in\ progress {
  background: #d1fae5;
  color: #047857;
}
.lwa-quiz-roadmap-status-testing {
  background: #e0f2fe;
  color: #075985;
}
.lwa-quiz-roadmap-status-live {
  background: #dcfce7;
  color: #166534;
}
.lwa-quiz-roadmap-title {
  font-weight: 600;
}
.lwa-quiz-roadmap-meta {
  font-size: 0.78rem;
  opacity: 0.9;
}
.lwa-quiz-roadmap-desc {
  font-size: 0.84rem;
  color: #4b5563;
  margin-top: 0.15rem;
}

/* Roadmap carousel: show one item at a time */
.lwa-quiz-panel-roadmap .lwa-quiz-roadmap-item {
  display: none;
}
.lwa-quiz-panel-roadmap .lwa-quiz-roadmap-item.is-active {
  display: block;
}


/* Read question button */

.lwa-quiz-read-btn {
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    border: 2px solid #16a34a;
    background: #ffffff;
    color: #16a34a;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.lwa-quiz-read-btn:hover,
.lwa-quiz-read-btn:focus {
    background: #ecfdf5;
    border-color: #16a34a;
    outline: none;
}


/* Layout fixes: timer in question + rules hide class */

/* LWA Quiz: keep rules visible until start, then hide via class */
.lwa-quiz-rules.lwa-quiz-rules-hidden {
    display: none !important;
}

/* Timer inside question card */
.lwa-quiz-timer--question {
    text-align: center;
    margin-bottom: 0.75rem;
}


/* Question actions row: timer + read button inline following the question number */
.lwa-quiz-question-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

/* On small screens stack timer and read button nicely */
@media (max-width: 600px) {
    .lwa-quiz-question-topline {
        flex-direction: row;
        align-items: center;
    }
    .lwa-quiz-question-actions {
        flex-wrap: wrap;
    }
}

/* Hide timer + read in the question area until the test has started.
   JS will add/remove the .lwa-quiz-has-started class on the wrapper. */
.lwa-quiz-wrapper:not(.lwa-quiz-has-started) .lwa-quiz-timer--question,
.lwa-quiz-wrapper:not(.lwa-quiz-has-started) .lwa-quiz-read-btn {
    display: none;
}

/* Make timer pill and read button the same size */
.lwa-quiz-timer-pill,
.lwa-quiz-read-btn {
    border-radius: 999px;
    padding: 0.3rem 1rem;
    border-width: 2px;
    border-style: solid;
    background: #ffffff;
    min-width: 130px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

/* Red outline for timer, green for read */
.lwa-quiz-timer-pill {
    border-color: #c62828;
    color: #c62828;
}

.lwa-quiz-read-btn {
    border-color: #16a34a;
    color: #16a34a;
    cursor: pointer;
}

/* Icon styling inside the pills */
.lwa-quiz-timer-icon,
.lwa-quiz-read-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
}

.lwa-quiz-question-actions > * {
    display: flex;
    align-items: center;
}

.lwa-quiz-timer {
    margin: 0;
    padding: 0;
}

.lwa-quiz-read-btn {
    margin: 0;
}

/* Icons via pseudo-elements so they always show */
.lwa-quiz-timer-pill::before {
    content: "⏱";
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 0.9em;
}

.lwa-quiz-read-btn::before {
    content: "🔊";
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 0.9em;
}

/* Ensure timer pill and read button share identical sizing */
.lwa-quiz-timer-pill,
.lwa-quiz-read-btn {
    border-radius: 999px;
    padding: 0.35rem 1.4rem;
    border-width: 2px;
    border-style: solid;
    background: #ffffff;
    min-width: 140px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
    line-height: 1.2;
    box-sizing: border-box;
}

/* Red outline for timer, green for read */
.lwa-quiz-timer-pill {
    border-color: #c62828;
    color: #c62828;
}

.lwa-quiz-read-btn {
    border-color: #16a34a;
    color: #16a34a;
    cursor: pointer;
}

/* Rules page start button – centred pill, not full width */
.lwa-quiz-rules {
    text-align: left;
}

.lwa-quiz-rules .lwa-quiz-start-btn {
    display: inline-flex;
    margin: 0;
}
/* Rules list styling with green checkmarks */
.lwa-quiz-rules-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
}

.lwa-quiz-rules-list li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 0.45rem;
}

.lwa-quiz-rules-list li::before {
    content: "✔";
    color: #16a34a;
    font-weight: 700;
    position: absolute;
    left: 0;
    top: 0.05rem;
    font-size: 1rem;
    line-height: 1;
}

/* Mobile tweaks: keep timer + read on one line */
@media (max-width: 480px) {
    .lwa-quiz-question-actions {
        justify-content: space-between;
    }
    .lwa-quiz-timer-pill,
    .lwa-quiz-read-btn {
        padding: 0.3rem 0.9rem;
        min-width: auto;
        font-size: 0.8rem;
    }
}


/* Hide Review flagged button until the quiz has started (no leaking onto rules page) */
.lwa-quiz-wrapper:not(.lwa-quiz-has-started) .lwa-quiz-review-flagged {
    display: none !important;
}



/* LWA – Full test + Practice Mode buttons row */
.lwa-quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.35rem;
  justify-content: center;
}

/* Practice Mode button – match Start button size, amber variant */
.lwa-quiz-practice-btn {
  border-radius: 999px;
  padding: 0.45rem 2rem;
  border: 2px solid var(--lwa-amber, #ffb300);
  background: #ffffff;
  color: var(--lwa-amber, #ffb300);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 600px) {
  .lwa-quiz-actions {
    flex-direction: column;
  }
  .lwa-quiz-actions .lwa-quiz-start-btn,
  .lwa-quiz-actions .lwa-quiz-practice-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}
