.dpc-calculator,
.dpc-calculator * {
    box-sizing: border-box;
}

.dpc-calculator {
    --dpc-accent: #6f4bd8;
    --dpc-accent-dark: #5131b8;
    --dpc-ink: #17161b;
    --dpc-muted: #6d6977;
    --dpc-line: #e7e3ef;
    --dpc-soft: #f7f5fb;
    --dpc-card: #ffffff;
    width: 100%;
    max-width: 1180px;
    margin: 24px auto;
    font-family: inherit;
    color: var(--dpc-ink);
}

.dpc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 28px 30px;
    border: 1px solid var(--dpc-line);
    border-radius: 20px 20px 0 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f6ff 100%);
}

.dpc-eyebrow {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    color: var(--dpc-accent-dark);
}

.dpc-header h2,
.dpc-section-heading h3,
.dpc-breakdown h4 {
    margin: 0;
    color: var(--dpc-ink);
}

.dpc-header h2 {
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.12;
    font-weight: 800;
}

.dpc-header p,
.dpc-section-heading p {
    margin: 8px 0 0;
    color: var(--dpc-muted);
}

.dpc-brand-mark {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--dpc-accent);
    color: #fff;
    font-weight: 900;
    font-size: 26px;
    box-shadow: 0 12px 30px rgba(77, 48, 166, .22);
}

.dpc-layout {
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    border-left: 1px solid var(--dpc-line);
    border-right: 1px solid var(--dpc-line);
}

.dpc-panel {
    padding: 30px;
    background: var(--dpc-card);
}

.dpc-input-panel {
    border-right: 1px solid var(--dpc-line);
}

.dpc-results-panel {
    background: #fbfaff;
}

.dpc-section-heading {
    margin-bottom: 22px;
}

.dpc-section-heading h3 {
    font-size: 20px;
    font-weight: 800;
}

.dpc-section-heading p {
    font-size: 13px;
}

.dpc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dpc-field {
    display: block;
}

.dpc-label,
.dpc-help {
    display: block;
}

.dpc-label {
    margin-bottom: 3px;
    font-size: 13px;
    font-weight: 800;
}

.dpc-help {
    min-height: 30px;
    margin-bottom: 7px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--dpc-muted);
}

.dpc-input-wrap {
    display: flex;
    align-items: center;
    min-height: 46px;
    border: 1px solid var(--dpc-line);
    border-radius: 11px;
    background: #fff;
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.dpc-input-wrap:focus-within {
    border-color: var(--dpc-accent);
    box-shadow: 0 0 0 3px rgba(111, 75, 216, .12);
}

.dpc-input-wrap input {
    width: 100%;
    min-width: 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 11px 12px !important;
    color: var(--dpc-ink) !important;
    font: inherit;
}

.dpc-input-wrap > span {
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 11px;
    border-left: 1px solid var(--dpc-line);
    background: var(--dpc-soft);
    color: var(--dpc-muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.dpc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.dpc-btn {
    appearance: none;
    border: 0;
    border-radius: 11px;
    padding: 12px 16px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.dpc-btn:hover {
    transform: translateY(-1px);
}

.dpc-btn-primary {
    background: var(--dpc-accent);
    color: #fff;
    box-shadow: 0 8px 20px rgba(111, 75, 216, .2);
}

.dpc-btn-primary:hover {
    background: var(--dpc-accent-dark);
}

.dpc-btn-secondary {
    background: var(--dpc-soft);
    color: var(--dpc-ink);
}

.dpc-note {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 11px;
    background: #f6f8f5;
    color: #5e665b;
    font-size: 11px;
    line-height: 1.5;
}

.dpc-status {
    padding: 18px;
    border: 1px dashed #d7d0e6;
    border-radius: 14px;
    color: var(--dpc-muted);
    text-align: center;
    background: #fff;
}

.dpc-status[data-dpc-status="error"] {
    border-color: #efc2c2;
    background: #fff7f7;
    color: #8c2f2f;
}

.dpc-hero-result {
    padding: 22px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: var(--dpc-ink);
    color: #fff;
}

.dpc-hero-result span,
.dpc-hero-result small {
    display: block;
}

.dpc-hero-result span {
    font-size: 12px;
    opacity: .76;
    font-weight: 700;
}

.dpc-hero-result strong {
    display: block;
    margin: 6px 0;
    font-size: clamp(27px, 4vw, 39px);
    line-height: 1;
}

.dpc-hero-result small {
    font-size: 12px;
    opacity: .82;
}

.dpc-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dpc-metric {
    padding: 14px;
    border: 1px solid var(--dpc-line);
    border-radius: 13px;
    background: #fff;
}

.dpc-metric span,
.dpc-metric strong {
    display: block;
}

.dpc-metric span {
    margin-bottom: 6px;
    color: var(--dpc-muted);
    font-size: 11px;
    line-height: 1.35;
}

.dpc-metric strong {
    font-size: 17px;
}

.dpc-metric-highlight {
    border-color: rgba(111, 75, 216, .22);
    background: #f8f5ff;
}

.dpc-breakdown {
    margin-top: 18px;
    padding: 18px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--dpc-line);
}

.dpc-breakdown h4 {
    margin-bottom: 10px;
    font-size: 15px;
}

.dpc-breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 8px 0;
    border-bottom: 1px solid #f0edf5;
    font-size: 12px;
}

.dpc-breakdown-row:last-child {
    border-bottom: 0;
}

.dpc-breakdown-row span {
    color: var(--dpc-muted);
}

.dpc-insight {
    margin-top: 14px;
    padding: 14px;
    border-left: 4px solid var(--dpc-accent);
    border-radius: 8px;
    background: #f6f3ff;
    color: #453d56;
    font-size: 12px;
    line-height: 1.55;
}

.dpc-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border: 1px solid var(--dpc-line);
    border-radius: 0 0 20px 20px;
    color: var(--dpc-muted);
    background: #fff;
    font-size: 11px;
}

.dpc-footer a {
    color: var(--dpc-accent-dark);
    font-weight: 800;
    text-decoration: none;
}

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

    .dpc-input-panel {
        border-right: 0;
        border-bottom: 1px solid var(--dpc-line);
    }
}

@media (max-width: 560px) {
    .dpc-calculator {
        margin: 14px auto;
    }

    .dpc-header,
    .dpc-panel {
        padding: 20px;
    }

    .dpc-brand-mark {
        display: none;
    }

    .dpc-grid,
    .dpc-metrics {
        grid-template-columns: 1fr;
    }

    .dpc-help {
        min-height: auto;
    }

    .dpc-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dpc-btn {
        width: 100%;
    }

    .dpc-footer {
        flex-direction: column;
    }
}

@media print {
    body * {
        visibility: hidden !important;
    }

    .dpc-calculator,
    .dpc-calculator * {
        visibility: visible !important;
    }

    .dpc-calculator {
        position: absolute;
        inset: 0 auto auto 0;
        max-width: 100%;
        margin: 0;
    }

    .dpc-input-panel,
    .dpc-actions,
    .dpc-note,
    .dpc-status,
    .dpc-footer {
        display: none !important;
    }

    .dpc-layout {
        display: block;
        border: 0;
    }

    .dpc-results-panel,
    .dpc-header {
        border: 0;
    }
}
