.popup-container.light-theme {
    --theme-scale-lg: 1; --theme-scale-sm: 1;
    --bg-color: #f0f2f5; --bg-color-rgb: 240, 242, 245;
    --text-color: #000000; --text-secondary: #333333; --hint-color: #555555; --term-color: #737b8b;
    --accent-color: #4a90e2; --card-bg: #FFFFFF; --border-color: #ccc; --header-bg: #4a90e2;
    --header-text: white; --panel-bg: #FFFFFF; --arrow-hover: #0056D2;
    --bg-gradient-start: rgba(74, 144, 226, 0.18); --inward-glow: rgba(74, 144, 226, 0.4);
    --donut-inner-bg: rgba(74, 144, 226, 0.15); --popup-border: var(--header-bg);
    --scrollbar-thumb: #c1c1c1; --scrollbar-track: transparent;
}

.popup-container * { box-sizing: border-box !important; outline: none !important; }
.popup-container img { image-rendering: crisp-edges; transform: translateZ(0); backface-visibility: hidden; }

.popup-container {
    display: flex; flex-direction: column; align-items: center; padding: 0;
    background-color: var(--header-bg); color: var(--text-color);
    width: 430px; height: 600px; position: relative; border: 3px solid var(--popup-border);
    overflow: visible; /* ИЗМЕНЕНО: теперь курсор видно за пределами плагина */
    font-family: 'Segoe UI', system-ui, sans-serif;
    border-radius: 0 !important;
}
.popup-container .content-wrapper {
    width: 100%; height: 100%; background-color: transparent; box-shadow: none;
    position: relative; z-index: 1; overflow: hidden; padding: 15px 15px 0 15px;
    display: flex; flex-direction: column;
}
.popup-container .content-wrapper::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1; pointer-events: none; background: linear-gradient(to bottom, #f0f2f5 45%, #d7e2f1 100%);
}

.popup-container .text-box::-webkit-scrollbar { width: 6px; }
.popup-container .text-box::-webkit-scrollbar-track { background: transparent; margin-top: 5px; margin-bottom: 5px; }
.popup-container .text-box::-webkit-scrollbar-thumb { background-color: #888888; border-radius: 10px; }

.popup-container .header { width: 100%; display: flex; justify-content: space-between; align-items: center; position: relative; margin-bottom: 8px; flex-shrink: 0; }
.popup-container .header-left, .popup-container .header-right { display: flex; align-items: center; flex: 1; }
.popup-container .header-left { padding-left: 5px; gap: 10px; }
.popup-container .header-right { justify-content: flex-end; padding-right: 5px; }
.popup-container .header-title { font-size: 24px; font-weight: bold; flex-shrink: 0; letter-spacing: 1.2px; }
.popup-container .title-ai { color: var(--header-bg); }
.popup-container .title-term { color: var(--term-color); }
.popup-container .info-trigger { font-size: 20px; font-weight: bold; opacity: 0.8; color: var(--header-bg); display: flex; align-items: center; justify-content: center; transition: opacity 0.25s, transform 0.2s; }
.popup-container .theme-switch { position: relative; width: 44px; height: 24px; display: flex; align-items: center; }
.popup-container .theme-track { position: absolute; width: 100%; height: 14px; background-color: var(--header-bg); opacity: 0.2; border-radius: 7px; }
.popup-container .theme-ball { position: absolute; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 2; color: var(--header-bg); transform: translateX(0); }
.popup-container .theme-ball svg { width: 18px; height: 18px; stroke: var(--header-bg); }
.popup-container .save-btn { color: var(--header-bg); opacity: 0.8; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 2px 8px; border-radius: 15px; }
.popup-container .save-text { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

.popup-container .translation-block { width: 100%; flex-shrink: 0; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.popup-container .text-box-wrapper { display: flex; flex-direction: column; align-items: center; width: 175px; position: relative; }
.popup-container .text-box { width: 100%; height: 80px; border: none !important; box-shadow: none !important; border-radius: 12px; background-color: var(--card-bg); color: var(--text-color); padding: 10px; font-size: 14px; font-family: 'Segoe UI', system-ui, sans-serif !important; resize: none; overflow-y: auto !important; }
.popup-container .translation-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 34px; flex-shrink: 0; }
.popup-container .swap-btn { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background-color: var(--card-bg); border: 1.5px solid var(--header-bg); color: var(--header-bg); transition: transform 0.2s; }
.popup-container .swap-btn.cancel-mode { border-color: #ff4757; color: #ff4757; background-color: rgba(255, 71, 87, 0.1); }

.popup-container .controls-row { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 8px; margin-bottom: 14px; padding: 0 5px; }
.popup-container .lang-select-btn { background-color: var(--card-bg); border: 1px solid rgba(0, 0, 0, 0.04) !important; border-radius: 20px; color: var(--hint-color); font-size: 11px; padding: 8px 12px; display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; font-weight: 700; letter-spacing: 1.2px; white-space: nowrap; overflow: hidden; }
.popup-container .inline-flag { width: 16px; height: 12px; border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,0.2); object-fit: cover; }

.popup-container .translate-action-btn {
    background-color: var(--card-bg);
    border: 1px solid transparent !important;
    box-sizing: border-box !important;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 12px;
    color: var(--text-color);
    font-weight: 700;
    flex: 1.3 1 0%;
    letter-spacing: 1.2px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.popup-container .translate-action-btn:hover,
.popup-container .translate-action-btn.mockup-hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.08), rgba(99, 102, 241, 0.08));
    border-color: var(--header-bg) !important;
    color: var(--header-bg);
    box-shadow: 0 2px 12px rgba(74, 144, 226, 0.15);
    transform: translateY(-1px);
}
.popup-container .translate-action-btn:active {
    transform: translateY(0) scale(0.96);
}
.popup-container .translate-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.popup-container .separator-line { width: 100%; height: 1px; background-color: var(--header-bg); margin: 2px 0; opacity: 0.3; }

