/* ═══════════════════════════════════════════════════════
   APP — Etyma (app.html)
   Depende de: shared.css
   ═══════════════════════════════════════════════════════ */

/* ─── APP HEADER NAV ─── */
.app-header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.app-header__nav .mode-tabs {
    list-style: none;
    display: flex;
    gap: 0;
    padding: 0;
    margin: 0;
    align-items: center;
    height: 64px;
}

.app-header__nav .mode-tab {
    border: none;
    background: transparent;
    padding: 0 var(--space-4);
    height: 64px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--ink-3);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 400;
    letter-spacing: var(--tracking-wide);
    cursor: pointer;
    position: relative;
    transition: color var(--t-base) var(--ease-snappy);
}

.app-header__nav .mode-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--space-4);
    right: var(--space-4);
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--t-base) var(--ease-snappy);
}

.app-header__nav .mode-tab:hover {
    color: var(--ink-2);
    background: transparent;
}

.app-header__nav .mode-tab[aria-current="page"] {
    color: var(--ink);
    font-weight: 600;
}

.app-header__nav .mode-tab[aria-current="page"]::after {
    opacity: 1;
}

.mode-tab__icon {
    width: 14px;
    height: 14px;
    color: inherit;
    flex-shrink: 0;
}

.app-header__nav .mode-tab[aria-current="page"] .mode-tab__icon {
    color: var(--accent);
}

.mode-tab__badge {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 1px 6px;
    background: rgba(177, 131, 32, 0.08);
    line-height: 1.4;
}

.mode-tab__meta {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-4);
}


/* ─── EXAMPLES · HISTORY ─── */

.examples-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.examples-label {
    font-size: 12px;
    color: var(--ink-4);
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.example-chip {
    background: transparent;
    border: 1px solid var(--border-2);
    padding: 4px 11px;
    color: var(--ink-3);
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.16s;
}

.example-chip:hover {
    background: var(--surface-3);
    border-color: var(--ink-4);
    color: var(--ink);
}

.history-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.history-label {
    font-size: 12px;
    color: var(--ink-4);
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.history-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.history-item {
    background: transparent;
    border: 1px solid var(--border);
    padding: 2px 9px;
    color: var(--ink-4);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.16s;
}

.history-item:hover {
    color: var(--ink);
    border-color: var(--border-2);
}


/* ─── LOADING · ERROR ─── */
/* ─── LOADING ─── */

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 72px 20px;
    gap: 18px;
}

.loading-glyph {
    position: relative;
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-letter {
    font-family: 'Montserrat', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--ink-2);
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-ring {
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    border-top-color: var(--ink-3);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.loading-text {
    font-size: 14px;
    color: var(--ink-3);
    font-style: italic;
    animation: pulse 2s ease-in-out infinite;
}

.loading-bar {
    width: 160px;
    height: 1px;
    background: var(--border-2);
    border-radius: 1px;
    overflow: hidden;
}

.loading-bar-inner {
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--ink-3), transparent);
    animation: slideBar 1.5s ease-in-out infinite;
}

/* ─── ERROR ─── */

.error-box {
    max-width: 820px;
    margin: 20px auto;
    padding: 13px 18px;
    background: rgba(192, 64, 42, 0.08);
    border: 1px solid rgba(192, 64, 42, 0.25);
    color: #E07060;
    font-size: 15px;
}


/* ─── EXAMPLE ITEMS · EMPTY STATE · FEATURE GRID ─── */
/* ─── EXAMPLES ─── */

.example-item {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 13px 17px;
    margin-bottom: 10px;
}

.ex-russian {
    font-family: 'Cormorant Garamond', monospace;
    font-size: 20px;
    color: var(--ink);
    margin-bottom: 4px;
    font-weight: 500;
}

.ex-spanish {
    font-size: 15px;
    color: var(--ink-3);
    font-style: italic;
    margin-bottom: 6px;
}

.ex-note {
    font-size: 13px;
    color: var(--ink-4);
    line-height: 1.55;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 4px;
}

.note-tag {
    color: var(--accent-2);
    font-weight: 600;
    font-size: 11px;
}

/* ─── EMPTY STATE ─── */

.empty-state {
    max-width: 560px;
    margin: 0 auto;
    padding: 50px 20px;
    text-align: center;
}

.empty-glyph {
    width: auto;
    height: 75px;
    margin-bottom: 15px;
    animation: float 5s ease-in-out infinite;
    line-height: 1;
    opacity: 0.2;
}

.empty-text {
    font-size: 15px;
    color: var(--ink-3);
    line-height: 1.78;
    max-width: 420px;
    margin: 0 auto 28px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: border-color 0.16s;
}

.feature-card:hover {
    border-color: var(--border-2);
}

.feature-title {
    font-size: 14px;
    color: var(--ink-3);
    font-weight: 600;
    letter-spacing: 0.3px;
}


/* ─── CYRILLIC KEYBOARD ─── */
/* ─── CYRILLIC KEYBOARD ─── */
.cyrillic-keyboard {
    background: var(--bg);
    border: 1px solid var(--border-2);
    border-top: none;
    padding: 14px 12px 10px;
    animation: fadeInUp 0.2s ease-out forwards;
}

.kb-row {
    display: flex;
    gap: 5px;
    margin-bottom: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.kb-row--bottom {
    margin-bottom: 0;
    margin-top: 4px;
}

.kb-key {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--ink-2);
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 500;
    min-width: 38px;
    height: 40px;
    padding: 0 6px;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s, color 0.1s, transform 0.06s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.kb-key:hover {
    background: var(--surface-3);
    border-color: var(--ink-4);
    color: var(--ink);
}

.kb-key:active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent-2);
    transform: scale(0.92);
}

