.llp-widget {
    --llp-shadow: 0 10px 28px rgba(11, 30, 53, 0.11);
    margin: 1.2rem 0;
    font-family: 'Avenir Next', 'Segoe UI', sans-serif;
    color: #1f2937;
}

body.llp-has-lesson-progress {
    padding-top: var(--llp-lesson-progress-space, 72px);
}

body.llp-flashcard-fullscreen-active.llp-has-lesson-progress {
    padding-top: 0;
}

body.llp-flashcard-fullscreen-active .llp-lesson-progress {
    display: none;
}

.llp-lesson-progress {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 10020;
    padding: 8px 12px;
    pointer-events: none;
}

.llp-lesson-progress-inner {
    max-width: 980px;
    margin: 0 auto;
    border-radius: 12px;
    border: 1px solid #d7dde7;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(4px);
    padding: 10px 12px;
    pointer-events: auto;
}

.llp-lesson-progress-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.llp-lesson-progress-title {
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #334155;
}

.llp-lesson-progress-status {
    font-size: 13px;
    font-weight: 700;
    color: #1e3a8a;
}

.llp-lesson-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #dbe6f2;
    overflow: hidden;
}

.llp-lesson-progress-fill {
    display: block;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #54a3f3);
    transition: width 0.34s ease;
}

.llp-lesson-progress-label {
    margin: 6px 0 0;
    color: #475569;
    font-size: 12px;
}

.llp-lesson-progress.is-complete .llp-lesson-progress-fill {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.llp-lesson-progress.is-complete .llp-lesson-progress-status,
.llp-lesson-progress.is-complete .llp-lesson-progress-label {
    color: #166534;
    font-weight: 700;
}

.llp-empty-state {
    border: 1px dashed #ccd6e1;
    border-radius: 12px;
    padding: 14px;
    background: #f8fafc;
}

.llp-vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.llp-vocab-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.llp-vocab-toolbar button {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 8px 12px;
    cursor: pointer;
}

.llp-vocab-manage-trigger {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.llp-vocab-manage-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.llp-vocab-manage-actions.is-hidden,
.llp-vocab-manage-trigger.is-hidden,
.llp-vocab-known-empty.is-hidden {
    display: none;
}

.llp-vocab-reset-all {
    margin-left: auto;
}

.llp-vocab-button {
    border: none;
    border-radius: 14px;
    padding: 14px;
    min-height: 92px;
    text-align: center;
    background: linear-gradient(
        180deg,
        var(--llp-vocab-gradient-start, var(--llp-vocab-button-bg)),
        var(--llp-vocab-gradient-end, #1e293b)
    );
    color: var(--llp-vocab-button-text);
    box-shadow: var(--llp-shadow);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.llp-vocab-button--with-image {
    padding: 12px;
    min-height: 120px;
    text-align: left;
    display: grid;
    grid-template-columns: minmax(86px, 200px) minmax(140px, 1fr);
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    grid-column: span 2;
}

.llp-vocab-image-wrap {
    width: 100%;
    max-width: 200px;
    max-height: 200px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.2);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.llp-vocab-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 9px;
}

.llp-vocab-text-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 10px 12px;
    min-width: 0;
    min-height: 0;
    width: 100%;
}

.llp-vocab-button--with-image .llp-vocab-word,
.llp-vocab-button--with-image .llp-vocab-phonetic,
.llp-vocab-button--with-image .llp-vocab-english {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.llp-vocab-button:hover,
.llp-vocab-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(11, 30, 53, 0.18);
}

.llp-vocab-button.is-known {
    opacity: 0.45;
    filter: grayscale(0.8);
}

.llp-vocab-button.is-known-hidden {
    display: none;
}

.llp-vocab-known-empty {
    margin: 10px 0 0;
    color: #475569;
    font-size: 0.95rem;
}

.llp-vocab-word {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.llp-vocab-phonetic {
    display: block;
    font-size: 0.95rem;
    line-height: 1.25;
    opacity: 0.9;
    margin: 0;
}

.llp-vocab-english {
    display: block;
    font-size: 0.9rem;
    line-height: 1.3;
    opacity: 0.88;
    margin: 0;
}

.llp-gender-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.23);
}

.llp-definition-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    place-items: center;
    z-index: 9999;
    padding: 16px;
}

.llp-definition-modal[hidden] {
    display: none !important;
}

.llp-definition-modal.is-open {
    display: grid !important;
}

.llp-definition-card {
    position: relative;
    width: min(460px, 100%);
    border-radius: 14px;
    padding: 22px;
    background: var(--llp-definition-popup-bg);
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.26);
    z-index: 10000;
}

