:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-2: #edf3f5;
  --ink: #151923;
  --muted: #5f6b78;
  --line: #d7e0e5;
  --accent: #007f73;
  --accent-soft: #dff4ef;
  --accent-tint: rgba(0, 127, 115, 0.08);
  --coral: #d86f45;
  --blue: #376fb7;
  --gold: #a86f10;
  --danger: #b14343;
  --optimize: #bf343b;
  --optimize-hover: #a7262d;
  --success: #14765f;
  --shadow: 0 18px 48px rgba(20, 31, 43, 0.1);
  --radius: 8px;
  --max-width: 1320px;
  --plot-bg: #fbfcfd;
  --plot-grid: #e4eaee;
  --plot-text: #637180;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101419;
  --surface: #1a1f27;
  --surface-2: #232a34;
  --ink: #f4f7fa;
  --muted: #b5bfca;
  --line: #323b47;
  --accent: #45c7b5;
  --accent-soft: #143a36;
  --accent-tint: rgba(69, 199, 181, 0.12);
  --coral: #ff9b70;
  --blue: #8fb6ff;
  --gold: #f1c66f;
  --danger: #ff9b8f;
  --optimize: #d94b55;
  --optimize-hover: #bd3943;
  --success: #65d6b8;
  --shadow: 0 20px 58px rgba(0, 0, 0, 0.3);
  --plot-bg: #151a21;
  --plot-grid: #29323d;
  --plot-text: #acb8c5;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(0, 127, 115, 0.07), transparent 32%),
    linear-gradient(180deg, rgba(55, 111, 183, 0.06), transparent 38%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

::selection {
  background: color-mix(in srgb, var(--accent), transparent 72%);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
.app-header nav a,
.theme-toggle {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  padding: 0.55rem 0.78rem;
  text-decoration: none;
}

button:hover,
.app-header nav a:hover,
.theme-toggle:hover {
  border-color: var(--accent);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.app-header a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 72%);
  outline-offset: 2px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem max(1rem, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), transparent 8%);
  backdrop-filter: blur(16px);
}

.brand,
.app-header nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand,
.app-header a {
  text-decoration: none;
}

.brand span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--surface);
  font-weight: 900;
}

.app-shell {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 4.2rem;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
  gap: 1.15rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.intro > div:first-child {
  max-width: 900px;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 0.5rem;
  font-size: clamp(2rem, 3vw, 2.65rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0.45rem;
  font-size: 1.45rem;
  line-height: 1.15;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.intro > div:first-child > p:last-child,
.model-note p,
.result-heading p,
.scope-footer,
.field-help,
.subheading span {
  color: var(--muted);
}

.intro > div:first-child > p:last-child {
  max-width: 74ch;
  margin-bottom: 0;
}

.intro > div:first-child > p:not(.eyebrow) {
  margin-bottom: 0.4rem;
}

.model-note {
  border-left: 3px solid var(--coral);
  padding: 0.2rem 0 0.2rem 1rem;
}

.model-note span,
.model-note strong {
  display: block;
}

.model-note span {
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.model-note strong {
  margin: 0.18rem 0 0.25rem;
}

.model-note p {
  margin: 0;
  font-size: 0.84rem;
}

.technique-section {
  padding: 0.72rem 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.section-heading h2 {
  margin-bottom: 0;
}

.technique-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), transparent 18%);
  padding: 0.35rem;
}

.technique-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  min-height: 56px;
  padding: 0.58rem;
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.technique-button:hover {
  transform: translateY(-2px);
}

.technique-button.is-active {
  border-color: var(--technique-color, var(--accent));
  background: color-mix(in srgb, var(--technique-color, var(--accent)), var(--surface) 91%);
}

.technique-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--technique-color, var(--accent)), var(--line) 38%);
  border-radius: var(--radius);
  color: var(--technique-color, var(--accent));
  font-size: 0.82rem;
  font-weight: 950;
}

.technique-button strong,
.technique-button small {
  display: block;
}

.technique-button small {
  display: none;
  margin-top: 0.12rem;
  color: var(--muted);
  font-weight: 650;
}

.technique-button.is-active small {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.graph-focus {
  --view-color: var(--accent);
  grid-column: 1 / -1;
  min-width: 0;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2), transparent 46%);
}

.panel-disclosure,
.panel-disclosure-body,
.graph-focus-body {
  min-width: 0;
}

.disclosure-summary {
  cursor: pointer;
  list-style: none;
}

.disclosure-summary::-webkit-details-marker,
.input-group-heading::-webkit-details-marker {
  display: none;
}

.disclosure-summary:focus-visible,
.input-group-heading:focus-visible {
  border-radius: var(--radius);
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 68%);
  outline-offset: 3px;
}

.disclosure-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.disclosure-indicator {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  background: var(--surface);
  font-size: 1rem;
  font-weight: 950;
}

.disclosure-indicator::before {
  content: "+";
}

.panel-disclosure[open] > .disclosure-summary .disclosure-indicator::before {
  content: "-";
}

.view-mark {
  min-width: 38px;
  border: 1px solid color-mix(in srgb, var(--view-color), var(--line) 48%);
  border-radius: var(--radius);
  color: var(--view-color);
  background: color-mix(in srgb, var(--view-color), transparent 94%);
  padding: 0.34rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 950;
  text-align: center;
}

.graph-focus-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.graph-focus-toolbar h2 {
  margin: 0.08rem 0 0;
  font-size: 1.08rem;
}

.graph-focus-body {
  margin-top: 0.8rem;
}

.graph-view-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.8rem;
}

.graph-view-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.graph-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  padding: 0.42rem 0.65rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 850;
}

.graph-view-button:hover,
.graph-view-button.is-active,
.graph-view-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.graph-view-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 68%);
  outline-offset: 2px;
}

.graph-view-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}

.graph-focus .gradient-workbench {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.graph-focus.is-ms .gradient-workbench,
.graph-focus.is-large .gradient-workbench {
  grid-template-columns: minmax(0, 1fr);
}

.graph-focus.is-large canvas.gradient-canvas,
.graph-focus.is-large canvas.separation-canvas,
.graph-focus.is-large canvas.ms-chromatogram-canvas,
.graph-focus.is-large canvas.mass-spectrum-canvas {
  height: 430px;
  min-height: 430px;
}

.graph-focus:fullscreen {
  width: 100vw;
  height: 100vh;
  overflow: auto;
  padding: 1rem 1.25rem 1.4rem;
  border: 0;
  background: var(--bg);
}

.graph-focus:fullscreen .graph-focus-toolbar {
  position: sticky;
  z-index: 5;
  top: -1rem;
  margin: -1rem -1.25rem 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg), transparent 4%);
}

.graph-focus:fullscreen .gradient-workbench {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.graph-focus:fullscreen.is-ms .gradient-workbench {
  grid-template-columns: minmax(0, 1fr);
}

.graph-focus:fullscreen canvas.gradient-canvas,
.graph-focus:fullscreen canvas.separation-canvas,
.graph-focus:fullscreen canvas.ms-chromatogram-canvas,
.graph-focus:fullscreen canvas.mass-spectrum-canvas {
  height: clamp(420px, 62vh, 900px);
  min-height: 420px;
}

.optimization-panel {
  margin-bottom: 0.85rem;
  scroll-margin-top: 5.25rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--optimize), var(--line) 32%);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--optimize), var(--surface) 96%);
}

