/* ─── Tokens (lab beige + Fraunces aesthetic) ─────────────────────────────── */
:root {
  --bg: #fbf7ef;
  --bg-2: #f3eee2;
  --card: #ffffff;
  --card-2: #fdfaf3;
  --border: #ece6d8;
  --border-strong: #ddd4c0;

  --text: #1d2238;
  --text-2: #4d5170;
  --text-dim: #8d8fa3;

  --accent: #6a5cff;
  --accent-2: #8d7eff;
  --accent-soft: #efeaff;
  --accent-glow: rgba(106, 92, 255, 0.28);

  --pink: #ff8fa3;
  --mint: #5dd6a8;
  --mint-soft: #d6f5e6;
  --lemon: #ffd166;
  --lemon-soft: #fff5cc;
  /* Warm-orange accent reserved for the canvas/workbench surface. Reads
     well against the beige bg without competing with --accent purple. */
  --peach: #e8835a;
  --peach-2: #d96a3f;
  --peach-soft: #fde6d8;

  --danger: #d05a6e;
  --danger-soft: #fde0e5;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --transition-fast: 130ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  height: 100%;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(
      700px 380px at 12% -10%,
      rgba(141, 126, 255, 0.18),
      transparent 60%
    ),
    radial-gradient(
      600px 320px at 110% 0%,
      rgba(255, 143, 163, 0.16),
      transparent 60%
    ),
    radial-gradient(
      circle at center,
      rgba(20, 20, 50, 0.05) 1px,
      transparent 1.5px
    );
  background-size:
    auto,
    auto,
    22px 22px;
  background-repeat: no-repeat, no-repeat, repeat;
  color: var(--text);
  font-family:
    'Plus Jakarta Sans',
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* Item 10: global focus ring. Custom outlines on specific inputs (.sb input,
   .res-cmt, .draft-body, etc.) keep their branded box-shadow + border. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Top bar + page heading ──────────────────────────────────────────────── */
.top-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 20px 0;
}
.back-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: color var(--transition-fast);
}
.back-link:hover {
  color: var(--accent);
}

.page-head {
  max-width: 1280px;
  margin: 0 auto;
  padding: 6px 24px 6px;
}
.page-head-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
}
.page-head-text {
  min-width: 0;
  text-align: center;
}
/* Workspace IO pins to the top-right corner so the title can sit centred
   against the full page width rather than the space left over beside it. */
.ws-toolbar {
  position: absolute;
  top: 0;
  right: 0;
}
/* Narrow screens: drop the absolute pin and stack so the toolbar can't
   overlap the centred title. */
@media (max-width: 720px) {
  .page-head-row {
    flex-direction: column;
    align-items: center;
  }
  .ws-toolbar {
    position: static;
  }
}
.page-head h1 {
  font-family: 'Fraunces', 'Plus Jakarta Sans', serif;
  font-size: clamp(28px, 3.6vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  color: var(--text);
}
.page-head h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 600;
}
.page-head .lead {
  color: var(--text-2);
  margin: 0;
  font-size: 14px;
}
.privacy-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font-weight: 500;
}
.privacy-link:hover {
  text-decoration: none;
}

/* ─── App shell ───────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  max-width: 1280px;
  margin: 0 auto;
  padding: 6px 24px 24px;
  gap: 12px;
}

/* When the workspace is mounted (searchtool only), the work surface itself
   takes the full viewport width — researcher on a 1920px screen shouldn't see
   a beige gutter. .top-bar and .page-head above remain centred at 1280px so
   the page header stays composed. Other lab pages (equalizer, flow-chart) do
   not have a .workspace and keep the 1280px cap.

   :has() is widely supported (Chromium 105+, Safari 15.4+, Firefox 121+).
   Falls back to the 1280px cap on older engines — degraded but functional. */
#app:has(.workspace) {
  max-width: 100%;
  padding: 12px 16px 16px;
}

.topbar {
  flex: 0 0 auto;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 rgba(20, 20, 50, 0.02);
}

/* Legacy 2-pane skeleton — kept for backwards CSS that targets .panel
   (sources, results, src-preview-body etc.). The new workspace shell below
   provides its own `.ws-*` classes. */
.panel {
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.placeholder {
  color: var(--text-dim);
}

/* ─── Workspace (Parcel 1 · 2026-05-23) ──────────────────────────────────────
   Three-column grid: Sources | Main | Side. The grid-template-columns string
   is set inline by layout.js applyLayout() — see ui/layout.js. Handle slots
   render as 5px vertical lines between adjacent columns when both are open.
   Narrow mode (<1100px): collapses to a single column, sides open as overlay
   sheets backed by the .ws-scrim layer.
*/
.workspace {
  flex: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  gap: 0;
  position: relative;
}

.ws-sources,
.ws-main,
.ws-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* Pin each pane to its explicit grid column in wide mode. Without this, a
   collapsed handle slot (display: none) drops out of grid auto-placement and
   the remaining children shift left — Main would land in the now-0px track
   that the handle used to occupy, vanishing from view. Narrow mode is a
   single-column grid with the sides position:fixed, so the rules below
   (scoped to [data-narrow="0"]) don't apply there. */
.workspace[data-narrow='0'] > .ws-sources {
  grid-column: 1;
}
.workspace[data-narrow='0'] > .ws-resize-left {
  grid-column: 2;
}
.workspace[data-narrow='0'] > .ws-main {
  grid-column: 3;
}
.workspace[data-narrow='0'] > .ws-resize-right {
  grid-column: 4;
}
.workspace[data-narrow='0'] > .ws-side {
  grid-column: 5;
}

.ws-sources,
.ws-side {
  transition: opacity var(--transition-fast);
}
.workspace[data-sources-open='0'] .ws-sources,
.workspace[data-side-open='0'] .ws-side {
  /* Grid track width is 0; this hides the lingering border-radius edge. */
  visibility: hidden;
}

.ws-pane-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--card-2);
  min-height: 36px;
}
.ws-pane-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.ws-pane-title-right {
  margin-left: auto;
}
.ws-collapse {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}
.ws-collapse:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.ws-sources-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

/* Generous drop affordance: the WHOLE Sources panel is the catch area at any
   source count. A file dragged anywhere over it rings the panel; the sticky
   add-bar (.src-add.is-dropping, below) flips its hint to "release here". */
.ws-sources-body.src-drag-active {
  outline: 2px dashed color-mix(in oklch, var(--accent) 55%, transparent);
  outline-offset: -6px;
  background: color-mix(in oklch, var(--accent) 5%, transparent);
}

.ws-pane-tabs-bar {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  background: var(--card-2);
  padding: 0 4px;
}
.ws-pane-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pane-tabs {
  display: flex;
  gap: 2px;
  align-items: stretch;
}
.pane-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 9px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}
.pane-tab:hover:not(:disabled) {
  color: var(--text);
  background: var(--card);
}
.pane-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--card);
}
.pane-tab:disabled {
  color: var(--text-dim);
  cursor: not-allowed;
  opacity: 0.6;
}
.pane-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
  border-radius: 4px;
}
.pane-slot {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.pane-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}
.pane-panel[hidden] {
  display: none;
}

