/* ===== Enhanced Vocabulary Box Styles ===== */
.ysp-lc-vocabulary-box {
    background: #f0f9ff;
    border: 1px solid #b2dfdb;
    border-left: 4px solid #005f73;
    border-radius: 8px;
    padding: 0;
    margin: 1.5rem 0;
    overflow: hidden;
}

.vocab-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #e0f2f1;
    border-bottom: none;
    border-left: 4px solid #005f73;
    border-radius: 4px;
}

.vocab-box-title {
    color: #005f73;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Toggle button - triangle indicator style */
.vocab-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #005f73;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
    font-size: 1.2em;
    line-height: 1;
    width: auto;
    height: auto;
}

.vocab-toggle-btn:hover {
    opacity: 0.7;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* Triangle glyph set via JS — no rotation needed */

/* Update the vocab-content-wrapper styles */
.vocab-content-wrapper {
    padding: 1.5rem;
    max-height: 20000px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.vocab-content-wrapper.collapsed {
    max-height: 0;
    padding: 0 1.5rem;
}

/* Flexbox layout instead of Grid for better compatibility */
.vocabulary-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.vocab-grid-item {
    flex: 0 1 calc(33.333% - 1rem);
    margin: 0.5rem;
    min-width: 250px;
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 3px solid #005f73;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vocab-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.vocab-term {
    font-weight: 700;
    color: #005f73;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.vocab-definition {
    color: #475569;
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Tablet view - 2 columns */
@media (max-width: 1024px) {
    .vocab-grid-item {
        flex: 0 1 calc(50% - 1rem);
    }
}

/* Mobile view - single column list with toggle */
@media (max-width: 768px) {
    /* Button is already visible, no need to redeclare display */
    
    .vocabulary-grid {
        margin: 0;
    }
    
    .vocab-grid-item {
        flex: 0 1 100%;
        margin: 0 0 0.75rem 0;
        padding: 0.5rem 0.75rem;
        border-left-width: 2px;
        min-width: auto;
    }
    
    .vocab-grid-item:last-child {
        margin-bottom: 0;
    }
    
    .vocab-box-header {
        padding: 0.75rem 1rem;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }
    
    .vocab-content-wrapper {
        padding: 1rem;
    }
    
    /* Start collapsed on mobile */
    .vocab-content-wrapper {
        max-height: 0;
        padding: 0 1rem;
    }
    
    .vocab-content-wrapper.expanded {
        max-height: 20000px;
        padding: 1.5rem;
    }
    
    /* Triangle glyph set via JS — no rotation needed on mobile */
}

.question-vocabulary-pair {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e5e5;
}

.question-vocabulary-pair:last-child {
    border-bottom: none;
}

.lexical-target-item {
    margin-top: 1rem;
}

/* Print styles */
@media print {
    .vocab-toggle-btn {
        display: none !important;
    }
    
    .vocab-content-wrapper,
    .vocab-content-wrapper.collapsed {
        max-height: none !important;
        padding: 1.5rem !important;
    }
    
    .vocab-grid-item {
        flex: 0 1 calc(50% - 1rem);
    }
}
/* ===== Scaffolding Box Styles (Grey) ===== */
.ysp-lc-scaffolding-box {
    background: #f8f9fa;
    border-color: #6c757d;
}

.ysp-lc-scaffolding-box .vocab-box-header {
    background: #e9ecef;
    border-bottom-color: #6c757d;
}

.ysp-lc-scaffolding-box .vocab-box-title {
    color: #495057;
}

.ysp-lc-scaffolding-box .vocab-toggle-btn {
    color: #6c757d;
}

.ysp-lc-scaffolding-box .vocab-toggle-btn:hover {
    opacity: 0.7;
}

.ysp-lc-scaffolding-box .vocab-grid-item {
    border-left-color: #6c757d;
}

.ysp-lc-scaffolding-box .vocab-term {
    color: #495057;
}

/* ===== Teacher Talk Box Styles (Green) ===== */
.ysp-lc-teacher-box {
    background: #f0fdf4;
    border-color: #22c55e;
}

.ysp-lc-teacher-box .vocab-box-header {
    background: #dcfce7;
    border-bottom-color: #22c55e;
}

.ysp-lc-teacher-box .vocab-box-title {
    color: #16a34a;
}

.ysp-lc-teacher-box .vocab-toggle-btn {
    color: #16a34a;
}

.ysp-lc-teacher-box .vocab-toggle-btn:hover {
    opacity: 0.7;
}

.ysp-lc-teacher-box .vocab-grid-item {
    border-left-color: #22c55e;
}

.ysp-lc-teacher-box .vocab-term {
    color: #16a34a;
}


/* ═══════════════════════════════════════════════════════════════
   AUDIO BOX — distinct toggle style for all audio content
   ═══════════════════════════════════════════════════════════════ */

/* New .ysp-lc-audio-box */
.ysp-lc-audio-box {
    background: #f0f7f9;
    border: 1px solid #005f73;
    border-left: 4px solid #005f73;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.ysp-lc-audio-box .vocab-box-header {
    background: #005f73;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.ysp-lc-audio-box .vocab-box-header h4 {
    color: #ffffff;
    margin: 0;
    font-size: 1em;
    font-weight: 600;
}

.ysp-lc-audio-box .vocab-toggle-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.2em;
}

.ysp-lc-audio-box .vocab-toggle-btn:hover {
    opacity: 0.8;
}

.ysp-lc-audio-box .vocab-content-wrapper {
    padding: 0;
}

.ysp-lc-audio-box .vocab-content-wrapper.collapsed {
    display: none;
}

.ysp-lc-audio-box .vocab-content-wrapper.expanded {
    display: block;
}

.ysp-lc-audio-box .vocab-content {
    padding: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   FALLBACK — existing audio toggles using vocabulary-box + aria-label
   Catches any on-site content not yet updated to .ysp-lc-audio-box
   ═══════════════════════════════════════════════════════════════ */

.ysp-lc-vocabulary-box:has(.vocab-toggle-btn[aria-label="Toggle audio player"]) {
    border: 1px solid #005f73;
    border-left: 4px solid #005f73;
    border-radius: 8px;
}

.ysp-lc-vocabulary-box:has(.vocab-toggle-btn[aria-label="Toggle audio player"]) .vocab-box-header {
    background: #005f73;
}

.ysp-lc-vocabulary-box:has(.vocab-toggle-btn[aria-label="Toggle audio player"]) .vocab-box-header h4 {
    color: #ffffff;
}

.ysp-lc-vocabulary-box:has(.vocab-toggle-btn[aria-label="Toggle audio player"]) .vocab-toggle-btn {
    background: none;
    border: none;
    color: #ffffff;
}


/* ===== Italian Grammar Comparison Table Styles ===== */
.italian-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
}

.italian-comparison-table thead {
    background: #f0f6fc;
    border-bottom: 2px solid #2271b1;
}

.italian-comparison-table th {
    padding: 12px;
    font-weight: 600;
    text-align: left;
}

.italian-comparison-table td {
    padding: 12px;
    line-height: 1.6;
    vertical-align: top;
}

.italian-comparison-table tr {
    border-bottom: 1px solid #f0f0f1;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .italian-comparison-table {
        font-size: 0.9em;
    }
    
    /* Stack table rows vertically on mobile */
    .italian-comparison-table thead {
        display: none; /* Hide header on mobile */
    }
    
    .italian-comparison-table tbody,
    .italian-comparison-table tr,
    .italian-comparison-table td {
        display: block;
        width: 100%;
    }
    
    .italian-comparison-table tr {
        margin-bottom: 1.5rem;
        padding: 1rem;
        background: #fff;
        border: 1px solid #dcdcde;
        border-radius: 6px;
        border-left: 4px solid #2271b1;
    }
    
    /* Style each cell as a labeled block */
    .italian-comparison-table td {
        padding: 8px 0;
        border: none;
        position: relative;
        padding-left: 0;
    }
    
    /* Add labels before content on mobile */
    .italian-comparison-table td:nth-child(1)::before {
        content: "#";
        font-weight: 700;
        color: #646970;
        display: inline-block;
        margin-right: 8px;
    }
    
    .italian-comparison-table td:nth-child(2)::before {
        content: "🇬🇧 English: ";
        font-weight: 700;
        color: #1d2327;
        display: block;
        margin-bottom: 4px;
    }
    
    .italian-comparison-table td:nth-child(3)::before {
        content: "🇮🇹 Italiano: ";
        font-weight: 700;
        color: #1d2327;
        display: block;
        margin-bottom: 4px;
    }
    
    .italian-comparison-table td:nth-child(4)::before {
        content: "Structure: ";
        font-weight: 700;
        color: #1d2327;
        display: inline-block;
        margin-right: 8px;
    }
    
    /* Style the structure indicator on mobile */
    .italian-comparison-table td:nth-child(4) {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #f0f0f1;
    }
    
    /* Notes row (colspan) on mobile */
    .italian-comparison-table td[colspan="4"] {
        padding: 12px;
        margin-top: 8px;
        background: #f8f9fa;
        border-radius: 4px;
    }
    
    .italian-comparison-table td[colspan="4"]::before {
        content: none; /* Remove label for notes */
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .italian-comparison-table {
        font-size: 0.9em;
    }
    
    .italian-comparison-table th,
    .italian-comparison-table td {
        padding: 10px;
    }
}

/* Very small mobile devices */
@media (max-width: 480px) {
    #italian-comparison .vocab-box-header h3 {
        font-size: 1rem;
    }
    
    #italian-comparison .vocab-box-header h3 span {
        display: block;
        margin-left: 0 !important;
        margin-top: 4px;
    }
    
    .italian-comparison-table {
        font-size: 0.85em;
    }
}

