.tfl-topo-quiz-wrapper {
    margin: 1em 0;
    background: #ffffff;
    padding: 1.25em;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.tfl-topo-map-quiz-intro {
    max-width: 960px;
    margin: 0 auto 1.5rem;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.tfl-topo-map-quiz-intro .tfl-map-quiz-title {
    margin: 0 0 0.75em;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: #1e293b;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.tfl-map-quiz-desc {
    color: #475569;
    line-height: 1.7;
    font-size: 1.05em;
}

.tfl-map-quiz-desc p {
    margin: 0 0 0.75em;
}

.tfl-map-quiz-desc p:last-child {
    margin-bottom: 0;
}

/* Break out of narrow theme columns so the map spans full viewport width */
.tfl-topo-quiz-wrapper.tfl-map-quiz--full-bleed {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    box-sizing: border-box;
}

.tfl-map-quiz-points-badge {
    display: none !important;
}

.tfl-topo-quiz-branding {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 0.5em;
}

.tfl-map-quiz-title {
    margin: 0 0 0.5em;
}

.tfl-topo-quiz-instructions {
    margin-bottom: 1em;
}

.tfl-topo-quiz-instructions p {
    margin: 0 0 0.5em;
    font-size: 1em;
}

.tfl-topo-quiz-controls {
    display: flex;
    gap: 0.5em;
    margin-bottom: 0.75em;
    justify-content: center;
    flex-wrap: wrap;
}

.tfl-topo-btn-draw {
    padding: 12px 20px;
    background: transparent;
    color: #2e7d32;
    border: 2px solid #2e7d32;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
}

.tfl-topo-btn-draw:hover {
    background: #2e7d32;
    color: #fff;
}

.tfl-topo-btn-finish {
    padding: 12px 20px;
    background: transparent;
    color: #1565c0;
    border: 2px solid #1565c0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
}

.tfl-topo-btn-finish:hover {
    background: #1565c0;
    color: #fff;
}

.tfl-topo-btn-delete {
    padding: 12px 20px;
    background: transparent;
    color: #c62828;
    border: 2px solid #c62828;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
}

.tfl-topo-btn-delete:hover {
    background: #c62828;
    color: #fff;
}

.tfl-topo-btn-undo {
    padding: 12px 20px;
    background: transparent;
    color: #6b7280;
    border: 2px solid #6b7280;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
}

.tfl-topo-btn-undo:hover {
    background: #6b7280;
    color: #fff;
}

/* --- Tile loading overlay --- */
.tfl-map-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 800;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(245,240,232,0.55);
    pointer-events: none;
}

.tfl-map-loading-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(0,0,0,0.12);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: tfl-spin 0.7s linear infinite;
}

@keyframes tfl-spin {
    to { transform: rotate(360deg); }
}

/* --- Pin-style location markers (large, high-visibility) --- */
.tfl-marker-pin {
    background: transparent !important;
    border: none !important;
}

.tfl-pin-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.tfl-pin-animate {
    animation: tfl-pin-drop 0.5s ease-out, tfl-pin-pulse 2s ease-in-out 0.6s 2;
}

