/* Import font Nunito bo tròn, đẹp */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap');

/* --- Collection Styles --- */
.fc-collection-wrap { max-width: 800px; margin: 20px auto; padding: 20px; font-family: 'Nunito', sans-serif; }
.fc-collection-header { display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 20px; min-height: 40px; }
.fc-collection-main-title { font-size: 28px; margin: 0; text-align: center; padding: 0 40px; font-weight: 700; color: #2c3e50; }
.fc-back-to-parent {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #555;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}
.fc-collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 30px; justify-items: center; }
.fc-collection-item { cursor: pointer; text-align: center; transition: transform 0.2s; }
.fc-collection-item:hover { transform: scale(1.05); }
.fc-collection-icon { width: 80px; height: 80px; color: white; display: flex; justify-content: center; align-items: center; font-size: 32px; font-weight: bold; margin: 0 auto 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); border: 3px solid white; transition: background .3s, opacity .3s; }
.fc-collection-title { font-size: 15px; color: #333; font-weight: 600; }

.fc-collection-grid[data-item-type="set"] .fc-collection-icon {
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.fc-collection-grid[data-item-type="collection"] .fc-collection-icon {
    border-radius: 20px;
    background: linear-gradient(135deg, #0ba360, #3cba92);
}
.fc-collection-grid[data-item-type="collection"] .fc-item-number {
    font-family: serif;
    font-style: italic;
}

.fc-collection-item.completed .fc-collection-icon { background: #bdc3c7 !important; opacity: 0.7; }
.fc-collection-item.completed .fc-collection-icon span { text-decoration: line-through; }

.fc-complete-button-wrapper { text-align: center; margin-top: 30px; }
.fc-complete-set { background: #27ae60; color: #fff; }
.fc-complete-next { background: #3498db; color: #fff; } 
.fc-collection-footer { text-align: center; margin-top: 30px; }
.fc-complete-collection { background: #e67e22; color: #fff; }

.fc-login-prompt { text-align: center; margin-bottom: 20px; background: #fffbe5; padding: 10px; border-radius: 5px; border: 1px solid #ffe8a0; }
.fc-continue-prompt { background-color: #eaf5ff; border: 1px solid #b8d9f3; border-radius: 8px; padding: 15px; margin-bottom: 25px; text-align: center; }
.fc-continue-prompt p { margin: 0 0 10px; font-size: 16px; }
.fc-continue-prompt .fc-btn { margin: 0 5px; }
#fc-continue-yes { background-color: #27ae60; }
#fc-continue-no { background-color: #7f8c8d; }

/* --- Flashcard Styles --- */
.fc-wrap {
    max-width: 600px;
    margin: 20px auto;
    padding: 0;
    font-family: 'Nunito', sans-serif; 
}

.fc-header{
    display:grid;
    grid-template-areas:"title actions" "progress progress";
    grid-template-columns:1fr auto;
    align-items:center;
    text-align:center;
    margin-bottom:15px;
}
.fc-header h3{
    grid-area:title;
    margin:0;
    justify-self:center;
    padding-left:80px;
    font-size:24px;
    font-weight:700;
}
.fc-progress{
    grid-area:progress;
    display:flex;
    justify-content:center;
    gap:20px;
    margin-top:10px;
    font-size:14px;
    font-weight:600;
}
.fc-header-actions{
    grid-area:actions;
    justify-self:end;
    display:flex;
    align-items:center;
    gap:8px;
}
.fc-swap-sides{
    background:#8e44ad;
    color:#fff;
    border:none;
    padding:8px 12px;
    border-radius:20px;
    cursor:pointer;
    font-size:12px;
}
.fc-swap-sides.active{background:#27ae60}

.fc-audio-open{
    background:linear-gradient(135deg,#ff9f43,#ff6b6b);
    color:#fff;
    border:none;
    padding:8px 12px;
    border-radius:20px;
    cursor:pointer;
    font-size:14px;
}
.fc-audio-open:hover{
    transform:translateY(-2px);
    box-shadow:0 6px 18px rgba(255,107,107,.35);
}

.fc-card{position:relative;perspective:1200px;width:100%;min-height:280px;height:clamp(280px, 45vh, 450px)}
.fc-inner{position:relative;width:100%;height:100%;transition:transform .6s;transform-style:preserve-3d;cursor:pointer}
.fc-inner.flipped{transform:rotateY(180deg)}
.fc-face{position:absolute;width:100%;height:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;box-sizing:border-box;border-radius:20px;box-shadow:0 8px 25px rgba(0,0,0,.15);font-size:22px;text-align:center;overflow:hidden}
.fc-text-content{width:100%;max-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;white-space:pre-wrap;word-wrap:break-word;word-break:break-word;line-height:1.5;overflow:visible;box-sizing:border-box;padding:10px}
.fc-front{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff}
.fc-back{background:linear-gradient(135deg,#f093fb,#f5576c);color:#fff;transform:rotateY(180deg)}
.fc-image-container{max-height:100%;margin:0;padding:0;width:100%;height:100%;display:none;align-items:center;justify-content:center}
.fc-image-container img{max-width:100%;max-height:100%;height:auto;border-radius:8px;object-fit:contain}
.fc-inner.image-only .fc-face.fc-front{padding:0}
.fc-btns{text-align:center;margin-top:20px}
.fc-shortcut-guide,.fc-shortcut-guide-quiz,.fc-shortcut-guide-write{color:#888;font-size:14px;margin-top:15px;text-align:center}
.fc-btn-row{margin:10px 0}
.fc-btn{padding:12px 25px;margin:5px;border:none;border-radius:25px;cursor:pointer;font-size:16px;font-weight:700;transition:all .3s; font-family: 'Nunito', sans-serif;}
.fc-btn:hover{transform:translateY(-2px);box-shadow:0 4px 15px rgba(0,0,0,.2)}
.fc-hard{background:#e74c3c;color:#fff}
.fc-easy{background:#27ae60;color:#fff}
.fc-quiz{background:#9b59b6;color:#fff}
.fc-write{background:#3498db;color:#fff}
.fc-restart,.fc-export,.fc-quiz-exit,.fc-quiz-restart,.fc-back-flashcard,.fc-write-exit{background:#34495e;color:#fff;margin-top:15px}
.fc-restart-hard,.fc-quiz-restart-wrong{background:#e74c3c;color:#fff;margin-top:15px}
.fc-summary{display:flex;gap:20px;justify-content:center;margin:20px 0}
.fc-stat{padding:15px 30px;background:#f8f9fa;border-radius:10px;font-size:18px;font-weight:600}
.fc-lists{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:20px 0}
.fc-list{padding:15px;background:#f8f9fa;border-radius:10px}
.fc-list h4{margin:0 0 15px;text-align:center}
.fc-list div div{padding:8px;margin:5px 0;background:#fff;border-left:4px solid #3498db;border-radius:5px;font-size:14px}
.fc-quiz-mode,.fc-quiz-results,.fc-results,.fc-writing-mode{background:#fff;padding:20px;border-radius:15px;box-shadow:0 4px 20px rgba(0,0,0,.1)}
.fc-quiz-controls{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}
.fc-quiz-options-toggle{position:relative}
.fc-quiz-options-list{position:absolute;top:100%;right:0;background:#fff;border:1px solid #ddd;padding:10px;border-radius:5px;z-index:10;width:200px;box-shadow:0 2px 5px rgba(0,0,0,.1)}
.fc-quiz-options-list label{display:block;padding:5px;font-size:14px}
.fc-quiz-question{font-size:18px;margin-bottom:20px;padding:15px;background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border-radius:10px;text-align:center}
.fc-quiz-options{display:grid;gap:10px;margin:20px 0}
.fc-quiz-option{padding:12px 15px;border:2px solid #ddd;border-radius:10px;background:#fff;cursor:pointer;font-size:16px;text-align:left;transition:all .3s; font-family: 'Nunito', sans-serif;}
.fc-quiz-option:hover{border-color:#3498db;background:#f0f8ff}
.fc-quiz-option.correct{background:#d4edda;border-color:#28a745}
.fc-quiz-option.wrong{background:#f8d7da;border-color:#dc3545}
.fc-quiz-feedback{padding:12px;margin:15px 0;border-radius:10px;font-size:16px;font-weight:600;text-align:center}
.correct-feedback{background:#d4edda;color:#155724}
.wrong-feedback{background:#f8d7da;color:#721c24}
.fc-quiz-next{background:#3498db;color:#fff}
.fc-quiz-results h3,.fc-results h3{text-align:center;margin-bottom:20px;color:#2c3e50;font-size:22px}

/* --- Back Content Specific Styling --- */
.fc-back-line-front {
    font-size: 1.2em;
    font-weight: 800;
    color: #ffeaa7;
    margin-bottom: 5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.fc-back-line-1 {
    font-size: 1em;
    margin-bottom: 5px;
}
.fc-separator {
    width: 80%;
    height: 2px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.8), rgba(255,255,255,0));
    margin: 10px auto;
    border-radius: 2px;
}
.fc-back-line-2, .fc-back-line-3 {
    font-size: 0.95em;
    opacity: 0.95;
    margin-bottom: 4px;
}

/* --- Writing Mode Styles --- */
.fc-writing-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.fc-write-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.fc-write-exit { margin-top: 0; }
.fc-write-actions .fc-btn { padding: 8px 15px; font-size: 14px; margin: 0; }
.fc-write-card-selector { font-size: 14px; padding: 8px; border-radius: 5px; max-width: 150px; font-family: 'Nunito', sans-serif;}
.fc-writing-area { position: relative; width: 100%; margin: 20px auto 0; }
.fc-writing-grid { display: flex; flex-wrap: wrap; justify-content: center; width: 100%; }
.fc-writing-char-box { width: 150px; height: 150px; border: 1px dashed #ccc; display: flex; justify-content: center; align-items: center; font-size: 90px; color: #e0e0e0; user-select: none; transition: color 0.3s; font-family: 'Nunito', sans-serif; font-weight: 600;}
.fc-writing-char-box.hide-ghost { color: transparent; }
#fc-writing-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; touch-action: none; }

/* --- Icon Button Styles --- */
.fc-btn-icon {
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1;
    min-width: 42px;
}
.fc-quiz-controls .fc-btn-icon {
    padding: 10px 12px;
    font-size: 16px;
    margin: 0;
}
.fc-header .fc-swap-sides,
.fc-header .fc-audio-open {
    padding: 8px 12px;
    font-size: 14px;
}

/* --- Audio Modal & Custom Player --- */
.fc-audio-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
}
.fc-audio-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(2px);
}
.fc-audio-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(540px, calc(100% - 30px));
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 18px 48px rgba(0,0,0,.28);
    animation: fcAudioPop .2s ease-out;
}
@keyframes fcAudioPop {
    from { opacity: 0; transform: translate(-50%, -47%) scale(0.98); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.fc-audio-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 16px 16px 0 0;
}
.fc-audio-dialog-head h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}
.fc-audio-close {
    margin: 0;
    background: rgba(255,255,255,.18);
    color: #fff;
}
.fc-audio-close:hover {
    background: rgba(255,255,255,.28);
}
.fc-audio-dialog-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.fc-custom-audio-player {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.fc-audio-progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: monospace;
    font-size: 15px;
    color: #555;
}

.fc-seek-bar {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
}
.fc-seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}
.fc-seek-bar::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.fc-audio-controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
}

.fc-audio-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #4a5568;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    font-family: 'Nunito', sans-serif;
    font-weight: bold;
}
.fc-audio-btn:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}
.fc-audio-btn:active {
    transform: scale(0.95);
}
.fc-audio-btn.main-btn {
    width: 70px;
    height: 70px;
    font-size: 26px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
.fc-audio-btn.main-btn:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}
.fc-audio-btn.active {
    background: #27ae60;
    color: white;
}

@media(max-width:640px){
    .fc-collection-wrap { padding: 10px; }
    .fc-wrap { padding: 0; } 
    .fc-header, .fc-main-content, .fc-results, .fc-quiz-results {
        padding-left: 10px;
        padding-right: 10px;
    }
    .fc-writing-mode { padding: 10px 0; }
    .fc-writing-grid { flex-direction: column; align-items: center; }
    .fc-writing-char-box {
        width: 80vw;
        height: 80vw;
        max-width: 250px;
        max-height: 250px;
        font-size: 150px;
        margin-bottom: 10px;
    }

    .fc-header{
        grid-template-areas:"title title" "progress progress" "actions actions";
        grid-template-columns:1fr;
    }
    .fc-header h3{padding-left:0;font-size:20px}
    .fc-header-actions{justify-self:center;margin-top:10px}
    .fc-lists{grid-template-columns:1fr}
    .fc-summary{flex-direction:column;gap:10px}
    .fc-stat{padding:10px}
    .fc-write-actions{justify-content:center;width:100%}
    .fc-collection-main-title { font-size: 22px; }
    .fc-back-to-parent { font-size: 20px; }

    /* Mobile Audio Player Adjustments */
    .fc-audio-dialog {
        width: calc(100% - 20px);
    }
    .fc-audio-dialog-body {
        padding: 20px 15px;
        gap: 15px;
    }
    .fc-audio-controls-container {
        gap: 12px;
    }
    .fc-audio-btn {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }
    .fc-audio-btn.main-btn {
        width: 65px;
        height: 65px;
        font-size: 24px;
    }
}

/* ==========================================================================
   AHOSHADOTAB 3-STEP SYSTEM STYLES (UNIFIED INTEGRATION)
   ========================================================================== */

.ahoshadotab-wrap {
    max-width: 850px;
    margin: 20px auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    font-family: 'Nunito', sans-serif;
    box-sizing: border-box;
}

/* Header */
.ast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 2px dashed #e2e8f0;
    flex-wrap: wrap;
    gap: 10px;
}
.ast-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.ast-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
}
.ast-brand-badge {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.ast-meta {
    font-size: 14px;
    color: #64748b;
}
.ast-card-count strong {
    color: #4f46e5;
    font-size: 16px;
}

/* Stepper Tabs Bar */
.ast-step-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 25px;
    background: #f8fafc;
    padding: 6px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}
.ast-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}
.ast-tab-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
}
.ast-tab-btn.active {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    border: 1px solid #c7d2fe;
}
.ast-tab-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e0e7ff;
    color: #3730a3;
    margin-bottom: 4px;
    text-transform: uppercase;
}
.ast-tab-btn.active .ast-tab-badge {
    background: #4f46e5;
    color: #ffffff;
}
.ast-tab-text {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
}
.ast-tab-btn.active .ast-tab-text {
    color: #1e293b;
}

/* AUDIO PLAYER CONTAINER */
.ast-audio-section {
    position: sticky;
    top: 8px;
    z-index: 990;
    margin-bottom: 18px;
}
.ast-audio-card {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.ast-audio-card-head {
    display: none;
}

.ast-custom-player {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}
.ast-custom-player .fc-audio-progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-family: monospace;
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
}
.ast-custom-player .fc-seek-bar {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
}
.ast-custom-player .fc-seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fbbf24;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.ast-custom-player .fc-audio-controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ast-custom-player .fc-audio-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}
.ast-custom-player .fc-audio-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.06);
}
.ast-custom-player .fc-audio-btn.main-btn {
    width: 44px;
    height: 44px;
    font-size: 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e1b4b;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4);
}
.ast-custom-player .fc-audio-btn.main-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 5px 16px rgba(245, 158, 11, 0.6);
}
.ast-custom-player .fc-audio-btn.active {
    background: #10b981;
    color: #ffffff;
}

/* STEP NAVIGATION BARS */
.ast-step-nav-bar {
    margin-top: 15px;
    text-align: center;
}
.ast-next-step-btn {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Nunito', sans-serif;
}
.ast-next-step-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.45);
    background: linear-gradient(135deg, #4338ca, #4f46e5);
}

/* STEP BANNERS */
.ast-step-banner {
    background: #f1f5f9;
    border-left: 4px solid #4f46e5;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.ast-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}
.ast-banner-title {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
}
.ast-banner-desc {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: #475569;
}

.ast-global-toggles {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ast-btn-action {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Nunito', sans-serif;
}
.ast-btn-action:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}
.ast-btn-action.active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

/* TABLES (STEP 2 & STEP 3) */
.ast-table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}
.ast-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}
.ast-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 800;
    font-size: 14px;
    padding: 12px 16px;
    text-align: left;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}
.ast-table th:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-left: 1px solid #e2e8f0;
}
.ast-table th:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-right: 1px solid #e2e8f0;
}

.ast-script-row, .ast-output-row {
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}
.ast-script-row:hover, .ast-output-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.ast-table td {
    padding: 14px 16px;
    font-size: 15px;
    color: #334155;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.ast-table td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-left: 1px solid #f1f5f9;
}
.ast-table td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-right: 1px solid #f1f5f9;
}

.ast-col-front {
    font-weight: 700;
    color: #1e293b;
}

.ast-back-line {
    margin-bottom: 4px;
}
.ast-back-line:last-child {
    margin-bottom: 0;
}
.ast-back1 { font-weight: 700; color: #1e293b; }
.ast-back2, .ast-back3 { color: #475569; }
.ast-back4 { color: #0284c7; font-weight: 600; }
.ast-back5-txt { color: #059669; font-weight: 600; }
.ast-empty-text { color: #94a3b8; font-style: italic; }

/* STEP 3 SPECIFIC STYLES & INTEGRATED TOGGLE */
.ast-col-back5 {
    background: #f0fdf4;
    color: #166534;
    font-weight: 700;
}
.ast-col-back4 {
    position: relative;
    background: #faf5ff;
}
.ast-back4-cell-wrap {
    position: relative;
    width: 100%;
}
.ast-back4-mask {
    color: #7e22ce;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3e8ff;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px dashed #c084fc;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.ast-back4-mask:hover {
    background: #e9d5ff;
    border-color: #a855f7;
    color: #6b21a8;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(168, 85, 247, 0.15);
}
.ast-back4-val {
    color: #581c87;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.ast-back4-content-inner {
    flex: 1;
    line-height: 1.5;
    word-break: break-word;
}
.ast-row-action-btns {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: stretch;
    flex-shrink: 0;
    width: 78px;
}
.ast-rehide-btn, .ast-mark-btn {
    width: 78px;
    height: 26px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
    padding: 0 4px;
    font-family: 'Nunito', sans-serif;
    transition: all 0.15s ease;
}
.ast-rehide-btn {
    background: #4a5568;
    color: #ffffff;
}
.ast-rehide-btn:hover {
    background: #2d3748;
    color: #ffffff;
}

.ast-mark-btn {
    background: #f59e0b;
    color: #1a202c;
}
.ast-mark-btn:hover {
    background: #d97706;
    color: #ffffff;
}
.ast-mark-btn.active {
    background: #ef4444;
    color: #ffffff;
}

.ast-report-trigger-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #cbd5e1;
    transition: all 0.2s ease;
    padding: 4px;
    margin-left: 4px;
}
.ast-report-trigger-btn:hover {
    color: #e53e3e;
    transform: scale(1.15);
}

.ast-step3-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}
.ast-nav-back-btn {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Nunito', sans-serif;
}
.ast-nav-back-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* REPORT MODAL */
.ast-report-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    box-sizing: border-box;
}
.ast-report-modal {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: astFadeUp 0.3s ease;
}
@keyframes astFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.ast-report-modal-header {
    background: #fef2f2;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #fee2e2;
}
.ast-report-modal-title {
    font-size: 16px;
    font-weight: 800;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ast-report-modal-close {
    background: transparent;
    border: none;
    font-size: 22px;
    color: #991b1b;
    cursor: pointer;
    line-height: 1;
}
.ast-report-modal-body {
    padding: 20px;
}
.ast-report-card-preview {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #334155;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}
.ast-report-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
}
.ast-report-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
    resize: vertical;
}
.ast-report-textarea:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.ast-report-status-msg {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}
.ast-report-status-msg.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.ast-report-status-msg.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.ast-report-modal-footer {
    background: #f8fafc;
    padding: 14px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
}
.ast-report-btn-cancel {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.ast-report-btn-submit {
    background: #ef4444;
    border: none;
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ast-report-btn-submit:hover {
    background: #dc2626;
}

@media (max-width: 600px) {
    .fc-card {
        min-height: 240px;
        height: auto;
    }
    .fc-face {
        padding: 14px 10px;
    }
    .fc-text-content {
        font-size: 16px;
        padding: 10px 6px;
        overflow: visible;
    }
    .ast-step-tabs {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .ast-tab-btn {
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        padding: 8px 12px;
    }
    .ast-tab-badge {
        margin-bottom: 0;
    }
    .ast-banner-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .ast-global-toggles {
        width: 100%;
        margin-top: 8px;
    }
    .ast-btn-action {
        flex: 1;
        text-align: center;
    }
    .ast-table th, .ast-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    .ast-back4-mask {
        font-size: 12px;
        padding: 8px 10px;
    }
}