:root {
    color-scheme: light;
    --bg-canvas: #ffefe3;
    --bg-panel: #ffffff;
    --bg-panel-strong: #ffffff;
    --bg-accent: #dff0ff;
    --bg-accent-strong: #9fd2ff;
    --bg-soft: #f6f8fb;
    --bg-selected: #e6f1ff;
    --bg-hover: #f7f9fc;
    --bg-success: #eaf7ee;
    --bg-warning: #fff4df;
    --bg-danger: #fff0ef;
    --bg-disabled: #eef1f5;
    --line-soft: rgba(18, 31, 53, 0.1);
    --line-strong: rgba(18, 31, 53, 0.18);
    --text-primary: #172033;
    --text-secondary: rgba(23, 32, 51, 0.74);
    --text-danger: #b02a37;
    --shadow-panel: 0 14px 34px rgba(52, 67, 92, 0.1);
    --shadow-card: 0 8px 22px rgba(30, 42, 64, 0.07);
    --shadow-soft: 0 2px 8px rgba(41, 57, 82, 0.08);
    --shadow-focus: 0 0 0 4px rgba(88, 156, 255, 0.2);
    --red: #b02a37;
    --page-gutter: clamp(1.5rem, 3vw, 2rem);
    --radius-card: 14px;
    --radius-control: 12px;
    --radius-pill: 999px;
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, "PingFang TC", "Hiragino Sans CNS",
        "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei UI",
        "Microsoft JhengHei", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-canvas);
    line-height: var(--line-height-body);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    font-size: var(--font-size-body);
}

