/* =====================
   WORD ACTION POPUP
   ===================== */
.word-popup-overlay {
    position: fixed; inset: 0;
    background: rgba(10,18,8,0.65);
    /* backdrop-filter removed — expensive on mid-range Android GPU */
    z-index: 300; display: flex; align-items: flex-end; justify-content: center;
    animation: fadeOverlay 0.2s ease;
}

.word-popup-sheet {
    width: 100%; max-width: 100%;
    background: var(--card); border-radius: 28px 28px 0 0;
    padding: 12px 24px 40px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
}

.word-popup-sheet.open { transform: translateY(0); }

.word-popup-handle {
    width: 36px; height: 4px; border-radius: 99px;
    background: var(--border); margin: 0 auto 20px;
}

.word-popup-word {
    font-family: var(--font-arabic); font-size: 2.8rem;
    font-weight: 700; color: var(--text);
    text-align: center; direction: rtl; line-height: 1.1;
    margin-bottom: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}

.word-popup-speaker { font-size: 1.2rem; opacity: 0.4; font-style: normal; }
.word-popup-word:hover .word-popup-speaker { opacity: 0.9; }

.word-popup-translation {
    text-align: center; font-family: var(--font-body);
    font-size: 1rem; color: var(--muted); font-style: italic;
    margin-bottom: 16px;
}

.word-popup-xp { margin-bottom: 6px; }
.word-popup-xp-top {
    display: flex; justify-content: space-between;
    font-size: 0.72rem; color: var(--muted); margin-bottom: 5px;
}

.word-popup-status { font-style: italic; }
.word-popup-xp-num { font-family: monospace; }

.word-popup-xp-bar {
    height: 5px; background: rgba(61,92,46,0.1);
    border-radius: 99px; overflow: hidden;
}

body.dark-mode .word-popup-xp-bar { background: rgba(141,184,122,0.1); }

.word-popup-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--fern), var(--sprout));
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

.word-popup-cat-label {
    text-align: center; font-size: 0.70rem; font-style: italic;
    letter-spacing: 0.1em; color: var(--muted); opacity: 0.6;
    margin-bottom: 20px; text-transform: uppercase;
}

.word-popup-actions { display: flex; gap: 10px; margin-bottom: 14px; }

.word-popup-btn {
    flex: 1; background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; padding: 14px 8px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer; transition: all 0.18s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.word-popup-btn:hover {
    border-color: var(--fern); transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.word-popup-btn.primary {
    background: var(--moss); border-color: var(--moss);
    box-shadow: 0 4px 16px rgba(61,92,46,0.25);
}

.word-popup-btn.primary:hover { filter: brightness(1.1); }

.wpb-icon  { font-size: 1.4rem; }
.wpb-label { font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; color: var(--text); }
.word-popup-btn.primary .wpb-label { color: var(--text); }
.wpb-desc  { font-size: 0.6rem; color: var(--muted); font-style: italic; }
.word-popup-btn.primary .wpb-desc  { color: var(--color-text-on-structure); }

.word-popup-dismiss {
    width: 100%; padding: 12px; border-radius: 10px;
    border: 1px solid var(--border); background: none;
    color: var(--muted); font-family: var(--font-body);
    font-size: 0.8rem; cursor: pointer; transition: 0.15s;
    letter-spacing: 0.04em;
}

.word-popup-dismiss:hover { background: rgba(61,92,46,0.05); border-color: var(--muted); }

/* =====================
   IMPORT CONFLICT SHEET
   ===================== */
.conflict-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex; align-items: flex-end; justify-content: center;
}

.conflict-sheet {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1.5rem 1.5rem 0 0;
    width: 100%; max-width: 100%;
    max-height: 90vh;
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.conflict-sheet.open { transform: translateY(0); }

.conflict-handle {
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: 99px;
    margin: 12px auto 0;
    flex-shrink: 0;
}

.conflict-header {
    padding: 16px 20px 12px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.conflict-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.conflict-sub   { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }

.conflict-body {
    overflow-y: auto; flex: 1;
    padding: 12px 16px;
    display: flex; flex-direction: column; gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--fern) transparent;
}

.conflict-body::-webkit-scrollbar       { width: 3px; }
.conflict-body::-webkit-scrollbar-thumb { background: var(--fern); border-radius: 99px; }

.cfl-row {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.cfl-row-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 10px; }

.cfl-cols { display: flex; gap: 10px; margin-bottom: 12px; }

@media (max-width: 380px) {
    .cfl-cols { flex-direction: column; }
}

.cfl-col       { flex: 1; min-width: 0; }
.cfl-col-label {
    font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); margin-bottom: 6px;
}

.cfl-word-list {
    max-height: 140px; overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px; padding: 6px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--fern) transparent;
}

.cfl-word-list::-webkit-scrollbar       { width: 3px; }
.cfl-word-list::-webkit-scrollbar-thumb { background: var(--fern); border-radius: 99px; }

.cfl-word {
    font-size: 0.8rem; padding: 2px 0;
    border-bottom: 1px solid var(--border);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cfl-word:last-child { border-bottom: none; }

.cfl-options { display: flex; gap: 6px; flex-wrap: wrap; }

.cfl-option {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.82rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 99px; padding: 4px 10px;
    cursor: pointer; transition: 0.15s;
}

.cfl-option:has(input:checked) {
    background: var(--fern);
    color: white;
    border-color: var(--fern);
}

.cfl-option input[type="radio"] { display: none; }

.conflict-actions {
    padding: 12px 16px 20px;
    display: flex; gap: 10px;
    flex-shrink: 0;
    border-top: 1px solid var(--border);
}

.conflict-actions .btn-continue-primary,
.conflict-actions .btn-continue-ghost { flex: 1; }
