.njmdc-wrap,
.njmdc-wrap * {
    box-sizing: border-box;
}

.njmdc-wrap {
    --njmdc-bg: transparent;
    --njmdc-panel: #ffffff;
    --njmdc-panel-soft: #f5f7fa;
    --njmdc-text: #111827;
    --njmdc-muted: #667085;
    --njmdc-border: #d8dee6;
    --njmdc-heavy-border: #111827;
    --njmdc-accent: #2f4d67;
    --njmdc-accent-strong: #22394c;
    --njmdc-focus: #1f6ea1;
    --njmdc-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    width: 100%;
    max-width: 920px;
    margin: 24px auto;
    padding: clamp(12px, 3vw, 22px);
    color: var(--njmdc-text);
    background: var(--njmdc-bg);
    font-family: inherit;
    overflow-wrap: anywhere;
}

.njmdc-wrap.njmdc-dark {
    --njmdc-panel: #18222d;
    --njmdc-panel-soft: #202c38;
    --njmdc-text: #edf2f7;
    --njmdc-muted: #b5c0cb;
    --njmdc-border: #324252;
    --njmdc-heavy-border: #e7edf5;
    --njmdc-accent: #93bad9;
    --njmdc-accent-strong: #bad6eb;
    --njmdc-focus: #a8d6f9;
    --njmdc-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.njmdc-panel {
    width: 100%;
    max-width: 100%;
    background: var(--njmdc-panel);
    border: 1px solid var(--njmdc-border);
    border-radius: 22px;
    box-shadow: var(--njmdc-shadow);
    padding: clamp(18px, 4vw, 30px);
}

.njmdc-header {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.njmdc-heading-copy {
    min-width: 0;
}

.njmdc-eyebrow {
    margin: 0 0 8px;
    color: var(--njmdc-accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.njmdc-header h2,
.njmdc-output h3,
.njmdc-manual-head h3,
.njmdc-report-section h4 {
    margin: 0;
    line-height: 1.15;
}

.njmdc-header h2 {
    font-size: clamp(1.5rem, 4.5vw, 2.3rem);
}

.njmdc-subtitle,
.njmdc-output-head p,
.njmdc-result-intro,
.njmdc-field small,
.njmdc-manual-head p,
.njmdc-report-section p {
    color: var(--njmdc-muted);
}

.njmdc-subtitle {
    margin: 10px 0 0;
    font-size: clamp(0.96rem, 2.7vw, 1.08rem);
}

.njmdc-theme-toggle,
.njmdc-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 46px;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.njmdc-theme-toggle {
    width: 100%;
    max-width: 180px;
    padding: 10px 16px;
    color: var(--njmdc-text);
    background: var(--njmdc-panel-soft);
    border: 1px solid var(--njmdc-border);
}

.njmdc-theme-toggle:hover,
.njmdc-btn:hover {
    transform: translateY(-1px);
}

.njmdc-theme-toggle:focus-visible,
.njmdc-btn:focus-visible,
.njmdc-field input:focus,
.njmdc-field select:focus {
    outline: 3px solid var(--njmdc-focus);
    outline-offset: 2px;
}

.njmdc-form {
    display: grid;
    gap: 18px;
    width: 100%;
}

.njmdc-grid {
    display: grid;
    gap: 16px;
}

.njmdc-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.njmdc-field label,
.njmdc-check-row label,
.njmdc-report-label,
.njmdc-report-subitem span {
    font-weight: 700;
}

.njmdc-field input,
.njmdc-field select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 12px 14px;
    color: var(--njmdc-text);
    background: var(--njmdc-panel-soft);
    border: 1px solid var(--njmdc-border);
    border-radius: 14px;
    font: inherit;
}

.njmdc-manual-block {
    padding: 18px;
    background: var(--njmdc-panel-soft);
    border: 1px solid var(--njmdc-border);
    border-radius: 18px;
}

.njmdc-manual-head {
    margin-bottom: 14px;
}

.njmdc-manual-head h3 {
    font-size: clamp(1.05rem, 3vw, 1.2rem);
}

.njmdc-manual-head p {
    margin: 8px 0 0;
}

.njmdc-check-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 14px;
    background: var(--njmdc-panel-soft);
    border: 1px solid var(--njmdc-border);
    border-radius: 16px;
}

.njmdc-check-row input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--njmdc-accent);
}

.njmdc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.njmdc-btn {
    flex: 1 1 150px;
    padding: 12px 16px;
    text-align: center;
}

.njmdc-btn-primary {
    color: #ffffff;
    background: var(--njmdc-accent);
    box-shadow: 0 12px 24px rgba(47, 77, 103, 0.24);
}

.njmdc-btn-primary:hover {
    background: var(--njmdc-accent-strong);
}

.njmdc-btn-secondary {
    color: var(--njmdc-text);
    background: var(--njmdc-panel-soft);
    border: 1px solid var(--njmdc-border);
}

.njmdc-message {
    min-height: 22px;
    color: var(--njmdc-accent-strong);
    font-weight: 700;
}

.njmdc-output {
    width: 100%;
    max-width: 100%;
    padding-top: 20px;
}

.njmdc-output-head h3 {
    font-size: clamp(1.24rem, 3.8vw, 1.8rem);
    margin-bottom: 8px;
}

.njmdc-output-head p,
.njmdc-result-intro {
    margin: 0;
}

.njmdc-report {
    display: block;
    width: 100%;
    margin-top: 16px;
}

.njmdc-report[hidden] {
    display: none !important;
}

.njmdc-report-item {
    width: 100%;
    padding: 22px 0;
    border-top: 1px solid var(--njmdc-border);
}

.njmdc-report-item:first-child {
    border-top-width: 3px;
}

.njmdc-report-label {
    color: var(--njmdc-muted);
    font-size: clamp(1rem, 3.6vw, 1.25rem);
    line-height: 1.35;
}

.njmdc-report-value {
    margin-top: 8px;
    color: var(--njmdc-text);
    font-size: clamp(1.5rem, 5.8vw, 2.3rem);
    font-weight: 800;
    line-height: 1.1;
    word-break: break-word;
}

.njmdc-report-section {
    width: 100%;
    padding: 24px 0 0;
    margin-top: 8px;
}

.njmdc-report-section h4 {
    padding-top: 16px;
    margin-bottom: 16px;
    border-top: 4px solid var(--njmdc-heavy-border);
    font-size: clamp(1.18rem, 4vw, 1.8rem);
}

.njmdc-report-subitem {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid var(--njmdc-border);
}

.njmdc-report-subitem:last-child {
    border-bottom: 0;
}

.njmdc-report-subitem span {
    color: var(--njmdc-muted);
    min-width: 0;
}

.njmdc-report-subitem strong {
    color: var(--njmdc-text);
    text-align: right;
    white-space: nowrap;
}

.njmdc-report-section p {
    margin: 0;
    line-height: 1.7;
}

@media (min-width: 700px) {
    .njmdc-header {
        flex-direction: row;
        align-items: center;
    }

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

    .njmdc-grid-manual {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media print {
    .njmdc-wrap {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .njmdc-theme-toggle,
    .njmdc-actions,
    .njmdc-message {
        display: none !important;
    }

    .njmdc-panel {
        box-shadow: none;
        border: 0;
        padding: 0 0 18px;
    }

    .njmdc-manual-block,
    .njmdc-check-row {
        break-inside: avoid;
    }
}
