.ct-calc {
    /* Дефолтные переменные */
    --ct-bg: #0b1220;
    --ct-surface: #020617;
    --ct-input-bg: #111c2e;
    --ct-input-border: rgba(255,255,255,0.08);
    --ct-text: #fff;
    --ct-input-text: #ffffff;
    --ct-text-muted: rgba(255,255,255,0.6);
    --ct-accent: #fbbd04;
    --ct-accent-hover: #004ffd;
    --ct-title-color: #fbbd04;
    --ct-copy-btn-bg: #fbbd04;
    --ct-copy-btn-text: #000;
    --ct-copy-btn-hover-bg: #004ffd;
    --ct-copy-btn-hover-text: #fff;
    --ct-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    --ct-radius: 14px;
    --ct-input-radius: 10px;
    --ct-preview-bg: rgba(15,23,42,0.8);
    --ct-preview-text: #ffffff;
    --ct-preview-radius: 10px;
    --ct-transition: 0.2s ease;

    background: var(--ct-bg);
    color: var(--ct-text);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
    padding: 35px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    backdrop-filter: blur(10px);
    margin: 20px 0;
    line-height: 1.5;
}

.ct-calc-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--ct-title-color) !important;
}

.ct-calc-subtitle {
    font-size: 14px;
    opacity: 0.7;
    margin: 0 0 24px;
}

.ct-manual-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ct-field {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ct-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.7;
}

/* ========== ПОЛЯ ВВОДА И СЕЛЕКТЫ – ПОЛНАЯ УНИФИКАЦИЯ ========== */
.ct-calc .ct-input,
.ct-calc .ct-select {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    line-height: 1.4;
    font-family: inherit;
    color: var(--ct-input-text);
    background: var(--ct-input-bg);
    border: 1px solid var(--ct-input-border);
    border-radius: var(--ct-input-radius);
    box-shadow: none;
    outline: none;
    appearance: none;
    margin: 0;
    box-sizing: border-box;
    min-height: 48px;
    transition: border-color var(--ct-transition), box-shadow var(--ct-transition);
}

.ct-calc .ct-input:focus,
.ct-calc .ct-select:focus {
    border-color: var(--ct-accent);
    box-shadow: 0 0 0 3px rgba(251,189,4,0.15);
    outline: none;
}

/* Убираем нативные стрелки у числового инпута */
.ct-calc .ct-input[type="number"] {
    -moz-appearance: textfield;
}
.ct-calc .ct-input[type="number"]::-webkit-inner-spin-button,
.ct-calc .ct-input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Собственная стрелка для select */
.ct-calc .ct-select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 6px;
    padding-right: 30px;
}

.ct-error {
    color: #ff4d4f;
    font-size: 14px;
    margin-bottom: 14px;
    padding: 8px 12px;
    background: rgba(255,77,79,0.1);
    border-radius: 6px;
    border-left: 3px solid #ff4d4f;
}

.ct-manual-result {
    margin-bottom: 20px;
}

.ct-clamp-result {
    background: #0a0e1a;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--ct-accent);
    word-break: break-all;
    font-family: 'Fira Code','Courier New',monospace;
    font-size: 14px;
    color: #e2e8f0;
}

.ct-clamp-result code {
    background: none;
    color: inherit;
    font-family: inherit;
}

.ct-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--ct-copy-btn-bg);
    color: var(--ct-copy-btn-text);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    font-family: inherit;
}
.ct-copy-btn:hover,
.ct-copy-btn:active {
    background: var(--ct-copy-btn-hover-bg);
    color: var(--ct-copy-btn-hover-text);
    border: none;
    transform: translateY(-1px);
}
.ct-copy-btn:active {
    transform: translateY(0);
}
.ct-copy-btn.copied {
    background: #10b981;
    color: white;
    pointer-events: none;
}

/* Превью */
.ct-preview-box,
.ct-preview {
    background: var(--ct-preview-bg);
    color: var(--ct-preview-text);
    border-radius: var(--ct-preview-radius);
    border: 1px solid rgba(255,255,255,0.03);
    padding: 14px;
    word-break: break-word;
    font-family: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    line-height: 1.6;
}

.ct-manual-preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ct-preview-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ct-preview-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.ct-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.ct-control {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ct-hint {
    font-size: 14px;
    opacity: 0.65;
    line-height: 1.6;
    margin-top: 4px;
    color: var(--ct-text-muted);
}

.ct-block {
    background: linear-gradient(145deg, var(--ct-surface) 0%, #0a1120 100%);
    border: 1px solid rgba(255,255,255,0.04);
    padding: 20px;
    border-radius: 14px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    opacity: 0;
    animation: ctFadeIn 0.3s ease forwards;
}
.ct-block:last-child {
    margin-bottom: 0;
}

@keyframes ctFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ct-block b {
    display: block;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ct-accent);
    margin-bottom: 10px;
}

.ct-clamp {
    font-family: 'Fira Code','Courier New',monospace;
    background: #0a0e1a;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    word-break: break-all;
    font-size: 13px;
    border-left: 3px solid var(--ct-accent);
    color: #e2e8f0;
}

@media (max-width:768px) {
    .ct-header,
    .ct-manual-row {
        flex-direction: column;
        gap: 14px;
    }
    .ct-calc {
        padding: 20px;
    }
}