.optimization-panel[data-status="running"] {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--optimize), transparent 78%);
}

.optimization-panel[data-status="complete"] {
  border-color: color-mix(in srgb, var(--success), var(--line) 35%);
  background: color-mix(in srgb, var(--success), var(--surface) 96%);
}

.optimization-panel[data-status="stopped"] {
  border-color: color-mix(in srgb, var(--gold), var(--line) 42%);
  background: color-mix(in srgb, var(--gold), var(--surface) 97%);
}

.optimization-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 0.8rem 0.62rem;
}

.optimization-heading > div:first-child span,
.optimization-heading > div:first-child strong {
  display: block;
}

.optimization-heading > div:first-child span {
  color: var(--optimize);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.optimization-panel[data-status="complete"] .optimization-heading > div:first-child span {
  color: var(--success);
}

.optimization-panel[data-status="stopped"] .optimization-heading > div:first-child span {
  color: var(--gold);
}

.optimization-heading > div:first-child strong {
  margin-top: 0.12rem;
  font-size: 0.92rem;
}

.optimization-count {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

.optimization-count button {
  min-height: 34px;
  border-color: color-mix(in srgb, var(--optimize), var(--line) 42%);
  background: var(--surface);
  color: var(--optimize);
  padding: 0.3rem 0.58rem;
  font-size: 0.72rem;
}

.optimization-progress {
  height: 5px;
  overflow: hidden;
  background: color-mix(in srgb, var(--optimize), transparent 84%);
}

.optimization-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--optimize);
  transition: width 120ms ease;
}

.optimization-panel[data-status="complete"] .optimization-progress i {
  background: var(--success);
}

.optimization-readouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.optimization-readouts > div {
  min-width: 0;
  padding: 0.7rem 0.8rem;
}

.optimization-readouts > div + div {
  border-left: 1px solid var(--line);
}

.optimization-readouts span,
.optimization-readouts strong,
.optimization-readouts small {
  display: block;
}

.optimization-readouts span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.optimization-readouts strong {
  margin-top: 0.18rem;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.35;
}

.optimization-readouts small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.optimization-log {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.optimization-log li {
  display: grid;
  grid-template-columns: 34px minmax(150px, 0.55fr) minmax(240px, 1fr);
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.46rem 0.8rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 34%);
  font-size: 0.72rem;
}

.optimization-log li.is-best {
  background: color-mix(in srgb, var(--success), transparent 92%);
}

.optimization-log li > span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.optimization-log li > strong,
.optimization-log li > small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.optimization-log li > small {
  color: var(--muted);
}

.optimization-note {
  margin: 0;
  padding: 0.55rem 0.8rem 0.62rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

@media (min-width: 900px) {
  .optimization-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  }

  .optimization-heading,
  .optimization-progress,
  .optimization-note {
    grid-column: 1 / -1;
  }

  .optimization-readouts {
    grid-column: 1;
    border-bottom: 0;
  }

  .optimization-log {
    grid-column: 2;
    max-height: 104px;
    overflow-y: auto;
    border-left: 1px solid var(--line);
    scrollbar-color: color-mix(in srgb, var(--muted), transparent 45%) transparent;
    scrollbar-width: thin;
  }

  .optimization-log li {
    grid-template-columns: 30px minmax(105px, 0.42fr) minmax(0, 1fr);
    gap: 0.45rem;
    padding: 0.38rem 0.65rem;
    font-size: 0.68rem;
  }

  .optimization-log li:last-child {
    border-bottom: 0;
  }

  .optimization-note {
    border-top: 1px solid color-mix(in srgb, var(--line), transparent 34%);
  }
}

.builder-panel,
.results-panel {
  min-width: 0;
  padding: 0.9rem;
}

.builder-panel {
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2), transparent 38%);
}

.panel-heading,
.result-heading,
.subheading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panel-disclosure[open] > .panel-heading,
.panel-disclosure[open] > .result-heading {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.panel-disclosure-body {
  min-width: 0;
}

.method-code,
.status-pill,
.subheading span {
  white-space: nowrap;
}

.method-code {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  padding: 0.35rem 0.48rem;
}

.input-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.input-group:first-child {
  margin-top: 0.35rem;
}

.method-mode-slot {
  margin-top: 0.85rem;
}

.input-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}

.input-group-heading > span {
  min-width: 0;
}

.input-group-heading h3 {
  margin: 0;
  font-size: 0.9rem;
}

.input-group-heading::after {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  background: var(--surface);
  content: "+";
  font-size: 0.92rem;
  font-weight: 950;
}

.input-group[open] > .input-group-heading {
  margin-bottom: 0.65rem;
}

.input-group[open] > .input-group-heading::after {
  content: "-";
}

.input-group-body {
  min-width: 0;
}

.input-group-heading p {
  display: none;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
}

.advanced-controls {
  margin-top: 0.65rem;
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
}

.advanced-controls > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
}

.advanced-controls > .field-grid {
  margin-top: 0.65rem;
}

.field,
.range-field {
  min-width: 0;
}

.field--wide,
.range-field {
  grid-column: 1 / -1;
}

.field label,
.range-header > span:first-child {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.76rem;
  font-weight: 850;
}

.field input,
.field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 0.55rem 0.65rem;
}

.segmented-field {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.segmented-field legend {
  margin-bottom: 0.28rem;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 850;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
  background: var(--surface-2);
}

.segmented-control label {
  min-width: 0;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  min-height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  padding: 0.35rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 900;
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.segmented-control input:checked + span {
  border-color: color-mix(in srgb, var(--accent), var(--line) 40%);
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--ink), transparent 90%);
}

.segmented-control input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 68%);
  outline-offset: 1px;
}

.range-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.range-value {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.range-field input {
  width: 100%;
  accent-color: var(--accent);
}

.field-help {
  display: block;
  margin-top: 0.24rem;
  font-size: 0.7rem;
}

.analyte-picker {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.analyte-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  cursor: pointer;
  list-style: none;
  padding: 0.58rem 0.65rem;
}

.analyte-picker > summary::-webkit-details-marker {
  display: none;
}

.analyte-picker > summary > span {
  min-width: 0;
}

.analyte-picker > summary strong,
.analyte-picker > summary small {
  display: block;
}

.analyte-picker > summary strong {
  font-size: 0.76rem;
  font-weight: 850;
}

.analyte-picker > summary small {
  overflow: hidden;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analyte-picker > summary b {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.72rem;
}

.analyte-picker[open] > summary {
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}

.analyte-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0;
  padding: 0.5rem 0.6rem 0.4rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.analyte-picker-heading strong {
  color: var(--accent);
  white-space: nowrap;
}

.analyte-library-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(150px, 0.65fr);
  gap: 0.5rem;
  padding: 0.55rem 0.6rem 0.35rem;
}

.analyte-library-toolbar label {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.analyte-library-toolbar label > span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
}

.analyte-library-toolbar input,
.analyte-library-toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.72rem;
  padding: 0.5rem 0.58rem;
}

