/* Calm, readable on-screen palette. Printing keeps its existing paper styling. */
@media screen {
  :root {
    color-scheme: light;
    --page: #ecefe9;
    --shell: #f9faf6;
    --panel: #f9faf6;
    --panel-soft: #f1f4ee;
    --line: #d8ded3;
    --line-strong: #bdc9bd;
    --text: #303b35;
    --muted: #606d61;
    --muted-strong: #56645a;
    --teal: #70598a;
    --teal-soft: #e8e2ed;
    --blue: #70598a;
    --blue-bright: #806a98;
    --danger: #994b43;
    --danger-bg: #f6e8e4;
    --shadow: 0 3px 10px #303b3505;
    --np-ink: #303b35;
    --np-secondary: #56645a;
    --np-muted: #606d61;
    --np-accent: #70598a;
    --np-accent-strong: #624d79;
    --np-paper: #f9faf6;
    --np-soft: #f1f4ee;
    --np-border: #d8ded3;
  }
  html, body.np-loaded {
    background: var(--page) !important;
    color: var(--np-ink) !important;
  }
  body.np-loaded .app-shell { background: transparent !important; }
  body.np-loaded .np-sidebar,
  body.np-loaded .np-topbar {
    background: #f3f5f0 !important;
    border-color: var(--np-border) !important;
  }
  body.np-loaded .np-card,
  body.np-loaded .panel,
  body.np-loaded .np-card > header,
  body.np-loaded .np-context,
  body.np-loaded .notlin-stats > div,
  body.np-loaded .saved-panel-row,
  body.np-loaded .notlin-detail-panel,
  body.np-loaded .help-card,
  body.np-loaded .direction-control,
  body.np-loaded .np-empty,
  body.np-loaded .np-card table,
  body.np-loaded .notlin-filters,
  body.np-loaded .material-subtabs {
    background: var(--np-paper) !important;
    border-color: var(--np-border) !important;
    box-shadow: 0 2px 6px #303b3503 !important;
  }
  body.np-loaded .np-card > header,
  body.np-loaded .np-context #np-name-slot,
  body.np-loaded .np-stage-nav,
  body.np-loaded .summary-grid,
  body.np-loaded .mesh-summary > div,
  body.np-loaded .np-history-row,
  body.np-loaded .project-tools,
  body.np-loaded .np-project-card > small,
  body.np-loaded .np-filter-row,
  body.np-loaded .notlin-result-line,
  body.np-loaded .notlin-panel-head,
  body.np-loaded .np-check-row,
  body.np-loaded .np-pagination,
  body.np-loaded .project-heading,
  body.np-loaded .notlin-detail-list > div,
  body.np-loaded .safety-card,
  body.np-loaded #np-opening-count {
    border-color: #e0e5dc !important;
  }
  body.np-loaded .np-brand,
  body.np-loaded .np-page-heading h1,
  body.np-loaded .np-card > header h2,
  body.np-loaded .np-project-card h3,
  body.np-loaded .np-history-main strong,
  body.np-loaded .np-project-heading h2,
  body.np-loaded .saved-panels h2,
  body.np-loaded .saved-panel-row strong,
  body.np-loaded .notlin-hero h2,
  body.np-loaded .notlin-panel-head h3,
  body.np-loaded .notlin-detail-panel h3,
  body.np-loaded .strength-card h3,
  body.np-loaded .class-card h3,
  body.np-loaded .result-panel h2,
  body.np-loaded .result-content h3,
  body.np-loaded .help-card summary,
  body.np-loaded .length-calculator h2,
  body.np-loaded .stats-panel h2,
  body.np-loaded .lookup-heading h2,
  body.np-loaded .np-check-row strong {
    color: var(--np-ink) !important;
  }
  body.np-loaded .np-page-heading > div > p:last-child,
  body.np-loaded .np-card > header p,
  body.np-loaded .np-context label,
  body.np-loaded .np-topbar strong,
  body.np-loaded .np-project-card p,
  body.np-loaded .np-project-card > small,
  body.np-loaded .np-history-main small,
  body.np-loaded .np-field-head strong,
  body.np-loaded .np-tip,
  body.np-loaded .np-tip strong,
  body.np-loaded .table-note,
  body.np-loaded .plan-note,
  body.np-loaded .result-action-note,
  body.np-loaded .length-mesh-note,
  body.np-loaded .length-note,
  body.np-loaded .length-results dt,
  body.np-loaded .notlin-hero p,
  body.np-loaded .notlin-panel-head p,
  body.np-loaded .notlin-filters label,
  body.np-loaded .notlin-result-line,
  body.np-loaded .notlin-detail-empty,
  body.np-loaded .notlin-detail-list dt,
  body.np-loaded .notlin-detail-list dd,
  body.np-loaded .notlin-source-note,
  body.np-loaded .notlin-muted,
  body.np-loaded .strength-boundary-note,
  body.np-loaded .strength-inputs label,
  body.np-loaded .strength-product-label,
  body.np-loaded .notlin-stats span,
  body.np-loaded .lookup-heading > span,
  body.np-loaded .np-reference-note,
  body.np-loaded .np-footnote,
  body.np-loaded .np-empty,
  body.np-loaded .project-fields label,
  body.np-loaded .material-fields legend,
  body.np-loaded .material-fields label,
  body.np-loaded .project-filter,
  body.np-loaded .saved-panel-row p,
  body.np-loaded .help-content p,
  body.np-loaded .direction-control > label,
  body.np-loaded .np-check-row small,
  body.np-loaded .summary-grid dt,
  body.np-loaded .mesh-summary dt {
    color: var(--np-secondary) !important;
  }
  body.np-loaded .np-brand small,
  body.np-loaded .np-nav-label,
  body.np-loaded .np-eyebrow,
  body.np-loaded .np-stage-nav > span,
  body.np-loaded .np-field-head small,
  body.np-loaded .np-storage-status,
  body.np-loaded .np-topbar > div,
  body.np-loaded .np-topbar i,
  body.np-loaded .np-card > header h2 small,
  body.np-loaded .np-pagination,
  body.np-loaded #np-mesh-info,
  body.np-loaded #np-opening-count,
  body.np-loaded .safety-card,
  body.np-loaded .app-shell > footer p,
  body.np-loaded .app-shell > footer .copyright,
  body.np-loaded .np-sidebar-bottom > small,
  body.np-loaded .np-local-box p,
  body.np-loaded .np-local-box strong {
    color: var(--np-muted) !important;
  }
  body.np-loaded .np-sidebar nav > button,
  body.np-loaded .np-stage-nav button {
    color: var(--np-secondary) !important;
  }
  body.np-loaded .np-sidebar nav > button:hover,
  body.np-loaded .np-sidebar nav > button.is-active,
  body.np-loaded .language-button.is-active,
  body.np-loaded .material-subtabs button.is-active {
    color: var(--np-accent-strong) !important;
    background: #e8e2ed !important;
  }
  body.np-loaded .np-stage-nav button.is-active {
    color: var(--np-accent-strong) !important;
    border-bottom-color: #806a98 !important;
  }
  body.np-loaded .np-stage-nav button b,
  body.np-loaded .np-context-icon,
  body.np-loaded .np-history-symbol,
  body.np-loaded .np-project-symbol,
  body.np-loaded .np-pagination button,
  body.np-loaded .lookup-table .selected-indicator,
  body.np-loaded .np-draft-badge,
  body.np-loaded .np-badge,
  body.np-loaded .panel-status-badge {
    color: #65546f !important;
    background: #ebe7ee !important;
    border-color: #d9d1df !important;
  }
  body.np-loaded .np-logo {
    background: #735a8f !important;
    color: #fff !important;
  }
  body.np-loaded .np-local-box{
    background: #eff2ec !important;
    border-color: var(--np-border) !important;
  }
  body.np-loaded .np-local-box > svg,
  body.np-loaded .np-local-box button,
  body.np-loaded .np-tip > svg,
  body.np-loaded .np-card > header h2 svg,
  body.np-loaded .np-history-row .np-open-button,
  body.np-loaded .np-project-card .np-new-project-panel {
    color: #7d6d88 !important;
  }
  body.np-loaded .np-text-button,
  body.np-loaded .np-card a,
  body.np-loaded .np-menu {
    color: var(--np-accent-strong) !important;
  }
  body.np-loaded .primary-button {
    background: var(--np-accent) !important;
    border-color: var(--np-accent) !important;
    color: #fff !important;
    box-shadow: 0 2px 4px #303b3509 !important;
  }
  body.np-loaded .primary-button:hover {
    background: #624d79 !important;
    border-color: #624d79 !important;
    filter: none !important;
  }
  body.np-loaded .secondary-button,
  body.np-loaded .np-heading-actions #save-new-panel {
    color: #665271 !important;
    background: #f4f6f0 !important;
    border-color: #d4ddd0 !important;
    box-shadow: none !important;
  }
  body.np-loaded .secondary-button:hover,
  body.np-loaded .np-heading-actions #save-new-panel:hover {
    background: #eaece5 !important;
    border-color: #b9c5b6 !important;
  }
  body.np-loaded input,
  body.np-loaded select,
  body.np-loaded textarea,
  body.np-loaded .np-input-body .input-card input,
  body.np-loaded .length-calculator .input-card input,
  body.np-loaded .np-filter-row input,
  body.np-loaded .np-filter-row select,
  body.np-loaded .notlin-filters input,
  body.np-loaded .notlin-filters select,
  body.np-loaded .strength-inputs input,
  body.np-loaded .strength-product-label select,
  body.np-loaded .project-fields textarea,
  body.np-loaded .material-fields input,
  body.np-loaded .direction-control select,
  body.np-loaded #np-project-form input,
  body.np-loaded #np-project-form textarea {
    background: #f1f4ee !important;
    color: var(--np-ink) !important;
    border-color: #cad4c7 !important;
    box-shadow: none !important;
  }
  body.np-loaded .np-context input {
    background: transparent !important;
    color: var(--np-ink) !important;
    border-color: transparent !important;
  }
  body.np-loaded input::placeholder,
  body.np-loaded textarea::placeholder {
    color: #606d61 !important;
    opacity: 1;
  }
  body.np-loaded .np-input-body .input-card span,
  body.np-loaded .length-calculator .input-card > span,
  body.np-loaded .input-card span {
    color: var(--np-secondary) !important;
  }
  body.np-loaded :focus-visible {
    outline-color: #a28bad !important;
    box-shadow: 0 0 0 3px #806a9817 !important;
  }
  body.np-loaded #np-mesh-options > button,
  body.np-loaded .np-more-mesh,
  body.np-loaded .material-subtabs button,
  body.np-loaded .language-button {
    background: #f4f6f0 !important;
    color: var(--np-secondary) !important;
    border-color: #d5ddd1 !important;
  }
  body.np-loaded #np-mesh-options > button.is-selected {
    color: var(--np-accent-strong) !important;
    background: #e9e3ee !important;
    border-color: #ab96bc !important;
    box-shadow: none !important;
  }
  body.np-loaded .plan-mode-picker,
  body.np-loaded .np-length-inline,
  body.np-loaded .material-fields,
  body.np-loaded .project-tools #import-review {
    background: #f0f2ec !important;
    border-color: #dbe1d5 !important;
  }
  body.np-loaded .plan-mode-option {
    background: transparent !important;
    color: var(--np-secondary) !important;
  }
  body.np-loaded .plan-mode-option:has(input:checked) {
    background: #f9faf6 !important;
    color: var(--np-accent-strong) !important;
    border-color: #c8bdcf !important;
    box-shadow: none !important;
  }
  body.np-loaded .plan-mode-option input,
  body.np-loaded .preflight-inner input {
    accent-color: #70598a !important;
  }
  body.np-loaded .np-length-inline > svg {
    color: #806c8d !important;
    background: #e6e2eb !important;
  }
  body.np-loaded .np-length-inline > strong,
  body.np-loaded .length-results dd,
  body.np-loaded .summary-grid dd,
  body.np-loaded .mesh-summary dd,
  body.np-loaded .notlin-stats strong,
  body.np-loaded .notlin-stats .material-stat-source {
    color: #4d4257 !important;
  }
  body.np-loaded .np-length-inline > div > span,
  body.np-loaded .np-length-inline small {
    color: var(--np-secondary) !important;
  }
  body.np-loaded .distribution-plan > * {
    background: #f0f3ed !important;
    color: var(--np-secondary) !important;
    border-color: #dbe2d5 !important;
    box-shadow: none !important;
  }
  body.np-loaded .distribution-plan strong {
    color: #655175 !important;
  }
  body.np-loaded table,
  body.np-loaded .notlin-table,
  body.np-loaded .np-table-wrap table {
    background: var(--np-paper) !important;
  }
  body.np-loaded th,
  body.np-loaded .notlin-table th,
  body.np-loaded .np-table-wrap th,
  body.np-loaded .lookup-table th,
  body.np-loaded .notlin-requirements th {
    color: #59685c !important;
    background: #f0f3ec !important;
    border-color: #dbe2d5 !important;
  }
  body.np-loaded td,
  body.np-loaded .notlin-table td,
  body.np-loaded .np-table-wrap td,
  body.np-loaded .lookup-table td,
  body.np-loaded .notlin-requirements td {
    color: #445348 !important;
    border-color: #e1e6dc !important;
  }
  body.np-loaded tbody tr:hover {
    background: #f0f2eb !important;
  }
  body.np-loaded tbody tr.is-selected,
  body.np-loaded tbody tr.is-selected td {
    background: #eae5ef !important;
    color: #5c476e !important;
  }
  body.np-loaded .lookup-table .mesh-choice {
    color: #665071 !important;
  }
  body.np-loaded .lookup-table tr.is-selected,
  body.np-loaded .notlin-table tbody tr.is-selected td:first-child {
    box-shadow: inset 3px 0 #a28ab4 !important;
  }
  body.np-loaded .np-warning,
  body.np-loaded .np-badge.warning,
  body.np-loaded .notlin-warning,
  body.np-loaded .strength-result.is-warning {
    color: #805c2d !important;
    background: #f3ede0 !important;
    border-color: #d7c9ac !important;
  }
  body.np-loaded .np-warning a {
    color: #79552b !important;
  }
  body.np-loaded .np-check-row > span,
  body.np-loaded .np-check-row > b,
  body.np-loaded .strength-result.is-pass {
    color: #41634c !important;
    background: #edf3e9 !important;
    border-color: #c8d8c7 !important;
  }
  body.np-loaded .error-message,
  body.np-loaded .strength-result.is-fail {
    color: #994b43 !important;
    background: #f6e8e4 !important;
    border-color: #ddc0b9 !important;
  }
  body.np-loaded .strength-result,
  body.np-loaded .calculation-rule {
    color: var(--np-secondary) !important;
    background: #f0f3ed !important;
    border-color: #d6dfd2 !important;
  }
  body.np-loaded .calculation-rule strong {
    color: #414c43 !important;
  }
  /* Dim drawing surface: no bright purple glow or high-contrast mesh noise. */
  body.np-loaded .panel-figure {
    background: radial-gradient(ellipse at 50% 15%, #3d4946, transparent 75%), #2d3836 !important;
    color: #e1e7df !important;
    box-shadow: 0 3px 12px #26372b0b !important;
  }
  body.np-loaded .panel-figure:before {
    background-image: linear-gradient(#d0dacb04 1px,transparent 1px), linear-gradient(90deg,#d0dacb04 1px,transparent 1px) !important;
  }
  body.np-loaded .shape-heading {
    background: transparent !important;
    border-color: #d7e3d215 !important;
  }
  body.np-loaded .shape-heading h3 {
    color: #e0e7dd !important;
  }
  body.np-loaded .shape-heading > span {
    color: #c2cec0 !important;
    border-color: #738371 !important;
    background: transparent !important;
  }
  body.np-loaded #shape-fill { fill: #3d4843 !important; }
  body.np-loaded #shape-outline { stroke: #b9bdcc !important; }
  body.np-loaded #shape-mesh path { stroke: #b7c3b3 !important; opacity: .29 !important; }
  body.np-loaded #shape-svg > path:not(#shape-fill):not(#shape-outline) { stroke: #9aa99a !important; }
  body.np-loaded #shape-arrow path { fill: #9aa99a !important; }
  body.np-loaded #shape-svg text { fill: #e3eade !important; }
  body.np-loaded #shape-dimensions {
    color: #d4dfcf !important;
    border-color: #d7e3d218 !important;
  }
  body.np-loaded #shape-caption,
  body.np-loaded #shape-empty {
    color: #c0ccbb !important;
  }
  /* Apply the same calm paper surface to extended work sessions and dialogs. */
  body.np-loaded #counter-dialog,
  body.np-loaded .dialog-shell,
  body.np-loaded .dialog-topbar,
  body.np-loaded .preflight-dialog,
  body.np-loaded #np-project-modal {
    background: #f3f6ee !important;
    border-color: #cad5c5 !important;
    color: var(--np-ink) !important;
  }
  body.np-loaded .count-number {
    background: transparent !important;
    color: #625170 !important;
    -webkit-text-fill-color: #625170 !important;
  }
  body.np-loaded .dialog-topbar p,
  body.np-loaded .counter-step,
  body.np-loaded .count-label,
  body.np-loaded .action-callout p,
  body.np-loaded .action-callout strong,
  body.np-loaded .action-callout svg,
  body.np-loaded .counter-active #previous-step,
  body.np-loaded .work-context h3,
  body.np-loaded .work-context p,
  body.np-loaded .work-context dd,
  body.np-loaded .work-context dt,
  body.np-loaded .wake-controls,
  body.np-loaded .counter-complete p,
  body.np-loaded .preflight-inner p,
  body.np-loaded .preflight-inner label,
  body.np-loaded #np-project-form > p,
  body.np-loaded #np-project-form label {
    color: var(--np-secondary) !important;
  }
  body.np-loaded .counter-complete h2,
  body.np-loaded .preflight-inner h2,
  body.np-loaded #np-project-form h2 {
    color: var(--np-ink) !important;
  }
  body.np-loaded .action-callout,
  body.np-loaded .work-context,
  body.np-loaded .preflight-inner label,
  body.np-loaded .dialog-topbar .icon-button {
    background: #e9eee3 !important;
    border-color: #d0dcc9 !important;
    color: #5b6a58 !important;
  }
  body.np-loaded .progress-track { background: #dae2d5 !important; }
  body.np-loaded .progress-fill { background: #8b779b !important; }
  body.np-loaded #np-project-form header > svg {
    background: #e8e3ed !important;
    color: #806b8e !important;
  }
  body.np-loaded #np-close-modal { color: #7d8b79 !important; }
  body.np-loaded #np-toast {
    background: #3d4b40 !important;
    color: #edf2e8 !important;
    border-color: #71826e !important;
    box-shadow: 0 8px 24px #293a2d1a !important;
  }
}
@media screen {
  body.np-loaded .strength-result *,
  body.np-loaded .strength-result .strength-result-label {
    color: inherit !important;
  }
  body.np-loaded .safety-card strong {
    color: #56645a !important;
  }
  body.np-loaded .strength-card .eyebrow,
  body.np-loaded .notlin-hero .eyebrow {
    color: #606d61 !important;
  }
  body.np-loaded .np-local-box button {
    color: #624d79 !important;
  }
}
@media screen {
  body.np-loaded .length-mesh-note strong,
  body.np-loaded #length-mesh-size,
  body.np-loaded .notlin-empty {
    color: #56645a !important;
  }
  body.np-loaded .distribution-plan * {
    color: inherit !important;
  }
  body.np-loaded .distribution-plan strong {
    color: #655175 !important;
  }
}

@media screen {
  .np-reference-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 18px;
    padding: 5px;
    border: 1px solid var(--np-border);
    border-radius: 10px;
    background: var(--np-paper);
  }

  .np-reference-tabs button {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--np-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
  }

  .np-reference-tabs button:hover {
    background: var(--np-soft);
  }

  .np-reference-tabs button[aria-selected="true"] {
    border-color: #cdbed7;
    background: var(--teal-soft);
    color: var(--np-accent-strong);
  }

  #material-csv {
    align-self: center;
  }
}
