.lh-cefr-calc-wrapper {
    --lh-main-color: #37785e;
    --lh-main-color-dark: #2e654f;
    --lh-main-color-light: #eaf3ef;
    --lh-border-light: #c9e4d9;
    --lh-border-radius: 6px;

    max-width: 700px;
    margin: 20px auto;
    padding: 16px;
    border: 4px solid var(--lh-border-light);
    border-radius: var(--lh-border-radius);
    background: #fafafa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    box-sizing: border-box;
}

.lh-cefr-calc-wrapper *,
.lh-cefr-calc-wrapper *::before,
.lh-cefr-calc-wrapper *::after {
    box-sizing: border-box;
}

.lh-cefr-calc-title {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: #151515;
}

.lh-cefr-calc-description {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.55;
    color: #666666;
}

.lh-cefr-calc-row {
    margin-bottom: 16px;
}

.lh-cefr-calc-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #222222;
}

.lh-cefr-calc-textarea {
    display: block;
    width: 100%;
    min-height: 200px;
    max-height: 420px;
    padding: 10px;
    border: 1px solid #cccccc;
    border-radius: var(--lh-border-radius);
    background: #ffffff;
    color: #222222;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.lh-cefr-calc-textarea:focus {
    outline: none;
    border-color: var(--lh-main-color);
    box-shadow: 0 0 0 2px rgba(55, 120, 94, 0.16);
}

.lh-cefr-calc-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.lh-cefr-switch-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.lh-cefr-switch-title {
    font-size: 13px;
    font-weight: 500;
    color: #222222;
}

.lh-cefr-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.lh-cefr-radio-label {
    font-size: 13px;
    color: #333333;
    cursor: pointer;
}

.lh-cefr-radio-label input {
    accent-color: var(--lh-main-color);
    cursor: pointer;
}

.lh-cefr-toggle-advanced {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333333;
    cursor: pointer;
}

.lh-cefr-toggle-advanced input {
    accent-color: var(--lh-main-color);
    cursor: pointer;
}

.lh-cefr-calc-button {
    display: inline-block;
    min-width: 140px;
    height: 40px;
    padding: 5px 18px;
    border: 3px solid var(--lh-main-color);
    border-radius: var(--lh-border-radius);
    background: var(--lh-main-color-light);
    color: #151515;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.lh-cefr-calc-button:hover {
    border-color: var(--lh-main-color);
    background: var(--lh-main-color);
    color: #ffffff;
}

.lh-cefr-calc-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(55, 120, 94, 0.2);
}

.lh-cefr-calc-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.lh-cefr-calc-button.lh-cefr-calc-button--gray {
    border-color: #b9b9b9;
    background: #ececec;
    color: #151515;
}

.lh-cefr-calc-button.lh-cefr-calc-button--gray:hover {
    border-color: #9f9f9f;
    background: #dddddd;
    color: #151515;
}

.lh-cefr-calc-note {
    font-size: 12px;
    line-height: 1.45;
    color: #777777;
}

.lh-cefr-calc-error {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: #c0392b;
}

.lh-cefr-results {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e3e3e3;
}

.lh-cefr-results-main-level {
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #151515;
}

.lh-cefr-results-main-level .lh-cefr-level-tag {
    display: inline-block;
    min-width: 44px;
    margin-left: 4px;
    padding: 3px 8px;
    border-radius: var(--lh-border-radius);
    background: var(--lh-main-color);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

.lh-cefr-results-subtitle {
    margin-bottom: 6px;
}

#lh-cefr-style-note {
    font-weight: 600;
}

.lh-cefr-results-disclaimer {
    font-size: 12px;
    line-height: 1.45;
    color: #777777;
}

.lh-cefr-progress-block {
    margin-top: 10px;
}

.lh-cefr-progress-label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #222222;
}

.lh-cefr-unknown {
    margin-top: 16px;
    font-size: 12px;
}

.lh-cefr-unknown-title {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #222222;
}

.lh-cefr-unknown-note {
    margin-bottom: 4px;
    color: #777777;
}

.lh-cefr-unknown-textarea {
    display: block;
    width: 100%;
    min-height: 120px;
    padding: 8px;
    border: 1px solid #dddddd;
    border-radius: var(--lh-border-radius);
    background: #ffffff;
    color: #222222;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.lh-cefr-unknown-textarea:focus {
    outline: none;
    border-color: var(--lh-main-color);
    box-shadow: 0 0 0 2px rgba(55, 120, 94, 0.16);
}

.lh-cefr-level-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.lh-cefr-level-btn {
    min-width: 42px;
    padding: 4px 10px;
    border: 2px solid var(--lh-main-color);
    border-radius: var(--lh-border-radius);
    background: #ffffff;
    color: #000000;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.lh-cefr-level-btn:hover,
.lh-cefr-level-btn.active {
    border-color: var(--lh-main-color);
    background: var(--lh-main-color);
    color: #ffffff;
}

.lh-cefr-level-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(55, 120, 94, 0.2);
}

.lh-read-speed-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lh-read-speed-toggle {
    display: inline-flex;
    overflow: hidden;
    border: 3px solid #37785e;
    border-radius: 6px;
    background: #ffffff;
}

.lh-read-speed-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 6px 12px;
    background: #ffffff;
    color: #333333;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.lh-read-speed-option + .lh-read-speed-option {
    border-left: 3px solid #37785e;
}

.lh-read-speed-option:hover {
    background: #eaf3ef;
}

.lh-read-speed-option.active {
    background: #37785e;
    color: #ffffff;
}

.lh-read-speed-option:focus-within {
    box-shadow: inset 0 0 0 2px rgba(55, 120, 94, 0.22);
}

@media (max-width: 480px) {
    .lh-cefr-calc-wrapper {
        margin: 10px auto;
        padding: 12px;
    }

    .lh-cefr-calc-title {
        font-size: 20px;
    }

    .lh-cefr-calc-controls {
        align-items: stretch;
    }

    .lh-cefr-calc-button {
        width: 100%;
    }

    .lh-read-speed-toggle {
        width: 100%;
    }

    .lh-read-speed-option {
        flex: 1 1 0;
        min-width: 0;
    }
}