/* Hosts mounted into the tab panels — they're already inside .pane-panel's
   padding, so no extra padding. */
.results-host,
.canvas-host {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.results-host > #results,
.results-host > .res-header,
.canvas-host > .canvas {
  /* Inherit pane-panel scroll instead of double-scrolling. */
  overflow: visible;
}

/* Side-pane placeholders for empty tabs. */
.src-placeholder {
  color: var(--text-dim);
  font-size: 13px;
  padding: 24px 8px;
  text-align: center;
}

/* Parcel 2.6: live AI tab placeholder. Background uses --accent-soft per
   proposal §"Aesthetic discipline" ("AI panel content area: --accent-soft
   background, --border outline, --accent for the active action chip"). */
.ai-placeholder {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-placeholder-lead {
  margin: 0;
  color: var(--accent);
  font-size: 13.5px;
}
.ai-placeholder-scope {
  margin: 0;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.ai-placeholder-scope-empty {
  border-color: var(--border-strong);
  color: var(--text-dim);
}
.ai-placeholder-hint {
  margin: 4px 0 0;
  color: var(--text-2);
}
.ai-placeholder-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.6;
}
.ai-placeholder-meta {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: center;
}

/* ─── Parcel 3: AI panel ─────────────────────────────────────────────────
   The Parcel 2.6 .ai-placeholder block above stays (no consumer imports it
   any more, but the CSS is harmless and keeps an audit trail). The full
   panel below uses the same --accent-soft / --border / --accent tokens
   per proposal §"Aesthetic discipline". */
.ai-panel-root {
  display: block;
  height: 100%;
}
.ai-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ai-panel-head {
  margin: 0;
}
.ai-panel-title {
  margin: 0;
  font-size: 14px;
  color: var(--accent);
}
.ai-panel-sub {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--text-dim);
}
.ai-panel-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.ai-panel-label {
  display: block;
  margin: 0 0 6px;
  font-size: 11.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ai-panel-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}
.ai-scope-select,
.ai-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
}
.ai-scope-summary {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-2);
}
.ai-action-radios {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-action-radio {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  align-items: baseline;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.ai-action-radio:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.ai-action-radio small {
  grid-column: 2;
  display: block;
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
}
.ai-textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.ai-form-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-form-row .ai-panel-label {
  margin: 0;
}
.ai-send-section {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
}
.ai-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.ai-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ai-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.ai-btn-primary:hover:not(:disabled) {
  background: var(--accent);
  filter: brightness(1.05);
}
.ai-btn-secondary {
  background: var(--card);
}
.ai-btn-tiny {
  padding: 3px 8px;
  font-size: 11.5px;
}
.ai-busy {
  font-size: 11.5px;
  color: var(--text-dim);
}
.ai-result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-result-card.ai-result-flagged {
  border-color: var(--danger);
}
.ai-result-card.ai-result-error {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.ai-result-head .ai-result-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}
.ai-result-body {
  max-height: 320px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.5;
}
.ai-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.ai-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.ai-result-table th,
.ai-result-table td {
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.ai-result-table code {
  font-size: 11px;
}
.ai-overlap-group {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.ai-overlap-group:last-child {
  border-bottom: none;
}
.ai-overlap-head {
  margin: 0 0 4px;
  font-size: 12.5px;
}
.ai-overlap-summary {
  margin: 0 0 4px;
  font-size: 12.5px;
}
.ai-overlap-ids {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-dim);
}
.ai-overlap-ids code {
  font-size: 11px;
}
.ai-cite {
  display: inline-block;
  margin-left: 2px;
  font-size: 10.5px;
  color: var(--accent);
}
.ai-draft-body p {
  margin: 0 0 8px;
}
.ai-draft-body p:last-child {
  margin-bottom: 0;
}
.ai-warn {
  margin: 0 0 6px;
  padding: 6px 8px;
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--danger);
}
.ai-history-summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-2);
}
.ai-history-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-history-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}
.ai-history-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ai-history-line {
  margin: 0;
  font-size: 12px;
  color: var(--text-2);
  flex: 1;
  min-width: 0;
}

/* ─── Resize handles ─────────────────────────────────────────────────────── */
.ws-resize-left,
.ws-resize-right {
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.pane-resize {
  width: 5px;
  min-width: 5px;
  cursor: col-resize;
  background: var(--border);
  position: relative;
  transition: background var(--transition-fast);
  align-self: stretch;
}
/* Grip glyph — two short horizontal bars, centred vertically. Using a
   linear-gradient so we don't need an extra child element. */
.pane-resize::before {
  content: '';
  position: absolute;
  left: 1px;
  right: 1px;
  top: 50%;
  height: 7px;
  margin-top: -4px;
  background-image: linear-gradient(
    to bottom,
    var(--border-strong) 0,
    var(--border-strong) 1px,
    transparent 1px,
    transparent 3px,
    var(--border-strong) 3px,
    var(--border-strong) 4px,
    transparent 4px,
    transparent 6px,
    var(--border-strong) 6px,
    var(--border-strong) 7px
  );
  border-radius: 1px;
  transition: background-image var(--transition-fast);
}
.pane-resize:hover,
.pane-resize:focus-visible,
.pane-resize.is-dragging {
  background: var(--border-strong);
}
.pane-resize:hover::before,
.pane-resize:focus-visible::before,
.pane-resize.is-dragging::before {
  background-image: linear-gradient(
    to bottom,
    var(--accent) 0,
    var(--accent) 1px,
    transparent 1px,
    transparent 3px,
    var(--accent) 3px,
    var(--accent) 4px,
    transparent 4px,
    transparent 6px,
    var(--accent) 6px,
    var(--accent) 7px
  );
}
.pane-resize:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Narrow mode (<1100px) ──────────────────────────────────────────────── */
.workspace[data-narrow='1'] {
  grid-template-columns: minmax(0, 1fr) !important;
}
.workspace[data-narrow='1'] .ws-resize-left,
.workspace[data-narrow='1'] .ws-resize-right {
  display: none;
}
.workspace[data-narrow='1'] .ws-sources,
.workspace[data-narrow='1'] .ws-side {
  position: fixed;
  top: 0;
  bottom: 0;
  width: min(360px, 88vw);
  z-index: 60;
  box-shadow: 0 12px 32px rgba(20, 20, 50, 0.18);
  border-radius: 0;
  border: 0;
  transition: transform 0.18s ease;
}
.workspace[data-narrow='1'] .ws-sources {
  left: 0;
  border-right: 1px solid var(--border-strong);
}
.workspace[data-narrow='1'] .ws-side {
  right: 0;
  border-left: 1px solid var(--border-strong);
}
.workspace[data-narrow='1'][data-sources-open='0'] .ws-sources {
  transform: translateX(-100%);
  visibility: visible;
}
.workspace[data-narrow='1'][data-side-open='0'] .ws-side {
  transform: translateX(100%);
  visibility: visible;
}

.ws-scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 50, 0.28);
  z-index: 55;
}
.ws-scrim[hidden] {
  display: none;
}