@keyframes tfl-pin-drop {
    0% { opacity: 0; transform: translateY(-30px) scale(0.7); }
    60% { opacity: 1; transform: translateY(4px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes tfl-pin-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.tfl-pin-icon {
    width: 48px;
    height: 72px;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
}

.tfl-marker-label {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 900;
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    border-radius: 3px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
    margin-top: -2px;
}

.tfl-label-green {
    background: rgba(46,125,50,0.85);
}

.tfl-label-red {
    background: rgba(198,40,40,0.85);
}

.tfl-topo-map path.leaflet-interactive {
    stroke: #2563eb !important;
    stroke-width: 6 !important;
    fill: none !important;
}

.tfl-topo-map path.leaflet-interactive.tfl-practice-route {
    stroke: #0b4fd9 !important;
    stroke-width: 24 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Practice routes — canvas + SVG fallback, always visible on practice map */
.tfl-practice-map-wrapper .leaflet-overlay-pane svg,
.tfl-practice-map-wrapper .leaflet-overlay-pane canvas {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none;
}

.tfl-practice-map-wrapper .leaflet-container {
    isolation: isolate;
}

.tfl-practice-map path.leaflet-interactive {
    stroke: #0b4fd9 !important;
    stroke-width: 6px !important;
    stroke-opacity: 1 !important;
    fill: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Larger START / END pins — practice map only (override Elementor svg { width: 1em }) */
.tfl-practice-map-wrapper .tfl-practice-marker-pin,
.tfl-practice-map-wrapper .leaflet-marker-icon.tfl-practice-marker-pin {
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
}

/* Stop theme/Elementor global CSS transitions from animating the marker's
   Leaflet transform during zoom/pan, which makes pins drift away from their
   map point before catching up. Leaflet must reposition markers instantly. */
.tfl-practice-map-wrapper .leaflet-marker-icon,
.tfl-practice-map-wrapper .leaflet-marker-pane .leaflet-marker-icon,
.tfl-practice-map-wrapper .leaflet-marker-icon * {
    transition: none !important;
}

.tfl-practice-map-wrapper .tfl-practice-pin-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 54px;
}

.tfl-practice-map-wrapper svg.tfl-practice-pin-icon,
.tfl-practice-map-wrapper .tfl-practice-marker-pin svg.tfl-practice-pin-icon,
.elementor-widget-container .tfl-practice-map-wrapper svg.tfl-practice-pin-icon {
    width: 54px !important;
    height: 81px !important;
    min-width: 54px !important;
    min-height: 81px !important;
    max-width: none !important;
    max-height: none !important;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}

.tfl-practice-map-wrapper .tfl-practice-marker-label {
    font-size: 12px;
    padding: 3px 9px;
    letter-spacing: 0.08em;
    margin-top: 1px;
}

.tfl-topo-map {
    position: relative;
    height: 500px;
    width: 100%;
    border: 1px solid #d5d0c8;
    border-radius: 4px;
    background: #f5f0e8;
    overscroll-behavior: contain;
}

.tfl-topo-map .leaflet-container {
    overscroll-behavior: contain;
}

.tfl-topo-map .leaflet-control-attribution {
    display: none !important;
}

.tfl-topo-map .tfl-checkpoint-tooltip {
    background: rgba(26, 26, 26, 0.9);
    border: 0;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 4px 6px;
}

.tfl-topo-map .tfl-checkpoint-tooltip:before {
    border-top-color: rgba(26, 26, 26, 0.9);
}

/* SeruPractice-style: filter applied via tfl_topo_quiz_tile_filter (contrast, saturate, sepia, brightness) */

.tfl-topo-quiz-actions {
    margin-top: 1em;
    display: flex;
    justify-content: center;
    gap: 0.75em;
    flex-wrap: wrap;
}

/* Timer hidden - not needed for map quizzes */
.tfl-map-quiz-timer {
    display: none !important;
}

.tfl-topo-submit-route {
    padding: 10px 20px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

.tfl-topo-submit-route:hover {
    background: #333;
}

/* --- Per-question result card (HIDDEN during quiz, only shown in final summary) --- */
.tfl-topo-quiz-result-card {
    padding: 1.25em 1.5em;
    border-radius: 8px;
    margin-top: 1em;
    text-align: center;
    border: 2px solid #d1d5db;
    background: #f9fafb;
    display: none !important; /* Hidden by default */
}

.tfl-topo-quiz-result-card.is-passed {
    background: #e8f5e9;
    border-color: #2e7d32;
}

.tfl-topo-quiz-result-card.is-failed {
    background: #fdecea;
    border-color: #c62828;
}

.tfl-result-badge {
    display: inline-block;
    padding: 6px 24px;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 0.5em;
}

.tfl-badge-passed {
    background: #2e7d32;
    color: #fff;
}

.tfl-badge-failed {
    background: #c62828;
    color: #fff;
}

.tfl-result-score-line {
    font-size: 1.6em;
    font-weight: 700;
    margin: 0.25em 0;
}

.tfl-result-points-sub {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0.15em 0 0;
    color: #1f2937;
}

.tfl-topo-quiz-result-card.is-passed .tfl-result-score-line {
    color: #1b5e20;
}

.tfl-topo-quiz-result-card.is-failed .tfl-result-score-line {
    color: #8e1b1b;
}

.tfl-topo-quiz-result-note {
    margin-top: 0.5em;
    font-size: 0.95em;
    color: #555;
}

/* --- Next Question button --- */
.tfl-topo-btn-next {
    padding: 12px 28px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 700;
    margin-left: 12px;
    transition: opacity 0.2s;
}

.tfl-topo-btn-next:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.tfl-topo-btn-next:not(:disabled):hover {
    background: #4f46e5;
}

.tfl-topo-btn-next.tfl-next-ready {
    animation: tfl-pulse-next 1.5s ease-in-out 2;
}

@keyframes tfl-pulse-next {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.5); }
    50% { box-shadow: 0 0 0 10px rgba(99,102,241,0); }
}

/* --- Final Summary --- */
.tfl-topo-final-summary {
    padding: 2.5em;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    margin: 2rem 0;
}

.tfl-topo-final-summary h2 {
    margin: 0 0 1em;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.tfl-summary-overall {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 2em 3em;
    border-radius: 16px;
    margin-bottom: 1.5em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tfl-summary-overall-passed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 3px solid #2e7d32;
}

.tfl-summary-overall-failed {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 3px solid #c62828;
}

.tfl-summary-overall-score {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 900;
    line-height: 1;
}

.tfl-summary-overall-passed .tfl-summary-overall-score {
    color: #1b5e20;
}

.tfl-summary-overall-failed .tfl-summary-overall-score {
    color: #8e1b1b;
}

.tfl-summary-overall-label {
    font-size: 1.3em;
    font-weight: 800;
    letter-spacing: 0.15em;
    margin-top: 0.5em;
    text-transform: uppercase;
}

.tfl-summary-overall-passed .tfl-summary-overall-label {
    color: #2e7d32;
}

.tfl-summary-overall-failed .tfl-summary-overall-label {
    color: #c62828;
}

.tfl-summary-counts {
    color: #64748b;
    margin: 0.75em 0 1.5em;
    font-size: 1.1rem;
    font-weight: 600;
}

.tfl-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto 1.5em;
    text-align: left;
}

.tfl-summary-table th {
    background: #f3f4f6;
    padding: 8px 12px;
    font-weight: 700;
    border-bottom: 2px solid #e5e7eb;
}

.tfl-summary-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.tfl-summary-passed {
    color: #2e7d32;
    font-weight: 700;
}

.tfl-summary-failed {
    color: #c62828;
    font-weight: 700;
}

.tfl-summary-feedback {
    max-width: 32em;
    font-size: 0.9em;
    line-height: 1.45;
    word-wrap: break-word;
    color: #444;
}

.tfl-summary-pts {
    font-weight: 500;
    color: #666;
}

.tfl-summary-actions {
    margin-top: 2em;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tfl-summary-restart {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tfl-summary-restart:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.tfl-map-quiz-feedback {
    min-height: 24px;
    margin-top: 0.75em;
    font-weight: 600;
}

.tfl-map-quiz-feedback.is-info {
    color: #0f5a95;
}

.tfl-map-quiz-feedback.is-success {
    color: #1b5e20;
}

.tfl-map-quiz-feedback.is-error {
    color: #8e1b1b;
}

.tfl-map-quiz-learndash-slot {
    margin-top: 1rem;
}

.tfl-map-quiz-linked-question .wpProQuiz_question {
    margin-top: 0 !important;
}

.tfl-map-quiz-player--mcq-only .tfl-map-quiz-mcq-section {
    margin-top: 0.75rem;
}

.tfl-map-quiz-player--mcq-only .tfl-topo-quiz-actions {
    margin-top: 1rem;
}

/* End-of-quiz: hide native LearnDash timer / empty score panel; custom summary uses #tfl-topo-final-summary-root */
body.map-quiz-active .wpProQuiz_results,
body.map-quiz-active .wpProQuiz_quiz_results {
    display: none !important;
}

/* Keep our custom final summary visible */
body.map-quiz-active #tfl-topo-final-summary-root {
    display: block !important;
}

/* Native Next/Finish stays hidden during map/MCQ Topo flow; our mirrored button invokes it programmatically when needed */
body.map-quiz-active.single-sfwd-quiz .wpProQuiz_quiz input.wpProQuiz_QuestionButton[name="next"],
body.map-quiz-active.single-sfwd-quiz .wpProQuiz_quiz input.wpProQuiz_button[name="next"] {
    display: none !important;
    visibility: hidden !important;
}

body.map-quiz-active .ld-advance-saveresume,
body.map-quiz-active .ld-advance-saveresume-box,
body.map-quiz-active input.ld_advance_quiz_resume,
body.map-quiz-active input.ld_advance_quiz_save {
    display: none !important;
    visibility: hidden !important;
}

#tfl-topo-final-summary-root {
    clear: both;
    position: relative;
    z-index: 5;
    margin: 2rem 0 3rem;
    padding: 1rem 0;
    animation: tfl-fade-in-up 0.6s ease-out;
    display: block !important;
    visibility: visible !important;
}

/* Ensure everything inside the final summary is visible */
#tfl-topo-final-summary-root .tfl-topo-final-summary {
    display: block !important;
    visibility: visible !important;
}

#tfl-topo-final-summary-root .tfl-summary-table {
    display: table !important;
    visibility: visible !important;
}

#tfl-topo-final-summary-root .tfl-summary-actions {
    display: flex !important;
    visibility: visible !important;
}