.analyte-library-toolbar input:focus,
.analyte-library-toolbar select:focus {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent), transparent 76%);
  outline-offset: 1px;
}

.analyte-library-status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.05rem 0.65rem 0.42rem;
  color: var(--muted);
}

.analyte-library-status span {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 850;
}

.analyte-library-status small {
  overflow: hidden;
  font-size: 0.61rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analyte-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  max-height: 356px;
  overflow-y: auto;
  padding: 0 0.6rem 0.6rem;
  scrollbar-gutter: stable;
}

.analyte-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  padding: 0.42rem 0.5rem;
}

.analyte-option[hidden] {
  display: none;
}

.analyte-option:hover {
  border-color: var(--accent);
}

.analyte-option.is-selected {
  border-color: color-mix(in srgb, var(--accent), var(--line) 22%);
  background: var(--accent-soft);
}

.analyte-option:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.52;
}

.analyte-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.analyte-option strong,
.analyte-option small {
  display: block;
  min-width: 0;
}

.analyte-option strong {
  overflow: hidden;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analyte-option small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.64rem;
}

.column-profile {
  margin-top: 0.42rem;
  border-left: 2px solid var(--accent);
  padding-left: 0.5rem;
}

.column-profile > span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.column-profile > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.32rem;
}

.column-profile small {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.61rem;
  font-weight: 800;
  padding: 0.12rem 0.34rem;
}

.chiral-analyte-profile {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  padding: 0.72rem 0.78rem;
}

.chiral-profile-heading,
.chiral-profile-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.chiral-profile-heading > div {
  min-width: 0;
}

.chiral-profile-heading span,
.chiral-profile-heading strong,
.chiral-profile-facts small,
.chiral-profile-source span,
.chiral-profile-scope {
  display: block;
}

.chiral-profile-heading span {
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chiral-profile-heading strong {
  margin-top: 0.08rem;
  color: var(--ink);
  font-size: 0.9rem;
}

.chiral-profile-heading b {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 0.68rem;
}

.chiral-profile-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.6rem;
}

.chiral-profile-facts > span {
  min-width: 0;
  color: var(--ink);
  font-size: 0.66rem;
  line-height: 1.4;
}

.chiral-profile-facts small {
  margin-bottom: 0.08rem;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 850;
  text-transform: uppercase;
}

.chiral-analyte-profile p {
  margin: 0.42rem 0 0;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.45;
}

.chiral-analyte-profile p strong {
  color: var(--ink);
}

.chiral-profile-source {
  align-items: baseline;
  margin-top: 0.55rem;
  border-top: 1px solid color-mix(in srgb, var(--line), transparent 28%);
  padding-top: 0.42rem;
  font-size: 0.6rem;
  font-weight: 800;
}

.chiral-profile-source span {
  color: var(--muted);
}

.chiral-profile-source a {
  color: var(--accent);
  text-align: right;
}

.chiral-profile-scope {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.4;
}

.column-structure {
  margin: 0.6rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
  color: var(--ink);
}

.column-structure-heading,
.column-structure figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
}

.column-structure-heading strong,
.column-structure figcaption strong {
  font-size: 0.68rem;
}

.column-structure-heading span,
.column-structure figcaption span {
  color: var(--muted);
  font-size: 0.64rem;
  text-align: right;
}

.column-structure svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.3rem 0 0.15rem;
  color: var(--ink);
}

.structure-bonds path,
.structure-bonds circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.structure-bonds text {
  fill: currentColor;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.structure-bonds .structure-formula {
  font-size: 13px;
}

.structure-bonds .structure-detail {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.structure-bonds .structure-dot {
  fill: currentColor;
  stroke: none;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.55rem 0.65rem;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.checkbox-field span {
  font-size: 0.78rem;
  font-weight: 850;
}

.toggle-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.72rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent), transparent 91%), transparent 66%),
    var(--surface);
  cursor: pointer;
  padding: 0.72rem;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.toggle-field:hover {
  border-color: color-mix(in srgb, var(--accent), var(--line) 35%);
  transform: translateY(-1px);
}

.toggle-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.toggle-control {
  position: relative;
  width: 54px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  transition: background 180ms ease, border-color 180ms ease;
}

.toggle-control::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: transform 180ms ease, background 180ms ease;
}

.toggle-field input:checked + .toggle-control {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.toggle-field input:checked + .toggle-control::after {
  background: var(--accent);
  transform: translateX(24px);
}

.toggle-field input:focus-visible + .toggle-control {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 68%);
  outline-offset: 3px;
}

.toggle-copy {
  min-width: 0;
}

.toggle-copy strong,
.toggle-copy small {
  display: block;
}

.toggle-copy strong {
  font-size: 0.86rem;
}

.toggle-copy small {
  margin-top: 0.18rem;
  color: var(--muted);
  line-height: 1.45;
}

.gradient-editor {
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.gradient-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 0.75rem;
}

.gradient-heading h4 {
  margin: 0;
  font-size: 0.86rem;
}

.gradient-heading p {
  display: none;
}

.gradient-heading > span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 900;
  padding: 0.28rem 0.42rem;
  white-space: nowrap;
}

.gradient-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 0.75rem 0.75rem;
}

.gradient-preset-row button {
  min-height: 34px;
  border-color: color-mix(in srgb, var(--accent), var(--line) 45%);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  padding: 0.38rem 0.58rem;
}

.method-snapshot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.method-snapshot > span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.55rem 0.65rem;
  background: var(--plot-bg);
}

.method-snapshot small,
.method-snapshot strong {
  display: block;
  overflow-wrap: anywhere;
}

.method-snapshot small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
}

.method-snapshot strong {
  margin-top: 0.16rem;
  color: var(--ink);
  font-size: 0.76rem;
}

.csp-screening-panel {
  margin-bottom: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.csp-screen-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.78rem 0.48rem;
}