.ws-reveal {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  padding: 8px 6px;
  background: var(--card);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 600;
  writing-mode: vertical-rl;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}
.ws-reveal:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.ws-reveal-left {
  left: 0;
  border-radius: 0 8px 8px 0;
}
.ws-reveal-right {
  right: 0;
  border-radius: 8px 0 0 8px;
}
.ws-reveal[hidden] {
  display: none;
}

/* ─── Reduced-motion preference ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .workspace[data-narrow='1'] .ws-sources,
  .workspace[data-narrow='1'] .ws-side {
    transition: opacity var(--transition-fast);
  }
  .workspace[data-narrow='1'][data-sources-open='0'] .ws-sources,
  .workspace[data-narrow='1'][data-side-open='0'] .ws-side {
    transform: none;
    opacity: 0;
    pointer-events: none;
  }
}

/* ─── Legacy free-floating source-preview aside — neutralized ─────────────
   Parcel 1 folded the source-viewer into the Side pane. If a stale build
   leaves an `aside.src-preview` in document.body, it must NOT push the
   page over (`body:has(> aside.src-preview:not([hidden])) { margin-right }`)
   and must NOT render visibly — source-dialog.js sweeps these on boot. */
body:has(> aside.src-preview:not([hidden])) {
  margin-right: 0;
}
aside.src-preview {
  display: none !important;
}

/* In-pane source preview surface (lives inside the Side pane's Source tab). */
.src-preview-host {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.src-preview-host .src-preview-head {
  position: static;
  border-bottom: 1px solid var(--border);
  padding: 4px 0 10px;
  background: transparent;
}
.src-preview-host .src-preview-body {
  flex: 1;
  min-height: 0;
  margin: 8px 0 0;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font:
    13.5px/1.55 'Plus Jakarta Sans',
    ui-sans-serif,
    system-ui,
    sans-serif;
  color: var(--text);
}
.src-preview-host .src-preview-body .src-mark {
  background: var(--lemon);
  color: var(--text);
  padding: 0 2px;
  border-radius: 3px;
}

/* ─── Search bar ──────────────────────────────────────────────────────────── */
.sb {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sb input[type='text'] {
  padding: 8px 12px;
  min-width: 240px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.sb input[type='text']::placeholder {
  color: var(--text-dim);
}
.sb input[type='text']:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.sb-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}
.sb-opt-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.slider-val {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
  min-width: 2ch;
  display: inline-block;
  text-align: end;
}
.slider-range {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sb-opt input[type='range'] {
  width: 100px;
  accent-color: var(--accent);
}
.sb #sb-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 50%;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast);
}
.sb #sb-go:hover {
  background: var(--accent-2);
}
.sb #sb-go:active {
  transform: translateY(1px);
}
.sb #sb-go svg {
  display: block;
}
.sb select {
  padding: 6px 10px;
  font: inherit;
  font-size: 12.5px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

/* Parcel 2.5: ★ Starred-only pill — workspace-wide lens. Uses the same
   --lemon family the per-card Star indicator uses. */
.sb-starred {
  padding: 6px 14px;
  background: var(--card-2);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.sb-starred:hover {
  background: var(--lemon-soft);
  color: var(--text);
  border-color: var(--lemon);
}
.sb-starred.is-active {
  background: var(--lemon-soft);
  color: var(--text);
  border-color: var(--lemon);
  font-weight: 600;
}

/* ─── Stop-words dropdown (search-bar) ───────────────────────────────────── */
.sb-sw {
  position: relative;
}
.sb-sw-btn {
  padding: 6px 14px;
  background: var(--card-2);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.sb-sw-btn:hover {
  background: var(--accent-soft, var(--card));
  color: var(--text);
  border-color: var(--accent);
}
.sb-sw-btn[aria-expanded='true'] {
  background: var(--accent-soft, var(--card));
  border-color: var(--accent);
  color: var(--text);
}
.sb-sw-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  width: 320px;
  max-height: 460px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Author CSS above sets display:flex with the same specificity as the
   user-agent [hidden]{display:none}, and order makes flex win — explicitly
   restore the hidden behaviour so the menu starts closed at boot. */
.sb-sw-menu[hidden] {
  display: none;
}
.sb-sw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.sb-sw-title {
  color: var(--text);
  font-weight: 600;
}
.sb-sw-reset {
  padding: 4px 10px;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.sb-sw-reset:hover {
  color: var(--text);
  border-color: var(--accent);
}
.sb-sw-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}
.sb-sw-chip {
  padding: 3px 9px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    opacity var(--transition-fast);
}
.sb-sw-chip:hover {
  border-color: var(--accent);
  background: var(--card);
}
.sb-sw-chip.is-off {
  color: var(--text-dim);
  opacity: 0.55;
  text-decoration: line-through;
  background: transparent;
}
.sb-sw-add {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.sb-sw-add input[type='text'] {
  flex: 1;
  padding: 5px 9px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 12.5px;
}
.sb-sw-add input[type='text']:focus-visible {
  outline: none;
  border-color: var(--accent);
}
.sb-sw-add-btn {
  padding: 5px 12px;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.sb-sw-add-btn:hover {
  background: var(--accent-2, var(--accent));
}

/* ─── Sources panel ───────────────────────────────────────────────────────── */
/* Sticky add-bar — pinned at the top of the Sources panel so the same control
   adds the 1st source and the 11th, never scrolling away under a long list. */
.src-add {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 0 10px;
  padding: 8px 8px 10px;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}
.src-add-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.src-add-files {
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.src-add-files:hover {
  background: var(--accent-2);
}
.src-add-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
}
.src-add-link {
  background: none;
  border: none;
  padding: 2px 2px;
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: color var(--transition-fast);
}
.src-add-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.src-add-sep {
  color: var(--border-strong);
}
.src-add-hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-dim);
}
/* Drag in progress: the bar confirms the drop will land. */
.src-add.is-dropping {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 10%, var(--card));
}
.src-add.is-dropping .src-add-hint {
  color: var(--accent);
  font-weight: 600;
}

.src-loading {
  color: var(--text-dim);
  margin-inline-start: 6px;
  font-size: 12px;
}

.src-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.src-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.src-row:hover {
  background: var(--card-2);
}
.src-row input[type='checkbox'] {
  accent-color: var(--accent);
}
.src-title {
  flex: 1;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 13.5px;
}
.src-icon {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}
.src-icon:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.src-icon-danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}
/* Parcel 5: small provenance marker for URL-imported sources. Sits between
   the include-in-search checkbox and the title; cursor:help signals the
   tooltip without claiming to be interactive. */
.src-origin-badge {
  font-size: 11px;
  line-height: 1;
  color: var(--text-dim);
  cursor: help;
  user-select: none;
  flex: 0 0 auto;
}

/* ─── Source preview modal ────────────────────────────────────────────────── */
/* Docked right-side panel. Floats above the layout but doesn't block
   clicks elsewhere — main UI stays interactive while the source is open.
   Selector is `aside.src-preview` (not bare `.src-preview`) so a stale
   `<dialog class="src-preview">` baked by an older sources.js template
   stays invisible by the UA default `dialog:not([open]) { display: none }`
   instead of being forced visible by our `display: flex`. */
aside.src-preview {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(520px, 45vw);
  height: 100vh;
  max-height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 0;
  border-left: 1px solid var(--border-strong);
  border-radius: 0;
  background: var(--card);
  color: var(--text);
  box-shadow: -12px 0 32px rgba(20, 20, 50, 0.1);
  z-index: 50;
}
aside.src-preview[hidden] {
  display: none;
}

/* When the drawer is open, squeeze the page instead of overlaying it. The
   panel's width is the same `min(520px, 45vw)` reserved here. transition
   on margin-right gives a soft slide-in feel. Requires :has() (Chromium
   105+, Safari 15.4+, Firefox 121+). */
body {
  transition: margin-right 0.18s ease;
}
body:has(> aside.src-preview:not([hidden])) {
  margin-right: min(520px, 45vw);
}
.src-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  font-weight: 600;
}
/* PDF page label in the source viewer header (right-aligned by space-between). */
.src-preview-page {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 12%, transparent);
  border-radius: 999px;
  padding: 2px 9px;
}
.src-preview-page[hidden] {
  display: none;
}
.src-preview-head button {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}
.src-preview-head button:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.src-preview-body {
  margin: 0;
  padding: 16px;
  flex: 1;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font:
    13.5px/1.55 'Plus Jakarta Sans',
    ui-sans-serif,
    system-ui,
    sans-serif;
  color: var(--text);
  background: var(--card-2);
}
/* Reveal-in-source mark: one continuous highlight over the result's
   snippet region. Same accent colour as the <b> in the card so the eye
   snaps between the two. Weight stays normal — a multi-line bold paragraph
   reads like a wall. */