@keyframes tfl-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide LearnDash/quiz system immediate result widgets inside our quiz wrapper
   so frontend users only see the plugin's final summary when configured. */
.tfl-topo-quiz-wrapper .ld-quiz-result,
.tfl-topo-quiz-wrapper .ld-quiz-results,
.tfl-topo-quiz-wrapper .quiz-result,
.tfl-topo-quiz-wrapper .wpProQuiz_result {
    display: none !important;
}

/* ---------------------------------------------------------------------------
   Map quiz LearnDash quiz template: white page, hide redundant chrome (scoped).
   ---------------------------------------------------------------------------- */
body.map-quiz-active.single-sfwd-quiz .site-content,
body.map-quiz-active.single-sfwd-quiz #primary,
body.map-quiz-active.single-sfwd-quiz .content-area .ast-container,
body.map-quiz-active.single-sfwd-quiz article,
body.map-quiz-active.single-sfwd-quiz article .inside-article,
body.map-quiz-active.single-sfwd-quiz article .entry-content {
    background-color: #ffffff !important;
}

body.map-quiz-active.single-sfwd-quiz article .inside-article {
    padding-top: 1rem;
    padding-bottom: 2.5rem;
    border-radius: 0;
    box-shadow: none;
}

/* Larger quiz post title ("Topographical Quiz") — Astra headings */
body.map-quiz-active.single-sfwd-quiz .entry-header .entry-title,
body.map-quiz-active.single-sfwd-quiz article h1.entry-title,
body.map-quiz-active.single-sfwd-quiz h1.wp-block-post-title {
    font-size: clamp(2rem, 4.8vw, 2.875rem);
    line-height: 1.18;
    font-weight: 800;
}

