:root {
  color-scheme: light;
  --background: #f4f6f2;
  --surface: #fff;
  --ink: #1b2621;
  --muted: #505e54;
  --accent: #315c42;
  --accent-dark: #244731;
  --rule: #dce3d9;
  --soft: #f7f9f5;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-family: var(--sans);
  background: var(--background);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.5; }
a { color: var(--accent-dark); text-underline-offset: 3px; }
button, select, input, textarea { font: inherit; color: inherit; }
button, summary, label:has(input[type="checkbox"]) { cursor: pointer; }
button, summary, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .65; }
h1, h2, h3, p, figure { margin: 0; }
.shell { width: min(1480px, 100% - 64px); margin-inline: auto; }
.skip-link { position: fixed; z-index: 5; left: 12px; top: 12px; background: var(--surface); padding: 10px; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.masthead { border-bottom: 1px solid var(--rule); background: var(--surface); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 16px; }
.masthead a { font-size: .89rem; font-weight: 550; color: var(--muted); }
.brand { display: flex; align-items: center; font-size: .98rem; font-weight: 700; letter-spacing: -.02em; gap: 11px; }
.brand-mark { display: grid; align-content: center; gap: 3px; width: 31px; height: 31px; padding: 5px; border: 1px solid #cbe0cd; border-radius: 7px; background: #e8f2e7; }
.brand-mark i { height: 3px; background: var(--accent); border-radius: 1px; }
.brand-mark i:first-child { width: 13px; }
.brand-mark i:nth-child(2) { margin-left: 4px; width: 15px; }
.brand-mark i:last-child { margin-left: 8px; width: 11px; }
.hero { padding: 30px 0 24px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 13px 24px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(2.25rem, 4.3vw, 3.35rem); letter-spacing: -.055em; line-height: 1.06; }
.hero p { max-width: 60ch; margin-top: 7px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.local-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .81rem; }
.inputs-toggle { display: inline-flex; gap: 6px; align-items: center; }
.workspace { display: grid; grid-template-columns: minmax(252px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; }
.workspace[data-inputs-hidden="true"] { grid-template-columns: minmax(0, 1fr); }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 11px; min-width: 0; }
.inputs { padding: 17px; }
.section-heading, .field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2 { font-size: 1.15rem; line-height: 1.25; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
.field { margin-top: 17px; }
.field-head { margin-bottom: 6px; font-size: .9rem; }
.field-head label { font-weight: 650; }
textarea, input:is([type="number"], [type="search"]), select { border: 1px solid #cbd8cb; border-radius: 6px; background: #fff; }
textarea { display: block; width: 100%; min-height: 76px; padding: 8px 9px; background: #fcfdfb; font: .81rem/1.55 var(--mono); resize: vertical; }
textarea::placeholder, input::placeholder { color: #66756a; opacity: 1; }
.hint, .format-help p { color: var(--muted); font-size: .84rem; }
.hint { margin-top: 6px; }
.check-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .875rem; }
.check-line input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: 0 0 auto; }
#data-form > .check-line { margin-top: 17px; }
.primary, .quiet, .text-button, .menu-popover button { font-size: .875rem; font-weight: 600; }
.primary { display: block; width: 100%; margin-top: 17px; min-height: 42px; padding: 8px 12px; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.quiet { border: 1px solid var(--rule); border-radius: 6px; background: #fff; padding: 5px 10px; color: var(--accent-dark); white-space: nowrap; }
.quiet:hover, .menu-popover button:hover { background: var(--soft); }
.text-button { border: 0; padding: 0; color: var(--accent); background: none; text-underline-offset: 3px; }
.text-button:hover { text-decoration: underline; }
.format-help { border-top: 1px solid var(--rule); margin-top: 20px; padding-top: 13px; font-size: .88rem; }
.format-help p, .format-help .text-button { margin-top: 9px; }
.format-help pre { margin: 10px 0; border-radius: 6px; background: var(--soft); padding: 8px; font: .76rem/1.5 var(--mono); overflow: auto; }
.format-help code { font-family: var(--mono); }
summary { color: var(--accent-dark); font-weight: 600; }
.feedback { margin-top: 10px; color: #72401e; font-size: .88rem; overflow-wrap: anywhere; }
.feedback[data-tone="error"] { color: #96332c; }
.feedback[data-tone="success"] { color: var(--accent-dark); }
.results-header { display: flex; justify-content: space-between; align-items: start; padding: 18px 18px 12px; gap: 12px; }
.result-title { min-width: 0; }
.result-title h2 { overflow-wrap: anywhere; font-size: 1.34rem; }
.result-title p { color: var(--muted); font-size: .875rem; margin-top: 3px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 18px; padding: 9px 0 12px; border-block: 1px solid var(--rule); }
.metrics div { display: grid; gap: 2px; padding: 0 0 0 14px; min-width: 0; }
.metrics div:first-child { padding-left: 0; }
.metrics div + div { border-left: 1px solid var(--rule); }
.metrics span { display: block; color: var(--muted); font-size: .8125rem; }
.metrics output { display: block; font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.25; font-weight: 650; letter-spacing: -.04em; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.result-controls { padding: 13px 18px 11px; }
.control-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.control-row + .control-row { margin-top: 8px; }
.segments { display: inline-flex; padding: 3px; background: var(--soft); border-radius: 8px; border: 1px solid var(--rule); gap: 3px; }
.segments button { background: transparent; border: 1px solid transparent; border-radius: 5px; min-height: 32px; padding: 4px 10px; font-size: .875rem; font-weight: 600; color: var(--muted); }
.segments button[aria-pressed="true"] { background: var(--accent-dark); color: white; }
.segments button:hover:not([aria-pressed="true"]) { color: var(--ink); background: #edf3ec; }
.range-controls, .select-label, .protein-picker { display: flex; gap: 7px; align-items: center; font-size: .86rem; color: var(--muted); }
.select-label { margin-left: auto; }
input:is([type="number"], [type="search"]), select { padding: 4px 7px; min-height: 34px; }
select { appearance: none; padding-right: 27px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%23536257' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 12px 8px; }
.range-controls input { width: 63px; font-variant-numeric: tabular-nums; }
.range-controls .text-button { margin-left: 3px; }
.protein-picker select { min-width: 0; max-width: min(260px, 52vw); }
.sample-menu, .export-menu { position: relative; }
:is(.sample-menu, .export-menu) > summary { list-style: none; padding: 5px 12px; background: white; border: 1px solid var(--rule); border-radius: 7px; font-size: .875rem; }
:is(.sample-menu, .export-menu) > summary::-webkit-details-marker { display: none; }
:is(.sample-menu, .export-menu) > summary:hover { background: var(--soft); }
.menu-popover { position: absolute; z-index: 3; top: calc(100% + 5px); min-width: max-content; background: white; border: 1px solid var(--rule); box-shadow: 0 8px 24px #1b26211c; border-radius: 8px; padding: 5px; }
.export-menu .menu-popover { right: 0; }
.menu-popover button { display: block; width: 100%; text-align: left; background: white; border: 0; border-radius: 5px; padding: 6px 10px; }
.sample-options { min-width: 180px; max-width: min(280px, 80vw); max-height: 280px; overflow: auto; padding: 8px 10px; }
.sample-options label { overflow-wrap: anywhere; padding: 5px 0; }
.plot-settings { margin-top: 8px; font-size: .875rem; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 13px; padding: 11px 0 4px; max-width: 700px; }
.setting { display: grid; gap: 3px; color: var(--muted); min-width: 0; }
.setting input, .setting select { width: 100%; }
.plot-figure { margin: 0 18px 18px; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.plot-caption { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 3px 12px; background: var(--soft); padding: 9px 12px; border-bottom: 1px solid var(--rule); color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
#plot-caption { color: var(--ink); font-size: .875rem; font-weight: 650; }
.overview { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 12px; border-bottom: 1px solid var(--rule); color: var(--muted); font-size: .8125rem; }
.overview-plot { flex: 1 1 180px; min-width: 0; }
.overview canvas { display: block; width: 100%; height: 16px; }
.plot-scroll { overflow: auto; max-height: min(74vh, 1050px); min-height: 76px; scrollbar-color: #a8bca8 #f1f5f0; }
#plot-slot > svg { display: block; max-width: none; }
.pg-peptide[role="button"] { cursor: pointer; outline: none; }
.pg-peptide:is(:hover, :focus-visible, [data-selected="true"]) .pg-peptide-box { stroke: #264a33; stroke-width: 1.4; }
.plot-scroll:focus-visible { outline-offset: -2px; }
.plot-empty { padding: 24px 12px; color: var(--muted); }
.selection, .diagnostics { margin: 0 17px 16px; border-top: 1px solid var(--rule); padding-top: 13px; }
.selected-sequence { font: 650 1rem/1.6 var(--mono); margin-top: 5px; overflow-wrap: anywhere; }
.selection-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.selection-values { max-height: 220px; overflow: auto; margin-top: 8px; }
.selection-values table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
.selection-values th, .selection-values td { padding: 4px 6px; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.diagnostics { font-size: .875rem; color: var(--muted); }
.diagnostics ul { padding-left: 18px; overflow-wrap: anywhere; }
.export-status { margin: 0 17px 16px; }
.empty-state { padding: 30px 17px; }
.empty-state p { color: var(--muted); margin-top: 5px; }
.footer { color: var(--muted); padding: 21px 0 30px; font-size: .84rem; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 34px); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 20px; }
}
@media (max-width: 540px) {
  .result-controls > .control-row:first-child { position: relative; }
  .sample-menu { position: static; }
  .sample-menu .menu-popover { right: 0; }
}
@media (max-width: 460px) {
  .shell { width: calc(100% - 24px); }
  .results-header, .result-controls { padding-inline: 12px; }
  .metrics, .plot-figure, .selection, .diagnostics { margin-inline: 12px; }
  .metrics div { padding-left: 8px; }
  .metrics span { font-size: .75rem; }
  .plot-figure { margin-inline: 9px; }
  .range-controls { flex-wrap: wrap; }
  .select-label { margin-left: 0; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .masthead, .hero, .inputs, .footer, .result-controls, .export-menu, .selection, .diagnostics, .metrics, .overview, .plot-caption, .export-status, .skip-link { display: none !important; }
  body, :root { background: white; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .shell { width: 100%; }
  .workspace { display: block; }
  .results, .plot-figure { border: 0; box-shadow: none; margin: 0; }
  .results-header { padding: 0 0 10px; }
  .results:has(#plot-slot > svg[data-presentation="labelled"]) .results-header { display: none; }
  .plot-scroll { overflow: visible; max-height: none; }
  #plot-slot > svg { width: 100%; max-width: 100%; height: auto; }
  #plot-slot .pg-peptide-box { stroke: #719576; stroke-width: 0.65; }
}