.kb-key--wide {
    min-width: 64px;
    font-size: 13px;
}

.kb-key--action {
    min-width: 48px;
    font-size: 17px;
    color: var(--ink-3);
}

.kb-key--enter {
    background: var(--accent-dim);
    border-color: rgba(177, 131, 32, 0.3);
    color: var(--accent-2);
}

.kb-key--enter:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
}

.kb-key--shift {
    color: var(--ink-3);
    font-size: 16px;
}

.kb-key--shift.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent-2);
}


/* ─── DICTIONARY ─── */
/* ─── DICTIONARY AREA ────────────────────────────────────────── */

.dictionary-area {
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.dic-search-wrap {
    margin-bottom: var(--space-4);
}

.dic-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    padding: 6px 16px;
    transition: border-color var(--t-base) var(--ease-snappy);
}

.dic-search-row:focus-within {
    border-color: var(--ink-4);
}

.dic-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--ink);
    font-size: var(--text-md);
    font-family: var(--font-sans);
    font-weight: 400;
    padding: 10px 4px;
}

.dic-hint {
    font-size: 12px;
    color: var(--ink-4);
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.dic-status {
    font-size: 14px;
    color: var(--ink-4);
    padding: 10px 2px;
}

/* ─── Entry list ─── */

.dic-results {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dic-entry {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 11px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    flex-wrap: wrap;
}

.dic-entry:hover {
    background: var(--surface-2);
    border-color: var(--border-2);
}

.dic-word {
    font-size: 20px;
    font-weight: 600;
    color: var(--ink-2);
    flex-shrink: 0;
}

.dic-translit {
    font-size: 13px;
    color: var(--ink-4);
    font-style: italic;
    flex-shrink: 0;
}

.dic-pos {
    font-size: 11px;
    background: var(--surface-3);
    border: 1px solid var(--border-2);
    color: var(--accent-2);
    padding: 2px 7px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    font-weight: 500;
}

.dic-def {
    font-size: 14px;
    color: var(--ink-3);
    flex: 1;
    min-width: 0;
}

.dic-empty {
    font-size: 15px;
    color: var(--ink-4);
    padding: 20px 0;
}

/* ─── Pagination ─── */

.dic-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.dic-page-btn {
    background: var(--surface);
    border: 1px solid var(--border-2);
    color: var(--ink-3);
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    padding: 7px 16px;
    cursor: pointer;
    transition: all 0.15s;
}

.dic-page-btn:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.dic-page-info {
    font-size: 13px;
    color: var(--ink-4);
}

/* ─── Detail view ─── */

.dic-detail {
    animation: fadeInUp 0.2s ease-out forwards;
}

.dic-back-btn {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--ink-4);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    padding: 7px 14px;
    cursor: pointer;
    margin-bottom: 18px;
    transition: all 0.15s;
}

.dic-back-btn:hover {
    background: var(--surface-2);
    color: var(--ink-2);
}

.dic-detail-header {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.dic-detail-word {
    font-size: 48px;
    font-weight: 700;
    color: var(--ink-2);
    line-height: 1.1;
}

.dic-pos--lg {
    font-size: 13px;
    padding: 3px 10px;
}

.dic-detail-def {
    font-size: 16px;
    color: var(--ink-2);
    line-height: 1.75;
    margin-bottom: 24px;
    font-weight: 300;
}

.dic-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-4);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Timeline */
.dic-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 24px;
    padding-left: 4px;
}

