/* css/refs-premium.css — refined References tab. Loaded last; everything is scoped to #tab-refs. */

#tab-refs {
  --rp-ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --rp-surface: #ffffff;
  --rp-surface-2: #faf7f1;
  --rp-border: rgba(26, 22, 17, 0.09);
  --rp-border-strong: rgba(26, 22, 17, 0.17);
  --rp-ring: rgba(168, 52, 31, 0.14);
  --rp-accent-soft: rgba(168, 52, 31, 0.08);
  --rp-good: #1f7a4d;
  --rp-good-bg: #e3f4ea;
  --rp-warn: #9a6200;
  --rp-warn-bg: #fdf1d8;
  --rp-bad: #9b2c1b;
  --rp-bad-bg: #fbe7e3;
  --rp-radius: 14px;
  --rp-radius-sm: 10px;
  --rp-shadow: 0 1px 2px rgba(26, 22, 17, 0.04), 0 8px 24px -16px rgba(26, 22, 17, 0.18);
  font-family: var(--rp-ui);
}

body.fs-theme-dark #tab-refs {
  --rp-surface: var(--card);
  --rp-surface-2: #16181e;
  --rp-border: rgba(255, 255, 255, 0.07);
  --rp-border-strong: rgba(255, 255, 255, 0.14);
  --rp-ring: rgba(224, 105, 79, 0.22);
  --rp-accent-soft: rgba(224, 105, 79, 0.12);
  --rp-good: #6fd49b;
  --rp-good-bg: rgba(111, 212, 155, 0.12);
  --rp-warn: #f0c26b;
  --rp-warn-bg: rgba(240, 194, 107, 0.12);
  --rp-bad: #f08a76;
  --rp-bad-bg: rgba(240, 138, 118, 0.12);
  --rp-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -16px rgba(0, 0, 0, 0.6);
}

#tab-refs > .panel-grid {
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
}

/* ── Page header ── */
#tab-refs .refs-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 4px 2px 2px;
}

#tab-refs .refs-page-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

#tab-refs .refs-page-lead {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

#tab-refs .refs-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#tab-refs .refs-stat {
  padding: 5px 11px;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: 999px;
}

#tab-refs .refs-stat strong {
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

#tab-refs .refs-stat--good { color: var(--rp-good); background: var(--rp-good-bg); border-color: transparent; }
#tab-refs .refs-stat--good strong { color: var(--rp-good); }
#tab-refs .refs-stat--warn { color: var(--rp-warn); background: var(--rp-warn-bg); border-color: transparent; }
#tab-refs .refs-stat--warn strong { color: var(--rp-warn); }

/* ── Cards ── */
#tab-refs .card {
  padding: 22px 24px;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius);
  box-shadow: var(--rp-shadow);
}

#tab-refs .card::before { display: none; }

#tab-refs .card-title {
  margin-bottom: 2px;
  font-family: var(--rp-ui);
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

#tab-refs .card-hint {
  margin-bottom: 0;
  font-family: var(--rp-ui);
  font-size: 12.5px;
  font-style: normal;
  line-height: 1.55;
}

#tab-refs .card-hint code {
  padding: 1px 5px;
  font-size: 11.5px;
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  border-radius: 5px;
}

body.fs-density-compact #tab-refs .card { padding: 16px 18px; }

#tab-refs .refs-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 16px;
}

/* ── Labels, inputs, selects ── */
#tab-refs label,
#tab-refs .refs-field-label {
  font-family: var(--rp-ui);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
}

#tab-refs .refs-field-label { display: block; margin-bottom: 6px; }

#tab-refs .refs-field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

#tab-refs input[type="text"],
#tab-refs input[type="search"],
#tab-refs select,
#tab-refs textarea {
  min-height: 40px;
  padding: 9px 12px;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border-strong);
  border-radius: var(--rp-radius-sm);
  font-family: var(--rp-ui);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink);
}

#tab-refs select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6358' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

#tab-refs input:focus,
#tab-refs select:focus,
#tab-refs textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--rp-ring);
}

#tab-refs input::placeholder,
#tab-refs textarea::placeholder { color: var(--muted); opacity: 0.65; }

#tab-refs input[type="checkbox"] { accent-color: var(--accent); }

#tab-refs .checkbox-cell {
  flex: none;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