body.map-quiz-active.single-sfwd-quiz .learndash-wrapper,
body.map-quiz-active.single-sfwd-quiz .ld-tabs.ld-tab-content,
body.map-quiz-active.single-sfwd-quiz .ld-tabs.ld-tab-content.ld-tab-content-visible {
    background: transparent !important;
}

/* Duplicate / native navigation we replace with Submit + Next / Finish Quiz */
body.map-quiz-active.single-sfwd-quiz .wpProQuiz_quiz input[name="checkSingle"].wpProQuiz_button,
body.map-quiz-active.single-sfwd-quiz button[name="checkSingle"].wpProQuiz_button,
body.map-quiz-active.single-sfwd-quiz input.wpProQuiz_button[name="checkSingle"],
body.map-quiz-active.single-sfwd-quiz input.wpProQuiz_QuestionButton[name="checkSingle"],
body.map-quiz-active.single-sfwd-quiz .wpProQuiz_listItem input.wpProQuiz_button[name="back"],
body.map-quiz-active.single-sfwd-quiz .wpProQuiz_listItem input.wpProQuiz_QuestionButton[name="back"] {
    display: none !important;
}

/* Resume / Save in quiz status bar — markup varies by addons; conservative backup */
body.map-quiz-active.single-sfwd-quiz .ld-quiz-status .learndash-resume-quiz-wrapper,
body.map-quiz-active.single-sfwd-quiz .ld-quiz-status [class*="resume"],
body.map-quiz-active.single-sfwd-quiz .ld-quiz-status [class*="save-quiz"],
body.map-quiz-active.single-sfwd-quiz .learndash-wrapper .quiz_resume_link,
body.map-quiz-active.single-sfwd-quiz .wpProQuiz_quiz .quiz_save_link {
    display: none !important;
}

body.map-quiz-active.single-sfwd-quiz .tfl-map-quiz-linked-question .wpProQuiz_points {
    display: none !important;
}

/* Hide per-question result cards - only show final summary at end */
body.map-quiz-active.single-sfwd-quiz .tfl-map-quiz-player .tfl-topo-quiz-result-card {
    display: none !important;
}

/* But ensure the final summary container with table is always visible */
#tfl-topo-final-summary-root .tfl-topo-quiz-result-card {
    display: block !important;
}

/* Follow-up MCQs inside map player */
.tfl-map-quiz-mcq-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tfl-map-quiz-mcq-heading {
    display: none !important;
}

