:root {
  color-scheme: light;
  --ink: #182b2a;
  --muted: #526662;
  --border: #dce5e1;
  --wash: #f5f8f6;
  --teal: #105d51;
  --light-teal: #e8f3ee;
  --quiet: #f9fbfa;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--wash); }
button, textarea, select { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .56; }
button, select, summary, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #1d8071; outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.app-header { background: #fff; border-bottom: 1px solid var(--border); }
.header-inner, .workspace { width: min(100% - 64px, 1410px); margin-inline: auto; }
.header-inner { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; letter-spacing: -.35px; }
.brand-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: #0e584f; }
.brand-country { color: #4b6d65; }
.privacy { display: inline-flex; align-items: center; gap: 6px; color: #2d5e50; background: #edf5f0; border: 1px solid #dcebe4; border-radius: 100px; padding: 5px 10px; font-size: 11px; font-weight: 650; }
.workspace { padding-block: 26px 40px; }
.introduction { margin-bottom: 19px; }
.introduction h1 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 670; letter-spacing: -.85px; line-height: 1.15; }
.introduction p { color: var(--muted); margin-top: 7px; line-height: 1.45; }
.work-grid { display: grid; grid-template-columns: minmax(280px, .77fr) minmax(0, 1.4fr); align-items: start; gap: 17px; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 11px; background: #fff; box-shadow: 0 2px 5px #142e2910; }
.panel-heading { display: flex; align-items: center; gap: 9px; min-height: 57px; padding: 10px 15px; border-bottom: 1px solid var(--border); }
.step { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 6px; background: var(--light-teal); color: #245f50; font-size: 12px; font-weight: 700; }
.panel-heading h2, .dialog-header h2 { font-size: 15px; font-weight: 700; }
.source-kind { margin-left: auto; color: var(--muted); font-size: 11px; }
.input-body { padding: 13px 15px 15px; }
.source-tools, .input-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.button, select { min-height: 31px; border: 1px solid #d4dfda; border-radius: 6px; background: #fff; color: #263e37; padding: 5px 9px; font-size: 12px; font-weight: 600; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; }
.button:hover:not(:disabled), select:hover:not(:disabled) { background: #f1f6f3; border-color: #b7cbc1; }
.button.primary { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 700; }
.button.primary:hover:not(:disabled) { background: #10493f; border-color: #10493f; }
.button.text-button { border-color: transparent; color: #285d4e; }
.button.small { min-height: 24px; padding: 2px 7px; font-size: 11px; }
textarea { width: 100%; min-height: 225px; height: 320px; display: block; margin-top: 10px; padding: 11px; resize: vertical; border: 1px solid #ccdcd4; border-radius: 7px; background: var(--quiet); color: #203b33; font: 12px/1.5 Consolas, "Liberation Mono", monospace; }
textarea::placeholder { color: #526762; }
textarea:focus { background: #fff; }
.input-meta { margin-top: 4px; color: var(--muted); font-size: 11px; }
#input-note, .sample-notice { font-size: 11px; line-height: 1.4; color: var(--muted); }
.sample-notice { margin-top: 8px; padding: 6px 8px; background: #eff6f1; border-radius: 5px; color: #315b49; }
.heading-text { flex: 1; min-width: 0; }
.heading-text p { margin-top: 1px; color: var(--muted); font-size: 11px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 9px 15px; border-bottom: 1px solid var(--border); }
.segmented { display: inline-flex; gap: 2px; border: 1px solid #dbe6e0; border-radius: 7px; padding: 2px; background: #f2f6f3; }
.segmented button { min-height: 25px; background: transparent; border: 1px solid transparent; color: #4b6159; border-radius: 5px; padding: 2px 10px; font-size: 12px; font-weight: 650; }
.segmented [aria-pressed="true"] { background: white; color: #1c5144; border-color: #d5e3db; box-shadow: 0 1px 2px #12332710; }
.filter { position: relative; margin-left: auto; }
.filter > summary { list-style: none; min-height: 31px; padding: 6px 8px 6px 12px; border: 1px solid #d4dfda; border-radius: 6px; color: #263e37; font-size: 12px; font-weight: 650; }
.filter > summary::-webkit-details-marker { display: none; }
.filter > summary::after { content: '⌄'; margin-left: 7px; }
.filter[open] > summary, .filter > summary:hover { background: #eff5f1; }
#filter-count { margin-left: 4px; color: var(--teal); }
.filter-body { position: absolute; z-index: 3; right: 0; top: calc(100% + 7px); width: min(275px, calc(100vw - 48px)); max-height: 58vh; overflow: auto; padding: 12px; border: 1px solid #cddcd4; border-radius: 8px; background: white; box-shadow: 0 6px 18px #122e2223; font-size: 12px; }
.filter-body > label, .filter-body legend { font-weight: 700; }
.filter-body select { display: block; width: 100%; margin: 4px 0 10px; }
.filter-body fieldset { margin: 0 0 9px; padding: 5px 7px; border: 1px solid var(--border); }
.filter-body fieldset label, #parameter-filters label { display: flex; align-items: start; gap: 5px; margin: 4px 0; }
.filter-body input { accent-color: var(--teal); margin: 1px 0 0; }
.parameter-details { padding-bottom: 9px; }
#parameter-filters { max-height: 190px; overflow: auto; padding-left: 5px; }
.filter-note { padding: 6px 15px; color: #355c50; background: #f1f8f3; border-bottom: 1px solid #dae9df; font-size: 11px; }
.review { padding: 7px 10px; margin: 10px 15px 0; color: #554725; background: #fbf8ef; border: 1px solid #eaddbd; border-radius: 6px; font-size: 12px; }
.review.neutral { color: #405b53; background: #f5f8f6; border-color: var(--border); }
.review summary { font-weight: 650; }
.review ul { padding-left: 16px; margin: 5px 0 0; max-height: 230px; overflow: auto; }
.review li { margin: 3px 0; overflow-wrap: anywhere; }
.review time { font-variant-numeric: tabular-nums; }
.preview { min-height: 300px; padding: 13px 15px 14px; }
.empty-state { min-height: 272px; display: grid; place-items: center; border: 1px dashed #d4e3db; border-radius: 8px; background: #fbfdfb; text-align: center; padding: 20px; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 9px; background: #eaf3ee; border-radius: 10px; color: #397365; }
.empty-state h3 { font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.empty-state p { font-size: 12px; }
.period + .period { margin-top: 14px; }
.period-title { border-bottom: 1px solid #ccddd4; color: #245647; padding: 0 0 4px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lab-group { margin: 7px 0 9px; }
.lab-group > summary { display: flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; min-height: 25px; list-style: none; font-size: 12px; font-weight: 700; }
.lab-group > summary::-webkit-details-marker { display: none; }
.lab-group > summary::before { content: ''; width: 5px; height: 5px; margin: 0 3px 0 2px; border-bottom: 1.5px solid #467063; border-right: 1.5px solid #467063; transform: rotate(-45deg); }
.lab-group[open] > summary::before { transform: rotate(45deg) translateY(-1px); }
.group-count { font-size: 10px; color: var(--muted); font-weight: 500; }
.group-copy { margin: 2px 0 4px; }
.table-frame { width: fit-content; max-width: 100%; border: 1px solid #d8e5dd; border-radius: 5px; overflow: hidden; }
.table-frame + .table-frame { margin-top: 5px; }
.lab-table { width: max-content; max-width: 100%; border-collapse: collapse; table-layout: auto; font-size: 12px; line-height: 1.27; }
.lab-table th, .lab-table td { padding: 2px 8px; text-align: right; vertical-align: top; overflow-wrap: anywhere; border-bottom: 1px solid #e4ece7; font-variant-numeric: tabular-nums; }
.lab-table th:first-child { text-align: left; }
.lab-table thead th { color: #37564c; background: #edf4ef; font-size: 11px; font-weight: 700; }
.lab-table tbody th { font-weight: 500; min-width: 108px; }
.lab-table tbody tr:last-child > * { border-bottom: 0; }
.lab-table td { min-width: 64px; }
.lab-table td.history { text-align: left; max-width: 275px; }
.lab-table .history span { white-space: normal; }
.paired-frame { width: min(100%, 620px); }
.paired-table { width: 100%; table-layout: fixed; }
.paired-table td { width: 50%; text-align: left; }
.paired-table td + td { border-left: 1px solid #d8e5dd; }
.word-preview .period + .period { margin-top: 10px; }
.word-preview .period-title { color: #173952; border-color: #68859c; }
.word-preview .lab-group { margin: 4px 0 6px; }
.word-preview .lab-group > summary { min-height: 21px; color: #173952; }
.word-frame { width: min(100%, 600px); overflow: auto; border-color: #a5b7c7; }
.word-layout-table { width: 100%; table-layout: fixed; font-family: Arial, sans-serif; font-size: 12px; line-height: 1.24; }
.word-frame .word-layout-table th, .word-frame .word-layout-table td { min-width: 0; padding: 2px 3px; border-bottom-color: #a5b7c7; color: #162538; }
.word-layout-table tbody th { min-width: 0; text-align: left; }
.word-frame .word-layout-table thead th { background: #dce9f3; color: #173952; font-size: 10.5px; }
.word-layout-table thead th:first-child, .word-layout-table thead .word-group-start,
.word-layout-table .word-history, .word-layout-table .word-single-value { text-align: left; }
.word-layout-table tbody tr:nth-child(even) { background: #f1f5f9; }
.word-layout-table .word-group-start, .word-layout-table .word-history { border-left: 1px solid #68859c; }
.word-layout-table .abnormal { color: #674516; }
.word-layout-table .abnormal[data-flag="H"] { color: #7d1735; }
.word-layout-table .abnormal[data-flag="L"] { color: #174e7a; }
.word-layout-table .value-meta, .word-layout-table .missing { color: #3b5064; }
.word-section-time { margin: 4px 0 2px; color: #3b5064; font-size: 10.5px; }
.word-unit-legend { margin-top: 8px; color: #3b5064; font-size: 11px; overflow-wrap: anywhere; }
.word-height-note { padding: 6px 15px; background: #fbf8ef; color: #554725; font-size: 11px; }
.preview.roomy .lab-table th, .preview.roomy .lab-table td { padding: 4px 10px; }
.unit, .value-meta, .normal-flag { color: var(--muted); font-size: 10px; font-weight: 400; }
.history-separator { color: #788b81; }
.abnormal { color: #124d40; font-weight: 750; }
.missing { color: #647770; }
.output-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 5px 9px; padding: 5px 15px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.legend-divider { margin-inline: 2px; }
.toast { position: fixed; z-index: 5; bottom: 16px; right: 16px; max-width: calc(100% - 32px); padding: 9px 13px; background: #173f35; color: #fff; border-radius: 7px; box-shadow: 0 3px 12px #10292325; font-size: 12px; }
.toast:empty { display: none; }
dialog { width: min(740px, calc(100% - 24px)); padding: 0; border: 1px solid #c8dad1; border-radius: 10px; color: var(--ink); }
dialog::backdrop { background: #16342d66; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dialog-header p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.manual-content { padding: 8px 16px 16px; max-height: 65vh; overflow: auto; }
@media (max-width: 870px) {
  .header-inner, .workspace { width: min(100% - 34px, 1410px); }
  .work-grid { grid-template-columns: minmax(210px, .7fr) minmax(0, 1.4fr); gap: 10px; }
  .toolbar, .panel-heading, .preview, .input-body { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 670px) {
  .header-inner, .workspace { width: calc(100% - 24px); }
  .header-inner { min-height: 52px; }
  .workspace { padding-block: 17px 25px; }
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  textarea { height: 155px; min-height: 120px; }
  .lab-table th, .lab-table td { padding-inline: 5px; }
}