.src-preview-body .src-mark {
  background: var(--lemon);
  color: var(--text);
  padding: 0 2px;
  border-radius: 3px;
}

/* ─── Results — tabs ──────────────────────────────────────────────────────── */
/* Sticky header wraps chips + filter top-bar so the whole strip stays
   visible while cards scroll under it. The `top: -12px` (matched by the
   negative top margin) extends the stick all the way to the scroll
   port's border edge, covering the parent's padding-top — without it,
   cards leak through that 12px strip as they scroll up. */
.res-header {
  position: sticky;
  top: -12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  margin: -12px -12px 10px;
  padding: 12px 12px 8px;
}
.res-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.res-topbar-slot:empty {
  display: none;
}
.res-batch-slot:empty {
  display: none;
}
/* When the slot holds the top-bar, the bar's own margin-bottom would
   add a gap inside the sticky header. Reset it — the header's flex gap
   handles spacing between chips and bar. */
.res-topbar-slot > .res-topbar {
  margin-bottom: 0;
}

/* ─── Parcel 2.3: selection + batch bar ──────────────────────────────────── */

/* Per-card checkbox. Sits before the term label in .res-head's flex row. */
.res-select {
  margin: 0 6px 0 0;
  cursor: pointer;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.res-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

/* "Select all matching" button — same visual register as Export ▾. */
.rtb-select-all {
  padding: 6px 12px;
  background: var(--card-2);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}
.rtb-select-all:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Batch action bar — appears at the top of the result panel when a
   selection exists. Same sticky-region as res-header. */
.bb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.bb-count {
  font-weight: 600;
  color: var(--accent);
  margin-right: 4px;
}
.bb-clear {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.bb-clear:hover {
  background: rgba(106, 92, 255, 0.16);
}
.bb-spacer {
  flex: 1;
  min-width: 8px;
}
.bb-btn {
  padding: 5px 11px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.bb-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.bb-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.bb-btn.is-danger {
  color: var(--danger);
  border-color: var(--danger-soft);
}
.bb-btn.is-danger:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

/* Tag popover (and any future bb-popover). position:fixed so it escapes
   scroll containers — same lesson as the +Add source menu. */
.bb-popover {
  position: fixed;
  z-index: 110;
  min-width: 240px;
  max-width: calc(100vw - 16px);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(20, 20, 50, 0.18);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bb-popover-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bb-popover-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 180px;
  overflow: auto;
}
.bb-popover-chip {
  padding: 3px 10px;
  border: 0;
  border-radius: var(--radius-pill);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: filter var(--transition-fast);
}
.bb-popover-chip:hover {
  filter: brightness(0.92);
}
.bb-popover-input-row {
  display: flex;
  gap: 6px;
}
.bb-popover-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  font: inherit;
  font-size: 12.5px;
  outline: none;
}
.bb-popover-input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.bb-popover-apply {
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.bb-popover-apply:hover {
  background: var(--accent-2);
}

/* ─── Parcel 2.4: sets ─────────────────────────────────────────────────────
   Lives in the Sources column under the source list. Same visual register
   as .src-list — quiet rows with hover affordance, name behaves like the
   source title (click for primary action), trailing ✎/✕ icons. */
.src-sets-section {
  margin-top: 18px;
}
.src-sets-section:empty {
  display: none;
}
.src-sets-head {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 4px 0 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.src-sets-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.src-sets-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}
.src-set-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}
.src-set-name:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
/* The Starred scope entry uses the --lemon family to stay visually linked
   to the per-card star indicator and the search-bar pill. */
.src-sets-row-starred .src-set-name {
  color: var(--text);
}
.src-sets-row-starred .src-set-name:hover {
  background: var(--lemon-soft);
  color: var(--text);
}
.res-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  cursor: pointer;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  color: var(--text-2);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.res-tab:hover {
  color: var(--accent);
  border-color: var(--border-strong);
}
.res-tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
  font-weight: 600;
}
/* Canvas tab — warm-orange chip; reads as a different surface from the
   purple/accent query tabs. */
.res-tab.is-canvas {
  background: var(--peach-soft);
  color: var(--peach-2);
  border-color: var(--peach-soft);
}
.res-tab.is-canvas:hover {
  color: var(--peach-2);
  border-color: var(--peach);
}
.res-tab.is-canvas.is-active {
  background: var(--peach);
  color: #fff;
  border-color: var(--peach);
}
.res-tab.is-canvas.is-active .res-tab-x {
  color: rgba(255, 255, 255, 0.75);
}
.res-tab.is-canvas.is-active .res-tab-x:hover {
  color: #fff;
}
.res-tab-lbl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.res-tab-lbl svg {
  display: block;
}
.res-tab-x {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 2px;
}
.res-tab-x:hover {
  color: var(--danger);
}

/* ─── Result cards ────────────────────────────────────────────────────────── */
.res-card {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 0 rgba(20, 20, 50, 0.02);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.res-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(20, 20, 50, 0.05);
}
.res-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  align-items: baseline;
}
.res-term {
  font-weight: 700;
  color: var(--text);
  font-size: 13px;
}
.res-src {
  color: var(--text-dim);
  font-size: 12px;
}
/* PDF page chip — only present on results from a PDF source. */
.res-page {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 12%, transparent);
  border-radius: 999px;
  padding: 1px 7px;
}
.res-body {
  margin: 8px 0;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
}
.res-body b {
  background: var(--lemon);
  color: var(--text);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 700;
}
/* Item 3: split actions — secondary left, danger right with a separator. */
.res-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.res-actions-left,
.res-actions-right {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.res-actions-right {
  position: relative;
  padding-inline-start: 10px;
  border-inline-start: 1px solid var(--border);
}
.res-actions button {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.res-btn-secondary {
  background: var(--card-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.res-btn-secondary:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}
.res-btn-danger {
  background: var(--card-2);
  color: #c53030;
  border: 1px solid var(--border);
  font-weight: 600;
}
.res-btn-danger:hover {
  background: var(--danger-soft);
  color: #c53030;
  border-color: var(--danger-soft);
}
/* Armed state — single-click delete morphs into a filled "Confirm" pill,
   auto-reverts after 3s if not clicked again. No modal for single-result. */
.res-btn-danger.is-arming {
  background: #c53030;
  color: #fff;
  border-color: #c53030;
  font-weight: 600;
}
.res-btn-danger.is-arming:hover {
  background: #9b2c2c;
  border-color: #9b2c2c;
}
.res-cmt {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  resize: vertical;
  background: var(--card-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.res-cmt:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* [hidden] must beat display:block (same class-vs-attribute specificity issue as .exp-menu) */
.res-cmt[hidden] {
  display: none;
}

/* (regular-tab drag-reorder removed — results there are relevance-ranked;
   user-driven ordering now happens only in the canvas workbench) */

/* Star button (per-result toggle into the canvas). Renamed from .res-btn-pin
   in Parcel 2.1. Active state uses --lemon (per proposal §"Aesthetic
   discipline" — star icon: filled --lemon when active). */
.res-btn-star {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--card-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-weight: 500;
}
.res-btn-star svg {
  display: block;
}

/* Reveal-in-source button — opens the source dialog with the match selected.
   Same visual weight as comment / Star (secondary action). */
.res-btn-reveal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--card-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-weight: 500;
}
.res-btn-reveal svg {
  display: block;
}
.res-btn-reveal:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}
.res-btn-star:hover {
  background: var(--lemon-soft);
  color: var(--text);
  border-color: var(--lemon-soft);
}
.res-btn-star.is-starred {
  background: var(--lemon-soft);
  color: var(--text);
  border-color: var(--lemon);
  font-weight: 600;
}
.res-btn-star.is-starred svg {
  color: var(--lemon);
  fill: var(--lemon);
}
.res-btn-star.is-starred:hover {
  background: var(--lemon);
  border-color: var(--lemon);
}

/* ─── Tags ────────────────────────────────────────────────────────────────── */
.res-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin: 8px 0;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
.tag-x {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  line-height: 1;
}
.tag-x:hover {
  color: #fff;
}
.tag-input {
  font: inherit;
  font-size: 12px;
  padding: 2px 8px;
  width: 90px;
  background: var(--card-2);
  color: var(--text);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  outline: none;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}
.tag-input::placeholder {
  color: var(--text-dim);
}
.tag-input:focus-visible {
  border-style: solid;
  border-color: var(--accent);
  background: var(--card);
}

/* ─── Filter top-bar (Item 8 layout) ──────────────────────────────────────── */
.res-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-2);
}
.rtb-left,
.rtb-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.rtb-label {
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
}
.rtb-clear {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--card);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.rtb-clear:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}
.rtb-canvas {
  font-size: 12px;
  padding: 4px 12px;
  background: var(--card);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.rtb-canvas:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}