/* ── Buttons ── */
#tab-refs .btn-primary,
#tab-refs .btn-ghost {
  min-height: 36px;
  padding: 7px 14px;
  border-radius: var(--rp-radius-sm);
  font-family: var(--rp-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
}

#tab-refs .btn-primary { box-shadow: 0 1px 2px rgba(26, 22, 17, 0.12); }

#tab-refs .btn-ghost {
  background: var(--rp-surface);
  border-color: var(--rp-border-strong);
}

#tab-refs .btn-ghost:hover { background: var(--rp-surface-2); }

#tab-refs .btn-tiny {
  min-height: 28px;
  padding: 3px 10px !important;
  font-size: 12px !important;
  border-radius: 8px;
}

body.fs-theme-dark #tab-refs .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Style card ── */
#tab-refs .refs-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
}

#tab-refs .refs-style-field select { width: 100%; }

#tab-refs .refs-output-style {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--rp-surface-2);
  border: 1px dashed var(--rp-border-strong);
  border-radius: var(--rp-radius-sm);
}

#tab-refs .refs-bib-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 18px 0 0;
  padding: 12px 14px;
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  border-left: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-sm);
}

#tab-refs .refs-switch {
  flex: none;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

#tab-refs .refs-switch input {
  appearance: none;
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  margin: 0;
  background: var(--rp-border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}

#tab-refs .refs-switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

#tab-refs .refs-switch input:checked { background: var(--accent); }
#tab-refs .refs-switch input:checked::after { transform: translateX(14px); }
#tab-refs .refs-switch input:focus-visible { box-shadow: 0 0 0 3px var(--rp-ring); }

#tab-refs .refs-cited-summary {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* ── Add references ── */
#tab-refs .refs-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#tab-refs .refs-paste-panel {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
}

#tab-refs .bulk-refs-textarea {
  width: 100%;
  min-height: 150px;
  margin-bottom: 12px;
  padding: 12px 14px;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.55;
  background: var(--rp-surface-2);
}

#tab-refs .bulk-refs-textarea:focus { background: var(--rp-surface); }

#tab-refs .refs-paste-actions {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0;
}

#tab-refs .refs-paste-note {
  font-size: 12px;
  color: var(--muted);
}

#tab-refs .refs-import-hint {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rp-border);
  font-size: 12px;
}

/* Paste review */
#tab-refs .bulk-review-tools {
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-sm);
}

#tab-refs .bulk-review-actions {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0;
}

#tab-refs .bulk-review-actions .checkbox-cell { margin-right: auto; }

#tab-refs .bulk-refs-review { display: grid; gap: 10px; margin-top: 12px; }

#tab-refs .bulk-review-summary {
  font-family: var(--rp-ui);
  font-size: 12px;
  letter-spacing: normal;
}

#tab-refs .bulk-ref-card {
  padding: 14px 16px;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-left-width: 3px;
  border-radius: var(--rp-radius-sm);
}

#tab-refs .bulk-ref-card--valid { border-left-color: var(--rp-good); }
#tab-refs .bulk-ref-card--invalid { border-left-color: var(--rp-bad); }
#tab-refs .bulk-ref-card--none,
#tab-refs .bulk-ref-card--pending { border-left-color: var(--rp-warn); }

#tab-refs .bulk-ref-card-head { gap: 10px; margin-bottom: 6px; }

#tab-refs .bulk-ref-card-head .checkbox-cell { font-weight: 650; }

#tab-refs .bulk-doi-status {
  font-family: var(--rp-ui);
  font-size: 12px;
  letter-spacing: normal;
  text-transform: none;
}

#tab-refs .bulk-dup-tag {
  padding: 2px 8px;
  font-family: var(--rp-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--rp-bad);
  background: var(--rp-bad-bg);
  border-radius: 999px;
}

#tab-refs .wi-ref-remove-btn,
#tab-refs .wi-ref-restore-btn {
  margin-left: auto;
  padding: 4px 10px;
  font: 600 12px var(--rp-ui);
  letter-spacing: normal;
  text-transform: none;
  color: var(--rp-bad);
  background: transparent;
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  cursor: pointer;
}

#tab-refs .wi-ref-restore-btn { color: var(--ink-soft); }

#tab-refs .wi-ref-remove-btn:hover { background: var(--rp-bad-bg); border-color: transparent; }