.dic-timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    padding-bottom: 14px;
}

.dic-timeline-step:last-child {
    padding-bottom: 0;
}

.dic-tl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-2);
    border: 2px solid var(--surface-3);
    flex-shrink: 0;
    margin-top: 5px;
    position: relative;
    z-index: 1;
}

.dic-timeline-step:not(:last-child) .dic-tl-dot::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(100% + 4px);
    background: var(--border);
}

.dic-tl-body {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.dic-tl-period {
    font-size: 12px;
    color: var(--ink-4);
    letter-spacing: 0.3px;
    min-width: 130px;
}

.dic-tl-form {
    font-family: 'Cormorant Garamond', serif;
    font-size: 19px;
    color: var(--ink);
    font-weight: 500;
}

.dic-tl-year {
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.2px;
}

/* Cognates */
.dic-cognates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.dic-cognate {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 8px 14px;
    gap: 3px;
}

.dic-cog-lang {
    font-size: 10px;
    color: var(--ink-4);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dic-cog-word {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    color: var(--ink-2);
    font-weight: 500;
}

/* Analyze button */
.dic-analyze-btn {
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    color: var(--accent-2);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 22px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.18s;
    letter-spacing: 0.2px;
}

.dic-analyze-btn:hover {
    background: var(--accent);
    color: var(--ink);
}

/* ─── ALPHA FILTER (Índice de letras) ─── */
.dic-alpha-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 6px;
    /* Espacio para el scroll táctil */
    -webkit-overflow-scrolling: touch;
    /* Scroll suave en iOS */
    scrollbar-width: none;
    /* Oculta la barra en Firefox */
}

.dic-alpha-filter::-webkit-scrollbar {
    display: none;
}

.alpha-btn {
    background: var(--surface);
    border: 1px solid var(--border-2);
    color: var(--ink-3);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    /* Evita que las letras se aplasten */
    min-width: 36px;
    text-align: center;
}

.alpha-btn:hover {
    background: var(--surface-2);
    border-color: var(--ink-4);
    color: var(--ink);
}

.alpha-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent-2);
}