/* Filter menus — outline pill with chevron, content drops below. */
.rtb-menu {
  position: relative;
  display: inline-block;
}
.rtb-menu summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 12px;
  padding: 4px 12px;
  background: var(--card);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  display: inline-block;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.rtb-menu summary:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}
.rtb-menu summary::-webkit-details-marker {
  display: none;
}
.rtb-menu[open] > summary {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}
/* Open the details into an ABSOLUTELY-positioned popover under the summary, so
   it overlays the page instead of pushing the top-bar siblings around. Items
   live in .rtb-menu-panel (hidden until [open]). */
.rtb-menu-panel {
  display: none;
}
.rtb-menu[open] > .rtb-menu-panel {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-start: 0;
  z-index: 60;
  min-width: 180px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 22px rgba(20, 20, 50, 0.1);
}
.rtb-menu-panel > .rtb-item {
  text-align: start;
  border: none;
  padding: 6px 12px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  width: 100%;
  white-space: nowrap;
  transition: background var(--transition-fast);
}
.rtb-menu-panel > .rtb-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.rtb-menu-panel > .rtb-item.is-on {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
}

/* Segmented control — Comments With / Without / All. */
.rtb-segment {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--card);
}
.rtb-segment-btn {
  background: transparent;
  border: 0;
  color: var(--text-2);
  padding: 4px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}
.rtb-segment-btn + .rtb-segment-btn {
  border-inline-start: 1px solid var(--border);
}
.rtb-segment-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.rtb-segment-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

/* ─── Workspace toolbar (Item 2: page-header right) ──────────────────────── */
.exp-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.exp-bar > button {
  padding: 5px 12px;
  background: var(--card-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.exp-bar > button:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}

.exp-dd {
  position: relative;
}
.exp-dd > button {
  padding: 5px 12px;
  background: var(--card-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.exp-dd > button:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}

.exp-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: auto;
  z-index: 5;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  box-shadow: 0 12px 32px rgba(20, 20, 50, 0.14);
  padding: 4px;
}
.exp-menu-section {
  padding: 6px 12px 2px;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.exp-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* P0 FIX: [hidden] attribute must beat .exp-menu's display:flex */
.exp-menu[hidden] {
  display: none;
}

.exp-menu > button {
  text-align: start;
  background: none;
  border: none;
  color: var(--text);
  padding: 7px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}
.exp-menu > button:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
}
.exp-menu > button:disabled {
  color: var(--text-dim);
  cursor: not-allowed;
}
.exp-msg {
  font-size: 12px;
  color: var(--text-dim);
}
.exp-msg.is-err {
  color: var(--danger);
}

/* ─── Canvas (workbench) ──────────────────────────────────────────────────── */
.panel-canvas-mode {
  background: linear-gradient(180deg, var(--peach-soft) 0%, transparent 60%);
  border-radius: var(--radius);
  padding: 14px 12px 4px;
  margin: -6px -2px 0;
}
.canvas-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.canvas-header-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--peach);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.canvas-header-chip svg {
  display: block;
}
.canvas-header-lead {
  color: var(--text-2);
  font-size: 12.5px;
}
.canvas-bar {
  margin-bottom: 10px;
  color: var(--text-2);
  font-size: 13px;
}
/* The Workbench pill doubles as the Editor-mode toggle: a checkbox sits inside
   it in place of the old star icon. Whole pill is clickable. */