button {
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

a {
    color: inherit;
}

.site-navbar-inner {
    width: min(1180px, calc(100% - var(--page-gutter)));
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.site-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.38rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-breadcrumb-item {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.site-breadcrumb-current {
    flex: 1 1 auto;
}

.site-separator {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 2px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: none;
}

.site-page-title {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-brand:hover {
    color: var(--accent);
}

.site-brand:focus-visible {
    outline: 0;
    box-shadow: var(--shadow-focus);
}


/* Shared theme.css supplies appearance modes, utility controls and footer. */
:root {
    --cc-chart-boundary: color-mix(in srgb, var(--accent) 42%, var(--bg-panel));
    --cc-chart-median: color-mix(in srgb, var(--accent) 66%, var(--text-secondary));
}
[hidden] { display: none !important; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .45; }
svg { display: block; }
a:focus-visible, button:focus-visible, summary:focus-visible, #nomogram [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 5px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.print-only, .chart-legend .print-only { display: none; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 12px 18px; background: var(--bg-panel); color: var(--accent); z-index: 50; }
.skip-link:focus { top: 8px; }
.app-shell { width: min(1180px, calc(100% - var(--page-gutter))); margin: 0 auto; }
.workspace { display: flex; flex-wrap: wrap; gap: var(--stack-gap); min-width: 0; align-items: flex-start; }
.panel { min-width: 0; border: 1px solid var(--line-soft); border-radius: var(--radius-panel); background: var(--bg-panel); box-shadow: var(--shadow-panel); }
.input-card, .followup-card, .history-section { padding: 20px; }
.input-card { flex: 0 0 310px; }
.result-column { flex: 1 1 0; min-width: 0; }
.history-section { margin-top: var(--stack-gap); }
.section-heading h2, .chart-heading h2, #assessment-form label { margin: 0; font-size: var(--font-size-heading); font-weight: 700; line-height: var(--line-height-heading); }
.section-heading, #assessment-form label { display: flex; align-items: center; min-height: 30px; }
.section-heading { justify-content: space-between; gap: 12px; }
.text-button { min-height: 44px; padding: 8px 4px; color: var(--accent); font-size: var(--font-size-small); font-weight: 600; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
#assessment-form { display: flex; flex-wrap: wrap; gap: 16px 12px; align-items: flex-start; }
.due-date-field, .date-field, .ga-field { flex: 1 0 100%; min-width: 0; }
.field-unit { display: flex; align-items: center; min-width: 0; border: 1px solid var(--line-soft); border-radius: var(--radius-control); background: var(--bg-panel-strong); }
.field-unit:hover, #due-date:hover, #exam-date:hover { border-color: var(--line-strong); }
.field-unit:focus-within, #due-date:focus, #exam-date:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); outline: 0; }
.field-unit input { width: 100%; min-width: 0; min-height: var(--control-min-height); padding: 8px 0 8px 12px; border: 0; border-radius: inherit; background: transparent; color: var(--text-primary); outline: 0; font-size: var(--font-size-body); font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.field-unit input::-webkit-inner-spin-button, .field-unit input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field-unit > span { padding: 0 10px 0 5px; color: var(--text-secondary); white-space: nowrap; }
.field-unit input::placeholder { color: var(--text-muted); font-weight: 400; }
.field-unit:has(input[aria-invalid=true]), #due-date[aria-invalid=true], #exam-date[aria-invalid=true] { border-color: var(--text-danger); background: var(--bg-danger); }
#due-date, #exam-date { display: block; width: 100%; min-width: 0; height: var(--control-min-height); margin-top: var(--space-field-label); padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-control); background: var(--bg-panel-strong); font-size: var(--font-size-body); font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ga-field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
#ga-value { display: flex; align-items: center; min-height: 40px; padding: 6px 12px; border-radius: var(--radius-control); background: var(--bg-soft); color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.field-error { margin: 6px 0 0; color: var(--text-danger); font-size: var(--font-size-small); line-height: var(--line-height-body); }
.ga-field .field-error, .form-error { flex: 1 0 100%; }
.length-field { flex: 1 1 120px; min-width: 0; }
.cc-input { margin-top: var(--space-field-label); }
.entry-actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; padding-top: calc(30px + var(--space-field-label)); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-min-height); padding: 8px 13px; border: 1px solid var(--line-soft); border-radius: var(--radius-control); background: var(--bg-selected); color: var(--accent); font-weight: 700; font-size: var(--font-size-body); white-space: nowrap; }
.primary-button:hover { border-color: var(--accent); background: var(--bg-accent); }
.primary-button:active { transform: scale(.98); }
.result-heading-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.result-context { margin: 8px 0 0; color: var(--text-secondary); font-size: var(--font-size-body); font-variant-numeric: tabular-nums; }
.empty-result { margin: 18px 0 6px; color: var(--text-secondary); }
.result-metrics { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin-top: 16px; }
.main-metric, .secondary-metric { flex: 1 1 0; min-width: 0; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.main-metric { background: var(--bg-selected); }
.secondary-metric { background: var(--bg-panel-strong); }
.metric-label { display: block; font-size: var(--font-size-body); font-weight: 600; color: var(--text-secondary); }
.percentile-value { margin-top: 6px; color: var(--accent); font-size: 40px; line-height: 1.2; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.z-value { margin-top: 6px; color: var(--text-primary); font-size: 32px; line-height: 1.5; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.supporting-metrics { flex: 1 0 100%; display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-top: 2px; min-width: 0; }
.reference-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0; }
.reference-value span { font-size: var(--font-size-small); color: var(--text-secondary); }
.reference-value strong { font-size: var(--font-size-subheading); font-weight: 600; font-variant-numeric: tabular-nums; }
.delta-value { margin: 0; font-size: var(--font-size-small); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.chart-card { border-top: 1px solid var(--line-soft); margin-top: 20px; padding-top: 20px; }
.chart-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 2px; }
.chart-axis-label { margin-left: 42px; font-size: var(--font-size-small); color: var(--text-secondary); white-space: nowrap; }
.chart-legend { display: flex; align-items: center; justify-content: flex-end; flex: 0 0 auto; max-width: 100%; margin-left: auto; gap: 14px; flex-wrap: wrap; }
.chart-legend span { display: flex; align-items: center; gap: 6px; font-size: var(--font-size-small); color: var(--text-secondary); white-space: nowrap; }
.legend-swatch { width: 28px; height: 14px; flex: 0 0 28px; overflow: visible; }
.legend-band-fill, .chart-band { fill: var(--bg-selected); }
.legend-boundaries { fill: none; stroke: var(--cc-chart-boundary); stroke-width: 1; }
.legend-median { stroke: var(--cc-chart-median); stroke-width: 1.7; }
.legend-trajectory { stroke: var(--accent); stroke-width: 2.5; }
.legend-marker { fill: var(--accent); }
.chart-grid { stroke: var(--line-soft); }
.chart-axis-text { fill: var(--text-secondary); }
.chart-boundary { stroke: var(--cc-chart-boundary); }
.chart-median { stroke: var(--cc-chart-median); }
.chart-label-leader { stroke: var(--text-secondary); }
.chart-trajectory { stroke: var(--accent); }
.chart-halo { fill: var(--bg-panel); stroke: var(--accent); }
.chart-point { fill: var(--accent); stroke: var(--bg-panel); }
.chart-wrap { position: relative; margin-top: 14px; }
.chart-wrap > svg, .cc-guide { width: 100%; height: auto; overflow: visible; }
.chart-detail { position: absolute; z-index: 1; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: var(--radius-control); background: var(--bg-panel-strong); box-shadow: var(--shadow-soft); font-size: var(--font-size-small); line-height: 1.5; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: pre-line; pointer-events: none; }
@media screen {
    .chart-record.is-hovered .chart-point { r: 7px; fill: var(--bg-panel); stroke: var(--accent); stroke-width: 3; }
}
#nomogram [role=button] { cursor: pointer; }
.history-count { margin-left: 8px; color: var(--text-secondary); font-size: var(--font-size-small); font-weight: 400; }
.history-empty { margin: 12px 0 0; color: var(--text-secondary); }
.history-table-wrap { overflow: visible; padding-bottom: 4px; margin-top: 8px; }
.history-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-body); font-variant-numeric: tabular-nums; }
.history-table th { font-weight: 600; font-size: var(--font-size-small); color: var(--text-secondary); white-space: nowrap; }
.history-table th, .history-table td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--line-soft); }
.history-table th:first-child, .history-table td:first-child { text-align: left; padding-left: 10px; }
.history-table td { white-space: nowrap; }
.history-table .unit { font-weight: 400; }
.history-table tr.is-selected { background: var(--bg-selected); }
.history-table tr.is-selected td:first-child { box-shadow: inset 3px 0 var(--accent); }
.record-select { display: inline-flex; min-height: 44px; align-items: center; padding: 6px 4px; color: var(--accent); font-size: var(--font-size-body); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.row-actions { width: 120px; }
.row-actions button { min-height: 44px; border-radius: 8px; color: var(--accent); font-size: var(--font-size-small); padding: 8px; }
.row-actions button:hover, .row-menu[open] summary { background: var(--bg-hover); }
.row-actions .row-menu { display: inline-block; position: relative; vertical-align: middle; text-align: left; }
.row-menu summary { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; list-style: none; border-radius: 8px; cursor: pointer; font-size: 20px; }
.row-menu summary::-webkit-details-marker, .method-details summary::-webkit-details-marker { display: none; }
.row-menu > button { display: block; position: absolute; right: 0; top: 44px; z-index: 12; width: 132px; min-height: 44px; padding: 10px 14px; white-space: nowrap; text-align: left; border: 1px solid var(--line-soft); background: var(--bg-panel-strong); box-shadow: var(--shadow-card); }
.row-menu > .mobile-edit { display: none; }
.row-menu:not([open]) > button { display: none; }
.details-section { margin-top: var(--stack-gap); }
.method-details summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 18px 20px; color: var(--text-primary); font-size: var(--font-size-subheading); font-weight: 700; cursor: pointer; }
.method-details summary > svg { width: 20px; height: 20px; fill: none; stroke: var(--text-secondary); stroke-width: 1.6; transition: transform .15s; flex-shrink: 0; }
.method-details[open] summary > svg { transform: rotate(180deg); }
.detail-content { padding: 0 20px 20px; font-size: var(--font-size-body); line-height: 1.8; color: var(--text-secondary); }
.method-grid { display: flex; gap: 32px; }
.method-grid > div { flex: 1 1 0; min-width: 0; }
.detail-content h3 { margin: 0 0 12px; font-size: var(--font-size-subheading); font-weight: 600; color: var(--text-primary); }
.detail-content p { margin: 0 0 16px; }
.detail-content p:last-child { margin-bottom: 0; }
.citation, .source-links, .detail-content code { font-size: var(--font-size-small); }
.source-links { display: flex; flex-wrap: wrap; gap: 10px 20px; color: var(--accent); }
.source-links a { text-underline-offset: 4px; overflow-wrap: anywhere; }
.detail-content code { color: var(--text-primary); overflow-wrap: anywhere; }
.equation { padding: 14px 16px; border-radius: var(--radius-control); background: var(--bg-soft); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.measurement-guide { margin: 22px 0 0; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.measurement-guide figcaption { margin-bottom: 12px; font-size: var(--font-size-body); font-weight: 600; text-align: center; }
.guide-drawing { width: 100%; max-width: 280px; margin-inline: auto; }
.cc-guide path { vector-effect: non-scaling-stroke; }
.guide-outer { fill: var(--bg-selected); stroke: var(--accent); stroke-width: 2; }
.guide-inner { fill: none; stroke: var(--cc-chart-boundary); stroke-width: 1.3; }
.guide-measure { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.guide-project { fill: none; stroke: var(--text-secondary); stroke-width: 1.2; stroke-dasharray: 4 4; }
.guide-labels { position: relative; height: 23px; margin-top: 3px; font-size: var(--font-size-small); font-weight: 500; }
.guide-labels span { position: absolute; transform: translateX(-50%); }
.guide-labels span:first-child { left: 16.07%; }
.guide-labels span:last-child { left: 85.36%; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 16px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--bg-panel-strong); color: var(--text-primary); font-size: var(--font-size-body); z-index: 40; box-shadow: var(--shadow-panel); }
#undo-btn { min-height: 44px; padding: 8px; color: var(--accent); font-weight: 600; text-decoration: underline; white-space: nowrap; }
.noscript { padding: 16px; background: var(--bg-warning); color: var(--text-primary); text-align: center; }
@media screen and (max-width: 999px) {
    .input-card, .result-column { flex: 1 0 100%; }
    #assessment-form { gap: 16px; }
    .due-date-field, .date-field { flex: 1 1 calc(50% - 8px); }
    .length-field { flex: 1 1 180px; }
    .entry-actions { flex: 1 1 140px; }
    .measurement-guide { max-width: 360px; margin-inline: auto; }
}
@media screen and (min-width: 641px) and (max-width: 999px) {
    .input-card { display: flex; flex-wrap: wrap; gap: 18px 24px; }
    #assessment-form { flex: 1 1 380px; }
    .measurement-guide { flex: 1 1 200px; align-self: center; margin: 0; padding: 0; border: 0; }
}
@media screen and (max-width: 640px) {
    .input-card, .followup-card, .history-section { padding: 16px; }
    .due-date-field, .date-field { flex: 1 0 100%; }
    .length-field { flex-basis: 130px; }
    .entry-actions { flex: 0 0 auto; }
    .main-metric, .secondary-metric { padding: 12px; }
    .percentile-value { font-size: 34px; }
    .z-value { font-size: 28px; }
    .chart-legend { gap: 8px; }
    .chart-legend span { gap: 4px; }
    .legend-swatch { width: 24px; height: 12px; flex-basis: 24px; }
    .chart-wrap { margin-inline: -6px; }
    .history-table { table-layout: fixed; font-size: 14px; }
    .history-table th, .history-table td { padding: 8px 3px; }
    .history-table th:first-child, .history-table td:first-child { width: 32%; padding-left: 3px; }
    .history-table th:nth-child(2) { width: 13%; white-space: normal; line-height: 1.35; }
    .history-table th:nth-child(3) { width: 18%; white-space: normal; line-height: 1.35; }
    .history-table .unit { white-space: nowrap; }
    .history-table th:nth-child(4) { width: 22%; }
    .history-table .row-actions { width: 44px; padding: 4px 0; }
    .record-select { font-size: 14px; padding: 6px 0; }
    .row-actions .edit-record { display: none; }
    .row-menu > .mobile-edit { display: block; border-radius: 8px 8px 0 0; }
    .row-menu > button:last-child { top: 88px; border-top: 0; border-radius: 0 0 8px 8px; }
    .method-details summary { padding: 16px; }
    .detail-content { padding: 0 16px 16px; }
    .method-grid { flex-direction: column; gap: 24px; }
}
@media screen and (max-width: 380px) {
    .input-card, .followup-card, .history-section { padding: 14px; }
    .history-section { padding-inline: 8px; }
    .percentile-value { font-size: 28px; }
    .z-value { font-size: 25px; }
    .main-metric, .secondary-metric { padding: 10px; }
    .history-table th, .history-table td { padding-inline: 2px; }
    .history-table th:first-child, .history-table td:first-child { width: 90px; }
    .history-table th:nth-child(2) { width: 34px; }
    .history-table th:nth-child(3) { width: 52px; }
    .history-table th:nth-child(4) { width: auto; }
    .history-table td:nth-child(4) { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Preserve the v20 A4 follow-up report. */
@page { size: A4 portrait; margin: 14mm; }
@media print {
  :root { color-scheme: light; background: #fff; color: #000; }
  *, *::before, *::after { color: #000 !important; background: transparent !important; box-shadow: none !important; text-shadow: none !important; transition: none !important; animation: none !important; -webkit-print-color-adjust: economy; print-color-adjust: economy; }
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; font-size: 10pt; line-height: 1.45; }
  .page { width: 100%; max-width: none; margin: 0; padding: 0; }
  .screen-only, .site-navbar, .site-footer, .site-header, .input-card, .details-section, .toast, .skip-link, .noscript, .row-actions, .chart-detail, button { display: none !important; }
  .print-only { display: block; }
  .print-header { margin-bottom: 8mm; padding-bottom: 4mm; border-bottom: .65pt solid #777; break-inside: avoid; }
  .print-header h1 { font-size: 20pt; font-weight: 600; margin: 0 0 3mm; }
  .print-meta { display: flex; justify-content: space-between; gap: 3mm 6mm; flex-wrap: wrap; font-size: 9.5pt; }
  .print-empty { font-size: 11pt; padding: 6mm 0; }
  body:not([data-has-result="true"]) .workspace { display: none !important; }
  .workspace { display: block; }
  .card { border: 0; border-radius: 0; padding: 0; overflow: visible; }
  .result-card { break-inside: avoid; }
  .main-metric, .secondary-metric { border: 0; border-radius: 0; padding: 0; }
  .history-table-wrap { margin-top: 0; }
  .section-heading { min-height: 0; }
  .section-heading, .chart-heading { break-after: avoid; }
  .section-heading h2, .chart-heading h2, .print-source h2 { margin: 0; font-size: 14pt; line-height: 1.3; font-weight: 600; }
  .result-context { display: block; margin-top: 2mm; font-size: 10pt; }
  .result-metrics { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 6mm; margin: 3mm 0; }
  .metric-label, .reference-value span, .delta-value { font-size: 10pt; }
  .percentile-value { margin-top: 2px; font-size: 28pt; font-weight: 600; }
  .z-value { margin-top: 5px; font-size: 23pt; line-height: 1.3; font-weight: 500; }
  .secondary-metric, .supporting-metrics { border: 0; padding: 0; }
  .supporting-metrics { grid-column: auto; display: block; }
  .reference-value { display: block; }
  .reference-value span, .reference-value strong { display: block; }
  .reference-value strong { margin-top: 3px; font-size: 13pt; font-weight: 500; }
  .delta-value { margin-top: 2mm; }
  .chart-card { margin-top: 9mm; padding-top: 0; border-top: 0; break-inside: avoid; }
  .chart-header { flex-wrap: nowrap; gap: 4mm; margin-bottom: 0; }
  .chart-axis-label { margin-left: 4.666667%; font-size: 10pt; }
  .chart-legend { flex-wrap: nowrap; gap: 5mm; }
  .chart-legend span { font-size: 9.5pt; gap: 1.5mm; }
  .chart-legend .print-only { display: inline; }
  .legend-swatch { width: 7mm; height: 3.5mm; flex-basis: 7mm; }
  .legend-band-fill { fill: none; }
  .legend-boundaries { stroke: #858585; stroke-width: 1.4; stroke-dasharray: 5 3; }
  .legend-median { stroke: #777; stroke-width: 1.5; }
  .legend-trajectory { stroke: #000; stroke-width: 2.5; }
  .legend-marker { fill: #000; }
  .chart-wrap { margin: 3mm 0 0; }
  .chart-wrap > svg { width: 100%; height: auto; max-height: 90mm; overflow: visible; }
  #nomogram text { fill: #000; font-size: 18px; }
  #nomogram .chart-grid { stroke: #aaa; stroke-width: .65; }
  #nomogram .chart-band { fill: none; }
  #nomogram .chart-boundary { stroke: #858585; stroke-width: 1.4; stroke-dasharray: 5 3; fill: none; }
  #nomogram .chart-median { stroke: #777; stroke-width: 1.5; fill: none; }
  #nomogram .chart-trajectory { stroke: #000; stroke-width: 2.5; fill: none; }
  #nomogram .chart-guide-line { stroke: #777; stroke-width: .8; stroke-dasharray: 2 4; }
  #nomogram .chart-halo { fill: #fff; fill-opacity: 1; stroke: #000; }
  #nomogram .chart-point { fill: #000; stroke: #fff; stroke-width: 2; }
  #nomogram .chart-label-bg { fill: #fff; stroke: #777; stroke-width: .7; }
  #nomogram .chart-label-leader { stroke: #777; }
  .history-section { margin-top: 9mm; padding: 0; }
  .history-table-wrap { overflow: visible; }
  .history-table { font-size: 10pt; table-layout: auto; }
  .history-table th, .history-table td { padding: 2.5mm 3mm; border: 0; }
  .history-table th { font-size: 10pt; font-weight: 600; width: auto !important; border-bottom: .5pt solid #bbb; }
  .history-table thead { display: table-header-group; }
  .history-table tr { break-inside: avoid; }
  .history-table .record-select { display: inline !important; min-height: 0; padding: 0; border: 0; font-size: 10pt; text-decoration: none; font-weight: 400; }
  .history-table tr.is-selected td, .history-table tr.is-selected .record-select { font-weight: 600; }
  .history-count { display: none; }
  .print-source { margin-top: 9mm; padding-top: 0; border-top: 0; font-size: 9pt; line-height: 1.5; break-inside: avoid; }
  .print-source p { margin: 1.5mm 0 0; overflow-wrap: anywhere; }
}