/* ─── ANIMATIONS (app-only) ─── */
@keyframes modeSlideInRight {
    from {
        opacity: 0;
        transform: translateX(32px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes modeSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(-32px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mode-enter-right {
    animation: modeSlideInRight 0.50s var(--ease-snappy) both;
}

.mode-enter-left {
    animation: modeSlideInLeft 0.50s var(--ease-snappy) both;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: .4;
    }

    50% {
        opacity: 1;
    }
}

@keyframes slideBar {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(280%);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}


/* ─── AUTH ─── */
/* ─── AUTH BUTTON ─── */
.auth-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink-2);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.auth-btn:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── MODAL ─── */
/* ─── MODAL ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 16px;
    overflow-y: auto;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    min-width: 0;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--ink-3);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s;
}

.modal-close:hover {
    color: var(--ink);
}

.modal-icon {
    width: 100%;
    display: flex;
    justify-content: center;
}

.modal-logo {
    width: 35px;
}


.modal-desc {
    font-size: 0.9rem;
    color: var(--ink-3);
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

.modal-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--ink-3);
}

.modal-features li {
    padding-left: 4px;
}

.modal-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 4px;
}

.modal-tab {
    background: transparent;
    border: none;
    color: var(--ink-3);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-tab.active {
    color: var(--accent);
    background: var(--accent-dim);
}

.authLoginF {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.modal-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 10px 14px;
    color: var(--ink);
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-btn-primary {
    width: 100%;
    background: var(--accent);
    border: none;
    padding: 11px;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-btn-primary:hover {
    opacity: 0.88;
}

.modal-btn-secondary {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    padding: 10px;
    color: var(--ink-3);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.modal-btn-tertiary {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    padding: 10px;
    color: var(--ink-3);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.modal-btn-tertiary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.modal-btn-google {
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    padding: 10px;
    color: #333;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: box-shadow 0.2s;
}

.modal-btn-google:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.modal-divider {
    text-align: center;
    color: var(--ink-4);
    font-size: 0.8rem;
    position: relative;
}

.modal-divider::before,
.modal-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.modal-divider::before {
    left: 0;
}

.modal-divider::after {
    right: 0;
}

.modal-error {
    color: #e05c5c;
    font-size: 0.85rem;
    text-align: center;
    margin: 0;
}

.modal-alt {
    font-size: 0.82rem;
    color: var(--ink-4);
    text-align: center;
    margin: 0;
}

.modal-alt a {
    color: var(--accent);
    text-decoration: none;
}

.modal-alt a:hover {
    text-decoration: underline;
}

.modal--user {
    max-width: 320px;
    align-items: center;
    text-align: center;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-email {
    font-size: 0.88rem;
    color: var(--ink-3);
    margin: 0;
}

.sub-status {
    width: 100%;
}

.sub-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

.sub-badge--active {
    background: rgba(80, 180, 100, 0.15);
    color: #5ab46a;
    border: 1px solid rgba(80, 180, 100, 0.3);
}

.sub-badge--inactive {
    background: rgba(200, 100, 100, 0.10);
    color: #c87070;
    border: 1px solid rgba(200, 100, 100, 0.2);
}

.modal-free-note {
    background: rgba(177, 131, 32, 0.08);
    border: 1px solid rgba(177, 131, 32, 0.22);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 12.5px;
    color: var(--ink-2);
    line-height: 1.5;
    margin: 5px 0px;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-free-badge {
    display: inline-block;
    background: rgba(177, 131, 32, 0.2);
    color: var(--accent-2);
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 2px 8px;
    width: fit-content;
    margin-bottom: 2px;
}


/* ─── FREE WORDS SIDEBAR ─── */
.fw-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 199;
    opacity: 0;
    transition: opacity .25s ease;
}

.fw-backdrop.visible {
    display: block;
    opacity: 1;
}

.fw-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 300px;
    background: var(--surface);
    border-right: 1px solid var(--border-2);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1), box-shadow .28s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    will-change: transform;
}

.fw-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0, 0, 0, .5);
}

.fw-sidebar-inner {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 32px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-2) transparent;
}

.fw-sidebar-inner::-webkit-scrollbar {
    width: 4px;
}

.fw-sidebar-inner::-webkit-scrollbar-track {
    background: transparent;
}

.fw-sidebar-inner::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 4px;
}

.fw-sidebar-header {
    margin-bottom: 22px;
}

.fw-tab {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 201;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-left: none;
    padding: 14px 10px 14px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    color: var(--ink-3);
    transition: left .28s cubic-bezier(.4, 0, .2, 1), background .15s, color .15s;
}

.fw-tab:hover {
    background: var(--surface-3);
    color: var(--ink);
}

.fw-tab.open {
    left: 300px;
    background: var(--surface-3);
    color: var(--ink-2);
}