.csp-screen-heading span {
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.csp-screen-heading h3 {
  margin-top: 0.12rem;
  font-size: 0.92rem;
}

.csp-screen-heading > strong {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.28rem 0.42rem;
  color: var(--muted);
  font-size: 0.64rem;
}

.csp-screen-note {
  margin: 0;
  padding: 0 0.78rem 0.68rem;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.csp-screen-columns,
.csp-screen-row {
  display: grid;
  grid-template-columns: 28px minmax(170px, 1.25fr) minmax(140px, 0.9fr) 54px;
  gap: 0.62rem;
  align-items: center;
}

.csp-screen-columns {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding: 0.38rem 0.72rem;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 900;
  text-transform: uppercase;
}

.csp-screen-row {
  width: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-weight: inherit;
  padding: 0.58rem 0.72rem;
  text-align: left;
}

.csp-screen-row:hover {
  border-color: var(--line);
  background: var(--accent-soft);
}

.csp-screen-row.is-leading {
  background: color-mix(in srgb, var(--accent-soft), transparent 22%);
}

.csp-rank {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-align: center;
}

.csp-copy,
.csp-copy > div {
  min-width: 0;
}

.csp-copy > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.csp-copy strong,
.csp-copy span,
.csp-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.csp-copy strong {
  font-size: 0.72rem;
}

.csp-copy > span {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 750;
}

.csp-copy small {
  margin-top: 0.14rem;
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.35;
}

.csp-anchor {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.08rem 0.28rem;
  color: var(--accent);
  font-size: 0.52rem;
  font-weight: 900;
}

.csp-interactions {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
}

.csp-interactions > span {
  display: grid;
  grid-template-columns: 48px minmax(52px, 1fr) 22px;
  gap: 0.3rem;
  align-items: center;
}

.csp-interactions b,
.csp-interactions strong {
  color: var(--muted);
  font-size: 0.54rem;
}

.csp-interactions strong {
  text-align: right;
}

.csp-interactions i {
  position: relative;
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.csp-interactions em {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--interaction-score);
  border-radius: inherit;
  background: var(--accent);
}

.csp-priority {
  text-align: right;
}

.csp-priority strong,
.csp-priority span {
  display: block;
}

.csp-priority strong {
  font-size: 0.86rem;
}

.csp-priority span {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 800;
}

.binding-mechanism {
  margin-top: 1.1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 0;
}

.binding-mechanism--limited {
  padding-bottom: 0.9rem;
  background: color-mix(in srgb, var(--gold) 5%, transparent);
}

.binding-mechanism--limited .binding-mechanism-note {
  max-width: 920px;
  padding-bottom: 0;
}

.binding-mechanism-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.78rem 0.42rem;
}

.binding-mechanism-heading span {
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0;
}

.binding-mechanism-heading h3 {
  margin-top: 0.12rem;
  font-size: 1rem;
}

.binding-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(42px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.binding-view-switch button {
  min-width: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0.34rem 0.48rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.64rem;
  font-weight: 850;
  cursor: pointer;
}

.binding-view-switch button:last-child {
  border-right: 0;
}

.binding-view-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.binding-mechanism-note,
.binding-mechanism-outcome {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.binding-mechanism-note {
  max-width: 850px;
  padding: 0 0.78rem 0.72rem;
}

.chiral-3d-stage {
  position: relative;
  width: 100%;
  min-height: 430px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 68%, var(--surface));
  touch-action: none;
  cursor: grab;
}

.chiral-3d-stage.is-dragging {
  cursor: grabbing;
}

.chiral-3d-stage canvas {
  display: block;
  width: 100%;
  height: 430px;
  outline: 0;
}

.chiral-3d-stage canvas:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.chiral-stage-divider {
  position: absolute;
  top: 3.1rem;
  bottom: 2.7rem;
  left: 50%;
  width: 1px;
  background: color-mix(in srgb, var(--line), transparent 20%);
  pointer-events: none;
}

.chiral-complex-label {
  position: absolute;
  top: 0.72rem;
  display: grid;
  gap: 0.05rem;
  pointer-events: none;
}

.chiral-complex-label--r {
  left: 1rem;
}

.chiral-complex-label--s {
  right: 1rem;
  text-align: right;
}

.chiral-complex-label b {
  color: var(--ink);
  font-size: 0.75rem;
}

.chiral-complex-label span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 750;
}

.chiral-contact-key {
  position: absolute;
  right: 0.75rem;
  bottom: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem 0.75rem;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 800;
  pointer-events: none;
}

.chiral-contact-key span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.chiral-contact-key span::before {
  width: 15px;
  height: 2px;
  content: "";
}

.chiral-contact-key .is-hbond::before {
  background: #35b7d5;
}

.chiral-contact-key .is-center::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.chiral-contact-key .is-pi::before {
  background: #e5ad36;
}

.chiral-contact-key .is-steric::before {
  background: #d06aa5;
}

.chiral-3d-stage[data-view="r"] .chiral-stage-divider,
.chiral-3d-stage[data-view="s"] .chiral-stage-divider {
  display: none;
}

.chiral-3d-stage[data-view="r"] .chiral-complex-label--s,
.chiral-3d-stage[data-view="s"] .chiral-complex-label--r {
  opacity: 0;
}

.chiral-3d-stage[data-view="r"] .chiral-complex-label--r,
.chiral-3d-stage[data-view="s"] .chiral-complex-label--s {
  right: auto;
  left: 1rem;
  text-align: left;
}

.adsorption-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.adsorption-paths article {
  min-width: 0;
  padding: 0.72rem 0.78rem;
  transition: opacity 160ms ease;
}

.adsorption-paths article + article {
  border-left: 1px solid var(--line);
}

.adsorption-paths article.is-muted {
  opacity: 0.35;
}

.adsorption-paths article > span,
.adsorption-paths article > small {
  display: block;
}

.adsorption-paths article > span {
  color: var(--accent);
  font-size: 0.56rem;
  font-weight: 900;
  text-transform: uppercase;
}

.adsorption-paths article > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px minmax(0, 0.82fr);
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.28rem;
}

.adsorption-paths article b,
.adsorption-paths article strong {
  overflow-wrap: anywhere;
  font-size: 0.68rem;
}

.adsorption-paths article i {
  color: var(--accent);
  font-size: 1.05rem;
  font-style: normal;
  text-align: center;
}

.adsorption-paths article > small {
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.4;
}

.binding-energy-outcome {
  display: flex;
  align-items: baseline;
  gap: 0.5rem 0.8rem;
  padding: 0.7rem 0.78rem 0.28rem;
}

.binding-energy-outcome strong {
  color: var(--accent);
  font-size: 0.78rem;
  white-space: nowrap;
}

.binding-energy-outcome span {
  color: var(--ink);
  font-size: 0.63rem;
  font-weight: 750;
}

.binding-mechanism-outcome {
  padding: 0 0.78rem 0.8rem;
}

.gradient-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 0.45rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
}

.gradient-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.gradient-legend span::before {
  width: 22px;
  height: 2px;
  background: var(--coral);
  content: "";
}

.gradient-legend .is-column::before {
  height: 0;
  border-top: 2px dashed var(--blue);
  background: transparent;
}

canvas.gradient-canvas {
  height: 300px;
  min-height: 300px;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.separation-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.spectrum-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  padding: 0 0.75rem 0.75rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.source-schematic {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  margin: 0 0.75rem 0.75rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.72rem;
  background: color-mix(in srgb, var(--surface-2), transparent 24%);
}

.source-schematic.is-caution {
  border-left-color: var(--gold);
}

.source-schematic.is-poor {
  border-left-color: var(--danger);
}

.source-copy small,
.source-copy strong,
.source-copy span,
.source-copy em {
  display: block;
}

.source-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.source-metrics > span {
  display: grid;
  grid-template-columns: auto minmax(28px, 1fr) auto;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.source-metrics b,
.source-metrics em {
  margin: 0;
  color: var(--muted);
  font-size: 0.57rem;
  font-style: normal;
  font-weight: 800;
}

.source-metrics i {
  position: relative;
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line);
}

.source-metrics i::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--metric);
  background: var(--accent);
  content: "";
}