.llp-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.08);
}

.llp-definition-word {
    margin: 0 0 6px;
    font-size: 1.3rem;
}

.llp-definition-text {
    margin: 0;
}

.llp-conversation-list {
    display: grid;
    gap: 10px;
}

.llp-conversation-line {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--llp-conversation-bg);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    position: relative;
}

.llp-conversation-line--has-image {
    padding: 0;
    gap: 0;
    overflow: hidden;
}

.llp-conversation-line--has-image .llp-conversation-copy {
    padding: 12px;
    background: var(--llp-conversation-bg);
}

.llp-conversation-line--male.llp-conversation-line--has-image .llp-conversation-copy {
    background: var(--llp-conversation-male-bg, var(--llp-conversation-bg));
}

.llp-conversation-line--female.llp-conversation-line--has-image .llp-conversation-copy {
    background: var(--llp-conversation-female-bg, var(--llp-conversation-bg));
}

.llp-conversation-image-wrap {
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    margin: 0;
    background: #e2e8f0;
}

.llp-conversation-image {
    display: block;
    height: 100%;
    width: auto;
    max-height: 100%;
    max-width: min(300px, 42vw);
    object-fit: cover;
}

.llp-conversation-line--image-left .llp-conversation-image-wrap {
    order: 0;
}

.llp-conversation-line--image-left .llp-conversation-copy {
    order: 1;
}

.llp-conversation-line--image-right .llp-conversation-copy {
    order: 0;
}

.llp-conversation-line--image-right .llp-conversation-image-wrap {
    order: 1;
}

.llp-conversation-line.llp-conversation-line--male {
    background: var(--llp-conversation-male-bg, var(--llp-conversation-bg));
}

.llp-conversation-line.llp-conversation-line--female {
    background: var(--llp-conversation-female-bg, var(--llp-conversation-bg));
}

.llp-conversation-line.is-clickable {
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.llp-conversation-line.is-clickable:hover,
.llp-conversation-line.is-clickable:focus-within {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.1);
}

.llp-conversation-line.is-clickable:focus-visible {
    outline: 2px solid rgba(29, 78, 216, 0.55);
    outline-offset: 2px;
}

.llp-conversation-copy {
    flex: 1;
    width: 100%;
    padding-right: 82px;
    position: relative;
}

.llp-conversation-play-trigger {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 999px;
    background: var(--llp-conversation-play-button-bg, #236736);
    color: #fff;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.llp-conversation-play-trigger:hover,
.llp-conversation-play-trigger:focus-visible {
    filter: brightness(0.92);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}

.llp-conversation-play-trigger:active {
    transform: scale(0.98);
}

.llp-play-icon {
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid currentColor;
    margin-left: 2px;
}

.llp-language-text {
    margin: 0;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1.25;
}

.llp-english-text {
    margin: 2px 0 0;
    opacity: 0.88;
    font-size: 1.55rem;
}

.llp-phonetic-text {
    margin: 2px 0 0;
    opacity: 0.82;
    font-style: italic;
    font-size: 1.05rem;
}

.llp-language-token {
    border-radius: 6px;
    transition: background-color 0.12s ease, color 0.12s ease;
    padding: 0 1px;
    cursor: inherit;
}

.llp-language-token.is-selected-range {
    background: rgba(249, 115, 22, 0.22);
    color: #0f172a;
}

.llp-language-token.llp-conversation-vocab-term {
    color: var(--llp-conversation-word-accent, var(--llp-accent-color, #1d4ed8));
    font-weight: 700;
    position: relative;
}

.llp-language-token.llp-conversation-vocab-term:hover::after,
.llp-language-token.llp-conversation-vocab-term:focus-visible::after {
    content: attr(data-definition);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    min-width: 140px;
    max-width: min(360px, 82vw);
    background: #0f172a;
    color: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.86rem;
    line-height: 1.3;
    text-align: center;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.28);
    z-index: 30;
    white-space: normal;
    pointer-events: none;
}

.llp-language-token.llp-conversation-vocab-term:hover::before,
.llp-language-token.llp-conversation-vocab-term:focus-visible::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #0f172a;
    z-index: 31;
}

.llp-language-token.is-speaking {
    background: rgba(29, 78, 216, 0.2);
    color: #0f172a;
}

.llp-conversation-waveform {
    margin-top: 10px;
    width: 100%;
    height: 58px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
    cursor: crosshair;
    position: relative;
    touch-action: none;
    user-select: none;
}

.llp-waveform-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.llp-conversation-line.is-playing .llp-conversation-waveform {
    box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.35);
}

.llp-flashcard-widget {
    --llp-study-font: "Noto Sans", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans Thai", "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Khmer", "Noto Sans Lao", "Noto Sans Myanmar", "Noto Sans Ethiopic", "Noto Sans Georgian", "Noto Sans Armenian", "Noto Sans CJK SC", "Noto Sans CJK TC", "Noto Sans CJK JP", "Noto Sans CJK KR", system-ui, -apple-system, "Segoe UI", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Helvetica Neue", Arial, sans-serif;
    max-width: 900px;
    margin: 24px auto;
}

.llp-flashcard-frame {
    border: 1px solid #dcdcde;
    border-radius: 14px;
    padding: 20px;
    background: linear-gradient(180deg, #fbfbfc 0%, var(--llp-flashcard-bg) 100%);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
    perspective: 1200px;
}

.llp-flashcard-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 20% 20%, rgba(34, 113, 177, 0.12), transparent 55%);
}