/* Make vocabulary terms and definitions display inline */
.vocab-grid-item dt.vocab-term,
.vocab-grid-item dd.vocab-definition {
    display: inline;
}

.vocab-grid-item dt.vocab-term {
    margin-right: 0.5em; /* Space between term and definition */
    margin-bottom: 0;
}

.vocab-grid-item dd.vocab-definition {
    margin-left: 0;
}

/* Talking Points Module Styles */
.talking-points-module {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.tp-media-player {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tp-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.tp-toggle-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.tp-toggle-content:hover {
    background: #005a87;
}

.tp-mode-indicator {
    font-style: italic;
    color: #666;
}

/* Quiz Styles */
.lexical-question {
    background: #f5f5f5;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.question-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.quiz-choice {
    padding: 12px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s;
    color: #000; /* lock base text color */
}

.quiz-choice:hover:not(:disabled) {
    border-color: #007cba;
    background: #f0f8ff;
    color: #000; /* lock hover text color */
}

.quiz-choice.correct {
    background: #c3f0ca;  /* Brighter green background */
    border-color: #22c55e; /* Brighter green border */
}


.quiz-choice.incorrect {
    background: #fecaca; /* Stronger red background */
    border-color: #ef4444; /* Stronger red border */
}

.quiz-choice:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Lexical Target Styles */
.lexical-target-item {
    background: #fff;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.target-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.target-term {
    font-size: 20px;
    font-weight: bold;
    color: #007cba;
}

.target-type {
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

.translation-note-wrapper {
    margin: 10px 0;
}

.translation-note-toggle {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 0.9em;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.translation-note-toggle:hover {
    background: #f8f8f8;
    border-color: #ccc;
}

.translation-note-toggle .toggle-icon {
    margin-left: auto;
    transition: transform 0.2s;
}

.translation-note-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.translation-note {
    background: #fef3c7;
    padding: 10px;
    border-left: 4px solid #f59e0b;
    margin-top: 5px;
    border-radius: 0 4px 4px 0;
}

.all-targets-revealed {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    margin-top: 30px;
}

/* Different styling for correct vs incorrect reveals */
.lexical-target-item.revealed-correct {
    border-color: #22c55e; /* Brighter green */
    background: #f0fdf4;
}

.lexical-target-item.revealed-incorrect {
    border-color: #f97316; /* Stronger orange-red */
    background: #fff7ed;
}


.lexical-target-item.revealed-incorrect::before {
    content: "📝 Study this carefully - you got the question wrong";
    display: block;
    background: #fed7aa; /* Stronger orange-red */
    color: #7c2d12;
    padding: 10px;
    margin: -20px -20px 15px -20px;
    border-bottom: 2px solid #f97316; /* Stronger orange-red */
    font-weight: bold;
}

.lexical-target-item.revealed-correct::before {
    content: "✅ Well done! You got this right";
    display: block;
    background: #c3f0ca; /* Brighter green */
    color: #14532d;
    padding: 10px;
    margin: -20px -20px 15px -20px;
    border-bottom: 2px solid #22c55e; /* Brighter green */
    font-weight: bold;
}

/* Enhanced lexical item styling */
.target-details p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.target-register {
    display: inline-block;
    background: #f0f4f8;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.9em;
}

.target-usage {
    color: #0369a1;
    font-style: italic;
}

.target-family {
    color: #059669;
}

.translation-note {
    background: #fef3c7;
    padding: 10px;
    border-left: 4px solid #f59e0b;
    margin-top: 10px;
    border-radius: 0 4px 4px 0;
}

/* Grammar Points Section - Card Style */
.tp-grammar-points {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #e5e7eb;
}

.tp-grammar-points h2 {
    color: #1e293b;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #3b82f6;
}

/* Individual Grammar Point Cards */
.tp-grammar-points .grammar-point {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tp-grammar-points .grammar-point:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tp-grammar-points .grammar-point:last-child {
    margin-bottom: 0;
}

.tp-grammar-points .grammar-point h3 {
    color: #3b82f6;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #eff6ff;
    border-radius: 4px;
    border-left: 4px solid #3b82f6;
}

/* Grammar Examples */
.tp-grammar-points .grammar-examples {
    background: #ffffff;
    border-left: 3px solid #94a3b8;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.tp-grammar-points .grammar-examples strong {
    color: #64748b;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.5rem;
}

.tp-grammar-points .grammar-examples ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}

.tp-grammar-points .grammar-examples li {
    color: #475569;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.tp-grammar-points .grammar-examples em {
    color: #1e293b;
    font-style: normal;
    font-weight: 500;
}

/* Pattern, Function, Contrast */
.tp-grammar-points .grammar-pattern,
.tp-grammar-points .grammar-function,
.tp-grammar-points .grammar-contrast {
    margin: 0.75rem 0;
    line-height: 1.6;
    color: #475569;
}

.tp-grammar-points .grammar-pattern strong,
.tp-grammar-points .grammar-function strong,
.tp-grammar-points .grammar-contrast strong {
    color: #1e293b;
    font-weight: 600;
    margin-right: 0.5rem;
}

.tp-grammar-points .grammar-pattern code {
    background: #94D2BD;
    color: #3A3A3A;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tp-grammar-points {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .tp-grammar-points h2 {
        font-size: 1.5rem;
    }
    
    .tp-grammar-points .grammar-point {
        padding: 1rem;
    }
    
    .tp-grammar-points .grammar-point h3 {
        font-size: 1.1rem;
    }
}

.grammar-showcase-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    border-radius: 4px;
}

.grammar-showcase-section h3 {
    color: #0073aa;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.showcase-structure {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.structure-name {
    color: #23282d;
    font-size: 1.1em;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.structure-details p {
    margin: 8px 0;
    line-height: 1.6;
}

.structure-form {
    font-family: "Courier New", monospace;
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 3px;
}

.structure-example {
    color: #555;
    font-style: italic;
}

.structure-notes {
    background: #fff3cd;
    padding: 8px;
    border-left: 3px solid #ffc107;
    margin-top: 10px;
}

.lexical-deep-dive {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .extraction-header {
    background-color: #F4F4F4; 
    color: #333; 
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}
    
    .extraction-meta {
        display: flex;
        gap: 20px;
        margin-top: 10px;
    }
    
    .extraction-meta span {
        background: rgba(255, 255, 255, 0.2);
        padding: 5px 15px;
        border-radius: 20px;
        font-size: 0.9em;
    }
    
    .priority-box {
        background: #f8f9fa;
        padding: 20px;
        border-radius: 10px;
        margin-bottom: 30px;
    }
    
    .priority-tabs {
        display: flex;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .priority-tab {
        padding: 10px 20px;
        background: white;
        border: 2px solid #dee2e6;
        border-radius: 5px;
        cursor: pointer;
        transition: all 0.3s;
    }
    
    .priority-tab.active {
        background: #007bff;
        color: white;
        border-color: #007bff;
    }
    
    .priority-content {
        display: none;
    }
    
    .priority-content.active {
        display: block;
    }
    
    .priority-item {
        background: white;
        padding: 15px;
        margin-bottom: 10px;
        border-radius: 5px;
        border-left: 4px solid #007bff;
    }
    
    .practice-tip {
        color: #28a745;
        font-style: italic;
        margin-top: 5px;
    }
    
    .vocab-group {
        margin-bottom: 40px;
    }
    
    .vocab-group h3 {
        color: #343a40;
        border-bottom: 2px solid #007bff;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }
    
    .group-function {
        color: #6c757d;
        font-style: italic;
        margin-bottom: 20px;
    }
    
    .vocab-cards {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .vocab-card {
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        transition: transform 0.2s;
    }
    
    .vocab-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 1px solid #e9ecef;
    }
    
    .term {
        font-size: 1.2em;
        font-weight: bold;
        color: #212529;
    }
    
    .pos {
        color: #6c757d;
        font-size: 0.9em;
        font-style: italic;
    }
    
    .register-badge {
        padding: 3px 8px;
        border-radius: 3px;
        font-size: 0.8em;
        font-weight: 500;
    }
    
    .register-badge.formal {
        background: #e3f2fd;
        color: #1976d2;
    }
    
    .register-badge.informal {
        background: #fff3e0;
        color: #f57c00;
    }
    
    .register-badge.neutral {
        background: #f5f5f5;
        color: #616161;
    }
    
    .definition {
        color: #495057;
        line-height: 1.6;
        margin-bottom: 15px;
    }
    
    .context-sentence {
        background: #f8f9fa;
        padding: 10px;
        border-radius: 5px;
        margin-bottom: 10px;
        color: #6c757d;
    }
    
    .collocations, .word-family {
        margin: 10px 0;
        padding: 10px;
        background: #f0f7ff;
        border-radius: 5px;
        font-size: 0.95em;
    }
    
    .l1-note {
        background: #fff3cd;
        padding: 10px;
        border-radius: 5px;
        margin-top: 10px;
        border-left: 3px solid #ffc107;
    }
    
    .common-errors {
        background: #f8d7da;
        padding: 10px;
        border-radius: 5px;
        margin-top: 10px;
        border-left: 3px solid #dc3545;
        color: #721c24;
    }
    
    .practice-section {
        background: #f8f9fa;
        padding: 30px;
        border-radius: 10px;
        margin-top: 40px;
    }
    
    .practice-activity {
        background: white;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    
    .gap-input {
        border: none;
        border-bottom: 2px solid #007bff;
        padding: 5px;
        font-size: 1em;
        width: 150px;
    }
    
    .option-btn {
        margin: 5px;
        padding: 5px 15px;
        background: #e9ecef;
        border: 1px solid #dee2e6;
        border-radius: 5px;
        cursor: pointer;
        transition: all 0.3s;
    }
    
    .option-btn:hover {
        background: #007bff;
        color: white;
    }
    
    .collocation-matching {
    margin: 20px 0;
}

.matching-columns {
    display: flex;
    gap: 40px;
    justify-content: center;
}

.left-column, .right-column {
    flex: 1;
    max-width: 200px;
}

.match-item {
    padding: 10px;
    margin: 10px 0;
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.match-item:hover {
    background: #e0e0e0;
    border-color: #007bff;
}

.match-item.selected {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.match-item.matched {
    background: #28a745;
    color: white;
    border-color: #1e7e34;
    cursor: default;
}

.formation-item, .synonym-item {
    padding: 10px;
    margin: 10px 0;
    background: #f8f9fa;
    border-left: 3px solid #007bff;
}

.usage-prompt {
    padding: 8px 0;
    color: #495057;
}

/* Gap fill wrong answer styling */
.option-btn.incorrect,
.practice-reveal.incorrect {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

/* Optional: Add a shake animation when wrong */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.option-btn.incorrect {
    animation: shake 0.3s;
}

.match-item.wrong {
    background: #f8d7da !important;
    border-color: #dc3545 !important;
    animation: shake 0.3s;
}

/* Preposition input styling */
.prep-input-container {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    align-items: center;
}

.prep-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: all 0.3s;
}

.prep-input:focus {
    outline: none;
    border-color: #007bff;
}

.check-answer-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.check-answer-btn:hover:not(:disabled) {
    background: #0056b3;
}

.check-answer-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Error correction styling */
.error-correction-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.error-item {
    padding: 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.error-text {
    color: #dc3545;
    font-weight: 500;
    margin-bottom: 10px;
}

.reveal-correction {
    padding: 8px 16px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.reveal-correction:hover {
    background: #138496;
}

.reveal-correction.active {
    background: #6c757d;
}

.correction-content {
    margin-top: 15px;
    padding: 15px;
    background: #d4edda;
    border-left: 4px solid #28a745;
    border-radius: 5px;
}

.correction-content .correction {
    color: #28a745;
    font-weight: 600;
    margin-bottom: 10px;
}

.correction-content .explanation {
    color: #155724;
    font-style: italic;
}

/* Word family hint */
.word-family-hint {
    font-size: 14px;
    color: #6c757d;
    margin: 10px 0;
    font-style: italic;
}

.word-family-input-group .feedback {
    min-width: 150px;
    font-weight: 600;
    font-size: 14px;
}
/* Word family gap fill styling */
.word-family-item {
    padding: 20px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
}

.word-family-text {
    font-size: 18px;
    margin-bottom: 10px;
}

.base-word {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 15px;
}

.word-family-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.word-family-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.word-family-input-group label {
    min-width: 60px;
    font-weight: 600;
}

.word-family-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.word-family-input:disabled {
    background: #d4edda;
    cursor: not-allowed;
}

.word-family-input-group .feedback {
    min-width: 100px;
    font-weight: 600;
    font-size: 14px;
}

.check-word-family {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.check-word-family:hover:not(:disabled) {
    background: #0056b3;
}

.check-word-family:disabled {
    cursor: not-allowed;
}

/*grammar targets 16 OCt*/
.grammar-deep-dive {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        max-width: 1200px;
        margin: 0 auto;
        line-height: 1.6;
    }
    
    .grammar-header {
        background: #F4F4F4; 
        color: #333;
        padding: 30px;
        border-radius: 10px;
        margin-bottom: 30px;
    }
    
    .grammar-meta {
        display: flex;
        gap: 20px;
        margin-top: 15px;
        flex-wrap: wrap;
    }
    
    .grammar-meta span {
        background: rgba(255, 255, 255, 0.2);
        padding: 5px 15px;
        border-radius: 20px;
        font-size: 0.9em;
    }
    
    .prerequisite-check {
        background: #fff3cd;
        padding: 20px;
        border-radius: 10px;
        margin-bottom: 30px;
        border-left: 4px solid #ffc107;
    }
    
    .prereq-items {
        display: grid;
        gap: 10px;
        margin-top: 15px;
    }
    
    .prereq-item {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        background: white;
        border-radius: 5px;
    }
    
    .prereq-structure {
        font-weight: 600;
        color: #495057;
    }
    
    .check-question {
        color: #6c757d;
        font-style: italic;
    }
    
    .grammar-structure-card {
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        padding: 30px;
        margin-bottom: 30px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .structure-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 20px;
        border-bottom: 2px solid #e9ecef;
        margin-bottom: 25px;
    }
    
    .structure-header h3 {
        color: #212529;
        margin: 0;
        font-size: 1.5em;
    }
    
    .cefr-level {
        background: #e7f3ff;
        color: #0056b3;
        padding: 5px 12px;
        border-radius: 15px;
        font-weight: 600;
        font-size: 0.9em;
    }
    
    .form-section, .uses-section, .examples-section, 
    .errors-section, .l1-interference, .contrasts-section, 
    .ccq-section {
        margin: 25px 0;
    }
    
    .form-section h4, .uses-section h4, .examples-section h4,
    .errors-section h4, .l1-interference h4, .contrasts-section h4,
    .ccq-section h4 {
        color: #495057;
        margin-bottom: 15px;
        font-size: 1.1em;
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 8px;
    }
    
    .form-grid {
        background: #f8f9fa;
        padding: 20px;
        border-radius: 8px;
    }
    
    .form-pattern {
        margin-bottom: 15px;
        font-size: 1.1em;
    }
    
    .form-pattern code {
        background: #fff;
        padding: 5px 10px;
        border-radius: 4px;
        font-family: "Courier New", monospace;
        color: #e83e8c;
        border: 1px solid #dee2e6;
    }
    
    .form-types {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 10px;
        margin-top: 15px;
    }
    
    .form-positive, .form-negative, .form-question, .form-short {
        padding: 10px;
        background: white;
        border-radius: 5px;
        border: 1px solid #dee2e6;
    }
    
    .form-positive { border-left: 3px solid #28a745; }
    .form-negative { border-left: 3px solid #dc3545; }
    .form-question { border-left: 3px solid #007bff; }
    .form-short { border-left: 3px solid #6c757d; }
    
    .uses-container {
        display: grid;
        gap: 15px;
    }
    
    .use-item {
        background: #f0f7ff;
        padding: 15px;
        border-radius: 8px;
        border-left: 3px solid #007bff;
    }
    
    .use-function {
        font-weight: 600;
        color: #0056b3;
        margin-bottom: 8px;
    }
    
    .use-example {
        color: #495057;
        margin: 8px 0;
        font-style: italic;
    }
    
    .time-markers, .typical-contexts {
        font-size: 0.9em;
        color: #6c757d;
        margin-top: 5px;
    }
    
    .text-examples {
        display: grid;
        gap: 15px;
    }
    
    .text-example {
        padding: 15px;
        background: #f8f9fa;
        border-radius: 8px;
    }
    
    .example-sentence mark {
        background: #fff3cd;
        padding: 2px 4px;
        border-radius: 3px;
        font-weight: 600;
    }
    
    .example-function {
        color: #28a745;
        margin-top: 8px;
        font-size: 0.95em;
    }
    
    .error-items {
        display: grid;
        gap: 15px;
    }
    
    .error-item {
        background: #f8d7da;
        padding: 15px;
        border-radius: 8px;
        border-left: 3px solid #dc3545;
    }
    
    .error-wrong {
        color: #721c24;
        margin-bottom: 5px;
    }
    
    .error-correct {
        color: #155724;
        font-weight: 600;
        margin-bottom: 5px;
    }
    
    .error-explanation {
        color: #495057;
        font-size: 0.95em;
        margin-top: 8px;
    }
    
    .l1-interference {
        background: #fff3cd;
        padding: 20px;
        border-radius: 8px;
        border-left: 4px solid #ffc107;
    }
    
    .interference-content p {
        margin: 10px 0;
    }
    
    .contrast-item {
        background: #f8f9fa;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 15px;
    }
    
    .contrast-item h5 {
        color: #495057;
        margin-bottom: 10px;
    }
    
    .contrast-difference {
        color: #6c757d;
        margin-bottom: 15px;
        font-style: italic;
    }
    
    .example-pair {
        display: grid;
        gap: 5px;
        padding: 15px;
        background: white;
        border-radius: 5px;
        margin-bottom: 10px;
    }
    
    .pair-a, .pair-b {
        padding: 8px;
        background: #e9ecef;
        border-radius: 4px;
    }
    
    .pair-explanation {
        color: #28a745;
        margin-top: 8px;
        font-style: italic;
    }
    
    .ccq-items {
        display: grid;
        gap: 15px;
    }
    
    .ccq-item {
        background: #e7f3ff;
        padding: 15px;
        border-radius: 8px;
    }
    
    .ccq-question {
        font-weight: 600;
        color: #0056b3;
        margin-bottom: 10px;
    }
    
    .ccq-reveal {
        background: #007bff;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 5px;
        cursor: pointer;
        transition: background 0.3s;
    }
    
    .ccq-reveal:hover {
        background: #0056b3;
    }
    
    .ccq-answer {
        margin-top: 10px;
        padding: 10px;
        background: white;
        border-radius: 5px;
    }
    
    .practice-progression {
        background: #f8f9fa;
        padding: 30px;
        border-radius: 10px;
        margin-top: 40px;
    }
    
    .practice-stage {
        background: white;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    
    .practice-stage.controlled {
        border-left: 4px solid #dc3545;
    }
    
    .practice-stage.guided {
        border-left: 4px solid #ffc107;
    }
    
    .practice-stage.free {
        border-left: 4px solid #28a745;
    }
    
    .stage-activity {
        color: #495057;
        margin: 10px 0;
    }
    
    .stage-examples, .stage-prompts {
        margin-top: 15px;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 5px;
    }
    
    .practice-example, .practice-prompt {
        padding: 5px 0;
        color: #6c757d;
    }
    
    .timeline-section {
        background: #e9ecef;
        padding: 30px;
        border-radius: 10px;
        margin-top: 40px;
    }
    
    .timeline-activity {
        background: white;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    
    .timeline-description {
        color: #495057;
        margin: 10px 0;
    }
    
    .timeline-example {
        color: #6c757d;
        font-style: italic;
        margin: 10px 0;
    }
    
    .timeline-visual {
        padding: 20px;
        background: #f8f9fa;
        border: 2px dashed #dee2e6;
        border-radius: 5px;
        text-align: center;
        color: #6c757d;
        margin-top: 15px;
    }

/* Alternative Color Scheme (if you prefer a different look) */
/* Uncomment this section for a warmer, educational feel:

.tp-grammar-points {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2px;
}

.tp-grammar-points > * {
    background: white;
    border-radius: 10px;
    padding: 2rem;
}

.tp-grammar-points h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
*/
/* ============================================
   GRAMMAR MODULE STYLES
   New classes for talking_points_grammar system
   ============================================ */

/* Main Container */
.grammar-module {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Grammar Quiz Section */
.grammar-quiz-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.grammar-quiz-section h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.grammar-quiz-section .quiz-instructions {
    color: #666;
    margin-bottom: 25px;
    font-style: italic;
}

/* Grammar Question Container */
.grammar-question-pair {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.grammar-question {
    position: relative;
}

/* Grammar Question Header */
.grammar-question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 6px;
    border-left: 4px solid #2196f3;
}

.grammar-form-label {
    font-size: 14px;
    color: #1976d2;
}

.grammar-form-label strong {
    color: #0d47a1;
    font-weight: 600;
}

.grammar-function-label {
    font-size: 13px;
    color: #555;
    font-style: italic;
}

/* Example from Story */
.example-from-story {
    margin: 15px 0;
    padding: 12px 15px;
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    border-radius: 4px;
}

.example-text {
    margin: 0;
    font-style: italic;
    color: #555;
    line-height: 1.6;
}

.example-text::before {
    content: '💬 ';
    margin-right: 5px;
}

/* Story Comprehension Section */
.story-comprehension-section {
    margin: 30px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.story-comprehension-section h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.comprehension-question {
    margin-bottom: 25px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 2px solid #ddd;
}

.question-type-label {
    display: inline-block;
    padding: 4px 10px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    background: #e8f5e9;
    color: #2e7d32;
}

.comprehension-question[data-type="factual"] .question-type-label {
    background: #e3f2fd;
    color: #1565c0;
}

.comprehension-question[data-type="inferential"] .question-type-label {
    background: #fff3e0;
    color: #e65100;
}

/* Grammar Reference Section */
.grammar-reference-section {
    margin-top: 40px;
}

.grammar-reference-section .vocab-box-header h3 {
    color: #5e35b1;
}

.grammar-form-reference {
    margin-bottom: 25px;
    padding: 15px;
    background: #fafafa;
    border-radius: 6px;
    border-left: 4px solid #7e57c2;
}

.grammar-form-reference h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #5e35b1;
    font-size: 18px;
}

.form-analysis {
    margin-bottom: 15px;
}

.form-analysis p {
    margin: 8px 0;
    line-height: 1.6;
}

.form-analysis strong {
    color: #333;
}

.usage-clusters-summary {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.usage-clusters-summary p {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.usage-clusters-summary ul {
    margin: 5px 0;
    padding-left: 25px;
}

.usage-clusters-summary li {
    margin: 5px 0;
    color: #666;
}

/* Grammar Focus Preview (in story section) */
.grammar-focus-preview {
    margin-top: 20px;
    padding: 15px;
    background: #f3e5f5;
    border-radius: 6px;
    border-left: 3px solid #9c27b0;
}

.grammar-focus-preview h4 {
    margin: 0 0 10px 0;
    color: #7b1fa2;
    font-size: 16px;
}

.grammar-forms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.grammar-form-tag {
    display: inline-block;
    padding: 6px 12px;
    background: white;
    border: 2px solid #ba68c8;
    border-radius: 20px;
    color: #7b1fa2;
    font-weight: 500;
    font-size: 14px;
}

/* Success Messages */
.all-grammar-complete {
    margin: 20px 0;
    padding: 20px;
    background: #e8f5e9;
    border: 2px solid #66bb6a;
    border-radius: 8px;
    text-align: center;
}

.all-grammar-complete .success-message {
    color: #2e7d32;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Italian Note (grammar-specific styling) */
.grammar-question .italian-note {
    margin-top: 15px;
    padding: 12px;
    background: #fff8e1;
    border-left: 3px solid #ffa726;
    border-radius: 4px;
    font-size: 14px;
    color: #e65100;
}

.grammar-question .italian-note strong {
    color: #bf360c;
}

/* Story Body in Grammar Module */
.grammar-module .story-body {
    line-height: 1.8;
    color: #333;
    margin: 15px 0;
}

.grammar-module .story-lead {
    font-size: 16px;
    font-weight: 500;
    color: #444;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .grammar-module {
        padding: 15px;
    }
    
    .grammar-question-pair {
        padding: 15px;
    }
    
    .grammar-question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .grammar-forms-list {
        flex-direction: column;
        gap: 5px;
    }
    
    .grammar-form-tag {
        display: block;
        text-align: center;
    }
}

/* Print Styles */
@media print {
    .grammar-module .vocab-toggle-btn {
        display: none;
    }
    
    .grammar-module .vocab-content-wrapper {
        display: block !important;
    }
    
    .grammar-quiz-section,
    .story-comprehension-section {
        page-break-inside: avoid;
    }
}


/* Grammar Highlights Styling */
.ysp-lc-grammar-highlights-module {
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.grammar-highlights-header {
    margin-bottom: 20px;
}

.grammar-highlights-header h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-badge {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: bold;
}

.grammar-meta-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.story-context {
    line-height: 1.8;
    text-align: justify;
    font-size: 1.05em;
    color: #333;
}

.grammar-form-block {
    margin-bottom: 30px;
    padding: 15px;
    background: white;
    border-left: 4px solid #2196F3;
    border-radius: 4px;
}

.grammar-form-title {
    color: #2196F3;
    font-size: 1.2em;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.cluster-note {
    color: #666;
    font-size: 0.95em;
    margin: 5px 0 15px 0;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 4px;
}

.grammar-examples {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.grammar-example-item {
    padding: 12px 15px;
    background: #fafafa;
    border-radius: 6px;
    border-left: 3px solid #4CAF50;
}

.example-sentence {
    margin: 0 0 8px 0;
    font-size: 1.05em;
    line-height: 1.6;
    color: #333;
}

.grammar-highlight {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    color: #000;
}

.function-label {
    margin: 0;
    color: #4CAF50;
    font-size: 0.9em;
    font-style: italic;
}

.study-tip-text {
    margin: 0;
    font-size: 1.05em;
    line-height: 1.7;
    color: #1976d2;
    font-weight: 500;
}

/* Grammar example visibility toggle */
.grammar-example-hidden {
    display: none;
}

.grammar-example-visible {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.show-more-examples {
    margin-top: 10px;
    background: #e3f2fd;
    border: 1px solid #2196F3;
    color: #2196F3;
    cursor: pointer;
    font-size: 0.9em;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.show-more-examples:hover {
    background: #2196F3;
    color: white;
}

/* Two Column Layout */
.two-column-container {
    display: flex;
    gap: 4%;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .two-column-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .column-left, .column-right {
        width: 100% !important;
    }
}

/* Comparison Box */
.comparison-container {
    display: flex;
    gap: 20px;
    position: relative;
    align-items: stretch;
}

@media (max-width: 768px) {
    .comparison-container {
        flex-direction: column;
        gap: 40px;
    }
    
.comparison-container > div[style*="position: absolute"] {
        position: relative !important;
        transform: none !important;
        left: auto !important;
        top: auto !important;
        margin: -20px auto;
    }
}

.comparison-left, .comparison-right {
    flex: 1;
    border-radius: 8px;
    padding: 20px;
}

/* Pink highlighting for translation differences */
.translation-item.translation-different {
    background: rgba(255, 224, 240, 0.8) !important;
    border-left: 3px solid #ff1493 !important;
}

.translation-item.translation-different .item-label {
    color: #c71585 !important;
}

.different-badge {
    display: inline-block;
    background: #ff1493;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

/* Module Header */
.ysp-lc-module-header {
    background: #e8eaf6;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.module-header-container {
    display: flex;
    gap: 30px;
    align-items: center;
}

.module-header-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.module-header-text h1 {
    margin: 0 0 15px 0;
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
}

.module-header-text h2 {
    margin: 0 0 12px 0;
    font-size: 1.3em;
    font-weight: bold;
    color: #34495e;
    line-height: 1.6;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .module-header-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .module-header-image,
    .module-header-text {
        order: unset !important;
        flex: 1 1 100% !important;
        width: 100%;
    }
    
    .module-header-text h1 {
        font-size: 1.5em;
    }
    
    .module-header-text h2 {
        font-size: 1.1em;
    }
}

/* NEW 12 NOV CSS FOR SINGLE TERM MULTI PATTERNS */
.single-term-teaching-module {
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        line-height: 1.6;
        color: #333;
    }
    
    /* Header - Complete box for title, badges, and summary */
.teaching-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.term-title {
    font-size: 48px;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.2;
}

.term-highlight {
    color: #4CAF50;
    font-weight: bold;
    font-size: 52px;
}

/* Mobile override */
@media (max-width: 768px) {
    .term-title {
        font-size: 28px;  /* Much smaller on mobile */
    }
    
    .term-highlight {
        font-size: 32px;  /* Proportionally smaller */
    }
    
    .teaching-header {
        padding: 20px 15px;  /* Less padding on mobile too */
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .term-title {
        font-size: 24px;  /* Even smaller */
    }
    
    .term-highlight {
        font-size: 28px;
    }
}

.frequency-badge {
    display: inline-block;
    padding: 12px 24px;
    background: #e8f5e9;
    border-radius: 24px;
    margin: 15px 0;
    border: 2px solid #4CAF50;
    font-size: 1em;
}

.badge-label {
    font-weight: bold;
    color: #2c3e50;
}

.badge-value {
    color: #4CAF50;
    font-weight: bold;
}

.teaching-summary {
    margin-top: 25px;
    padding: 20px;
    background: #fff8dc;
    border-left: 5px solid #ffd700;
    border-radius: 6px;
    font-size: 1.05em;
    text-align: left;
    line-height: 1.7;
}
    
    /* Section styles */
    .section-title {
        font-size: 2em;
        color: #2c3e50;
        margin: 40px 0 15px 0;
        padding-bottom: 10px;
        border-bottom: 2px solid #e0e0e0;
    }
    
    .section-intro {
        font-size: 1.1em;
        color: #666;
        margin-bottom: 25px;
    }
    
    /* Semantic Clusters */
    .clusters-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        margin-top: 20px;
    }
    
    .cluster-card {
        background: white;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    .cluster-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .cluster-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .cluster-number {
        background: #4CAF50;
        color: white;
        padding: 5px 12px;
        border-radius: 4px;
        font-weight: bold;
        font-size: 0.9em;
        white-space: nowrap;
    }
    
    .cluster-name {
        font-size: 1.3em;
        color: #2c3e50;
        margin: 0;
        flex-grow: 1;
    }
    
    .cluster-explanation {
        margin: 15px 0;
        color: #555;
    }
    
    .cluster-example {
        background: #f0f8ff;
        padding: 10px;
        border-radius: 4px;
        margin: 10px 0;
        font-style: italic;
    }
    
    .example-label {
        font-weight: bold;
        color: #4CAF50;
        font-style: normal;
    }
    
    .cluster-tip {
        background: #fff8dc;
        padding: 10px;
        border-radius: 4px;
        margin-top: 10px;
        font-size: 0.95em;
    }
    
    .tip-icon {
        font-size: 1.2em;
    }
    
    /* Grammatical Patterns */
    .pattern-block {
        background: white;
        border: 2px solid #e0e0e0;
        border-left: 4px solid #2196F3;
        border-radius: 4px;
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .pattern-header {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 15px;
        flex-wrap: wrap;
    }
    
    .pattern-number {
        background: #2196F3;
        color: white;
        padding: 5px 12px;
        border-radius: 4px;
        font-weight: bold;
        font-size: 0.9em;
    }
    
    .pattern-cluster-link {
        background: #4CAF50;
        color: white;
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 0.85em;
        cursor: pointer;
        transition: background 0.2s;
    }
    
    .pattern-cluster-link:hover {
        background: #45a049;
    }
    
    .pattern-formula {
        background: #f5f5f5;
        padding: 8px 15px;
        border-radius: 4px;
        font-family: "Courier New", monospace;
        font-size: 1.1em;
        color: #d32f2f;
        border: 1px solid #ddd;
        flex-grow: 1;
    }
    
    .pattern-explanation {
        margin: 15px 0;
        color: #555;
    }
    
    .pattern-example {
        background: #e3f2fd;
        padding: 12px;
        border-radius: 4px;
        margin: 12px 0;
    }
    
    .pattern-error-alert {
        background: #fff3cd;
        border-left: 4px solid #ff9800;
        padding: 12px;
        margin-top: 12px;
        border-radius: 4px;
    }
    
    .alert-icon {
        font-size: 1.2em;
    }
    
    /* Register Section */
    .register-comparison-table {
        margin-top: 20px;
    }
    
    .register-row {
        display: grid;
        grid-template-columns: 1fr 50px 1fr;
        gap: 15px;
        align-items: center;
        margin-bottom: 20px;
        padding: 15px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .register-column {
        padding: 15px;
        border-radius: 4px;
    }
    
    .register-column.informal {
        background: #ffe0b2;
        border: 2px solid #ff9800;
    }
    
    .register-column.formal {
        background: #e8eaf6;
        border: 2px solid #3f51b5;
    }
    
    .register-label {
        font-weight: bold;
        font-size: 0.85em;
        text-transform: uppercase;
        margin-bottom: 8px;
        color: #666;
    }
    
    .register-example {
        font-size: 1.05em;
        color: #333;
    }
    
    .register-arrow {
        text-align: center;
        font-size: 2em;
        color: #4CAF50;
        font-weight: bold;
    }
    
    .register-note {
        grid-column: 1 / -1;
        background: #f5f5f5;
        padding: 10px;
        border-radius: 4px;
        font-size: 0.95em;
        margin-top: 10px;
    }
    
    .note-icon {
        font-size: 1.1em;
    }
    
    /* Verb Forms */
    .forms-table table {
        width: 100%;
        border-collapse: collapse;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .forms-table th {
        background: #4CAF50;
        color: white;
        padding: 12px;
        text-align: left;
        font-weight: bold;
    }
    
    .forms-table td {
        padding: 12px;
        border-bottom: 1px solid #e0e0e0;
        font-size: 1.1em;
    }
    
    .forms-table tr:last-child td {
        border-bottom: none;
    }
    
    .forms-note {
        background: #fff8dc;
        padding: 12px;
        border-radius: 4px;
        margin-top: 15px;
    }
    
    /* Collocations */
    .collocations-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        margin-top: 20px;
    }
    
    .collocation-card {
        background: white;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .collocation-type {
        background: #9c27b0;
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        font-size: 0.85em;
        font-weight: bold;
        display: inline-block;
        margin-bottom: 12px;
    }
    
    .collocation-examples {
        list-style: none;
        padding: 0;
        margin: 12px 0;
    }
    
    .collocation-examples li {
        padding: 6px 0;
        padding-left: 20px;
        position: relative;
    }
    
    .collocation-examples li:before {
        content: "✓";
        position: absolute;
        left: 0;
        color: #4CAF50;
        font-weight: bold;
    }
    
    .collocation-freq {
        margin-top: 10px;
    }
    
    .freq-badge {
        background: #e3f2fd;
        color: #1976d2;
        padding: 3px 8px;
        border-radius: 3px;
        font-size: 0.85em;
        font-weight: bold;
    }
    
    .collocation-pattern-link {
        margin-top: 8px;
        color: #666;
    }
    
    /* Common Errors */
    .errors-list {
        display: grid;
        gap: 20px;
        margin-top: 20px;
    }
    
    .error-card {
        background: white;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .error-header {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 15px;
    }
    
    .error-type-badge {
        background: #9c27b0;
        color: white;
        padding: 5px 12px;
        border-radius: 4px;
        font-size: 0.85em;
        font-weight: bold;
    }
    
    .error-cluster-badge,
    .error-pattern-badge {
        background: #4CAF50;
        color: white;
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 0.8em;
        cursor: pointer;
        transition: background 0.2s;
    }
    
    .error-cluster-badge:hover,
    .error-pattern-badge:hover {
        background: #45a049;
    }
    
    .error-incorrect {
        background: #ffebee;
        border-left: 4px solid #f44336;
        padding: 12px;
        margin: 10px 0;
        border-radius: 4px;
    }
    
    .error-icon {
        font-size: 1.2em;
        color: #f44336;
    }
    
    .error-correct {
        background: #e8f5e9;
        border-left: 4px solid #4CAF50;
        padding: 12px;
        margin: 10px 0;
        border-radius: 4px;
    }
    
    .correct-icon {
        font-size: 1.2em;
        color: #4CAF50;
        font-weight: bold;
    }
    
    .error-explanation {
        margin: 15px 0;
        color: #555;
    }
    
    /* Phrasal Verbs & Idioms Notes */
    .phrasal-verbs-note-section,
    .idioms-note-section {
        background: #f5f5f5;
        border-radius: 8px;
        padding: 25px;
        margin-top: 30px;
    }
    
    .pv-examples,
    .idiom-list {
        margin: 20px 0;
    }
    
    .pv-item {
        background: white;
        padding: 12px;
        margin: 10px 0;
        border-radius: 4px;
        border-left: 4px solid #2196F3;
    }
    
    .pv-term {
        color: #2196F3;
        font-size: 1.1em;
    }
    
    .pv-freq {
        color: #666;
        font-size: 0.9em;
        font-style: italic;
    }
    
    .idiom-list {
        list-style: none;
        padding: 0;
    }
    
    .idiom-item {
        background: white;
        padding: 12px;
        margin: 10px 0;
        border-radius: 4px;
        border-left: 4px solid #ff9800;
    }
    
    .pv-more,
    .idiom-more {
        margin-top: 20px;
        color: #666;
    }
    /* Priority badge in header */
.priority-badge {
    font-size: 0.75em;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-badge.essential {
    background: #d4edda;
    color: #155724;
}

.priority-badge.important {
    background: #fff3cd;
    color: #856404;
}

.priority-badge.useful {
    background: #e7f3ff;
    color: #004085;
}

/* Pattern formula inline */
.pattern-formula-inline {
    background: #f5f5f5;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 12px 0;
    border-left: 3px solid #2196F3;
}

.pattern-formula-inline code {
    font-family: "Courier New", monospace;
    color: #d32f2f;
    font-weight: 600;
}

/* Slot schema */
.slot-schema {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 4px;
    margin: 12px 0;
    font-size: 0.95em;
}

.slot-item {
    margin: 6px 0;
}

.slot-label {
    font-weight: 600;
    color: #666;
    min-width: 90px;
    display: inline-block;
}

.slot-values {
    color: #2196F3;
    font-family: monospace;
}

/* Constraint note */
.cluster-constraint {
    background: #fff3cd;
    border-left: 3px solid #ff9800;
    padding: 10px;
    margin-top: 12px;
    border-radius: 4px;
    font-size: 0.9em;
}
    
    
    
    /* Responsive */
    @media (max-width: 768px) {
        .clusters-grid {
            grid-template-columns: 1fr;
        }
        
        .register-row {
            grid-template-columns: 1fr;
        }
        
        .register-arrow {
            transform: rotate(90deg);
            grid-row: 2;
        }
        
        .collocations-grid {
            grid-template-columns: 1fr;
        }
        
        .pattern-header {
            flex-direction: column;
            align-items: flex-start;
        }
    } /* Close @media (max-width: 768px) */
    
    
    /* ========================================
   GRAMMAR HIGHLIGHTS QUIZ STYLES
   ======================================== */

.ysp-grammar-quiz-block {
    max-width: 800px;
    margin: 30px auto;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ysp-quiz-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.ysp-quiz-header h3 {
    color: #1976d2;
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: 600;
}

.ysp-quiz-instructions {
    color: #666;
    font-size: 1.05em;
    margin: 0;
}

.ysp-grammar-question {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    border-left: 4px solid #1976d2;
}

.ysp-grammar-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    margin-bottom: 10px;
    font-weight: 500;
}

.ysp-question-text {
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.5;
}

.ysp-question-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ysp-grammar-choice {
    background: white;
    border: 2px solid #ddd;
    padding: 15px;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1em;
    color: #333;
    width: 100%;
}

.ysp-grammar-choice:hover:not(:disabled):not(.answered) {
    border-color: #1976d2;
    background: #f0f7ff;
    transform: translateX(5px);
}

.ysp-grammar-choice:disabled,
.ysp-grammar-choice.answered {
    cursor: not-allowed;
}

.ysp-grammar-choice.ysp-grammar-correct {
    background: #e8f5e9 !important;
    border-color: #4caf50 !important;
    color: #2e7d32;
    font-weight: 500;
}

.ysp-grammar-choice.ysp-grammar-incorrect {
    background: #ffebee !important;
    border-color: #f44336 !important;
    color: #c62828;
}

.ysp-question-feedback {
    margin-top: 15px;
    padding: 15px;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 6px;
}

.ysp-feedback-rationale {
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* Results Styles */
.ysp-grammar-results {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.ysp-grammar-results.show {
    opacity: 1;
    transform: translateY(0);
}

.ysp-grammar-results.excellent {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.ysp-grammar-results.good {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.ysp-grammar-results.needs-practice {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.ysp-results-content {
    max-width: 500px;
    margin: 0 auto;
}

.ysp-score-display {
    margin-bottom: 20px;
}

.ysp-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    border: 4px solid rgba(255,255,255,0.5);
}

.ysp-score-number {
    font-size: 2.5em;
    font-weight: bold;
}

.ysp-score-message {
    font-size: 1.3em;
    margin: 10px 0;
}

.ysp-recommendation {
    background: rgba(255,255,255,0.15);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 1.05em;
}

/* Responsive */
@media (max-width: 600px) {
    .ysp-grammar-quiz-block {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .ysp-quiz-header h3 {
        font-size: 1.5em;
    }
    
    .ysp-grammar-question {
        padding: 18px;
    }
    
    .ysp-grammar-choice {
        padding: 14px 16px;
        font-size: 1em;
    }
}



/* ========================================
   STORY COMPREHENSION QUIZ STYLES
   ======================================== */

.ysp-comp-quiz-block {
    max-width: 800px;
    margin: 30px auto;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ysp-comp-question {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

.ysp-summary-question {
    border-left-color: #ff9800;
    background: #fff8e1;
}

.ysp-comp-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    margin-bottom: 10px;
    font-weight: 500;
    text-transform: capitalize;
}

.ysp-summary-badge {
    background: #ffe0b2;
    color: #e65100;
}

.ysp-comp-choice {
    background: white;
    border: 2px solid #ddd;
    padding: 15px;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1em;
    color: #333; /* base text color */
    width: 100%;
}

.ysp-comp-choice:hover:not(:disabled):not(.answered) {
    border-color: #2196f3;
    background: #f0f7ff;
    transform: translateX(5px);
    color: #333; /* 🔒 lock text color */
}

.ysp-comp-choice:disabled,
.ysp-comp-choice.answered {
    cursor: not-allowed;
}

.ysp-comp-choice.ysp-comp-correct {
    background: #e8f5e9 !important;
    border-color: #4caf50 !important;
    color: #2e7d32;
    font-weight: 500;
}

.ysp-comp-choice.ysp-comp-incorrect {
    background: #ffebee !important;
    border-color: #f44336 !important;
    color: #c62828;
}

/* Summary choices are larger for longer text */
.ysp-summary-choice {
    padding: 20px;
    line-height: 1.6;
    min-height: 120px;
    display: flex;
    align-items: center;
}

/* Results Styles - reuse from grammar quiz */
.ysp-comp-results {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.ysp-comp-results.show {
    opacity: 1;
    transform: translateY(0);
}

.ysp-comp-results.excellent {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.ysp-comp-results.good {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.ysp-comp-results.needs-practice {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Responsive */
@media (max-width: 600px) {
    .ysp-comp-quiz-block {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .ysp-comp-question {
        padding: 18px;
    }
    
    .ysp-comp-choice {
        padding: 14px 16px;
    }
    
    .ysp-summary-choice {
        min-height: auto;
        padding: 16px;
    }
}

/* GS HIGHLIGHTS CEFR Tier Badges */
.cefr-tier-badge {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.cefr-tier-badge.tier-a2 {
    background: #c8e6c9;
    color: #2e7d32;
}

.cefr-tier-badge.tier-b1 {
    background: #fff3e0;
    color: #e65100;
}

.cefr-tier-badge.tier-b2 {
    background: #e3f2fd;
    color: #1565c0;
}

.cefr-tier-badge.tier-c1 {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Form header layout */
.grammar-form-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.instance-count {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

/* Function group styling */
.grammar-function-group {
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 2px solid #e0e0e0;
}

.function-label-header {
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 6px;
    font-size: 0.9em;
}

/* Level analysis grid */
.level-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.level-analysis-group h6 {
    margin: 0 0 6px 0;
    font-size: 0.9em;
}

.level-forms {
    font-size: 0.85em;
    color: #555;
    margin: 0;
}

/* GS_Grammar_quiz_ refactored_CEFR tier badge colors (match highlights module) */
.ysp-grammar-badge.tier-a2 {
    background: #c8e6c9;
    color: #2e7d32;
}

.ysp-grammar-badge.tier-b1,
.ysp-grammar-badge.tier-b1b2 {
    background: #fff3e0;
    color: #e65100;
}

.ysp-grammar-badge.tier-b2 {
    background: #e3f2fd;
    color: #1565c0;
}

.ysp-grammar-badge.tier-c1 {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Question type label */
.ysp-question-type-label {
    font-size: 0.8em;
    color: #666;
    margin-left: 10px;
}

/* Forms covered summary */
.ysp-quiz-forms-covered {
    font-size: 0.9em;
    color: #555;
    font-style: italic;
    margin-top: 8px;
}

/* Feedback enhancements */
.ysp-feedback-source {
    font-size: 0.9em;
    color: #444;
    background: #f5f5f5;
    padding: 8px 12px;
    border-left: 3px solid #1976d2;
    margin-bottom: 8px;
}

.ysp-feedback-source .grammar-highlight {
    background: #fff59d;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 600;
}

.ysp-feedback-function {
    font-size: 0.85em;
    color: #1976d2;
    font-weight: 500;
    margin-bottom: 6px;
}

.ysp-feedback-rationale {
    font-size: 0.9em;
    line-height: 1.5;
}

/* Catalog version styling */
.ysp-lc-grammar-highlights-module.catalog-version {
    border-left: 4px solid #1976d2;
}

.showcase-subtitle {
    font-size: 0.9em;
    color: #666;
    margin-top: -8px;
    font-style: italic;
}

/* Catalog code badge */
.catalog-code-badge {
    background: #e3f2fd;
    color: #1565c0;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    margin-right: 6px;
}

/* Teaching mode block */
.grammar-form-block.teaching-mode {
    background: #fafafa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

/* Teaching note (longer cluster note) */
.cluster-note.teaching-note {
    background: #fff;
    padding: 12px;
    border-left: 3px solid #4caf50;
    margin: 12px 0;
    line-height: 1.6;
}

/* Formation pattern */
.formation-pattern {
    margin: 10px 0;
    font-size: 0.9em;
}

.formation-pattern code {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}

/* Common errors */
.common-errors {
    background: #fff3e0;
    padding: 10px 14px;
    border-radius: 6px;
    margin: 12px 0;
    font-size: 0.9em;
}

.common-errors ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.common-errors li {
    margin-bottom: 4px;
    color: #e65100;
}

/* Example teaching note */
.example-teaching-note {
    font-size: 0.85em;
    color: #2e7d32;
    margin: 4px 0 8px 16px;
    font-style: italic;
}

/* Practice prompts */
.practice-prompts {
    background: #e8f5e9;
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 0.9em;
}

.practice-prompts ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.practice-prompts li {
    margin-bottom: 4px;
    color: #1b5e20;
}




/* ═══════════════════════════════════════════════════════════════
   OUTER COLLAPSIBLE SECTION — wraps long content blocks
   (e.g. vocabulary recap) without interfering with inner toggles
   ═══════════════════════════════════════════════════════════════ */
 
.ysp-lc-collapsible-section {
    margin: 1.5rem 0;
}
 
.ysp-collapsible-header {
    background: #e0f2f1;
    border-left: 4px solid #005f73;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px;
    margin-bottom: 2px;
    user-select: none;
    -webkit-user-select: none;
}
 
.ysp-collapsible-header:hover {
    background: #d5edeb;
}
 
.ysp-collapsible-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #005f73;
    margin: 0;
}
 
.ysp-collapsible-subtitle {
    font-size: 0.85em;
    color: #555;
    margin-left: 8px;
}
 
.ysp-collapsible-icon {
    font-size: 1.2em;
    color: #005f73;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
    margin-left: 12px;
}
 
.ysp-collapsible-body {
    padding: 16px 0 0 0;
}
 
 
 
/* Debrief audio script toggle box */
.ysp-lc-debrief-box {
    border-left: 4px solid #6366f1;  /* indigo accent — distinct from vocab green/teacher blue */
    background: #f5f3ff;
}
.ysp-lc-debrief-box .vocab-box-header h4::before {
    content: "🎧 ";
}