.tfl-map-quiz-mcq-item {
    border: none;
    margin: 0 0 1.5rem;
    padding: 1.25rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.tfl-map-quiz-mcq-item:last-of-type {
    margin-bottom: 0;
}

/* Legend removed - only showing prompt now */

.tfl-map-quiz-mcq-item .tfl-mcq-prompt {
    display: none !important;
}

.tfl-map-quiz-mcq-item .tfl-mcq-desc {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    white-space: pre-wrap;
}

.tfl-map-quiz-mcq-item .tfl-mcq-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 1rem;
    border-radius: 8px;
    border: 2px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tfl-map-quiz-mcq-item .tfl-mcq-choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tfl-map-quiz-mcq-item .tfl-mcq-choice:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.tfl-map-quiz-mcq-item .tfl-mcq-choice input {
    margin: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.tfl-map-quiz-mcq-item .tfl-mcq-choice input:checked + span {
    font-weight: 700;
    color: #1e293b;
}

.tfl-map-quiz-mcq-item .tfl-mcq-choice:has(input:checked) {
    background: #dbeafe;
    border-color: #3b82f6;
}

.tfl-map-quiz-mcq-submit {
    margin-top: 0.5rem;
}

/* Practice Map */
.tfl-practice-map-wrapper {
    margin: 1em 0;
    background: #ffffff;
    padding: 1.25em;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    position: relative;
}

/* Full viewport width — practice map only */
.tfl-practice-map-wrapper.tfl-practice-map--full-bleed {
    width: 100vw;
    max-width: 100vw;
    margin: 0 calc(50% - 50vw);
    padding-top: 0;
    padding-bottom: 0;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    box-sizing: border-box;
    border: none;
    border-radius: 0;
}

.tfl-practice-map-wrapper .tfl-practice-map,
.tfl-practice-map-wrapper .tfl-topo-map.tfl-practice-map {
    width: 100%;
    /* Fill the full viewport height, leaving room only for the toolbar above
       so the map stretches all the way down to the footer. */
    height: calc(100vh - 96px) !important;
    min-height: 600px;
}

.tfl-practice-map-wrapper .tfl-practice-toolbar {
    display: flex;
    gap: 0.5em;
    margin-bottom: 10px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

/* Keep toolbar clickable above theme/Elementor linked headers when the
   WP admin bar shifts layout on logged-in administrator sessions. */
.admin-bar .tfl-practice-map-wrapper .tfl-practice-toolbar {
    z-index: 1000;
}

.admin-bar .tfl-practice-map-wrapper .tfl-practice-map,
.admin-bar .tfl-practice-map-wrapper .tfl-topo-map.tfl-practice-map {
    height: calc(100vh - 96px - 32px) !important;
}

@media screen and (max-width: 782px) {
    .admin-bar .tfl-practice-map-wrapper .tfl-practice-map,
    .admin-bar .tfl-practice-map-wrapper .tfl-topo-map.tfl-practice-map {
        height: calc(100vh - 96px - 46px) !important;
    }
}

.tfl-practice-btn {
    padding: 12px 20px;
    background: transparent;
    border: 2px solid #6b7280;
    color: #6b7280;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
}

.tfl-practice-btn-start { color: #2e7d32; border-color: #2e7d32; }
.tfl-practice-btn-end { color: #c62828; border-color: #c62828; }
.tfl-practice-btn-draw,
.tfl-practice-btn-finish { color: #1565c0; border-color: #1565c0; }
.tfl-practice-btn-delete { color: #c62828; border-color: #c62828; }
.tfl-practice-btn-clear { color: #1a1a1a; border-color: #1a1a1a; }

.tfl-practice-map-wrapper .tfl-practice-btn.active,
.tfl-practice-map-wrapper .tfl-practice-btn.tfl-drawing-active {
    background: #1976d2;
    color: #fff;
    border-color: #1976d2;
}

.tfl-practice-map-wrapper .tfl-practice-btn-start.active {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}

.tfl-practice-map-wrapper .tfl-practice-btn-end.active {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
}

.tfl-practice-map {
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    cursor: crosshair;
}

.tfl-practice-feedback {
    padding: 8px 0;
    font-size: 14px;
    min-height: 1.5em;
    font-weight: 600;
}

.tfl-practice-feedback.is-info {
    color: #1976d2;
}

.tfl-practice-feedback.is-success {
    color: #2e7d32;
}

.tfl-practice-feedback.is-error {
    color: #c62828;
}

.tfl-practice-status {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    font-size: 13px;
    color: #555;
    padding: 6px 0;
    border-top: 1px solid #f0f0f0;
}
