:root {
    --bg: #0d0d0d;
    --panel: #1b1b1b;
    --panel-2: #141414;
    --border: #2a2a2a;
    --text: #f0f0f0;
    --muted: #888888;
    --accent: #d4ff00;
    --accent-dim: rgba(212, 255, 0, 0.12);
    --danger: #ff6b6b;
    --font: 'Exo 2', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(ellipse 70% 55% at 50% 0%, rgba(212, 255, 0, 0.05) 0%, transparent 55%),
        var(--bg);
}

.calc-header {
    border-bottom: 1px solid var(--border);
    background: rgba(13, 13, 13, 0.95);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.calc-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
}

.calc-back {
    display: inline-block;
    margin-bottom: 0.85rem;
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
}

.calc-back:hover { color: var(--accent); }

.calc-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.calc-brand__mark {
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: #000;
    font-weight: 800;
    font-size: 1.2rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calc-brand__title {
    font-size: clamp(1.2rem, 3vw, 1.55rem);
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.02em;
}

.calc-brand__sub {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.calc-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    align-items: start;
}

.calc-section {
    background: rgba(27, 27, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.calc-section--sticky {
    position: sticky;
    top: 7.5rem;
    margin-bottom: 0;
}

.calc-section__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.calc-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    font-size: 0.82rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calc-section__title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.calc-badge {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
    background: var(--accent-dim);
    color: var(--accent);
}

.calc-badge--muted {
    background: rgba(136, 136, 136, 0.15);
    color: var(--muted);
    text-transform: none;
    font-weight: 600;
}

.calc-grid {
    display: grid;
    gap: 0.85rem;
}

.calc-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.calc-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.calc-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}

.calc-optional {
    font-weight: 400;
    font-style: italic;
}

.calc-input-wrap {
    display: flex;
    align-items: center;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.calc-input-wrap:focus-within {
    border-color: rgba(212, 255, 0, 0.45);
}

.calc-prefix,
.calc-suffix {
    padding: 0 0.65rem;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
    flex-shrink: 0;
}

.calc-input {
    flex: 1;
    width: 100%;
    padding: 0.65rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    -moz-appearance: textfield;
}

.calc-input--plain {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    transition: border-color 0.15s;
}

.calc-input--plain:focus {
    border-color: rgba(212, 255, 0, 0.45);
}

.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calc-summary-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.calc-summary-card__title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.calc-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.calc-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.calc-summary-item__label {
    font-size: 0.68rem;
    color: var(--muted);
}

.calc-summary-item__value {
    font-size: 0.88rem;
    font-weight: 700;
}

.calc-summary-item--accent .calc-summary-item__value {
    color: var(--accent);
}

.designs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.design-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
}

.design-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.design-card__title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
}

.design-card__remove {
    background: none;
    border: none;
    color: var(--danger);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.design-card__remove:hover {
    background: rgba(255, 107, 107, 0.12);
}

.design-card__remove:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.calc-btn-add {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent-dim);
    border: 1px solid rgba(212, 255, 0, 0.55);
    border-radius: 10px;
    color: var(--accent);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.calc-btn-add:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    transform: translateY(-1px);
}

.calc-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.35rem;
}

.calc-toggle__btn {
    flex: 1;
    padding: 0.55rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.calc-toggle__btn.active {
    background: var(--accent);
    color: #000;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.breakdown-row dt {
    color: var(--muted);
    font-weight: 600;
}

.breakdown-row dd {
    font-weight: 700;
}

.breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 700;
}

.breakdown-sale {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--accent-dim);
    border: 1px solid rgba(212, 255, 0, 0.25);
    border-radius: 10px;
    text-align: center;
}

.breakdown-sale__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.breakdown-sale__price {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
}

.breakdown-sale__meta {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.breakdown-sale__meta span {
    color: var(--text);
    font-weight: 700;
}

.calc-foot {
    padding: 1.25rem;
    text-align: center;
    font-size: 0.7rem;
    color: #555;
}

@media (max-width: 900px) {
    .calc-layout {
        grid-template-columns: 1fr;
    }

    .calc-section--sticky {
        position: static;
    }

    .calc-breakdown {
        order: -1;
    }
}

@media (max-width: 560px) {
    .calc-grid--2,
    .calc-summary-grid {
        grid-template-columns: 1fr;
    }

    .calc-layout {
        padding: 1rem;
    }
}