.fw-tab-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.fw-tab-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.fw-tab-count {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-2);
    font-family: 'Montserrat', sans-serif;
    border-radius: 8px;
    padding: 2px 5px;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}

.fw-tab-arrow {
    color: var(--ink-4);
    transition: transform .28s ease;
    flex-shrink: 0;
}

.fw-tab.open .fw-tab-arrow {
    transform: rotate(180deg);
}

.free-badge {
    display: inline-block;
    background: rgba(177, 131, 32, 0.15);
    color: var(--accent-2);
    border: 1px solid rgba(177, 131, 32, 0.3);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 2px 9px;
    margin-bottom: 9px;
}

.free-words-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 5px;
    line-height: 1.25;
}

.free-words-desc {
    font-size: 11.5px;
    color: var(--ink-4);
    line-height: 1.5;
}

.fw-pos-filter {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fw-pos-btn {
    background: var(--surface-3);
    border: 1px solid var(--border-2);
    color: var(--ink-3);
    font-family: 'Montserrat', sans-serif;
    font-size: 10.5px;
    font-weight: 500;
    padding: 4px 11px;
    border-radius: 20px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.fw-pos-btn:hover {
    color: var(--ink);
}

.fw-pos-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #F0EDE8;
    font-weight: 600;
}

.free-words-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.fw-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fw-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fw-group-icon {
    width: 13px;
    height: 13px;
    stroke: var(--ink-4);
    stroke-width: 1.6;
    flex-shrink: 0;
    display: block;
}

.fw-group-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ink-4);
}

.fw-group-count {
    font-size: 9.5px;
    color: var(--ink-4);
    background: var(--surface-3);
    border-radius: 8px;
    padding: 1px 6px;
    margin-left: 2px;
}

.fw-group-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-left: 18px;
}

.fw-chip {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--ink-2);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 400;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s, transform .1s;
    white-space: nowrap;
}

.fw-chip:hover {
    background: var(--surface-3);
    color: var(--ink);
    border-color: rgba(177, 131, 32, .4);
    transform: translateY(-1px);
}

.fw-empty {
    font-size: 12px;
    color: var(--ink-4);
    padding: 12px 0;
}

/* --- Toast Notificación --- */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #2e7d32;
    /* Un verde premium y oscuro */
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.toast-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    margin-left: 8px;
    padding: 0;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ipa {
    color: var(--ink-4);
    font-size: 0.9rem;
}


/* ─── STUDY DASHBOARD · SESSION ─── */
/* ═══════════════════════════════════════════════════════
   STUDY DASHBOARD
   ═══════════════════════════════════════════════════════ */
#flashcardArea {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* ─── El modal grande ─── */
.study-dashboard {
    background: var(--bg);
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ─── Header del dashboard ─── */
.study-dashboard-header {
    display: flex;
    align-items: center;
    padding: 0 0 0;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}

/* ─── Tabs de navegación (pill style) ─── */
.study-tabs {
    display: flex;
    gap: 4px;
}

.study-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ink-4);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    letter-spacing: 0.2px;
    border-radius: 6px 6px 0 0;
    position: relative;
    bottom: -1px;
}

.study-tab:hover {
    color: var(--ink-2);
    background: var(--surface-2);
}

.study-tab.active {
    color: var(--accent-2);
    border-bottom-color: var(--accent);
    background: var(--surface-2);
}

/* ─── Paneles ─── */
.study-panel {
    display: none;
    flex-direction: column;
    gap: 24px;
    flex: 1;
    padding: 28px;
}

.study-panel.active {
    display: flex;
}

#sessionConfig {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ─── Secciones internas ─── */
.home-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-section-title,
.study-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-4);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.study-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ─── Stat grid ─── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: border-color 0.18s;
}

.stat-card:hover {
    border-color: var(--border-2);
}

.stat-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--ink-4);
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.3px;
}

/* ─── Gráfico de barras de niveles ─── */
.level-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.level-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.level-bar-label {
    font-size: 12px;
    color: var(--ink-4);
    width: 52px;
    flex-shrink: 0;
}

