.cwn-app,
.cwn-app * {
    box-sizing: border-box;
}

.cwn-app {
    --cwn-primary: #1677ff;
    --cwn-primary-dark: #075cc7;
    --cwn-text: #14213d;
    --cwn-muted: #62708a;
    --cwn-border: #dbe4f0;
    --cwn-soft: #f5f8fc;
    --cwn-success: #087f5b;
    --cwn-warning: #9a6700;
    --cwn-danger: #c92a2a;
    width: 100%;
    max-width: 920px;
    margin: 32px auto;
    padding: 0 16px;
    color: var(--cwn-text);
    font-family: inherit;
}

.cwn-card {
    padding: clamp(22px, 4vw, 42px);
    border: 1px solid var(--cwn-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(20, 33, 61, 0.08);
}

.cwn-heading {
    margin-bottom: 24px;
    text-align: center;
}

.cwn-heading h2 {
    margin: 12px 0 8px;
    color: var(--cwn-text);
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.08;
}

.cwn-heading p {
    max-width: 690px;
    margin: 0 auto;
    color: var(--cwn-muted);
    font-size: 16px;
    line-height: 1.6;
}

.cwn-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #e8f3ff;
    color: #075cc7;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
}

.cwn-dropzone {
    display: flex;
    min-height: 275px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px;
    border: 2px dashed #9eb9da;
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8fd 100%);
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.cwn-dropzone:hover,
.cwn-dropzone:focus,
.cwn-dropzone.is-dragging {
    border-color: var(--cwn-primary);
    background: #eef6ff;
    outline: none;
    transform: translateY(-1px);
}

.cwn-upload-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    place-items: center;
    border-radius: 16px;
    background: var(--cwn-primary);
    color: #fff;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
}

.cwn-dropzone > strong {
    font-size: 21px;
}

.cwn-dropzone > span {
    margin-top: 5px;
    color: var(--cwn-muted);
}

.cwn-picker-buttons,
.cwn-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.cwn-picker-buttons {
    margin-top: 20px;
}

.cwn-btn {
    min-height: 46px;
    padding: 11px 18px;
    border: 0;
    border-radius: 11px;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease, background .15s ease;
}

.cwn-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.cwn-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.cwn-btn-primary,
.cwn-btn-convert {
    background: var(--cwn-primary);
    color: #fff;
}

.cwn-btn-primary:hover:not(:disabled),
.cwn-btn-convert:hover:not(:disabled) {
    background: var(--cwn-primary-dark);
}

.cwn-btn-secondary {
    border: 1px solid var(--cwn-border);
    background: #fff;
    color: var(--cwn-text);
}

.cwn-btn-danger {
    border: 1px solid #ffc9c9;
    background: #fff5f5;
    color: var(--cwn-danger);
}

.cwn-settings {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
    gap: 16px;
    margin-top: 18px;
}

.cwn-setting,
.cwn-check-row {
    min-height: 132px;
    padding: 18px;
    border: 1px solid var(--cwn-border);
    border-radius: 15px;
    background: #fff;
}

.cwn-setting-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.cwn-setting label,
.cwn-check-row strong {
    font-weight: 800;
}

.cwn-setting output {
    min-width: 54px;
    padding: 5px 9px;
    border-radius: 8px;
    background: #e8f3ff;
    color: #075cc7;
    font-weight: 900;
    text-align: center;
}

.cwn-setting input[type="range"] {
    width: 100%;
    accent-color: var(--cwn-primary);
}

.cwn-setting small,
.cwn-check-row small {
    display: block;
    margin-top: 9px;
    color: var(--cwn-muted);
    font-size: 13px;
    line-height: 1.45;
}

.cwn-check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.cwn-check-row input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex: 0 0 auto;
    accent-color: var(--cwn-primary);
}

.cwn-file-summary,
.cwn-progress-wrap,
.cwn-message,
.cwn-results,
.cwn-privacy-note {
    margin-top: 16px;
    border-radius: 14px;
}

.cwn-file-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 17px;
    background: var(--cwn-soft);
}

.cwn-file-summary[hidden],
.cwn-progress-wrap[hidden],
.cwn-message[hidden],
.cwn-btn[hidden] {
    display: none !important;
}

.cwn-file-summary div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cwn-file-summary span {
    color: var(--cwn-muted);
    font-size: 13px;
}

.cwn-link-button {
    padding: 5px;
    border: 0;
    background: transparent;
    color: var(--cwn-primary-dark);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.cwn-progress-wrap {
    padding: 16px;
    border: 1px solid var(--cwn-border);
    background: #fff;
}

.cwn-progress-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.cwn-progress {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9eef5;
}

.cwn-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--cwn-primary);
    transition: width .18s linear;
}

.cwn-current-file {
    overflow: hidden;
    margin-top: 8px;
    color: var(--cwn-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cwn-actions {
    margin-top: 18px;
}

.cwn-btn-convert {
    min-width: min(100%, 320px);
    min-height: 54px;
    font-size: 17px;
}

.cwn-message {
    padding: 14px 16px;
    border: 1px solid var(--cwn-border);
    background: var(--cwn-soft);
    font-weight: 700;
    line-height: 1.45;
}

.cwn-message.is-success {
    border-color: #b2f2dc;
    background: #ebfbee;
    color: var(--cwn-success);
}

.cwn-message.is-warning {
    border-color: #ffe8a1;
    background: #fff9db;
    color: var(--cwn-warning);
}

.cwn-results {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border: 1px solid var(--cwn-border);
    background: var(--cwn-soft);
}

.cwn-results > strong {
    width: 100%;
}

.cwn-result-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    padding: 9px 14px;
    border-radius: 10px;
    background: var(--cwn-primary);
    color: #fff !important;
    font-weight: 800;
    text-decoration: none !important;
}

.cwn-privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: #f1f3f5;
    color: #495057;
}

.cwn-privacy-note p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .cwn-card {
        padding: 20px 15px;
        border-radius: 16px;
    }

    .cwn-settings {
        grid-template-columns: 1fr;
    }

    .cwn-setting,
    .cwn-check-row {
        min-height: 0;
    }

    .cwn-dropzone {
        min-height: 250px;
        padding: 22px 14px;
    }

    .cwn-picker-buttons,
    .cwn-picker-buttons .cwn-btn,
    .cwn-actions,
    .cwn-actions .cwn-btn {
        width: 100%;
    }

    .cwn-file-summary {
        align-items: flex-start;
        flex-direction: column;
    }
}

.cwn-savings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.cwn-savings[hidden] {
    display: none !important;
}

.cwn-savings > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    padding: 15px;
    border: 1px solid var(--cwn-border);
    border-radius: 14px;
    background: var(--cwn-soft);
}

.cwn-savings span {
    color: var(--cwn-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cwn-savings strong {
    overflow-wrap: anywhere;
    font-size: 18px;
}

.cwn-savings .is-highlight {
    border-color: #b2f2dc;
    background: #ebfbee;
    color: var(--cwn-success);
}

@media (max-width: 560px) {
    .cwn-savings {
        grid-template-columns: 1fr;
    }
}