.source-copy small {
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-copy strong {
  margin-top: 0.12rem;
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1.4;
}

.source-copy span {
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.4;
}

.source-copy em {
  margin-top: 0.42rem;
  color: var(--ink);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 800;
}

.source-copy .source-metrics > span {
  display: grid;
  margin-top: 0;
}

.source-copy .source-metrics em {
  margin: 0;
  color: var(--muted);
  font-size: 0.57rem;
}

.source-device {
  position: relative;
  width: 100%;
  height: 78px;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(180deg, transparent 48%, color-mix(in srgb, var(--line), transparent 25%) 49% 51%, transparent 52%),
    var(--plot-bg);
}

.source-inlet,
.source-needle,
.source-energy,
.source-particle,
.source-orifice {
  position: absolute;
  display: block;
}

.source-inlet {
  left: 5px;
  top: 30px;
  width: 24px;
  height: 18px;
  border: 2px solid var(--muted);
  border-right: 0;
  border-radius: 3px 0 0 3px;
}

.source-needle {
  left: 26px;
  top: 36px;
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--muted);
}

.source-needle::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 1px;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
  border-left: 8px solid var(--muted);
}

.source-orifice {
  right: 6px;
  top: 16px;
  width: 18px;
  height: 46px;
  border: 2px solid var(--blue);
  border-radius: 45% 4px 4px 45%;
  background: color-mix(in srgb, var(--blue), transparent 86%);
}

.source-orifice::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 18px;
  width: 5px;
  height: 7px;
  border-radius: 50%;
  background: var(--plot-bg);
}

.source-particle {
  left: 67px;
  top: 35px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent), transparent 62%);
  animation: source-flight 2.4s ease-in-out infinite;
}

.source-particle::after {
  content: "+";
  position: absolute;
  inset: -7px 0 auto;
  color: var(--accent);
  font-size: 0.52rem;
  font-weight: 900;
  text-align: center;
}

.source-device--negative .source-particle::after {
  content: "-";
}

.source-particle.particle-2 {
  top: 24px;
  width: 7px;
  height: 7px;
  animation-delay: -0.6s;
}

.source-particle.particle-3 {
  top: 45px;
  width: 6px;
  height: 6px;
  animation-delay: -1.2s;
}

.source-particle.particle-4 {
  top: 34px;
  width: 4px;
  height: 4px;
  animation-delay: -1.8s;
}

.source-energy {
  left: 43px;
  top: 8px;
  width: 35px;
  height: 19px;
}

.source--esi .source-energy::before {
  content: "kV";
  color: var(--coral);
  font-size: 0.62rem;
  font-weight: 900;
}

.source--apci .source-energy {
  left: 76px;
  top: 8px;
  width: 2px;
  height: 27px;
  background: var(--coral);
  box-shadow: 3px 4px 0 var(--gold), -3px 8px 0 var(--coral);
}

.source--apci .source-energy::after {
  content: "corona";
  position: absolute;
  left: -17px;
  top: -9px;
  color: var(--coral);
  font-size: 0.5rem;
  font-weight: 900;
}

.source--appi .source-energy {
  left: 67px;
  top: 7px;
  width: 32px;
  height: 17px;
  border: 2px solid var(--gold);
  border-radius: 3px;
  background: color-mix(in srgb, var(--gold), transparent 70%);
}

.source--appi .source-energy::after {
  content: "VUV";
  position: absolute;
  inset: 1px 0 auto;
  color: var(--gold);
  font-size: 0.52rem;
  font-weight: 900;
  text-align: center;
}

.source--apci .source-particle,
.source--appi .source-particle {
  border-style: solid;
  border-color: var(--coral);
  background: var(--coral);
}

.source--apci .source-particle::after,
.source--appi .source-particle::after {
  color: var(--coral);
}

@keyframes source-flight {
  0% { transform: translateX(0) scale(1); opacity: 0; }
  18% { opacity: 1; }
  70% { transform: translateX(54px) scale(0.55); opacity: 1; }
  100% { transform: translateX(76px) scale(0.35); opacity: 0; }
}

.sq-acquisition {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  margin: 0 0.75rem 0.75rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0;
}

.sq-acquisition-track {
  display: flex;
  align-items: stretch;
  gap: 3px;
  height: 42px;
  overflow: hidden;
  border-radius: 5px;
  padding: 5px;
  background: var(--plot-bg);
}

.sq-ramp {
  flex: 1 1 auto;
  min-width: 48px;
  background: linear-gradient(135deg, var(--blue), var(--accent));
  clip-path: polygon(0 100%, 82% 0, 100% 0, 18% 100%);
}

.sq-acquisition--sim .sq-ramp {
  display: none;
}

.sq-acquisition--scanSim .sq-ramp {
  flex: 0 0 34%;
}

.sq-acquisition--inSourceCid .sq-ramp {
  background: repeating-linear-gradient(135deg, var(--coral) 0 8px, var(--gold) 8px 12px);
}

.sq-dwell {
  display: grid;
  flex: 1 1 0;
  min-width: 30px;
  place-items: center;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent), transparent 22%);
  color: var(--plot-bg);
  font-size: 0.52rem;
  font-weight: 900;
}

.sq-pause {
  flex: 0 0 5px;
  background: var(--muted);
  opacity: 0.46;
}

.qqq-track .sq-ramp {
  background: linear-gradient(135deg, var(--blue), var(--coral));
}

.qqq-switch {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 3px;
  background: var(--gold);
  color: #17202a;
  font-size: 0.58rem;
  font-weight: 900;
}

.qqq--mrm .sq-dwell,
.qqq--q1Sim .sq-dwell,
.qqq--q3Sim .sq-dwell {
  background: color-mix(in srgb, var(--blue), var(--accent) 45%);
}

.sq-acquisition-copy small,
.sq-acquisition-copy strong,
.sq-acquisition-copy span {
  display: block;
}

.sq-acquisition-copy small {
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sq-acquisition-copy strong {
  margin-top: 0.12rem;
  color: var(--ink);
  font-size: 0.75rem;
}

.sq-acquisition-copy span {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.67rem;
}

.ms-mechanism-disclosure {
  margin: 0.8rem 0.75rem 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2), transparent 36%);
}

.ms-mechanism-disclosure > summary {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) 28px;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.7rem;
}

.ms-mechanism-disclosure > summary::-webkit-details-marker {
  display: none;
}

.ms-mechanism-disclosure > summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 68%);
  outline-offset: -3px;
}

.ms-mechanism-disclosure > summary span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.ms-mechanism-disclosure > summary small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.7rem;
}

.ms-mechanism-disclosure > summary b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  background: var(--surface);
}

.ms-mechanism-disclosure > summary b::before {
  content: "+";
}

.ms-mechanism-disclosure[open] > summary b::before {
  content: "-";
}

.ms-mechanism-body {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.ms-mechanism-body .mass-path {
  margin-bottom: 0;
  border-bottom: 0;
}

.mass-path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0.4rem;
  margin: 0 0.75rem 0.75rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0;
}

.mass-stage {
  min-width: 0;
}

.stage-graphic {
  position: relative;
  display: block;
  width: 100%;
  height: 38px;
  margin-bottom: 0.4rem;
  overflow: hidden;
  border-radius: 5px;
  background: var(--plot-bg);
}

