/* VocabLab Plugin Styles */
.vocablab-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 0 40px;
    color: #1a1a1a;
    line-height: 1.5;
}

/* Header */
.vl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 24px;
}
.vl-logo {
    font-size: 22px;
    font-weight: 700;
    color: #534AB7;
    letter-spacing: -0.5px;
}
.vl-header-right { display: flex; align-items: center; gap: 16px; }
.vl-score-wrap { display: flex; align-items: center; gap: 6px; background: #f4f4f8; border-radius: 20px; padding: 6px 14px; }
.vl-score-label { font-size: 12px; color: #888; }
.vl-score-val { font-size: 16px; font-weight: 700; color: #534AB7; }

/* Day selector */
.vl-streak-board {
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid #e8e7f2;
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(255, 198, 93, 0.18), transparent 34%),
        radial-gradient(circle at top right, rgba(83, 74, 183, 0.12), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f8f8fc 100%);
    box-shadow: 0 20px 44px rgba(28, 31, 53, 0.08);
}
.vl-streak-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.vl-streak-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e47a19;
}
.vl-streak-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d2b52;
}
.vl-streak-fire {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    padding: 10px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff4e5 0%, #ffe0b5 100%);
    box-shadow: inset 0 0 0 1px rgba(228, 122, 25, 0.08);
}
.vl-streak-fire-icon {
    font-size: 26px;
    line-height: 1;
}
.vl-streak-fire-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}
.vl-streak-fire-count {
    font-size: 24px;
    font-weight: 800;
    color: #3c2a13;
}
.vl-streak-fire-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a5a18;
}
.vl-day-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 16px 14px;
    justify-items: center;
}
.vl-empty {
    color: #888;
    font-size: 15px;
    padding: 20px 0;
    grid-column: 1 / -1;
}
.vl-day-btn {
    position: relative;
    width: 88px;
    height: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #d8dceb;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #edf1fb 100%);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, filter 0.15s ease;
    text-align: center;
    box-shadow: 0 10px 22px rgba(25, 30, 50, 0.1);
    overflow: visible;
}
.vl-day-btn:hover {
    transform: translateY(-2px);
    border-color: #5d56bf;
    box-shadow: 0 14px 28px rgba(83, 74, 183, 0.18);
}
.vl-day-btn:focus-visible {
    outline: none;
    border-color: #5d56bf;
    box-shadow: 0 0 0 4px rgba(83, 74, 183, 0.14);
}
.vl-day-btn:first-child .vl-day-link {
    display: none;
}
.vl-day-link {
    position: absolute;
    top: 50%;
    left: -24px;
    width: 30px;
    height: 6px;
    border-radius: 999px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, #d8dcea 0%, #c8d0ea 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.vl-day-num {
    position: relative;
    z-index: 1;
    font-size: 14px;
    font-weight: 800;
    color: #34305f;
    letter-spacing: -0.2px;
}
.vl-day-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(25, 30, 50, 0.12);
    background: #cfd4e6;
}
.vl-day-badge::before,
.vl-day-badge::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.vl-day-btn.completed .vl-day-badge::before {
    opacity: 1;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 9px;
    inset: auto;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}