.canvas-header-chip {
  cursor: pointer;
}
.canvas-header-toggle {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1.5px solid #fff;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: background var(--transition-fast);
}
.canvas-header-toggle::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #fff;
  transform: scale(0);
  transition: transform var(--transition-fast);
}
.canvas-header-toggle:checked {
  background: rgba(255, 255, 255, 0.18);
}
.canvas-header-toggle:checked::before {
  transform: scale(1);
}
.canvas-header-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

/* Slot wrapper for pointer-drag. Sibling slots ease into new positions
   while the lifted slot follows the cursor. */
.canvas-slot {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: var(--radius-sm);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.canvas-slot > .res-card {
  flex: 1;
  margin-bottom: 0;
}
.canvas-handle {
  flex: 0 0 auto;
  margin-top: 14px;
  width: 18px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: var(--text-dim);
  opacity: 0.35;
  user-select: none;
  touch-action: none;
  transition:
    opacity var(--transition-fast),
    color var(--transition-fast);
  border-radius: 4px;
}
.canvas-slot:hover .canvas-handle {
  opacity: 0.85;
  color: var(--peach-2);
}
.canvas-handle:hover {
  opacity: 1;
  background: var(--peach-soft);
}
.canvas-handle:active {
  cursor: grabbing;
}
.canvas-slot.is-dragging {
  box-shadow: 0 12px 28px rgba(20, 20, 50, 0.18);
  transition: none;
  cursor: grabbing;
}
.canvas-placeholder {
  margin-bottom: 10px;
  border: 2px dashed var(--peach);
  background: var(--peach-soft);
  border-radius: var(--radius-sm);
  opacity: 0.55;
  transition: height 140ms ease;
}
.canvas-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  row-gap: 6px;
  margin-bottom: 8px;
  align-items: center;
  /* Normal-flow toolbar card sitting ABOVE the editor's own scroll box
     (.canvas-ce scrolls internally). It stays put while editing a long
     composition — no sticky, so no editor text can ever slide above it. */
  background: var(--card);
  padding: 6px;
  border-radius: 16px;
}
/* The auto-width pill buttons (Export ▾, Append, Rebuild references, Rebuild
   from stars) must keep their label on one line and never shrink — otherwise a
   narrow canvas pane overlaps their text instead of wrapping the toolbar. */
.canvas-tools .canvas-export,
.canvas-tools .canvas-append,
.canvas-tools .canvas-rebuild,
.canvas-tools .canvas-refs-rebuild {
  white-space: nowrap;
  flex-shrink: 0;
  width: auto;
}
.canvas-tools button {
  width: 30px;
  height: 30px;
  font-weight: 700;
  background: var(--card-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.canvas-tools button:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}
/* Per-view export dropdown anchor (results top bar + canvas) */
.rtb-export-dd {
  position: relative;
  display: inline-block;
}
.rtb-export-dd > .exp-menu {
  top: calc(100% + 4px);
  right: 0;
  left: auto;
}
.canvas-export-dd {
  position: relative;
  display: inline-block;
}
.canvas-export-dd > .exp-menu {
  top: calc(100% + 4px);
  right: 0;
  left: auto;
  min-width: 240px;
}
/* Reset the .canvas-tools 30×30 button shape for items inside our popover */
.canvas-tools .exp-menu > button {
  width: 100%;
  height: auto;
  font-weight: 400;
  background: transparent;
  border: none;
  border-radius: 0;
  text-align: start;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
}
.canvas-tools .exp-menu > button:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

/* Canvas Export ▾ button — right-aligned, first of the right group */
.canvas-tools .canvas-export-dd {
  margin-inline-start: auto;
}
.canvas-tools .canvas-export {
  width: auto;
  height: 30px;
  padding: 0 12px;
  font-weight: 500;
  font-size: 12.5px;
}
/* "Append new pins" — non-destructive add. Outline pill, peach accent. */
.canvas-tools .canvas-append {
  width: auto;
  height: 30px;
  padding: 0 12px;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--peach);
  border-color: var(--peach-soft);
}
.canvas-tools .canvas-append:hover:not(:disabled) {
  background: var(--peach-soft);
  border-color: var(--peach);
}
.canvas-tools .canvas-append:disabled {
  color: var(--text-dim);
  border-color: var(--border);
  background: var(--card-2);
  cursor: not-allowed;
  opacity: 0.7;
}
/* "Rebuild from pins" — destructive reset. Same peach family, stronger. */
.canvas-tools .canvas-rebuild {
  width: auto;
  height: 30px;
  padding: 0 12px;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--peach);
  border-color: var(--peach-soft);
}
.canvas-tools .canvas-rebuild:hover {
  background: var(--peach-soft);
  color: var(--peach);
  border-color: var(--peach);
}
/* Vertical separator between B/I/U and heading buttons */
.canvas-tools-sep {
  width: 1px;
  background: var(--border);
  height: 20px;
  flex-shrink: 0;
  margin: 0 2px;
}
/* Heading buttons — wider than the 30px B/I/U square */
.canvas-tools .canvas-fmt-heading {
  padding: 0 5px;
  font-size: 11px;
}

.canvas-ce {
  min-height: 320px;
  /* Scroll the composition INSIDE its own box so the toolbar above stays put
     (no sticky needed, no text peeping above the controls). The cap leaves
     room for the page header + canvas header/bar/tools; tune if those change. */
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  background: var(--card);
  color: var(--text);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: normal;
  word-break: break-word;
  outline: none;
  font-size: 14px;
  line-height: 1.6;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}
/* Heading styles inside the contenteditable */
.canvas-ce h1 {
  font-size: 1.6em;
  font-weight: 700;
  margin: 0.5em 0 0.2em;
  line-height: 1.3;
}
.canvas-ce h2 {
  font-size: 1.3em;
  font-weight: 700;
  margin: 0.5em 0 0.2em;
  line-height: 1.3;
}
.canvas-ce h3 {
  font-size: 1.1em;
  font-weight: 700;
  margin: 0.5em 0 0.2em;
  line-height: 1.3;
}
.canvas-ce p {
  margin: 0 0 0.5em;
}
.canvas-ce:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ─── RTL ─────────────────────────────────────────────────────────────────── */
[dir='rtl'] .exp-menu {
  right: auto;
  left: 0;
}
/* .src-add-menu is now `position: fixed` with JS-driven left/top from the
   button's bounding rect (sources.js positionMenu). Setting `right: 0` here
   combined with the JS `style.left` stretched the menu from its left anchor
   all the way to the viewport's right edge in RTL mode. The JS now writes
   `style.right = 'auto'` to neutralise any stale RTL rule, so this rule is
   intentionally removed — adding it back will reintroduce the stretch. */

/* (.res-head uses flex + space-between, which already mirrors under
   dir=rtl — no manual row-reverse, that double-flipped it) */

