.nmr-choice {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}

.nmr-choice label {
  position: relative;
  display: inline-flex;
}

.nmr-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.nmr-choice span {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.nmr-choice label:hover span {
  color: var(--text);
}

.nmr-choice input:checked + span {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-small), 0 0 0 1px var(--border);
}

.nmr-choice input:focus-visible + span {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

.nmr:has(input[name="nucleus"][value="13C"]:checked) [data-view="1H"],
.nmr:has(input[name="nucleus"][value="1H"]:checked) [data-view="13C"] {
  display: none;
}

.nmr-structure {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background-subtle);
}

.nmr-structure .structure {
  width: 100%;
  height: auto;
  max-height: 300px;
}

.nmr-molecule .bonds,
.nmr-molecule .atoms {
  pointer-events: none;
}

.nmr-mark {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 120ms ease, stroke 120ms ease;
}

.nmr-mark.is-active {
  fill: var(--accent-soft);
  stroke: var(--accent);
}

.nmr-hint {
  font-size: 12px;
}

.nmr-spectrum-panel .panel-header {
  flex-wrap: wrap;
}

.nmr-spectrum-panel .panel-actions {
  flex-wrap: wrap;
}

.nmr-summary {
  color: var(--text-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.nmr-plot {
  margin-top: var(--space-2);
  touch-action: pan-y;
}

.nmr-spectrum {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
}

.nmr-trace {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.1;
  stroke-linejoin: round;
}

.nmr-signal-trace {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 120ms ease;
}

.nmr-signal-trace.is-active {
  opacity: 1;
}

.nmr-axis line {
  stroke: var(--border-strong);
  stroke-width: 1;
}

.nmr-axis line.minor {
  stroke: var(--border);
}

.nmr-axis text,
.nmr-labels text,
.nmr-integrals text,
.nmr-reference text {
  font-family: var(--font-sans);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-anchor: middle;
}

.nmr-axis text {
  fill: var(--text-muted);
}

.nmr-axis .nmr-unit {
  fill: var(--text-subtle);
  text-anchor: start;
}

.nmr-labels text {
  fill: var(--text-muted);
  font-weight: 500;
}

.nmr-labels text.is-active {
  fill: var(--accent-text);
}

.nmr-integrals text {
  fill: var(--accent-partner);
  font-weight: 600;
}

.nmr-integrals text.is-active {
  fill: var(--accent-text);
}

.nmr-reference line {
  stroke: var(--text-subtle);
  stroke-dasharray: 3 3;
}

.nmr-reference text {
  fill: var(--text-subtle);
  font-size: 10px;
}

.nmr-hit {
  fill: transparent;
  cursor: zoom-in;
}

.nmr-selection {
  fill: var(--accent-soft);
  stroke: var(--accent-border);
  pointer-events: none;
}

.nmr-caption {
  font-size: 12.5px;
  line-height: 1.5;
}

.nmr-views [data-warnings]:empty {
  display: none;
}

.nmr-views .callout p + p {
  margin-top: var(--space-2);
}

.nmr-peaks .copy-field {
  margin-top: var(--space-3);
}

.nmr-table th.numeric,
.nmr-table td.numeric {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.nmr-table td small {
  display: block;
  color: var(--text-subtle);
  font-family: var(--font-sans);
  font-size: 11.5px;
}

.nmr-table tbody tr[data-signal] {
  cursor: zoom-in;
}

.nmr-table tbody tr:last-child td {
  border-bottom: 0;
}

.nmr-table tbody tr:hover td,
.nmr-table tbody tr.is-active td {
  background: var(--accent-soft);
}

.nmr-table tbody tr:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

.nmr-exchanged td {
  color: var(--text-subtle);
}

@media (max-width: 480px) {
  .nmr-table th,
  .nmr-table td {
    padding: 8px 8px;
  }
}