.popup-container .level-section { width: 100%; display: flex; align-items: center; gap: 15px; padding-left: 35px; flex-shrink: 0; margin-bottom: 5px; }
.popup-container .level-indicator { display: inline-block; transform-origin: left center; font-size: 80px; font-weight: bold; color: var(--header-bg); line-height: 1; min-width: 90px; }
.popup-container .level-text-anim { display: inline-block; animation: levelTick 0.25s ease; }
.popup-container .level-hint { transform-origin: left center; font-size: 14px; font-style: italic; color: var(--hint-color); }

.popup-container .usage-section { width: 100%; display: flex; justify-content: flex-end; align-items: center; gap: 15px; padding-right: 35px; flex-shrink: 0; margin-bottom: 5px; }
.popup-container .usage-hint { transform-origin: right center; font-size: 14px; font-style: italic; color: var(--hint-color); text-align: right; }

.popup-container .usage-donut { position: relative; width: 80px; height: 80px; flex-shrink: 0; transform: translateZ(0); }
.popup-container .donut-svg { position: absolute; top: 0; left: 0; width: 80px; height: 80px; transform: rotate(-90deg) translateZ(0); display: block; overflow: visible; }
.popup-container .donut-track { fill: transparent; stroke: rgba(128, 128, 128, 0.2); stroke-width: 14; }
.popup-container .donut-fill { fill: transparent; stroke: var(--header-bg); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 188.496; transition: stroke-dashoffset 0.8s ease-out; }
.popup-container .usage-donut-number { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) translateZ(0); z-index: 2; width: 44px; height: 44px; box-sizing: border-box; border: 2px solid var(--header-bg); border-radius: 50%; background-color: var(--donut-inner-bg); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: bold; color: var(--header-bg); margin: 0; padding: 0; backface-visibility: hidden; }