.stage-graphic b {
  position: absolute;
  left: 6%;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  animation: ion-flight 2.35s linear infinite;
}

.stage-graphic--quad .rejected-ion {
  background: var(--blue);
  opacity: 0.72;
}

.stage-graphic--quad .rejected-a {
  animation: quad-reject-up 2.35s linear infinite;
  animation-delay: -0.75s;
}

.stage-graphic--quad .rejected-b {
  animation: quad-reject-down 2.35s linear infinite;
  animation-delay: -1.5s;
}

.stage-graphic--quad i {
  position: absolute;
  left: 24%;
  width: 52%;
  height: 5px;
  border-radius: 4px;
  background: var(--blue);
}

.stage-graphic--quad i:nth-child(1) { top: 7px; transform: skewX(-16deg); }
.stage-graphic--quad i:nth-child(2) { top: 14px; transform: skewX(16deg); opacity: 0.56; }
.stage-graphic--quad i:nth-child(3) { bottom: 14px; transform: skewX(-16deg); opacity: 0.56; }
.stage-graphic--quad i:nth-child(4) { bottom: 7px; transform: skewX(16deg); }

.stage-graphic--collision {
  border: 1px solid color-mix(in srgb, var(--coral), transparent 65%);
}

.stage-graphic--collision i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.stage-graphic--collision i:nth-child(1) { left: 30%; top: 8px; }
.stage-graphic--collision i:nth-child(2) { left: 48%; top: 23px; }
.stage-graphic--collision i:nth-child(3) { left: 62%; top: 10px; }
.stage-graphic--collision i:nth-child(4) { left: 74%; top: 26px; }

.stage-graphic--collision .precursor-ion {
  animation: precursor-to-collision 2.5s linear infinite;
}

.stage-graphic--collision .fragment-ion {
  width: 5px;
  height: 5px;
  background: var(--accent);
}

.stage-graphic--collision .fragment-a {
  animation: fragment-flight-up 2.5s linear infinite;
}

.stage-graphic--collision .fragment-b {
  animation: fragment-flight-down 2.5s linear infinite;
}

.stage-graphic--tof i {
  position: absolute;
  left: 17%;
  top: 9px;
  width: 68%;
  height: 20px;
  border: 2px solid var(--blue);
  border-radius: 5px 12px 12px 5px;
}

.stage-graphic--tof .tof-fast { top: 9px; animation-duration: 1.55s; }
.stage-graphic--tof .tof-medium { top: 16px; animation-duration: 2.05s; background: var(--accent); }
.stage-graphic--tof .tof-slow { top: 23px; animation-duration: 2.65s; background: var(--blue); }

.stage-graphic--orbitrap i {
  position: absolute;
  top: 7px;
  width: 28%;
  height: 24px;
  border: 2px solid var(--blue);
  border-radius: 50%;
}

.stage-graphic--orbitrap i:first-child { left: 24%; }
.stage-graphic--orbitrap i:nth-child(2) { right: 24%; }

.stage-graphic--orbitrap .orbit-ion {
  left: 47%;
  top: 16px;
  animation: orbit-ion-motion 1.9s ease-in-out infinite;
}

.stage-graphic--optics i {
  position: absolute;
  top: 7px;
  width: 8px;
  height: 24px;
  border: 2px solid var(--blue);
  border-radius: 50%;
}

.stage-graphic--optics i:first-child { left: 28%; }
.stage-graphic--optics i:nth-child(2) { left: 48%; }
.stage-graphic--optics i:nth-child(3) { left: 68%; }

.stage-graphic--detector i {
  position: absolute;
  width: 14px;
  height: 7px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.stage-graphic--detector i:nth-child(1) { left: 34%; top: 5px; }
.stage-graphic--detector i:nth-child(2) { left: 44%; top: 12px; }
.stage-graphic--detector i:nth-child(3) { left: 54%; top: 19px; }
.stage-graphic--detector i:nth-child(4) { left: 64%; top: 26px; }

.stage-graphic--detector .detector-ion {
  animation: detector-hit 1.8s linear infinite;
}

.stage-graphic--detector .detector-pulse {
  left: 72%;
  top: 13px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  background: transparent;
  animation: detector-pulse 1.8s ease-out infinite;
}

@keyframes ion-flight {
  0% { left: 6%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: 94%; opacity: 0; }
}

@keyframes quad-reject-up {
  0% { left: 6%; top: 16px; opacity: 0; }
  15% { opacity: 0.72; }
  48% { left: 48%; top: 16px; opacity: 0.72; }
  72%, 100% { left: 76%; top: -7px; opacity: 0; }
}

@keyframes quad-reject-down {
  0% { left: 6%; top: 16px; opacity: 0; }
  15% { opacity: 0.72; }
  48% { left: 48%; top: 16px; opacity: 0.72; }
  72%, 100% { left: 76%; top: 40px; opacity: 0; }
}

@keyframes precursor-to-collision {
  0% { left: 6%; opacity: 0; }
  12% { opacity: 1; }
  48% { left: 49%; opacity: 1; }
  54%, 100% { left: 49%; opacity: 0; }
}

@keyframes fragment-flight-up {
  0%, 46% { left: 49%; top: 16px; opacity: 0; }
  54% { opacity: 1; }
  100% { left: 94%; top: 7px; opacity: 0; }
}

@keyframes fragment-flight-down {
  0%, 46% { left: 49%; top: 16px; opacity: 0; }
  54% { opacity: 1; }
  100% { left: 94%; top: 25px; opacity: 0; }
}

@keyframes orbit-ion-motion {
  0%, 100% { left: 34%; top: 10px; opacity: 0.4; }
  25% { left: 50%; top: 16px; opacity: 1; }
  50% { left: 64%; top: 23px; opacity: 0.45; }
  75% { left: 50%; top: 16px; opacity: 1; }
}

@keyframes detector-hit {
  0% { left: 6%; opacity: 0; }
  16% { opacity: 1; }
  82% { left: 70%; opacity: 1; }
  84%, 100% { left: 70%; opacity: 0; }
}

@keyframes detector-pulse {
  0%, 78% { transform: scale(0.25); opacity: 0; }
  84% { opacity: 0.8; }
  100% { transform: scale(1.65); opacity: 0; }
}

.mass-stage small,
.mass-stage strong {
  display: block;
}

.mass-stage small {
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mass-stage strong {
  margin-top: 0.18rem;
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1.35;
}

.mass-path-arrow {
  align-self: center;
  color: var(--coral);
  font-size: 1rem;
  font-weight: 900;
}

.spectrum-key span {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.spectrum-key i {
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--blue);
}

.spectrum-key i.is-primary {
  background: var(--accent);
}

.spectrum-key strong {
  margin-left: auto;
  color: var(--ink);
}

.ms-chromatogram {
  margin-bottom: 0.75rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--plot-bg);
}

.ms-chromatogram-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem;
}

.ms-chromatogram-heading small,
.ms-chromatogram-heading strong,
.ms-chromatogram-heading span {
  display: block;
}