/* ─── Draft editor (Item 1: "Paste text" lands in the results panel) ─────── */
.draft-card {
  max-width: 720px;
  margin: 24px auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 16px rgba(20, 20, 50, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.draft-head h2 {
  font-family: 'Fraunces', 'Plus Jakarta Sans', serif;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}
.draft-head h2 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 600;
}
.draft-title-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-2);
  font-size: 12.5px;
}
.draft-title {
  padding: 9px 12px;
  font: inherit;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.draft-title:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* URL-mode helper note under the URL field — privacy explainer. */
.draft-help {
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}
.draft-body {
  width: 100%;
  min-height: 50dvh;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.draft-body:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.draft-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
/* Sticky toolbar at the top of the draft card: the title + the Cancel/Add
   buttons stay reachable while a long paste scrolls underneath. Sticky
   walks up to the nearest scroll ancestor (#results.panel). The negative
   side+top margins extend the background to the card's edge so the
   textarea doesn't peek through when scrolled. */
.draft-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--card);
  margin: -24px -24px 0;
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.draft-toolbar .draft-head {
  flex: 1 1 auto;
  min-width: 0;
}
.draft-toolbar .draft-foot {
  flex: 0 0 auto;
}
.draft-btn {
  padding: 8px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    opacity var(--transition-fast);
}
.draft-btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.draft-btn-primary:hover:not(:disabled) {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.draft-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.draft-btn-cancel {
  background: var(--card);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
}
.draft-btn-cancel:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}

/* ─── Empty state (Item 5) ───────────────────────────────────────────────── */
.res-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 12vh 24px 8vh;
  color: var(--text-2);
}
.res-empty-msg {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-2);
}
.res-empty-cta {
  padding: 8px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.res-empty-cta:hover {
  background: var(--accent-2);
}

/* ─── No-results floating toast ──────────────────────────────────────────── */
/* Sits absolutely inside .res-panel (which is position:relative). No overlay,
   no blur — just a card with a soft shadow. Auto-dismiss is wired in JS:
   X click / Esc / click outside / typing in the search bar. */
.res-panel {
  position: relative;
}
.res-noresults-toast {
  position: absolute;
  top: 14vh;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 32px));
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  padding: 18px 38px 18px 22px;
  z-index: 5;
  text-align: center;
}
.res-noresults-msg {
  margin: 0;
  font-size: 14.5px;
  color: var(--text);
}
.res-noresults-sub {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.4;
}
.res-noresults-x {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 24px;
  cursor: pointer;
  border-radius: 50%;
}
.res-noresults-x:hover {
  color: var(--text);
  background: var(--card-2);
}

