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

.mtcdc-calculator {
    --mtcdc-bg: #f5f7fb;
    --mtcdc-panel: #ffffff;
    --mtcdc-panel-soft: #f7f9fc;
    --mtcdc-text: #18202f;
    --mtcdc-muted: #5f6b7a;
    --mtcdc-border: #d8dee8;
    --mtcdc-accent: #263245;
    --mtcdc-accent-hover: #111827;
    --mtcdc-error: #9f1239;
    --mtcdc-success: #14532d;
    --mtcdc-warning: #92400e;
    --mtcdc-shadow: 0 14px 32px rgba(24, 32, 47, 0.08);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    color: var(--mtcdc-text);
    font-family: inherit;
}

.mtcdc-calculator[data-theme="dark"] {
    --mtcdc-bg: #111827;
    --mtcdc-panel: #1f2937;
    --mtcdc-panel-soft: #273244;
    --mtcdc-text: #f8fafc;
    --mtcdc-muted: #c7d2df;
    --mtcdc-border: #3d4858;
    --mtcdc-accent: #e5e7eb;
    --mtcdc-accent-hover: #ffffff;
    --mtcdc-error: #fda4af;
    --mtcdc-success: #86efac;
    --mtcdc-warning: #fcd34d;
    --mtcdc-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

.mtcdc-shell {
    width: min(100%, 1080px);
    margin: 0 auto;
    padding: clamp(14px, 3vw, 24px);
    background: transparent;
}

.mtcdc-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 18px;
}

.mtcdc-header-copy {
    min-width: 0;
}

.mtcdc-kicker {
    margin: 0 0 8px;
    color: var(--mtcdc-muted);
    font-size: clamp(0.78rem, 2vw, 0.9rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mtcdc-header h2 {
    margin: 0;
    color: var(--mtcdc-text);
    font-size: clamp(1.45rem, 4vw, 2.2rem);
    line-height: 1.15;
}

.mtcdc-intro,
.mtcdc-result-head p {
    margin: 10px 0 0;
    max-width: 860px;
    color: var(--mtcdc-muted);
    font-size: clamp(0.94rem, 2.3vw, 1.02rem);
    line-height: 1.65;
}

.mtcdc-form-shell {
    width: 100%;
    padding: clamp(16px, 3vw, 24px);
    background: var(--mtcdc-bg);
    border: 1px solid var(--mtcdc-border);
    border-radius: 22px;
    box-shadow: var(--mtcdc-shadow);
}

.mtcdc-theme-toggle,
.mtcdc-button {
    appearance: none;
    border: 1px solid var(--mtcdc-border);
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    line-height: 1.2;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mtcdc-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    color: var(--mtcdc-text);
    background: var(--mtcdc-panel);
}

.mtcdc-theme-toggle:hover,
.mtcdc-button:hover {
    transform: translateY(-1px);
    border-color: var(--mtcdc-accent);
}

.mtcdc-theme-toggle:focus-visible,
.mtcdc-button:focus-visible,
.mtcdc-form input:focus-visible,
.mtcdc-form select:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.38);
    outline-offset: 3px;
}

.mtcdc-form {
    display: block;
    width: 100%;
    max-width: 100%;
}

.mtcdc-field,
.mtcdc-check-field {
    width: 100%;
    max-width: 100%;
    margin: 0 0 18px;
    min-width: 0;
}

.mtcdc-field label,
.mtcdc-check-field label {
    display: block;
    margin: 0 0 8px;
    color: var(--mtcdc-text);
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.35;
}

.mtcdc-form input[type="date"],
.mtcdc-form input[type="number"],
.mtcdc-form input[type="text"],
.mtcdc-form select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    color: var(--mtcdc-text);
    background: var(--mtcdc-panel);
    border: 1px solid var(--mtcdc-border);
    border-radius: 14px;
    font: inherit;
    min-width: 0;
}

.mtcdc-form input::placeholder {
    color: var(--mtcdc-muted);
}