.ms-chromatogram-heading small {
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ms-chromatogram-heading strong {
  margin-top: 0.12rem;
  color: var(--ink);
  font-size: 0.9rem;
}

.ms-chromatogram-heading span {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.ms-acquisition-state {
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--accent);
  padding: 0.3rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 900;
}

.ms-acquisition-state.is-outside {
  color: var(--danger);
}

canvas.ms-chromatogram-canvas {
  display: block;
  width: 100%;
  height: 300px;
  min-height: 300px;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ms-chromatogram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  padding: 0.62rem 0.75rem 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.ms-chromatogram-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ms-chromatogram-legend span::before {
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}

.ms-chromatogram-legend .is-background::before {
  height: 0;
  border-top: 2px dashed var(--coral);
  border-radius: 0;
  background: transparent;
}

.ms-chromatogram-legend .is-window::before {
  height: 10px;
  background: color-mix(in srgb, var(--blue), transparent 76%);
}

.ms-rt-control {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem 0.8rem;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 900;
}

.ms-rt-control input {
  width: 100%;
  accent-color: var(--accent);
}

.ms-rt-control output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.peak-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 0.75rem 0.75rem;
}

.peak-toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--peak-color);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  padding: 0.3rem 0.48rem;
  font-size: 0.72rem;
  font-weight: 850;
}

.peak-toggle-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--peak-color);
}

canvas.separation-canvas {
  height: 300px;
  min-height: 300px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

canvas.mass-spectrum-canvas {
  height: 300px;
  min-height: 300px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.gradient-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0.75rem;
}

.gradient-input-grid label {
  min-width: 0;
}

.gradient-input-grid label > span:first-child {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.7rem;
  font-weight: 850;
}

.gradient-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.gradient-input-wrap input {
  min-width: 0;
  min-height: 39px;
  width: 100%;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 0.5rem 0.55rem;
}

.gradient-input-wrap em {
  padding: 0 0.5rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
}

.builder-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.optimize-button {
  grid-column: 1 / -1;
  border-color: var(--optimize);
  background: var(--optimize);
  color: #ffffff;
}

.optimize-button:hover,
.optimize-button:focus-visible,
.optimize-button.is-running {
  border-color: var(--optimize-hover);
  background: var(--optimize-hover);
  color: #ffffff;
}

.optimize-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--optimize), transparent 64%);
  outline-offset: 2px;
}

.is-optimizing [data-input-groups],
.is-optimizing [data-method-mode-slot],
.is-optimizing [data-gradient-host] {
  cursor: progress;
}

.detector-guide {
  margin-top: 1rem;
  border: 1px solid color-mix(in srgb, var(--blue), var(--line) 58%);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--blue), transparent 95%);
  padding: 0.68rem 0.74rem;
}

.detector-guide details,
.detector-guide summary {
  display: block;
}

.detector-guide summary {
  cursor: pointer;
  list-style: none;
}

.detector-guide summary::-webkit-details-marker {
  display: none;
}

.detector-guide span,
.detector-guide strong {
  display: block;
}

.detector-guide span {
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detector-guide strong {
  margin-top: 0.2rem;
  font-size: 0.84rem;
}

.detector-guide p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.result-heading {
  padding-bottom: 0;
  border-bottom: 0;
}

.result-heading p {
  max-width: 70ch;
  margin-bottom: 0;
}

.panel-disclosure:not([open]) > .result-heading [data-result-summary] {
  display: none;
}

.status-pill {
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--success);
  font-size: 0.74rem;
  font-weight: 900;
  padding: 0.35rem 0.62rem;
}

.status-pill.is-caution {
  color: var(--gold);
}

.status-pill.is-risk {
  color: var(--danger);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.score-item {
  min-width: 0;
  border-left: 3px solid var(--score-color, var(--accent));
  padding-left: 0.7rem;
}

.score-item span,
.score-item strong,
.score-item small {
  display: block;
}

.score-item span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.score-item strong {
  margin: 0.1rem 0 0.15rem;
  font-size: 1.02rem;
}

.score-item small {
  color: var(--muted);
  font-size: 0.66rem;
}

.score-track {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.score-track i {
  display: block;
  width: var(--score, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--score-color, var(--accent));
  transition: width 220ms ease;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.profile-layout.is-single {
  grid-template-columns: 1fr;
}

.profile-layout.is-ms {
  grid-template-columns: 1fr;
}

.profile-layout.is-ms .prediction-list {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.gradient-workbench,
.secondary-analysis,
.prediction-list {
  min-width: 0;
}

.gradient-workbench {
  display: grid;
  gap: 0.8rem;
}

.secondary-analysis {
  display: grid;
  gap: 0.8rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.secondary-analysis .method-snapshot {
  margin: 0;
}

.subheading {
  align-items: center;
  margin-bottom: 0.7rem;
}

.subheading span {
  font-size: 0.72rem;
  font-weight: 750;
}

canvas {
  display: block;
  width: 100%;
  height: 250px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--plot-bg);
}

.prediction-list > div:last-child {
  display: grid;
  gap: 0.38rem;
}

.prediction-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  min-height: 40px;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--line);
}

.prediction-item:last-child {
  border-bottom: 0;
}

.prediction-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.prediction-item strong {
  font-size: 0.92rem;
  text-align: right;
}

.prediction-item.is-good strong {
  color: var(--accent);
}

.prediction-item.is-warning strong {
  color: var(--gold);
}

.prediction-details {
  border-top: 1px solid var(--line);
  padding-top: 0.25rem;
}

.prediction-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  padding: 0.35rem 0;
}

.prediction-details > div {
  display: grid;
  gap: 0.24rem;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.diagnostic-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), transparent 18%);
  padding: 0.68rem 0.72rem;
}

.diagnostic-section > summary {
  cursor: pointer;
  list-style: none;
  margin-bottom: 0;
}

.diagnostic-section > summary::-webkit-details-marker {
  display: none;
}

.diagnostic-section > summary::after {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  content: "+";
  font-weight: 950;
}

.diagnostic-section[open] > summary {
  margin-bottom: 0.62rem;
}

.diagnostic-section[open] > summary::after {
  content: "-";
}

.diagnostic-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.diagnostic-list li {
  position: relative;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.diagnostic-list li::before {
  content: "";
  position: absolute;
  top: 0.58em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
}

.recommendation-list li::before {
  background: var(--accent);
}

.diagnostic-list .empty-state::before {
  background: var(--success);
}

.diagnostic-list .list-more {
  padding-left: 0;
}

.diagnostic-list .list-more::before {
  display: none;
}

.list-more summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
}

.overflow-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.55rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--line);
}

.overflow-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.reasoning-section {
  padding-top: 0.75rem;
}

.reasoning-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  cursor: pointer;
  list-style: none;
  padding: 0.45rem 0;
}

.reasoning-summary::-webkit-details-marker {
  display: none;
}

