:root {
  color-scheme: light dark;
  --bg: #edf3ef; --surface: #fafffc; --input: #f0f6f2; --headline: #182f29; --ink: #243c34;
  --muted: #506b61; --line: #c9dbd2; --accent: #205f51; --on-accent: #f4fffa; --accent-soft: #e0eee7;
  --error: #9b3529; --shadow: 0 14px 36px #183e2b0c; --radius: 9px;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14211d; --surface: #1b2a25; --input: #21342c; --headline: #f2fff7; --ink: #eaf8ef;
    --muted: #adcbc0; --line: #435e52; --accent: #a1dec2; --on-accent: #163831; --accent-soft: #294538;
    --error: #ffb0a0; --shadow: none;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.9rem); line-height: 1.15; font-weight: 710; color: var(--headline); letter-spacing: -.055em; }
h2 { font-size: 1.22rem; line-height: 1.35; color: var(--headline); }
a { color: var(--accent); text-underline-offset: .24em; }
button, input, textarea, select { font: inherit; }
button, select, textarea { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
button { min-height: 37px; padding: 5px 10px; font-weight: 600; cursor: pointer; }
button:hover { background: var(--accent-soft); }
button:disabled { color: var(--muted); opacity: .65; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 2; padding: 8px 12px; background: var(--surface); }
.bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-inner, main { max-width: 1275px; margin-inline: auto; padding-inline: clamp(15px, 4vw, 38px); }
.bar-inner { min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--headline); font-weight: 700; letter-spacing: -.015em; }
.wordmark img { flex: 0 0 auto; }
.bar-end { display: flex; gap: clamp(8px, 3vw, 25px); font-size: .86rem; white-space: nowrap; }
.bar-end a { color: var(--muted); text-decoration: none; }
.bar-end a:hover { color: var(--accent); text-decoration: underline; }
main { padding-block: clamp(22px, 4vw, 50px) 56px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 0 0 22px; }
.kicker { font-size: .8rem; font-weight: 680; letter-spacing: .09em; color: var(--accent); }
.intro .kicker { margin-bottom: 9px; }
.intro h1 + p { margin-top: 11px; color: var(--muted); }
.local { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); font-size: .84rem; }
.local span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.workspace, .results-grid { display: grid; grid-template-columns: minmax(245px, 310px) minmax(0, 1fr); gap: 14px; align-items: start; }
.results-grid { margin-top: 14px; }
.panel { min-width: 0; padding: clamp(14px, 2vw, 22px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.small { margin-top: 7px; color: var(--muted); font-size: .875rem; }
.file-target { margin-top: 15px; display: flex; align-items: center; gap: 10px; min-height: 58px; border: 1px dashed var(--accent); border-radius: 5px; padding: 8px 10px; color: var(--accent); cursor: pointer; }
.file-target:hover, .file-target:has(+ .file-input:focus-visible) { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: 1px; }
.file-symbol { padding-inline: 5px; font-size: 1.35rem; }
.file-target small { display: block; color: var(--muted); font-size: .8rem; }
.quick, .export-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.quick { margin-top: 9px; }
.quick button { flex: 1; }
.paste, .concentration { margin-top: 10px; }
summary { color: var(--accent); font-size: .875rem; font-weight: 630; cursor: pointer; }
textarea { display: block; width: 100%; margin: 6px 0; padding: 7px; resize: vertical; }
.file-label { margin-block: 10px; min-height: 1.3em; color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
#sheet-field, .form-grid label { display: flex; flex-direction: column; min-width: 0; font-size: .875rem; gap: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.form-grid .full { grid-column: 1 / -1; }
select { width: 100%; min-width: 0; height: 38px; background: var(--input); padding: 4px; }
.concentration .form-grid, .mix-selects { margin-top: 8px; }
.primary { width: 100%; margin-top: 13px; background: var(--accent); color: var(--on-accent); border-color: transparent; }
.primary:hover { background: var(--accent); filter: brightness(.94); }
.error { margin-top: 10px; color: var(--error); overflow-wrap: anywhere; }
.plot-header { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.plot-header h2 { margin-top: 3px; font-size: 1.48rem; }
.counts { margin: 13px 0 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--input); border: 1px solid var(--line); border-radius: 5px; }
.counts div { min-width: 0; padding: 7px 10px; border-inline-end: 1px solid var(--line); }
.counts div:last-child { border: 0; }
.counts dt { color: var(--muted); font-size: .82rem; }
.counts dd { color: var(--headline); font-size: 1.3rem; font-variant-numeric: tabular-nums; font-weight: 680; }
.chart-area { min-width: 0; min-height: 295px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: #f7fbf8; color: #324e45; }
#chart { width: 100%; display: block; }
#chart-empty { padding: 14px; text-align: center; }
.plot-footer { display: flex; flex-wrap: wrap; gap: 9px 17px; justify-content: space-between; margin-top: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.legend li { display: inline-flex; gap: 4px; align-items: center; overflow-wrap: anywhere; font-size: .84rem; }
.legend svg { flex: 0 0 auto; }
.display-options, .inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .86rem; }
.inline { margin-top: 10px; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0 4px 0 0; accent-color: var(--accent); vertical-align: text-bottom; }
.mix-status { min-height: 2.6em; }
.table-scroll { overflow-x: auto; margin-top: 9px; }
table { width: 100%; min-width: 390px; border-collapse: collapse; text-align: left; font-size: .87rem; font-variant-numeric: tabular-nums; }
.report table { min-width: 674px; }
th { background: var(--input); color: var(--accent); font-weight: 680; }
td, th { padding: 7px 9px; vertical-align: top; border-bottom: 1px solid var(--line); }
td { overflow-wrap: anywhere; }
.report, .method { margin-top: 14px; }
.report details { margin-top: 11px; }
.method dl { margin-top: 11px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.method dt { margin-bottom: 4px; font-weight: 670; }
.method dd { color: var(--muted); font-size: .89rem; }
.citations { display: flex; gap: 10px 19px; flex-wrap: wrap; margin-top: 15px; font-size: .875rem; }
@media (max-width: 850px) {
  .workspace, .results-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 500px) {
  .intro { display: block; }
  .local { margin-top: 9px; }
  .method dl { grid-template-columns: 1fr; }
  .plot-header { flex-wrap: wrap; }
  .plot-note { line-height: 1.45; }
}