.mtcdc-help {
    margin: 7px 0 0;
    color: var(--mtcdc-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.mtcdc-check-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    background: var(--mtcdc-panel);
    border: 1px solid var(--mtcdc-border);
    border-radius: 14px;
}

.mtcdc-check-field input {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.mtcdc-check-field label {
    margin: 0;
    font-weight: 700;
}

.mtcdc-error {
    min-height: 24px;
    margin: 2px 0 16px;
    color: var(--mtcdc-error);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.mtcdc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
}

.mtcdc-button {
    flex: 1 1 100%;
    min-height: 46px;
    padding: 12px 14px;
    color: var(--mtcdc-text);
    background: var(--mtcdc-panel);
}

.mtcdc-button-primary {
    color: #ffffff;
    background: #263245;
    border-color: #263245;
}

.mtcdc-button-primary:hover {
    background: #111827;
    border-color: #111827;
}

.mtcdc-calculator[data-theme="dark"] .mtcdc-button-primary {
    color: #111827;
    background: #f8fafc;
    border-color: #f8fafc;
}

.mtcdc-button-muted {
    color: var(--mtcdc-muted);
}

.mtcdc-result {
    width: 100%;
    max-width: 100%;
    margin-top: 20px;
    padding: 0;
    background: transparent;
    border: 0;
}

.mtcdc-result-head {
    padding: 0 0 8px;
}

.mtcdc-result-head h3,
.mtcdc-section h4 {
    margin: 0;
    color: var(--mtcdc-text);
}

.mtcdc-result-head h3 {
    font-size: clamp(1.2rem, 3vw, 1.55rem);
}

.mtcdc-summary,
.mtcdc-report-list {
    width: 100%;
    background: var(--mtcdc-panel);
    border-top: 1px solid var(--mtcdc-border);
    border-bottom: 1px solid var(--mtcdc-border);
}

.mtcdc-section {
    margin-top: 22px;
}

.mtcdc-section h4 {
    margin-bottom: 12px;
    font-size: 1.05rem;
}

.mtcdc-summary-row,
.mtcdc-report-row {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 16px 0;
    border-bottom: 1px solid var(--mtcdc-border);
}

.mtcdc-summary-row:last-child,
.mtcdc-report-row:last-child {
    border-bottom: 0;
}

.mtcdc-summary-row span,
.mtcdc-report-row span {
    display: block;
    color: var(--mtcdc-muted);
    font-weight: 700;
    line-height: 1.45;
}

.mtcdc-summary-row strong,
.mtcdc-report-row strong {
    display: block;
    margin-top: 6px;
    color: var(--mtcdc-text);
    font-size: clamp(1rem, 2.8vw, 1.08rem);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.mtcdc-summary-row strong {
    font-size: clamp(1.32rem, 4vw, 1.85rem);
    font-weight: 800;
}

.mtcdc-explanation,
.mtcdc-disclaimer {
    margin-top: 18px;
    color: var(--mtcdc-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.mtcdc-disclaimer {
    padding-top: 14px;
    border-top: 1px solid var(--mtcdc-border);
}

.mtcdc-status-good {
    color: var(--mtcdc-success) !important;
}

.mtcdc-status-warn {
    color: var(--mtcdc-warning) !important;
}

.mtcdc-status-bad {
    color: var(--mtcdc-error) !important;
}

@media (min-width: 700px) {
    .mtcdc-header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }

    .mtcdc-theme-toggle {
        width: auto;
        flex: 0 0 auto;
    }

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

    .mtcdc-field,
    .mtcdc-check-field {
        margin-bottom: 0;
    }

    .mtcdc-check-field,
    .mtcdc-error,
    .mtcdc-actions {
        grid-column: 1 / -1;
    }

    .mtcdc-button {
        flex: 1 1 160px;
    }
}

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

    .mtcdc-calculator,
    .mtcdc-calculator * {
        visibility: visible;
    }

    .mtcdc-calculator {
        position: absolute;
        inset: 0 auto auto 0;
    }

    .mtcdc-actions,
    .mtcdc-theme-toggle,
    .mtcdc-form-shell {
        display: none !important;
    }

    .mtcdc-summary,
    .mtcdc-report-list {
        border-color: #cccccc;
    }
}