.level-bar-track {
    flex: 1;
    height: 8px;
    background: var(--surface-3);
    border-radius: 4px;
    overflow: hidden;
}

.level-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(.4, 0, .2, 1);
}

.level-bar-count {
    font-size: 12px;
    color: var(--ink-3);
    min-width: 24px;
    text-align: right;
    font-weight: 600;
}

/* Colores por nivel */
.level-bar-row[data-level="0"] .level-bar-fill {
    background: #4a4a48;
}

.level-bar-row[data-level="1"] .level-bar-fill {
    background: linear-gradient(90deg, #8b6914, #a07a20);
}

.level-bar-row[data-level="2"] .level-bar-fill {
    background: linear-gradient(90deg, #4a7a8a, #5a9aaa);
}

.level-bar-row[data-level="3"] .level-bar-fill {
    background: linear-gradient(90deg, #3a7a5a, #4a9a6a);
}

.level-bar-row[data-level="4"] .level-bar-fill {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ─── Actividad reciente ─── */
.recent-activity-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recent-activity-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--ink-3);
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.recent-empty {
    font-size: 13px;
    color: var(--ink-4);
    font-style: italic;
}

/* ─── Cards seleccionables (source & mode) ─── */
.source-options,
.mode-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.option-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border-2);
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
    user-select: none;
}

.option-card:hover {
    background: var(--surface-2);
    border-color: var(--ink-4);
}

.option-card.selected {
    border-color: var(--accent);
    background: var(--surface-2);
}

.option-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    pointer-events: none;
}

.option-card-desc {
    font-size: 11.5px;
    color: var(--ink-4);
    line-height: 1.5;
    pointer-events: none;
}


/* ─── Área de sesión activa ─── */
.session-area {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.session-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
}

.session-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--surface-3);
    border-radius: 2px;
    overflow: hidden;
}

.session-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 2px;
    transition: width 0.4s ease;
}

.session-counter {
    font-size: 13px;
    color: var(--ink-4);
    font-weight: 600;
    white-space: nowrap;
}

/* ─── Study card (flashcard 3D) ─── */
.study-card-container {
    perspective: 1200px;
    width: 100%;
    max-width: 640px;
    height: 300px;
    cursor: pointer;
}

.study-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(.4, 0, .2, 1);
}

.study-card-container.flipped .study-card {
    transform: rotateY(180deg);
}

.study-card-front,
.study-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border-2);
    padding: 32px 28px;
    text-align: center;
}

.study-card-back {
    transform: rotateY(180deg);
    justify-content: center;
}

.sc-hint {
    font-size: 11px;
    color: var(--ink-4);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
}

.sc-word {
    font-family: 'Cormorant Garamond', serif;
    font-size: 56px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}

.sc-approx {
    font-size: 15px;
    color: var(--accent-2);
    font-weight: 500;
}

.sc-ipa {
    font-family: 'Noto Sans', 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--ink-4);
    background: var(--surface-2);
    padding: 3px 10px;
    border: 1px solid var(--border);
}

.sc-divider {
    border: none;
    border-top: 1px solid var(--border);
    width: 60%;
    margin: 4px 0;
}

.sc-translation {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
}

/* ─── Botones de respuesta ─── */
.response-btns {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 640px;
}

.resp-btn {
    flex: 1;
    padding: 14px 10px;
    border: 1px solid transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s, filter 0.15s;
    letter-spacing: 0.2px;
}

.resp-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.15);
}

.resp-btn:active {
    transform: translateY(0);
}

.resp-btn--no {
    background: rgba(200, 80, 70, 0.15);
    border-color: rgba(200, 80, 70, 0.3);
    color: #d87878;
}

.resp-btn--almost {
    background: rgba(200, 160, 50, 0.15);
    border-color: rgba(200, 160, 50, 0.3);
    color: #c8a050;
}

.resp-btn--yes {
    background: rgba(80, 180, 100, 0.15);
    border-color: rgba(80, 180, 100, 0.3);
    color: #5ab46a;
}

