/* --- CONTAINER --- */
.sdc-app {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    font-family: var(--font-family, system-ui, -apple-system, BlinkMacSystemFont, sans-serif) !important;
    color: var(--sh-text) !important;
    box-sizing: border-box;
    --sdc-radius: var(--radius-2xl, 24px);
    --sdc-field-height: var(--control-height, 48px);
}

.sdc-app * {
    font-family: var(--font-family, system-ui, -apple-system, BlinkMacSystemFont, sans-serif) !important;
    box-sizing: border-box;
}

/* --- TABS --- */
.sdc-tabs {
    display: flex;
    border-radius: var(--sdc-radius);
    padding: 6px;
    gap: 8px;
    margin-bottom: 25px;
}

.sdc-tab {
    flex: 1;
    min-height: 46px;
    border: none;
    background: transparent;
    color: var(--sh-text);
    padding: 0 12px;
    border-radius: var(--radius-pill, 999px);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.sdc-tab.active {
    background: var(--lg-surface-bg-strong, var(--sh-menu-bg)) !important;
    box-shadow: var(--lg-shadow-soft, var(--shadow-sm)) !important;
    font-weight: 800;
}

/* --- MODES --- */
.sdc-mode {
    display: none;
    animation: fadeIn 0.3s ease;
}
.sdc-mode.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- INPUTS --- */
.sdc-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    opacity: 0.85;
}

.sdc-input {
    width: 100%;
    min-height: var(--sdc-field-height);
    padding: 0 15px !important;
    margin-bottom: 15px !important;
    border-radius: var(--sdc-radius) !important;
    color: var(--sh-text) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.35;
    outline: none;
    text-align: center !important;
    -webkit-appearance: none;
}

.sdc-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* --- PRESETS (Чіпи) --- */
.sdc-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto; /* Скрол на мобільному */
    padding-bottom: 5px;
    justify-content: center; /* Центруємо */
}

.sdc-chip {
    min-height: 40px;
    border-radius: var(--radius-pill, 999px);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--sh-text);
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.1s;
}

/* --- CHECKBOX (Custom) --- */
.sdc-checkbox-wrapper {
    margin-bottom: 20px;
    text-align: center;
}
.sdc-checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    user-select: none;
}
.sdc-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--sh-menu-border);
    border-radius: var(--sdc-radius);
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.sdc-checkbox-label input { display: none; } /* Сховати стандартний */
.sdc-checkbox-label input:checked + .sdc-checkbox-custom {
    background: var(--sh-text); /* Зафарбувати */
    border-color: var(--sh-text);
}
.sdc-checkbox-label input:checked + .sdc-checkbox-custom::after {
    content: '✔';
    color: var(--sh-pill-bg); /* Колір галочки (фон) */
    font-size: 14px;
}

/* --- MAIN BUTTON --- */
.sdc-btn {
    width: 100%;
    min-height: var(--sdc-field-height);
    padding: 0 22px !important;
    margin-top: 10px;
    border-radius: var(--sdc-radius) !important;
    color: var(--sh-text) !important;
    font-weight: 800 !important;
    text-transform: none;
    font-size: 14px !important;
    line-height: 1.35;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sdc-btn:active { box-shadow: none !important; }

/* --- RESULT BOX --- */
.sdc-result-box {
    margin-top: 24px;
    padding: 18px 20px;
    border-radius: var(--sdc-radius);
    text-align: left;
    position: relative;
}

.sdc-result-label {
    display: block;
    font-size: 13px;
    line-height: 1.4;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 6px;
}

.sdc-result-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.sdc-result-value {
    font-size: clamp(22px, 3.2vw, 30px);
    line-height: 1.35;
    font-weight: 800;
    color: var(--sh-text);
    overflow-wrap: anywhere;
}

.sdc-result-sub {
    margin-top: 5px;
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.45;
    font-weight: 600;
}

/* --- COPY BUTTON --- */
.sdc-copy-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: var(--sdc-radius);
    transition: background 0.2s;
}
.sdc-copy-btn:hover { background: var(--lg-surface-bg-strong); }

.sdc-tabs,
.sdc-input,
.sdc-chip,
.sdc-btn,
.sdc-result-box {
    background: var(--lg-surface-bg, var(--glass-bg)) !important;
    border: 1px solid var(--lg-surface-border, var(--border-subtle)) !important;
    box-shadow: var(--lg-shadow-soft, var(--shadow-sm)), var(--lg-inner-highlight) !important;
    color: var(--sh-text) !important;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .sdc-tabs,
    .sdc-input,
    .sdc-chip,
    .sdc-btn,
    .sdc-result-box {
        backdrop-filter: var(--lg-blur, blur(var(--glass-blur, 20px)));
        -webkit-backdrop-filter: var(--lg-blur, blur(var(--glass-blur, 20px)));
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .sdc-tabs,
    .sdc-input,
    .sdc-chip,
    .sdc-btn,
    .sdc-result-box {
        background: var(--bg-surface-solid, #ffffff) !important;
    }
}

.sdc-tab:focus-visible,
.sdc-chip:focus-visible,
.sdc-btn:focus-visible,
.sdc-input:focus-visible,
.sdc-copy-btn:focus-visible {
    outline: none;
    box-shadow: var(--lg-shadow-soft, var(--shadow-sm)), var(--lg-inner-highlight), var(--sh-ui-focus-ring) !important;
}

.sdc-btn:active,
.sdc-chip:active,
.sdc-copy-btn:active {
    transform: scale(var(--lg-press-scale, 0.98));
}

@media (prefers-reduced-motion: reduce) {
    .sdc-app * {
        transition: none !important;
        animation: none !important;
    }
}

@media (max-width: 600px) {
    .sdc-app {
        max-width: 100%;
    }

    .sdc-tabs {
        margin-bottom: 20px;
    }
}