.popup-container .examples-section { width: 100%; display: flex; flex-direction: column; flex-grow: 1; min-height: 0; }
.popup-container .examples-header { display: flex; justify-content: flex-start; align-items: center; position: relative; margin-top: 4px; margin-bottom: 4px; }
.popup-container .examples-title-container { position: relative; width: 105px; height: 24px; margin-left: 10px; }
.popup-container .examples-title { position: absolute; left: 0; top: 50%; font-size: 18px; font-weight: bold; color: var(--header-bg); opacity: 0; visibility: hidden; line-height: 1; transform: translateY(-50%); transition: opacity 0.25s, visibility 0.25s; }
.popup-container .examples-title.active { opacity: 1; visibility: visible; }
.popup-container .examples-arrows-container { display: flex !important; align-items: center !important; gap: 15px !important; margin: 0 auto !important; position: absolute !important; left: 0 !important; right: 0 !important; width: max-content !important; z-index: 5; }

/* ИЗМЕНЕНИЯ ЗДЕСЬ ДЛЯ ЗАЛИВКИ СТРЕЛКИ ФИРМЕННЫМ ЦВЕТОМ */
.popup-container .examples-arrow-button { color: var(--header-bg); display: flex; align-items: center; justify-content: center; transition: color 0.2s ease, transform 0.15s ease; cursor: pointer; }
.popup-container .examples-arrow-button svg { transition: fill 0.2s ease, stroke 0.2s ease; }
.popup-container .examples-arrow-button.mockup-hover-arrow { color: var(--header-bg); }
.popup-container .examples-arrow-button.mockup-hover-arrow svg { fill: var(--header-bg); stroke: var(--header-bg); }

.popup-container .left-arrow svg { transform: rotate(180deg); }
.popup-container .content-lang-toggle { position: absolute; right: 10px; display: flex; align-items: center; gap: 6px; }
.popup-container .toggle-flag { width: 24px; height: 16px; border-radius: 3px; opacity: 0.3; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: transform 0.2s, opacity 0.2s; }
.popup-container .toggle-flag.active { opacity: 1; transform: scale(1.15); border: 1px solid var(--header-bg); }

.popup-container .carousel-container { width: 100%; flex-grow: 1; min-height: 0; overflow: hidden; position: relative; margin-bottom: 15px; padding: 4px 2px; border-radius: 12px; background-color: var(--card-bg); }
.popup-container .carousel-track { display: flex; width: 300%; height: 100%; transition: transform 0.4s ease-in-out; }
.popup-container .carousel-track.tab-0 { transform: translateX(0); }
.popup-container .carousel-track.tab-1 { transform: translateX(-33.333%); }
.popup-container .carousel-track.tab-2 { transform: translateX(-66.666%); }
.popup-container .carousel-slide { width: 33.333%; height: 100%; padding: 0 2px; }

.popup-container .examples-content { width: 100%; height: 100%; padding: 8px 10px 20px 10px !important; font-size: 13.5px; color: var(--text-color); overflow: hidden; white-space: normal; text-align: left; line-height: 1.4; opacity: 0; transform: translateY(15px); transition: opacity 0.25s, transform 0.4s; box-sizing: border-box; }
.popup-container .carousel-slide.active-slide .examples-content.ready { opacity: 1; transform: translateY(0); }
.popup-container .list-item { display: flex; align-items: flex-start; margin-bottom: 8px; line-height: 1.4; }
.popup-container .list-item::before { content: '•'; color: var(--header-bg); font-size: 20px; line-height: 1; margin-right: 8px; transform: translateY(-2px); }
.popup-container .content-fade-wrapper { animation: contentSwitchFade 0.3s ease-in-out; }

.popup-container .carousel-pagination { position: absolute; bottom: 8px; left: 0; right: 0; width: 100%; display: flex; justify-content: center; align-items: center; gap: 6px; z-index: 10; }
.popup-container .dot { width: 6px; height: 6px; border-radius: 3px; background-color: var(--hint-color); opacity: 0.4; transition: transform 0.2s, opacity 0.25s, width 0.25s; }
.popup-container .dot.active { width: 18px; background-color: var(--header-bg); opacity: 1; }

@keyframes contentSwitchFade { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes levelTick { 0% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.05); } 100% { opacity: 1; transform: scale(1); } }