/* ─── Opción múltiple ─── */
.mc-question {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mc-hint {
    font-size: 11px;
    color: var(--ink-4);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
}

.mc-word {
    margin-bottom: 0.5em;
    font-family: 'Cormorant Garamond', serif;
    font-size: 56px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}

.mc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 520px;
}

.mc-opt {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--ink-2);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 18px 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    text-align: center;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-opt:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--ink-4);
    color: var(--ink);
}

.mc-opt.correct {
    background: rgba(80, 180, 100, 0.15);
    border-color: rgba(80, 180, 100, 0.5);
    color: #5ab46a;
}

.mc-opt.incorrect {
    background: rgba(200, 80, 70, 0.12);
    border-color: rgba(200, 80, 70, 0.35);
    color: #d87878;
}

/* ─── Botón terminar sesión ─── */
.end-session-btn {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--ink-4);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.18s;
    margin-top: 8px;
}

.end-session-btn:hover {
    border-color: var(--ink-4);
    color: var(--ink-3);
}

/* ─── Panel Favoritas ─── */
.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.favorites-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 48px 20px;
    text-align: center;
    color: var(--ink-4);
}

.favorites-empty-icon {
    font-size: 40px;
    opacity: 0.3;
}

.favorites-empty p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-4);
}

/* ─── RESPONSIVE MOBILE (≤600px) ─── */

/* ─── Cards de favoritas ─── */
.fav-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: border-color 0.15s;
}

.fav-card:hover {
    border-color: var(--border-2);
}

.fav-word {
    font-size: 18px;
    font-weight: 500;
    color: var(--ink-2);
    flex: 1;
}

.fav-actions {
    display: flex;
    gap: 6px;
}

.fav-study-btn,
.fav-remove-btn {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--ink-4);
    font-size: 14px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.fav-study-btn:hover {
    border-color: var(--accent);
    color: var(--accent-2);
    background: var(--accent-dim);
}

.fav-remove-btn:hover {
    border-color: rgba(200, 80, 70, 0.4);
    color: #d87878;
    background: rgba(200, 80, 70, 0.08);
}

/* ─── Actividad reciente ─── */
.recent-word {
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-2);
    flex: 1;
}

.recent-level {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-2);
    background: rgba(177, 131, 32, 0.12);
    border: 1px solid rgba(177, 131, 32, 0.2);
    padding: 2px 7px;
    letter-spacing: 0.3px;
}

.recent-ago {
    font-size: 11px;
    color: var(--ink-4);
    white-space: nowrap;
}

/* ─── Botones de respuesta bloqueados (antes de flipear) ─── */
.resp-btn.locked {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ─── Resumen de sesión ─── */
.session-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 40px 20px;
    text-align: center;
    animation: fadeInUp 0.3s ease-out forwards;
}

.summary-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--ink);
}

.summary-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 20px 28px;
    min-width: 90px;
}

.summary-stat-num {
    font-family: 'Montserrat', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}

.summary-stat-num.summary-correct {
    color: #5ab46a;
}

.summary-stat-num.summary-incorrect {
    color: #d87878;
}

.summary-stat-label {
    font-size: 11px;
    color: var(--ink-4);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* --- SEO --- */
.seo-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    /* Asumiendo que tenés variables, o usá un color claro */
    text-align: center;
}

/* Oculto en desktop — visible en @media 600px */
.mobile-bottom-nav {
    display: none;
}

.mobile-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--t-base) var(--ease-snappy);
}



/* ═══════════════════════════════════════════════════════
   RESPONSIVE APP
   ═══════════════════════════════════════════════════════ */