#tab-refs .bulk-ref-raw {
  font-family: var(--rp-ui);
  font-size: 12px;
  font-style: normal;
}

#tab-refs .ref-doi-row {
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 4px;
}

#tab-refs .ref-doi-row label { flex: 1; gap: 6px; }

#tab-refs .ref-doi-row .btn-primary { min-height: 40px; }

#tab-refs .wi-ref-removed-head {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

#tab-refs .wi-ref-list--removed {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

#tab-refs .wi-ref-item--removed {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--rp-surface-2);
  border: 1px dashed var(--rp-border-strong);
  border-radius: var(--rp-radius-sm);
}

/* ── Library ── */
#tab-refs .refs-library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 14px;
}

#tab-refs .refs-library-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

#tab-refs .refs-library-count {
  font-family: var(--rp-ui);
  font-size: 12px;
  letter-spacing: normal;
  color: var(--muted);
}

#tab-refs .refs-library-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#tab-refs .refs-search-wrap { position: relative; }

#tab-refs .refs-search {
  width: 260px;
  min-height: 36px;
  padding-left: 34px;
  background: var(--rp-surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b6358' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E") no-repeat 12px center;
}

#tab-refs .refs-search:focus { background-color: var(--rp-surface); }

#tab-refs .refs-clear-all { color: var(--rp-bad); }

#tab-refs .refs-clear-all:hover {
  color: var(--rp-bad);
  background: var(--rp-bad-bg);
  border-color: transparent;
}

#tab-refs .refs-sort-hint {
  margin: 0 0 10px;
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
}

#tab-refs #refs-list { display: grid; gap: 8px; }

#tab-refs .refs-empty {
  display: grid;
  gap: 4px;
  place-items: center;
  padding: 36px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--rp-surface-2);
  border: 1.5px dashed var(--rp-border-strong);
  border-radius: var(--rp-radius-sm);
}

#tab-refs .refs-empty strong { font-size: 14px; color: var(--ink); }

#tab-refs .refs-search-empty {
  margin: 12px 0 0;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

/* Reference row */
#tab-refs .ref-row.ref-row-csl {
  display: block;
  margin: 0;
  padding: 0;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

#tab-refs .ref-row.ref-row-csl:hover { border-color: var(--rp-border-strong); }

#tab-refs .ref-row.is-expanded {
  border-color: var(--rp-border-strong);
  box-shadow: 0 0 0 3px var(--rp-ring);
}

#tab-refs .ref-row--duplicate {
  border-left: 3px solid var(--rp-warn);
  background: linear-gradient(90deg, var(--rp-warn-bg), var(--rp-surface) 40%);
}

#tab-refs .ref-row-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px 12px 12px 14px;
}

#tab-refs .row-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  font: 650 12px var(--rp-ui);
  color: var(--ink-soft);
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

#tab-refs .ref-row--cited .row-index {
  color: var(--rp-good);
  background: var(--rp-good-bg);
  border-color: transparent;
}

#tab-refs .ref-row-summary { min-width: 0; }

#tab-refs .ref-formatted {
  margin: 0;
  padding: 0;
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-style: normal;
  line-height: 1.55;
  text-align: left;
  text-indent: 0;
  color: var(--ink);
  background: none;
  border: 0;
  overflow-wrap: anywhere;
}

#tab-refs .ref-row--uncited .ref-formatted { opacity: 0.8; }

#tab-refs a.ref-doi {
  font-family: var(--rp-ui);
  font-size: 12px;
  color: var(--accent);
}

#tab-refs .ref-links-secondary {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 0 6px;
  vertical-align: 1px;
}

#tab-refs .ref-link:not(.ref-doi) {
  padding: 2px 8px;
  font-family: var(--rp-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink-soft);
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  border-radius: 999px;
}

#tab-refs .ref-link:not(.ref-doi):hover { color: var(--accent); border-color: var(--accent); }

#tab-refs .ref-raw-hint { font-family: var(--rp-ui); font-style: normal; }

#tab-refs .ref-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

#tab-refs .ref-row-tags:empty { display: none; }

#tab-refs .ref-cite-badge,
#tab-refs .ref-dup-badge,
#tab-refs .ref-key-tag {
  padding: 2px 9px;
  font-family: var(--rp-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  border: 0;
  border-radius: 999px;
}