.vl-day-btn.locked .vl-day-badge::after {
    opacity: 1;
    left: 6px;
    top: 5px;
    width: 8px;
    height: 7px;
    inset: auto;
    border: 2px solid #fff;
    border-top: none;
    border-radius: 0 0 2px 2px;
}
.vl-day-btn.locked .vl-day-badge::before {
    opacity: 1;
    left: 7px;
    top: 2px;
    width: 6px;
    height: 6px;
    inset: auto;
    border: 2px solid #fff;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}
.vl-day-btn.available {
    border-color: #b8c8ef;
    background: linear-gradient(180deg, #fefeff 0%, #e8efff 100%);
}
.vl-day-btn.available .vl-day-link {
    background: linear-gradient(90deg, #b7c7f5 0%, #88a2ec 100%);
}
.vl-day-btn.available .vl-day-badge {
    background: linear-gradient(180deg, #7ea2ff 0%, #557de6 100%);
}
.vl-day-btn.in-progress {
    border-color: #e7b85a;
    background: linear-gradient(180deg, #fff9ed 0%, #ffe4a9 100%);
}
.vl-day-btn.in-progress .vl-day-link {
    background: linear-gradient(90deg, #ffd164 0%, #f0a533 100%);
}
.vl-day-btn.in-progress .vl-day-badge {
    background: linear-gradient(180deg, #ffb53f 0%, #ee8d23 100%);
}
.vl-day-btn.completed {
    border-color: #1fa56a;
    background: linear-gradient(180deg, #effff6 0%, #cbf4dd 100%);
}
.vl-day-btn.completed .vl-day-badge {
    background: linear-gradient(180deg, #28c57d 0%, #19925a 100%);
}
.vl-day-btn.locked {
    border-color: #d8dbe7;
    background: linear-gradient(180deg, #f4f5f8 0%, #e8eaf1 100%);
    box-shadow: 0 8px 16px rgba(25, 30, 50, 0.06);
    filter: saturate(0.72);
    cursor: not-allowed;
}
.vl-day-btn.locked .vl-day-num {
    color: #8a8fa6;
}
.vl-day-btn.locked .vl-day-badge {
    background: linear-gradient(180deg, #aeb5c9 0%, #8d94ab 100%);
}
.vl-day-btn.locked .vl-day-link {
    background: linear-gradient(90deg, #dfe3ef 0%, #d6d9e6 100%);
}
.vl-day-btn.completed .vl-day-link {
    background: linear-gradient(90deg, #5ad58f 0%, #1fa56a 100%);
}
.vl-day-btn.active {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 18px 32px rgba(83, 74, 183, 0.22);
}
.vl-day-btn.active.available {
    border-color: #5a52c4;
    background: linear-gradient(180deg, #7066df 0%, #4d44b8 100%);
}
.vl-day-btn.active.in-progress {
    border-color: #ef9b21;
    background: linear-gradient(180deg, #ffca5c 0%, #f08b23 100%);
}
.vl-day-btn.active.completed {
    border-color: #168b56;
    background: linear-gradient(180deg, #29be7a 0%, #168b56 100%);
}
.vl-day-btn.active .vl-day-num {
    color: #fff;
}
.vl-day-btn.active .vl-day-badge {
    background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 640px) {
    .vl-streak-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .vl-streak-fire {
        width: 100%;
        justify-content: center;
    }

    .vl-day-selector {
        grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
        gap: 14px 10px;
    }

    .vl-day-btn {
        width: 76px;
        height: 76px;
    }

    .vl-day-num {
        font-size: 13px;
    }

    .vl-day-link {
        left: -17px;
        width: 22px;
    }
}

/* Breadcrumb */
.vl-breadcrumb { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.vl-back-btn {
    background: none; border: none; color: #534AB7; cursor: pointer;
    font-size: 14px; font-weight: 500; padding: 4px 0;
}
.vl-back-btn:hover { text-decoration: underline; }
.vl-current-day { font-size: 15px; font-weight: 600; color: #333; }

/* Tabs */
.vl-tabs {
    display: flex;
    gap: 4px;
    background: #f4f4f4;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}
.vl-tab {
    flex: 1;
    padding: 9px 4px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    color: #666;
    transition: all 0.15s;
    font-weight: 500;
}
.vl-tab.active { background: #fff; color: #534AB7; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.vl-tab:hover:not(.active) { color: #333; }

/* Screens */
.vl-screen { display: none; }
.vl-screen.active { display: block; }

/* ============ FLASHCARD ============ */
.vl-fc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.vl-fc-counter { font-size: 13px; color: #888; }
.vl-fc-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.vl-fc-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #e0e0e0; transition: background 0.3s;
}
.vl-fc-dot.seen { background: #AFA9EC; }
.vl-fc-dot.easy { background: #4CAF50; }
.vl-fc-dot.ok   { background: #FF9800; }
.vl-fc-dot.hard { background: #f44336; }

.vl-card {
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 16px;
    min-height: 240px;
    padding: 28px 24px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.1s;
    position: relative;
    user-select: none;
}
.vl-card:hover { border-color: #AFA9EC; }
.vl-card:active { transform: scale(0.99); }
.vl-card-front, .vl-card-back {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
}
.vl-card-pos {
    font-size: 11px; font-weight: 600; color: #534AB7;
    background: #EEEDFE; border-radius: 20px; padding: 3px 12px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.vl-card-word { font-size: 36px; font-weight: 700; color: #1a1a1a; }
.vl-card-phonetic { font-size: 15px; color: #999; }
.vl-card-tap { font-size: 13px; color: #bbb; margin-top: 20px; }
.vl-card-def { font-size: 16px; color: #333; line-height: 1.6; margin-top: 6px; }
.vl-card-ex { font-size: 14px; color: #777; font-style: italic; }
.vl-syn-ant { font-size: 13px; color: #555; margin-top: 10px; line-height: 1.8; text-align: left; width: 100%; }
.vl-syn-lbl { font-weight: 600; color: #4CAF50; }
.vl-ant-lbl { font-weight: 600; color: #f44336; }

.vl-rating-row { display: flex; gap: 10px; margin: 16px 0; }
.vl-rate-btn {
    flex: 1; padding: 12px 0; border-radius: 10px; font-size: 14px;
    font-weight: 600; border: 1.5px solid #e0e0e0; cursor: pointer;
    transition: all 0.15s; background: #fff;
}
.vl-rate-hard { border-color: #ffcdd2; color: #c62828; }
.vl-rate-hard:hover { background: #ffebee; }
.vl-rate-ok   { border-color: #ffe0b2; color: #e65100; }
.vl-rate-ok:hover { background: #fff3e0; }
.vl-rate-easy { border-color: #c8e6c9; color: #2e7d32; }
.vl-rate-easy:hover { background: #e8f5e9; }

.vl-fc-nav { display: flex; justify-content: space-between; margin-top: 12px; }
.vl-nav-btn {
    padding: 8px 16px; border: 1px solid #ddd; border-radius: 8px;
    background: #fff; cursor: pointer; font-size: 13px; color: #555;
    transition: all 0.15s;
}
.vl-nav-btn:hover { background: #f4f4f4; }
.vl-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.vl-fc-done {
    text-align: center; padding: 40px 20px;
    background: #f8f7ff; border-radius: 16px; border: 1.5px dashed #AFA9EC;
}
.vl-done-icon { font-size: 48px; margin-bottom: 12px; }
.vl-done-title { font-size: 22px; font-weight: 700; color: #534AB7; margin-bottom: 6px; }
.vl-done-sub { font-size: 15px; color: #888; margin-bottom: 20px; }

/* ============ QUIZ ============ */
.vl-quiz-types { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.vl-qtype {
    padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
    border: 1.5px solid #e0e0e0; background: #fff; cursor: pointer; color: #666;
    transition: all 0.15s;
}
.vl-qtype.active { background: #EEEDFE; border-color: #AFA9EC; color: #534AB7; }
.vl-qtype:hover:not(.active) { border-color: #bbb; }

.vl-quiz-summary {
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid #e5dcbd;
    border-radius: 16px;
    background: linear-gradient(180deg, #fffdf7 0%, #fff4dd 100%);
}
.vl-quiz-summary-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b97316;
    margin-bottom: 8px;
}
.vl-quiz-summary-title {
    font-size: 20px;
    font-weight: 700;
    color: #3c2d15;
    margin-bottom: 6px;
}
.vl-quiz-summary-text {
    font-size: 14px;
    line-height: 1.6;
    color: #6a5632;
}

.vl-quiz-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 13px; color: #888; }
.vl-qprogbar { flex: 1; height: 6px; background: #eee; border-radius: 99px; overflow: hidden; }
.vl-qprogfill { height: 6px; background: #534AB7; border-radius: 99px; transition: width 0.4s; }

.vl-quiz-sentence {
    background: #f8f7ff; border-radius: 12px; padding: 16px 20px;
    font-size: 16px; line-height: 1.7; color: #333; margin-bottom: 16px;
    border-left: 4px solid #534AB7;
}
.vl-blank { display: inline-block; min-width: 90px; border-bottom: 2px solid #534AB7; font-weight: 700; color: #534AB7; }
.vl-quiz-instruction { font-size: 14px; color: #888; margin-bottom: 12px; }

.vl-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.vl-opt {
    padding: 14px 16px; border: 1.5px solid #e0e0e0; border-radius: 10px;
    background: #fff; cursor: pointer; font-size: 14px; color: #333;
    text-align: left; transition: all 0.15s; line-height: 1.4;
}
.vl-opt:hover:not(:disabled) { border-color: #534AB7; background: #f8f7ff; }
.vl-opt.correct { background: #e8f5e9; border-color: #4CAF50; color: #2e7d32; font-weight: 600; }
.vl-opt.wrong   { background: #ffebee; border-color: #f44336; color: #c62828; }
.vl-opt:disabled { cursor: not-allowed; }

.vl-quiz-feedback {
    border-radius: 10px; padding: 14px 16px; font-size: 14px;
    line-height: 1.6; margin-bottom: 14px;
}
.vl-quiz-feedback.correct { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.vl-quiz-feedback.wrong   { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

.vl-fill-hint { font-size: 12px; color: #aaa; margin-bottom: 8px; }
.vl-fill-row { display: flex; gap: 8px; margin-bottom: 12px; }
.vl-fill-row input {
    flex: 1; padding: 11px 14px; border: 1.5px solid #e0e0e0; border-radius: 10px;
    font-size: 15px; color: #333; outline: none; transition: border 0.2s;
    background: #fff;
}
.vl-fill-row input:focus { border-color: #534AB7; }
.vl-check-btn {
    padding: 11px 20px; border: 1.5px solid #534AB7; border-radius: 10px;
    background: #534AB7; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.15s;
}
.vl-check-btn:hover { background: #3F38A0; }

/* MATCH */
.vl-match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.vl-match-col { display: flex; flex-direction: column; gap: 8px; }
.vl-match-item {
    padding: 12px 14px; border: 1.5px solid #e0e0e0; border-radius: 10px;
    background: #fff; cursor: pointer; font-size: 13px; color: #333;
    transition: all 0.15s; line-height: 1.4; text-align: center;
}
.vl-match-item:hover { border-color: #AFA9EC; background: #f8f7ff; }
.vl-match-item.selected { border-color: #534AB7; background: #EEEDFE; color: #534AB7; }
.vl-match-item.correct  { border-color: #4CAF50; background: #e8f5e9; color: #2e7d32; cursor: default; }
.vl-match-item.wrong    { border-color: #f44336; background: #ffebee; color: #c62828; }

/* Quiz result */
.vl-quiz-result { font-size: 24px; font-weight: 700; color: #534AB7; margin: 12px 0 20px; }

/* ============ CONTEXT ============ */
.vl-ctx-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; font-size: 13px; color: #888; }
.vl-ctx-nav-bottom { margin-top: 16px; margin-bottom: 0; justify-content: flex-end; }
.vl-ctx-card {
    background: #fff; border: 1.5px solid #e0e0e0; border-radius: 16px;
    padding: 24px; margin-bottom: 16px;
}
.vl-ctx-word { font-size: 28px; font-weight: 700; color: #1a1a1a; margin-bottom: 4px; }
.vl-ctx-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.vl-ctx-phon { font-size: 14px; color: #999; }
.vl-ctx-pos {
    font-size: 11px; font-weight: 700; color: #534AB7;
    background: #EEEDFE; border-radius: 20px; padding: 2px 10px;
    text-transform: uppercase;
}
.vl-ctx-def { font-size: 16px; color: #333; line-height: 1.6; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #f0f0f0; }
.vl-ctx-divider { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #bbb; margin-bottom: 12px; }
.vl-ctx-story {
    font-size: 15px; line-height: 1.8; color: #444;
    background: #f8f7ff; border-radius: 10px; padding: 16px;
    margin-bottom: 20px;
}
.vl-ctx-story .highlight { color: #534AB7; font-weight: 700; border-bottom: 2px solid #AFA9EC; }
.vl-ctx-syn-ant { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vl-ctx-col-title { font-size: 12px; font-weight: 700; color: #888; text-transform: uppercase; margin-bottom: 8px; }
.vl-ctx-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.vl-ctx-tag { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: #f0f0f0; color: #555; }
.vl-ctx-tag.syn { background: #e8f5e9; color: #2e7d32; }
.vl-ctx-tag.ant { background: #ffebee; color: #c62828; }
.vl-ctx-dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.vl-ctx-dot { width: 8px; height: 8px; border-radius: 50%; background: #e0e0e0; cursor: pointer; transition: background 0.2s; }
.vl-ctx-dot.active { background: #534AB7; }

/* ============ PROGRESS ============ */
.vl-prog-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.vl-prog-stat { background: #f8f7ff; border-radius: 12px; padding: 16px; text-align: center; }
.vl-prog-stat-num { font-size: 28px; font-weight: 700; color: #534AB7; }
.vl-prog-stat-lbl { font-size: 12px; color: #888; margin-top: 2px; }
.vl-prog-title { font-size: 14px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.vl-prog-list { display: flex; flex-direction: column; gap: 8px; }
.vl-prog-row {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 12px 16px;
}
.vl-prog-word-info { display: flex; flex-direction: column; gap: 2px; }
.vl-prog-word { font-size: 15px; font-weight: 600; color: #333; }
.vl-prog-def  { font-size: 12px; color: #999; }
.vl-prog-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.vl-prog-bar-wrap { width: 80px; height: 5px; background: #eee; border-radius: 99px; overflow: hidden; }
.vl-prog-bar-fill { height: 5px; border-radius: 99px; transition: width 0.4s; }
.vl-prog-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.badge-unseen  { background: #f0f0f0; color: #999; }
.badge-hard    { background: #ffebee; color: #c62828; }
.badge-ok      { background: #fff3e0; color: #e65100; }
.badge-easy    { background: #e8f5e9; color: #2e7d32; }

/* Buttons */
.vl-primary-btn {
    display: inline-block; padding: 12px 28px; background: #534AB7; color: #fff;
    border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: background 0.15s; margin-top: 10px;
}
.vl-primary-btn:hover { background: #3F38A0; }
.vl-secondary-btn {
    display: inline-block; padding: 12px 24px; background: #fff; color: #534AB7;
    border: 1.5px solid #534AB7; border-radius: 10px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.15s; margin-top: 10px; margin-left: 10px;
}
.vl-secondary-btn:hover { background: #f8f7ff; }

/* Responsive */
@media (max-width: 480px) {
    .vl-options { grid-template-columns: 1fr; }
    .vl-match-grid { grid-template-columns: 1fr 1fr; }
    .vl-prog-stats { grid-template-columns: repeat(3,1fr); }
    .vl-card-word { font-size: 28px; }
    .vl-tabs { gap: 2px; }
    .vl-tab { font-size: 11px; padding: 8px 2px; }
    .vl-ctx-syn-ant { grid-template-columns: 1fr; }
    .vl-ctx-nav { flex-wrap: wrap; }
    .vl-ctx-nav-bottom { justify-content: stretch; }
    .vl-ctx-nav-bottom .vl-nav-btn { flex: 1; }
}