.llp-srs-header,
.llp-flashcard-definition,
.llp-srs-prompt,
.llp-srs-options,
.llp-srs-spelling,
.llp-flashcard-controls,
.llp-flashcard-feedback {
    position: relative;
    z-index: 1;
}

.llp-srs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #50575e;
}

.llp-srs-header-main {
    display: grid;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 180px;
}

.llp-srs-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.llp-srs-stage,
.llp-flashcard-counter {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.llp-srs-stage {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #d0d4d8;
    background: #f0f2f4;
    color: #1d2327;
    white-space: nowrap;
}

.llp-srs-progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e5e9ef;
    overflow: hidden;
    position: relative;
}

.llp-srs-progress-fill {
    display: block;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #54a3f3);
    transition: width 0.3s ease;
}

.llp-fullscreen {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #d0d4d8;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #1d2327;
    transition: transform 0.12s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.llp-fullscreen:active {
    transform: scale(0.98);
}

.llp-flashcard-definition {
    margin: 0 0 12px;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
}

.llp-flashcard-image-wrap {
    margin: 0 0 12px;
    border: 1px solid #d7dde5;
    border-radius: 12px;
    background: #f8fafc;
    padding: 6px;
    width: fit-content;
    max-width: min(100%, 320px);
}

.llp-flashcard-image-wrap.is-hidden {
    display: none;
}

.llp-flashcard-image {
    display: block;
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 9px;
}

.llp-srs-prompt {
    margin-bottom: 12px;
    min-height: 26px;
}

.llp-srs-hint {
    margin: 0;
    color: #50575e;
    font-size: 14px;
}

.llp-srs-options {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 12px;
}

.llp-option-button {
    font-family: var(--llp-study-font);
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #d0d4d8;
    background: #fff;
    cursor: pointer;
    font-size: 32px;
    line-height: 1.3;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.llp-option-button:hover {
    border-color: #2271b1;
}

.llp-option-button.is-selected {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
    transform: translateY(-1px);
}

.llp-option-button.is-incorrect,
.llp-option-button.is-incorrect:hover,
.llp-option-button.is-incorrect:focus-visible,
.llp-option-button.is-incorrect.is-selected {
    color: #b32d2e;
    border-color: #e07a7a;
    background: rgba(211, 47, 47, 0.08);
    box-shadow: 0 0 0 2px rgba(179, 45, 46, 0.16);
}

.llp-srs-spelling {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.llp-spell-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.llp-spell-slot {
    min-width: 26px;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px dashed #c3c4c7;
    border-radius: 6px;
    font-family: var(--llp-study-font);
    font-size: 34px;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.llp-spell-slot.is-space {
    border: none;
    min-width: 12px;
    padding: 6px 0;
}

.llp-spell-slot.is-reveal-correct {
    color: #1d7f3c;
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.14);
    animation: llp-spell-reveal 0.24s ease;
}

.llp-spell-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.llp-keyboard-key {
    font-family: var(--llp-study-font);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #d0d4d8;
    background: #fff;
    color: #1d2327;
    cursor: pointer;
    font-size: 28px;
    line-height: 1.2;
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.llp-keyboard-key:active {
    transform: scale(0.98);
}

.llp-keyboard-key.is-used {
    opacity: 0.4;
    background: #e9edf1;
    color: #7a828a;
    border-color: #c3c8cf;
}

.llp-spell-tools {
    display: flex;
    gap: 8px;
}

.llp-spell-tools button {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #d0d4d8;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
}

.llp-spell-result {
    min-height: 20px;
}

.llp-spell-attempt-wrong {
    margin: 2px 0 0;
    color: #b32d2e;
    font-size: 0.88rem;
    line-height: 1.35;
}

.llp-flashcard-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.llp-flashcard-controls button {
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: #1d2327;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.llp-flashcard-controls button:hover {
    background: #2271b1;
}

.llp-flashcard-controls button:active {
    transform: scale(0.98);
}

.llp-flashcard-controls button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.llp-flashcard-controls button.is-hidden {
    display: none;
}

.llp-flashcard-feedback {
    margin-top: 12px;
    font-weight: 600;
    min-height: 20px;
}

.llp-flashcard-feedback.is-correct {
    color: #1d7f3c;
}

.llp-flashcard-feedback.is-wrong {
    color: #b32d2e;
}

.llp-flashcard-stats {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #e2e4e7;
    background: #f9fafb;
    min-height: 100%;
    box-sizing: border-box;
}

.llp-flashcard-inner {
    position: relative;
    min-height: 360px;
}

.llp-flashcard-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.llp-flashcard-front {
    --llp-front-scale: 1;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(var(--llp-front-scale));
    transform-origin: top center;
}

.llp-flashcard-back {
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    overflow-y: auto;
}

.llp-flashcard-frame.is-flipped .llp-flashcard-front {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px) scale(var(--llp-front-scale));
}

.llp-flashcard-frame.is-flipped .llp-flashcard-back {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.llp-flashcard-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.llp-flashcard-stats-title {
    margin: 0;
    font-size: 1.1rem;
}

.llp-flashcard-stats-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.llp-flashcard-stats-actions button {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #d0d4d8;
    background: #fff;
    color: #1d2327;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.llp-flashcard-stats-actions button:active {
    transform: scale(0.98);
}

.llp-flashcard-stats-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.llp-stat-card {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 10px;
    padding: 10px 12px;
    display: grid;
    gap: 4px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.llp-stat-label {
    font-size: 11px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.llp-stat-value {
    font-size: 19px;
    font-weight: 700;
    color: #1d2327;
}

.llp-flashcard-stats-search-wrap {
    margin-bottom: 10px;
}

.llp-flashcard-stats-search {
    width: 100%;
    max-width: 360px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #d0d4d8;
    background: #fff;
    font-size: 13px;
}

.llp-flashcard-stats-list {
    display: grid;
    gap: 10px;
}

.llp-flashcard-stats-row {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e2e4e7;
    background: #fff;
    display: grid;
    gap: 8px;
}

.llp-flashcard-stats-main {
    min-width: 0;
}

.llp-flashcard-stats-word {
    font-family: var(--llp-study-font);
    font-size: 1.05rem;
    font-weight: 700;
    color: #1d2327;
}

.llp-flashcard-stats-definition {
    font-size: 0.92rem;
    color: #5b6672;
}

.llp-flashcard-stats-meta {
    font-size: 12px;
    color: #6b7280;
}

.llp-flashcard-stats-bar {
    position: relative;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #d7dde5;
    background: #eef2f6;
    overflow: hidden;
}

.llp-flashcard-stats-bar-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2271b1, #54a3f3);
    transition: width 0.3s ease;
}

.llp-flashcard-stats-bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #1d2327;
    font-weight: 600;
}

.llp-flashcard-stats-empty {
    margin: 0;
    padding: 10px 0 2px;
    color: #6b7280;
    font-size: 13px;
}

.llp-flashcard-stats-empty.is-hidden {
    display: none;
}

.llp-flashcard-frame:fullscreen,
.llp-flashcard-frame:-webkit-full-screen,
.llp-flashcard-frame.is-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    padding: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.llp-flashcard-frame.is-pseudo-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    padding: calc(24px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
    overflow: hidden;
    z-index: 9999;
    background: linear-gradient(180deg, #fbfbfc 0%, var(--llp-flashcard-bg) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.llp-flashcard-frame:fullscreen .llp-flashcard-inner,
.llp-flashcard-frame:-webkit-full-screen .llp-flashcard-inner,
.llp-flashcard-frame.is-fullscreen .llp-flashcard-inner,
.llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-inner {
    width: min(980px, 100%);
    margin: 0 auto;
}

body.llp-pseudo-lock {
    overflow: hidden;
}

.llp-word-order-widget {
    max-width: 900px;
    margin: 24px auto;
}

.llp-word-order-english {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
}

.llp-word-order-image-wrap {
    margin: 0 0 10px;
    border: 1px solid #d7dde5;
    border-radius: 12px;
    background: #f8fafc;
    padding: 6px;
    width: fit-content;
    max-width: min(100%, 420px);
}

.llp-word-order-image-wrap.is-hidden {
    display: none;
}

.llp-word-order-image {
    display: block;
    max-width: 100%;
    max-height: 240px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 9px;
}

.llp-word-order-instruction {
    margin: 0 0 12px;
}

.llp-word-order-target,
.llp-word-order-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-radius: 10px;
    min-height: 64px;
    padding: 10px;
    margin-bottom: 10px;
}

.llp-word-order-target {
    border: 1px dashed #94a3b8;
    background: #f8fafc;
}

.llp-word-order-bank {
    border: 1px solid #d0d7e2;
    background: #fff;
}

.llp-word-order-placeholder {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}

.llp-word-order-token {
    font-family: var(--llp-study-font);
    border: 1px solid #d0d4d8;
    border-radius: 999px;
    background: #fff;
    color: #1d2327;
    padding: 8px 14px;
    line-height: 1.2;
    font-size: 1.15rem;
    cursor: grab;
    transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.llp-word-order-token:hover {
    border-color: #2271b1;
}

.llp-word-order-token:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.llp-word-order-token.is-answer {
    background: #eef4ff;
    border-color: #bcd0ef;
}

.llp-word-order-token.is-dragging {
    opacity: 0.55;
}

.llp-word-order-controls {
    margin-top: 6px;
}

.llp-srs-options,
.llp-srs-spelling,
.llp-flashcard-controls,
.llp-flashcard-feedback {
    animation: llp-fade-up 0.25s ease;
}

@keyframes llp-fade-up {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes llp-spell-reveal {
    from {
        opacity: 0.4;
        transform: translateY(4px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .llp-lesson-progress {
        padding: 6px 8px;
    }

    .llp-lesson-progress-inner {
        padding: 8px 10px;
    }

    .llp-lesson-progress-title,
    .llp-lesson-progress-status {
        font-size: 12px;
    }

    .llp-lesson-progress-track {
        height: 9px;
    }

    .llp-vocab-toolbar {
        align-items: stretch;
    }

    .llp-vocab-reset-all {
        margin-left: 0;
    }

    .llp-conversation-line {
        flex-direction: column;
        align-items: stretch;
    }

    .llp-conversation-line--has-image {
        flex-direction: row;
    }

    .llp-conversation-copy {
        padding-right: 0;
    }

    .llp-conversation-play-trigger {
        position: static;
        align-self: flex-end;
        margin-top: 2px;
    }

    .llp-conversation-controls {
        width: 100%;
        justify-content: space-between;
    }

    .llp-conversation-image {
        max-width: min(44vw, 180px);
    }

    .llp-vocab-button--with-image {
        min-height: 104px;
        grid-column: span 1;
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 10px;
    }

    .llp-vocab-image-wrap {
        width: min(100%, 110px);
        max-width: 110px;
        max-height: 110px;
    }

    .llp-vocab-text-wrap {
        align-items: center;
        text-align: center;
        padding: 10px 10px 12px;
    }

    .llp-flashcard-frame {
        padding: 16px;
    }

    .llp-flashcard-frame.is-pseudo-fullscreen {
        padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
    }

    .llp-flashcard-definition {
        font-size: 20px;
    }

    .llp-word-order-english {
        font-size: 18px;
    }

    .llp-word-order-token {
        font-size: 1rem;
        padding: 8px 12px;
    }

    .llp-option-button {
        font-size: clamp(20px, 6.2vw, 30px);
    }

    .llp-keyboard-key {
        font-size: clamp(18px, 6vw, 28px);
        padding: 10px 12px;
    }

    .llp-spell-slot {
        font-size: clamp(18px, 6vw, 28px);
        min-height: 34px;
    }

    .llp-flashcard-controls {
        width: 100%;
    }

    .llp-srs-header {
        align-items: flex-start;
    }

    .llp-srs-header-main {
        min-width: 120px;
    }

    .llp-srs-header-actions {
        justify-content: flex-end;
    }

    .llp-fullscreen {
        font-size: 14px;
        padding: 8px 14px;
    }

    .llp-flashcard-inner {
        min-height: 360px;
    }

    .llp-flashcard-stats {
        padding: 14px;
    }

    .llp-flashcard-stats-actions button {
        font-size: 12px;
        padding: 7px 12px;
    }

    .llp-flashcard-stats-search {
        max-width: none;
    }
}
