.auto-tools-calculator {
    box-sizing: border-box;
    width: 100%;
    max-width: 760px;
    margin: 1.5rem 0;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid #d7dce1;
    border-radius: 12px;
    background: #fff;
    color: #1f2933;
    font: inherit;
    line-height: 1.5;
}

.auto-tools-calculator *,
.auto-tools-calculator *::before,
.auto-tools-calculator *::after {
    box-sizing: inherit;
}

.auto-tools-form {
    margin: 0;
}

.auto-tools-field + .auto-tools-field {
    margin-top: 1.25rem;
}

.auto-tools-label {
    display: block;
    margin: 0 0 0.45rem;
    font-weight: 700;
}

.auto-tools-input-wrap {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.auto-tools-input {
    min-width: 0;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0.7rem 0.85rem;
    border: 1px solid #8a949e;
    border-radius: 8px 0 0 8px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 1rem;
    line-height: 1.25;
}

.auto-tools-input:focus {
    outline: 3px solid rgba(37, 99, 235, 0.22);
    outline-offset: 1px;
    border-color: #2563eb;
}

.auto-tools-input-invalid,
.auto-tools-input-invalid:focus {
    border-color: #b42318;
}

.auto-tools-unit {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 0.7rem 0.8rem;
    border: 1px solid #8a949e;
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: #f4f6f8;
    color: #354052;
    font-weight: 600;
    white-space: nowrap;
}

.auto-tools-help {
    margin: 0.4rem 0 0;
    color: #5b6470;
    font-size: 0.9rem;
}

.auto-tools-error {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border-left: 4px solid #b42318;
    border-radius: 6px;
    background: #fff2f0;
    color: #7a271a;
}

.auto-tools-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.auto-tools-button {
    min-height: 46px;
    margin: 0;
    padding: 0.7rem 1rem;
    border: 1px solid #1d4ed8;
    border-radius: 8px;
    background: #1d4ed8;
    color: #fff;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.auto-tools-button:hover {
    filter: brightness(0.94);
}

.auto-tools-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.3);
    outline-offset: 2px;
}

.auto-tools-button-secondary {
    border-color: #9aa4af;
    background: #fff;
    color: #26313d;
}

.auto-tools-result {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid #b8c5d1;
    border-radius: 10px;
    background: #f7f9fb;
}

.auto-tools-result:focus {
    outline: 3px solid rgba(37, 99, 235, 0.18);
    outline-offset: 2px;
}

.auto-tools-result-label,
.auto-tools-result-main,
.auto-tools-result-secondary {
    margin: 0;
}

.auto-tools-result-label {
    margin-bottom: 0.35rem;
    color: #4a5562;
    font-size: 0.95rem;
    font-weight: 700;
}

.auto-tools-result-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
}

.auto-tools-result-main strong {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    line-height: 1.15;
}

.auto-tools-result-main span {
    font-weight: 700;
}

.auto-tools-result-secondary {
    margin-top: 0.65rem;
    color: #3f4b57;
}

@media (max-width: 520px) {
    .auto-tools-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .auto-tools-button {
        width: 100%;
    }

    .auto-tools-unit {
        min-width: 64px;
    }
}

.auto-tools-field-optional {
    padding-top: 0.25rem;
}

.auto-tools-optional {
    color: #66717d;
    font-size: 0.9em;
    font-weight: 500;
}

.auto-tools-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.auto-tools-result-card {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid #d7dfe7;
    border-radius: 8px;
    background: #fff;
}

.auto-tools-result-card-label {
    display: block;
    margin-bottom: 0.25rem;
    color: #5b6470;
    font-size: 0.85rem;
}

.auto-tools-result-card strong {
    display: block;
    overflow-wrap: anywhere;
}

.auto-tools-comparison,
.auto-tools-tips {
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid #d7dfe7;
}

.auto-tools-subheading {
    margin: 0 0 0.65rem;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.35;
}

.auto-tools-comparison p {
    margin: 0.35rem 0 0;
}

.auto-tools-warning {
    margin-top: 1rem;
    padding: 0.8rem 0.9rem;
    border-left: 4px solid #a15c00;
    border-radius: 6px;
    background: #fff8e6;
    color: #684100;
}

.auto-tools-result-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.auto-tools-copy-status {
    color: #4a5562;
    font-size: 0.9rem;
}

.auto-tools-tip-list {
    margin: 0;
    padding-left: 1.2rem;
}

.auto-tools-tip-list li + li {
    margin-top: 0.65rem;
}

.auto-tools-source-note {
    margin: 0.85rem 0 0;
    color: #5b6470;
    font-size: 0.85rem;
}

.auto-tools-source-note a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 520px) {
    .auto-tools-result-grid {
        grid-template-columns: 1fr;
    }

    .auto-tools-result-actions {
        align-items: stretch;
    }

    .auto-tools-result-actions .auto-tools-button {
        width: 100%;
    }
}

.auto-tools-result-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auto-tools-calculation-note {
    margin-top: 0.75rem;
    padding: 0.85rem;
    border: 1px solid #d7dfe7;
    border-radius: 8px;
    background: #fff;
}

.auto-tools-calculation-note strong {
    display: block;
    overflow-wrap: anywhere;
}

.auto-tools-price-impact {
    margin-top: 1.25rem;
}

@media (max-width: 680px) {
    .auto-tools-result-grid-3 {
        grid-template-columns: 1fr;
    }
}