/* ─────────────────────────────────────────────────────────────────────────
   Modal — branded replacement for window.confirm/prompt
   ───────────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(29, 34, 56, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modal-fade-in 130ms ease-out;
}
.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px 18px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(29, 34, 56, 0.18);
  animation: modal-pop-in 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-title {
  margin: 0 0 8px;
  font-family: 'Fraunces', 'Plus Jakarta Sans', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.modal-msg {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}
.modal-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: var(--card-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.modal-input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.modal-btn-cancel {
  background: var(--card);
  border-color: var(--border-strong);
  color: var(--text);
}
.modal-btn-cancel:hover {
  background: var(--bg-2);
}
.modal-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.modal-btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.modal-btn-danger {
  background: #c53030;
  border-color: #c53030;
  color: #fff;
}
.modal-btn-danger:hover {
  background: #9b2c2c;
  border-color: #9b2c2c;
}

/* Options checklist (deleteWorkspaceSelective + future multi-pick modals). */
.modal-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
}
.modal-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 6px;
}
.modal-opt:hover {
  background: var(--bg-2);
}
.modal-opt input[type='checkbox'] {
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.modal-opt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.modal-opt-label {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 500;
}
.modal-opt-hint {
  font-size: 12px;
  color: var(--text-2);
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .modal-overlay,
  .modal-card {
    animation: none;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Storage indicator (Parcel 4) — sticky footer under the workspace
   ───────────────────────────────────────────────────────────────────────── */
.storage-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 12px auto 0;
  max-width: 1280px;
  padding: 6px 24px 10px;
  display: flex;
  justify-content: flex-end;
  background: linear-gradient(
    to bottom,
    rgba(251, 247, 239, 0) 0%,
    var(--bg) 45%,
    var(--bg) 100%
  );
  pointer-events: none; /* let the button own the hit area */
}
.storage-footer-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.storage-footer-btn:hover {
  background: var(--card-2);
  border-color: var(--border);
  color: var(--text-2);
}
.storage-footer-btn .storage-counts,
.storage-footer-btn .storage-size,
.storage-footer-btn .storage-pct {
  display: inline-block;
}
.storage-footer-btn .storage-pct:not(:empty)::before,
.storage-footer-btn .storage-size:not(:empty)::before {
  content: '·';
  margin-right: 8px;
  color: var(--border-strong);
}
/* Color cue follows usage band. --text-dim default; warn at 70%, critical at 90%. */
.storage-footer-btn[data-level='warn'] {
  color: var(--lemon);
}
.storage-footer-btn[data-level='warn']:hover {
  color: var(--lemon);
  border-color: var(--lemon-soft);
}
.storage-footer-btn[data-level='critical'] {
  color: var(--danger);
}
.storage-footer-btn[data-level='critical']:hover {
  color: var(--danger);
  border-color: var(--danger-soft);
}
.storage-footer-btn[data-level='unknown'] {
  color: var(--text-dim);
  font-style: italic;
}

/* Breakdown modal (extends .modal-card pattern) */
.storage-modal-card {
  max-width: 480px;
}
.storage-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 18px;
  font-size: 13px;
}
.storage-table td {
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
}
.storage-table tbody tr:last-child td {
  border-bottom: 1px solid var(--border-strong);
}
.storage-table tfoot td {
  padding-top: 10px;
  font-weight: 600;
  color: var(--text);
  border-bottom: none;
}
.storage-row-label {
  color: var(--text-2);
}
.storage-row-size {
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ─── Boot error overlay ───────────────────────────────────────────────────
   Shown by main.js showBootError() when IndexedDB couldn't be opened
   (blocked by another tab on an older version, or thrown/errored). Lives
   inside #app — replaces the "Loading…" stub. No dependency on layout.css
   tokens that may not have parsed yet by the time we mount it. */
.boot-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 24px;
}
.boot-error-card {
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 24px 26px;
  text-align: center;
}
.boot-error-title {
  margin: 0 0 12px;
  font-family: 'Fraunces', 'Plus Jakarta Sans', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.boot-error-body {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}
.boot-error-reload {
  background: var(--accent);
  color: var(--card);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition-fast);
}
.boot-error-reload:hover {
  background: var(--accent-2);
}
.boot-error-reload:active {
  transform: translateY(1px);
}

/* ─── Parcel 6a — citations + bibliography modal ─────────────────────────── */

/* Inline footnote chip rendered by citations.js renderCitationsAsHTML. */
.cite-marker {
  display: inline-block;
  margin: 0 1px;
  font-size: 10.5px;
  color: var(--accent);
  cursor: help;
}
.ai-cite-missing {
  color: var(--danger);
}

/* Auto-References block in the canvas editor (h2 stamped with
   data-canvas-references="auto"; following <p data-ref-n="…">). */
.canvas-ce h2[data-canvas-references='auto'] {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-dim);
}
.canvas-ce p[data-ref-n] {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* Canvas Rebuild-references button — matches the existing canvas-append /
   canvas-rebuild row affordances. */
.canvas-refs-rebuild {
  /* width:auto + height:30px — without these it inherits the 30px square from
     `.canvas-tools button` and clips its label to "Reb". Matches the Export /
     Append / Rebuild-from-stars pills. */
  width: auto;
  height: 30px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.canvas-refs-rebuild:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Bibliography modal — extends .modal-card. */
.bib-modal-card {
  max-width: 520px;
}
.bib-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-height: 60vh;
  overflow-y: auto;
}
.bib-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-dim);
}
.bib-label > input,
.bib-label > select {
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.bib-label > input:focus,
.bib-label > select:focus {
  outline: none;
  border-color: var(--accent);
}
.bib-extras {
  margin-top: 6px;
}
.bib-extras > summary {
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 0;
}
.bib-extras-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0;
}
.bib-extra-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 4px;
  align-items: center;
}
.bib-extra-row input {
  font-size: 12.5px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.bib-extra-del {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
}
.bib-extra-del:hover {
  color: var(--danger);
}
.bib-extra-add {
  align-self: flex-start;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}
.bib-extra-add:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Parcel 6b — citation-style picker + multi-style chip variants ──────── */

.canvas-cite-style {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 0 4px;
}
.canvas-cite-style-select {
  font: inherit;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.canvas-cite-style-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Parenthetical chip variant (author-year + apa) — same accent color as
   numeric chips but rendered inline, not superscript. */
span.cite-marker {
  display: inline;
  font-size: 0.92em;
  color: var(--accent);
  white-space: nowrap;
  cursor: help;
}

/* ─────────────────────────────────────────────────────────────────────────
   Canvas editor "Show in source" — right-click context menu + lookup modal
   ───────────────────────────────────────────────────────────────────────── */
.canvas-ctx-menu {
  position: fixed;
  z-index: 1100;
  min-width: 160px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(29, 34, 56, 0.18);
}
.canvas-ctx-item {
  display: block;
  width: 100%;
  text-align: start;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.canvas-ctx-item:hover,
.canvas-ctx-item:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

/* Lookup modal — reuses .modal-overlay / .modal-card; wider, with a scrollable
   list of result cards. */
.source-lookup-card {
  max-width: 620px;
  display: flex;
  flex-direction: column;
  max-height: min(78vh, 720px);
}
.source-lookup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.source-lookup-close {
  flex: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.source-lookup-close:hover {
  background: var(--bg-2);
  color: var(--text);
}
.source-lookup-list {
  margin-top: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Search-bar "Options ▾" dropdown — fuzziness + distance + snippet length.
   Folds the pre-search settings into one pill so the search row stays compact.
   Mirrors the stop-words dropdown pattern.
   ───────────────────────────────────────────────────────────────────────── */
.sb-opts {
  position: relative;
}
.sb-opts-btn {
  padding: 6px 14px;
  background: var(--card-2);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.sb-opts-btn:hover,
.sb-opts-btn[aria-expanded='true'] {
  background: var(--accent-soft, var(--card));
  color: var(--text);
  border-color: var(--accent);
}
.sb-opts-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  /* Fixed width: an `auto` width reflowed the whole popover every time a slider
     value label changed digits (e.g. "7" → "10"). */
  width: 300px;
  max-width: calc(100vw - 24px);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 36px rgba(29, 34, 56, 0.16);
  padding: 6px;
}
.sb-opts-menu[hidden] {
  display: none;
}
.sb-opts-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
}
.sb-opts-section + .sb-opts-section {
  border-top: 1px solid var(--border);
}
.sb-opts-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.sb-opts-menu .sb-opt {
  width: 100%;
}
/* min-width:0 lets the range shrink below its intrinsic width so the
   "Fuzziness … 0…0.4" row can never overflow the menu box. */
.sb-opts-menu .sb-opt input[type='range'] {
  flex: 1;
  width: auto;
  min-width: 0;
}
.sb-opts-hint {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}
.sb-level-seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: max-content;
}
.sb-level-btn {
  width: 34px;
  height: 30px;
  padding: 0;
  border: none;
  border-inline-start: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text-2);
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.sb-level-btn:first-child {
  border-inline-start: none;
}
.sb-level-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.sb-level-btn.is-active {
  background: var(--accent);
  color: #fff;
}
/* Sort + word-order segmented controls: word labels, not single chars — let
   buttons size to their text instead of the snippet control's fixed 34px square. */
.sb-sort-seg .sb-level-btn,
.sb-mode-seg .sb-level-btn {
  width: auto;
  padding: 0 12px;
}
/* Word-order control: stack label / segmented buttons / hint vertically, like a
   mini-section, instead of the .sb-opt single-row (slider) layout that crammed
   the pill and the hint onto one line. */
.sb-mode-opt {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Guide affordances: the menu-header link + the per-section ⓘ both open the
   side drawer. Low-emphasis until hovered. */
.sb-opts-guide-row {
  display: flex;
  justify-content: flex-end;
  padding: 2px 4px 0;
}
.sb-guide-btn {
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}
.sb-guide-btn:hover {
  background: var(--accent-soft);
}
.sb-opt-help {
  border: none;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0 2px;
  vertical-align: baseline;
}
.sb-opt-help:hover {
  color: var(--accent);
}

/* ── Help / README drawer ─────────────────────────────────────────────────── */
.help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(29, 34, 56, 0.32);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.help-backdrop.is-open {
  opacity: 1;
}
.help-backdrop[hidden] {
  display: none;
}
.help-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 91;
  width: min(440px, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-inline-start: 1px solid var(--border-strong);
  box-shadow: -18px 0 48px rgba(29, 34, 56, 0.18);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}
/* RTL: the drawer sits on the left, so it slides in from the left. */
[dir='rtl'] .help-drawer {
  transform: translateX(-100%);
}
.help-drawer.is-open {
  transform: translateX(0);
}
.help-drawer[hidden] {
  display: none;
}
.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.help-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.help-close {
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.help-close:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.help-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}
.help-tab {
  border: none;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.help-tab:hover {
  color: var(--accent);
}
.help-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.help-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.help-toc-link {
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
}
.help-toc-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.help-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 4px 32px;
}
.help-section {
  padding: 16px;
  border-bottom: 1px dashed var(--border);
  scroll-margin-top: 8px;
}
.help-section:last-child {
  border-bottom: none;
}
.help-section.is-flash {
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  transition: background 0.3s ease;
}
.help-section-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}
.help-section p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
.help-section ul {
  margin: 0 0 10px;
  padding-inline-start: 18px;
}
.help-section li {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 6px;
  color: var(--text);
}
.help-section code {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.help-sub {
  font-weight: 600;
  color: var(--text-dim) !important;
}