.reasoning-summary span {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.reasoning-summary small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.reasoning-summary::after {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  content: "+";
  font-weight: 900;
}

.reasoning-section[open] .reasoning-summary::after {
  content: "-";
}

.reasoning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.reasoning-item {
  border-top: 2px solid var(--reason-color, var(--blue));
  background: var(--surface-2);
  padding: 0.7rem;
}

.reasoning-item strong,
.reasoning-item span {
  display: block;
}

.reasoning-item strong {
  margin-bottom: 0.28rem;
  font-size: 0.78rem;
}

.reasoning-item span {
  color: var(--muted);
  font-size: 0.74rem;
}

.scope-footer {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--gold);
  background: color-mix(in srgb, var(--surface), transparent 28%);
  font-size: 0.8rem;
}

.scope-footer strong {
  color: var(--ink);
}

.scope-footer > span {
  display: block;
  margin-top: 0.42rem;
}

@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .builder-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .field--wide,
  .range-field {
    grid-column: auto;
  }

  .analyte-picker.field--wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .app-header nav {
    width: 100%;
    flex-wrap: wrap;
    padding-bottom: 0.15rem;
  }

  .app-header nav > * {
    flex: 0 0 auto;
  }

  .app-shell {
    padding-top: 1rem;
  }

  .intro,
  .profile-layout,
  .diagnostic-grid {
    grid-template-columns: 1fr;
  }

  .graph-focus .gradient-workbench,
  .graph-focus:fullscreen .gradient-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .graph-focus-body {
    display: flex;
    flex-direction: column;
  }

  .graph-view-row {
    order: 1;
  }

  .graph-focus .gradient-workbench {
    order: 2;
  }

  .optimization-panel {
    order: 3;
    margin-top: 0.8rem;
    margin-bottom: 0;
  }

  .graph-focus-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .optimization-readouts {
    grid-template-columns: 1fr;
  }

  .optimization-readouts > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .optimization-log li {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .optimization-log {
    max-height: 170px;
    overflow-y: auto;
    scrollbar-color: color-mix(in srgb, var(--muted), transparent 45%) transparent;
    scrollbar-width: thin;
  }

  .optimization-log li > small {
    grid-column: 2;
  }

  .mass-path {
    grid-template-columns: 1fr;
  }

  .ms-mechanism-disclosure > summary {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .ms-mechanism-disclosure > summary small {
    grid-column: 1;
    grid-row: 2;
  }

  .ms-mechanism-disclosure > summary b {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .source-schematic {
    grid-template-columns: 1fr;
  }

  .method-snapshot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .csp-screen-columns {
    display: none;
  }

  .csp-screen-row {
    grid-template-columns: 28px minmax(0, 1fr) 62px;
  }

  .csp-interactions {
    grid-column: 2 / 4;
  }

  .chiral-3d-stage,
  .chiral-3d-stage canvas {
    min-height: 390px;
    height: 390px;
  }

  .adsorption-paths {
    grid-template-columns: 1fr;
  }

  .adsorption-paths article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .sq-acquisition {
    grid-template-columns: 1fr;
  }

  .source-device {
    max-width: 320px;
  }

  .mass-path-arrow {
    justify-self: start;
    transform: rotate(90deg);
  }

  .model-note {
    max-width: 520px;
  }

  .technique-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .technique-button {
    min-height: 64px;
  }

  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chiral-profile-facts {
    grid-template-columns: 1fr;
  }

  .gradient-input-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reasoning-grid {
    grid-template-columns: 1fr;
  }

  canvas.gradient-canvas,
  canvas.separation-canvas,
  canvas.ms-chromatogram-canvas,
  canvas.mass-spectrum-canvas {
    height: 280px;
    min-height: 280px;
  }

  .graph-focus.is-large canvas.gradient-canvas,
  .graph-focus.is-large canvas.separation-canvas,
  .graph-focus.is-large canvas.ms-chromatogram-canvas,
  .graph-focus.is-large canvas.mass-spectrum-canvas,
  .graph-focus:fullscreen canvas.gradient-canvas,
  .graph-focus:fullscreen canvas.separation-canvas,
  .graph-focus:fullscreen canvas.ms-chromatogram-canvas,
  .graph-focus:fullscreen canvas.mass-spectrum-canvas {
    height: 340px;
    min-height: 340px;
  }
}

@media (max-width: 480px) {
  .intro {
    gap: 0.65rem;
    padding-bottom: 0.7rem;
  }

  .intro-note,
  .model-note p {
    display: none;
  }

  .model-note {
    padding-block: 0.1rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.05rem;
  }

  .section-heading .eyebrow {
    margin-bottom: 0;
  }

  .section-heading h2 {
    font-size: 1.25rem;
  }

  .technique-button {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.45rem;
    min-height: 58px;
    padding: 0.48rem;
  }

  .technique-mark {
    width: 34px;
    height: 34px;
  }

  .technique-button.is-active small {
    display: none;
  }

  .graph-focus {
    padding: 0.78rem;
  }

  .graph-view-actions {
    width: 100%;
  }

  .graph-view-button {
    flex: 1 1 0;
  }

  .optimization-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }

  .optimization-count {
    width: 100%;
    justify-content: space-between;
  }

  .csp-screen-heading {
    flex-wrap: wrap;
  }

  .binding-mechanism-heading {
    flex-wrap: wrap;
  }

  .csp-screen-heading > strong {
    flex-basis: 100%;
    text-align: center;
  }

  .binding-view-switch {
    width: 100%;
  }

  .chiral-3d-stage,
  .chiral-3d-stage canvas {
    min-height: 360px;
    height: 360px;
  }

  .chiral-complex-label {
    top: 0.55rem;
    width: calc(50% - 1rem);
    gap: 0.12rem;
    line-height: 1.2;
  }

  .chiral-complex-label--r {
    left: 0.65rem;
  }

  .chiral-complex-label--s {
    right: 0.65rem;
  }

  .chiral-complex-label span {
    max-width: 100%;
    font-size: 0.54rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .chiral-contact-key {
    right: 0.6rem;
    left: 0.6rem;
    justify-content: center;
  }

  .binding-energy-outcome {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .source-metrics {
    grid-template-columns: 1fr;
  }
  .brand strong {
    font-size: 0.88rem;
  }

  h1 {
    font-size: 1.85rem;
  }

  .field-grid,
  .score-grid,
  .builder-actions {
    grid-template-columns: 1fr;
  }

  .gradient-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .field--wide,
  .range-field {
    grid-column: 1;
  }

  .chiral-profile-heading,
  .chiral-profile-source {
    align-items: flex-start;
    flex-direction: column;
  }

  .chiral-profile-source a {
    text-align: left;
  }

  .analyte-options {
    grid-template-columns: 1fr;
  }

  .analyte-library-toolbar {
    grid-template-columns: 1fr;
  }

  .analyte-library-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.16rem;
  }

  .analyte-library-status small {
    max-width: 100%;
    text-align: left;
  }

  .score-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.7rem;
  }

  .score-track {
    grid-column: 1 / -1;
  }

  .score-item small {
    grid-column: 1 / -1;
  }

  .panel-heading,
  .result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ms-chromatogram-heading {
    flex-direction: column;
  }

  .ms-rt-control {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .ms-rt-control output {
    white-space: normal;
  }
}

@media (max-width: 350px) {
  .technique-switch {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .source-particle,
  .stage-graphic b {
    animation: none !important;
  }
}