#tab-refs .ref-cite-badge--yes { color: var(--rp-good); background: var(--rp-good-bg); }
#tab-refs .ref-cite-badge--no { color: var(--muted); background: var(--rp-surface-2); box-shadow: inset 0 0 0 1px var(--rp-border); }
#tab-refs .ref-dup-badge { color: var(--rp-warn); background: var(--rp-warn-bg); }

#tab-refs .ref-key-tag {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--rp-surface-2);
  box-shadow: inset 0 0 0 1px var(--rp-border);
}

#tab-refs .ref-row-controls {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  opacity: 0.75;
  transition: opacity 0.15s;
}

#tab-refs .ref-row:hover .ref-row-controls,
#tab-refs .ref-row.is-expanded .ref-row-controls,
#tab-refs .ref-row-controls:focus-within { opacity: 1; }

#tab-refs .ref-icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0 !important;
  font-family: var(--rp-ui);
  font-size: 14px !important;
  letter-spacing: normal;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

#tab-refs .ref-icon-btn:hover:not(:disabled) {
  color: var(--ink);
  background: var(--rp-surface-2);
  border-color: var(--rp-border);
}

#tab-refs .ref-icon-btn:disabled { opacity: 0.3; cursor: default; }

#tab-refs .ref-row-remove { font-size: 17px !important; color: var(--rp-bad); }

#tab-refs .ref-row-remove:hover { color: var(--rp-bad) !important; background: var(--rp-bad-bg) !important; border-color: transparent !important; }

#tab-refs .ref-edit-toggle[aria-expanded="true"] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

#tab-refs .ref-dup-resolve {
  color: var(--rp-warn);
  background: var(--rp-warn-bg);
  border-color: transparent;
}

/* Edit fields */
#tab-refs .refs-list--compact .ref-row:not(.is-expanded) .ref-row-main { display: none; }

#tab-refs .ref-row-main {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px 56px;
  background: var(--rp-surface-2);
  border-top: 1px solid var(--rp-border);
  border-radius: 0 0 var(--rp-radius-sm) var(--rp-radius-sm);
}

#tab-refs .ref-row-main label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

#tab-refs .ref-row-main input[type="text"] {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 13px;
}

#tab-refs .ref-key-doi-row,
#tab-refs .ref-source-row {
  display: grid;
  gap: 10px 12px;
  margin: 0;
}

#tab-refs .ref-key-doi-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; align-items: end; }

#tab-refs .ref-source-row { grid-template-columns: minmax(0, 2.2fr) repeat(4, minmax(0, 1fr)); }

#tab-refs .ref-fetch-btn { min-height: 36px; }

/* Duplicates panel */
#tab-refs .refs-duplicates-panel {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--rp-warn-bg);
  border: 1px solid rgba(154, 98, 0, 0.2);
  border-radius: var(--rp-radius-sm);
  font-size: 12.5px;
}

#tab-refs .refs-dup-summary { font-weight: 650; color: var(--rp-warn); }
#tab-refs .refs-dup-summary-detail { margin-top: 4px; color: var(--ink-soft); }

/* ── Export ── */
#tab-refs .refs-export-panel .refs-card-head { margin-bottom: 14px; }

#tab-refs .refs-export-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0;
  padding: 12px 14px;
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-sm);
}

#tab-refs .refs-export-row .refs-field-label { min-width: 0; margin: 0 4px 0 0; flex: none; }

#tab-refs .refs-export-row select {
  width: auto;
  min-width: 200px;
  max-width: none;
  min-height: 36px;
  margin-right: auto;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  #tab-refs .refs-style-grid { grid-template-columns: 1fr; }
  #tab-refs .refs-search { width: 100%; }
  #tab-refs .refs-search-wrap { flex: 1 1 100%; }
  #tab-refs .ref-row-head { grid-template-columns: 28px minmax(0, 1fr); }
  #tab-refs .ref-row-controls { grid-column: 2; flex-wrap: wrap; opacity: 1; }
  #tab-refs .ref-row-main { padding-left: 16px; }
  #tab-refs .ref-key-doi-row,
  #tab-refs .ref-source-row { grid-template-columns: 1fr 1fr; }
  #tab-refs .ref-source-row label:first-child { grid-column: 1 / -1; }
  #tab-refs .refs-export-row select { margin-right: 0; flex: 1; }
}