@media (max-width: 600px) {

    .modal {
        padding: 24px 18px;
        gap: 14px;
    }

    .search-box {
        display: grid;
    }

    .main-input,
    .dic-input {
        font-size: 16px;
        min-width: 0;
    }

    .examples-row,
    .history-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .history-list {
        flex-wrap: nowrap;
    }

    .examples-row::-webkit-scrollbar,
    .history-row::-webkit-scrollbar {
        display: none;
    }

    .example-chip,
    .history-item {
        flex-shrink: 0;
    }

    .cyrillic-keyboard {
        max-width: none;
        width: calc(100% + 40px);
        margin-left: -20px;
        margin-right: -20px;
        padding: 12px 4px 10px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .kb-row {
        flex-wrap: nowrap;
        gap: 1.5px;
        width: 100%;
        padding: 0 2px;
    }

    .kb-key {
        flex: 1 1 0;
        min-width: 0;
        height: 35px;
        font-size: 18px;
        padding: 0;
        border-radius: 3px;
    }

    .kb-key--wide {
        flex: 2.5 1 0;
        font-size: 11px;
    }

    .kb-key--action {
        flex: 1.5 1 0;
    }

    .word-title,
    .dic-detail-word,
    .dic-word {
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .dic-word {
        font-size: 15px;
    }

    .dic-detail-word {
        font-size: 30px;
    }

    .dic-def {
        min-width: 0;
        flex-basis: 100%;
    }

    .dic-hint {
        display: none;
    }

    .seo-title {
        font-size: 1.5em;
    }

    .fw-sidebar {
        width: 100%;
        height: 72vh;
        top: auto;
        bottom: 0;
        left: 0;
        border-right: none;
        border-top: 1px solid var(--border-2);
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .fw-sidebar.open {
        transform: translateY(0);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, .5);
    }

    .fw-tab {
        display: none !important;
    }

    .study-dashboard {
        width: 100vw;
        height: auto;
        min-height: 100dvh;
        max-width: 100%;
        max-height: none;
        border: none;
        border-radius: 0;
        padding: 10px 20px 60px;
    }

    .study-dashboard-header {
        align-items: center;
        padding: 10px 20px;
    }

    .study-tabs {
        display: flex;
        gap: 0;
        width: 100%;
    }

    .study-tab {
        flex: 1;
        text-align: center;
        padding: 10px 6px;
        font-size: 12px;
    }

    .study-panel {
        padding: 18px 16px 24px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        flex-direction: row;
        justify-content: space-between;
        padding: 14px 16px;
    }

    .stat-number {
        font-size: 28px;
    }

    .source-options,
    .mode-options {
        grid-template-columns: 1fr;
    }

    .study-card-container {
        height: 200px;
    }

    .end-session-btn {
        margin-top: 0;
    }

    .sc-word {
        font-size: 38px;
    }

    .sc-approx {
        font-size: 13px;
    }

    .sc-translation {
        font-size: 14px;
    }

    .mc-word {
        font-size: 40px;
    }

    .response-btns {
        flex-direction: column;
    }

    .mc-grid {
        grid-template-columns: 1fr;
    }

    .summary-stats {
        gap: 10px;
    }

    .summary-stat {
        padding: 14px 16px;
        min-width: 70px;
    }

    .summary-stat-num {
        font-size: 28px;
    }

    .app-header__nav {
        display: none;
    }

    .main-content {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
        min-height: 100dvh;
    }



    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: var(--z-overlay);
        background: var(--bg);
        border-top: 1px solid var(--border);
        height: calc(56px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        align-items: stretch;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: transparent;
        border: none;
        color: var(--ink-4);
        font-family: var(--font-sans);
        font-size: 9px;
        font-weight: 500;
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        cursor: pointer;
        position: relative;
        transition: color var(--t-base) var(--ease-snappy);
        padding: 0;
    }

    .mobile-nav-item[aria-current="page"] {
        color: var(--accent);
        font-weight: 600;
    }

    .mobile-nav-item[aria-current="page"]::before {
        opacity: 1;
    }

    .mobile-nav-item svg,
    .mobile-nav-item i {
        width: 18px;
        height: 18px;
        color: inherit;
    }

    .mobile-nav-badge {
        position: absolute;
        top: 6px;
        left: calc(50% + 6px);
        background: var(--accent);
        color: #0D0D0C;
        font-family: var(--font-mono);
        font-size: 9px;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        line-height: 1;
    }

    .footer {
        display: none;
    }
}

@media (max-width: 400px) {
    .footer {
        display: none;
    }
}