/* The task queue, the detail pane, and the resizable thread/doc panel.

   Part of the split style sheet — see index.html for the link order. */
/* ---------- Task area ---------- */
.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 24px;
  padding: 28px 32px;
  width: 100%;
  height: 100%;
  align-content: start;
}

.empty-state {
  color: var(--ink-muted);
  padding: 80px 32px;
  text-align: center;
  width: 100%;
  font-size: 15px;
  grid-column: 1 / -1;
}

.task-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* §5.4 On desktop keep the queue within the viewport while the detail pane
   scrolls. align-self:start stops the grid item stretching to the (tall) row
   height so sticky can take effect; the task list itself already scrolls
   independently (see .task-list max-height). Not applied on narrow layouts. */
@media (min-width: 901px) {
  .task-column {
    position: sticky;
    top: 28px; /* matches .app-shell padding-top */
    align-self: start;
    max-height: calc(100vh - 56px);
  }
  /* The column is a capped flex column; let the task list take the leftover
     space and scroll within it, so the whole queue always fits the viewport
     regardless of how tall the filter/search controls are. */
  .task-column .task-list {
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
  }
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn {
  flex: 1;
  padding: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  color: var(--ink-soft);
  border-color: var(--glass-border);
  transition: var(--transition);
}

.filter-btn:hover {
  background: color-mix(in srgb, var(--accent-soft) 60%, transparent);
  color: var(--accent-strong);
}

.filter-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

#refreshBtn { flex: 0 0 auto; padding: 10px 12px; }

.list-tools {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.list-tools select {
  flex: 1;
  font-size: 12.5px;
  padding: 8px 10px;
}

.filter-row #shortcutsBtn { flex: 0 0 auto; padding: 10px 12px; }
.list-tools { flex-wrap: wrap; }
.list-tools select { min-width: 128px; }

/* Search box above the task list */
.list-search { position: relative; margin-bottom: 10px; }
.list-search .search-ic {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-muted); display: inline-flex; pointer-events: none;
}
.list-search .search-ic .ic { width: 15px; height: 15px; }
.search-input { width: 100%; padding: 9px 34px; font-size: 13px; border-radius: var(--radius-md); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  padding: 4px; border: none; background: transparent; color: var(--ink-muted);
  display: inline-flex; cursor: pointer; border-radius: 6px; transition: var(--transition);
}
.search-clear:hover { color: var(--ink); background: color-mix(in srgb, var(--surface-2) 80%, transparent); }
.search-clear .ic { width: 14px; height: 14px; }

/* "Stale only" toggle in the tools row */
.tool-toggle {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  color: var(--ink-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
}
.tool-toggle .ic { width: 14px; height: 14px; }
.tool-toggle:hover { color: var(--accent-strong); border-color: var(--accent); }
.tool-toggle.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* Freshness line: "Updated 2m ago" / "Load N new tasks" */
.list-fresh {
  display: flex; align-items: center; gap: 8px;
  min-height: 20px; margin: -4px 0 12px;
  font-size: 11.5px; color: var(--ink-muted);
}
.list-fresh:empty { display: none; margin: 0; }
.fresh-mini {
  display: inline-flex; padding: 2px; border: none; background: transparent;
  color: var(--ink-muted); cursor: pointer; border-radius: 5px; transition: var(--transition);
}
.fresh-mini:hover { color: var(--accent-strong); background: var(--accent-soft); }
.fresh-mini .ic { width: 13px; height: 13px; }
.fresh-refresh {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  cursor: pointer; transition: var(--transition);
}
.fresh-refresh:hover { border-color: var(--accent); }
.fresh-refresh .ic { width: 13px; height: 13px; }
.list-fresh.has-error { color: var(--danger); }
.fresh-err { display: inline-flex; align-items: center; gap: 5px; color: var(--danger); }
.fresh-err .ic { width: 13px; height: 13px; }

/* Offline outbox chip (bottom-left), shown while writes are pending */
.outbox-chip {
  position: fixed; left: 20px; bottom: 20px; z-index: 60;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600;
  padding: 9px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: var(--shadow-md); cursor: pointer;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.outbox-chip.show { opacity: 1; transform: none; pointer-events: auto; }
.outbox-chip:hover { border-color: var(--accent); }
.outbox-chip .ic { width: 14px; height: 14px; }
@media (prefers-reduced-motion: reduce) { .outbox-chip { transition: none; } }

/* Per-sheet colour tag on task cards + detail header */
.src-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: baseline;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
}
/* Colour swatch input in the source card header */
.src-color {
  flex: 0 0 auto; width: 34px; height: 34px; padding: 2px;
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
}
.src-color::-webkit-color-swatch-wrapper { padding: 0; }
.src-color::-webkit-color-swatch { border: none; border-radius: 4px; }
.src-color::-moz-color-swatch { border: none; border-radius: 4px; }

.age-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-block;
  margin-left: 6px;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  color: var(--ink-muted);
  border: 1px solid var(--rule);
}

.age-badge.age-warn { background: var(--gold-soft); color: var(--gold); border-color: rgba(156, 122, 30, 0.3); }
.age-badge.age-stale { background: var(--danger-soft); color: var(--danger); border-color: rgba(177, 74, 61, 0.3); }

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding-right: 4px;
}

.task-item {
  position: relative;
  border-left: 4px solid var(--rule-strong);
  border-radius: var(--radius-card);
  padding: 14px 16px 14px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.task-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.task-item.status-assigned { border-left-color: var(--accent); }
.task-item.status-update { border-left-color: var(--gold); }

.task-item.active {
  border-color: var(--ink-muted);
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
  box-shadow: var(--shadow-md);
}

.task-item .product { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--ink); }

.task-item .type {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.badge {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-block;
  border: 1px solid transparent;
}

.badge-assigned { background: var(--accent-soft); color: var(--accent-strong); border-color: rgba(43, 110, 85, 0.25); }
.badge-update { background: var(--gold-soft); color: var(--gold); border-color: rgba(156, 122, 30, 0.3); }

/* ---------- Detail pane ---------- */
.detail-pane {
  background: var(--glass-bg);
  border-radius: var(--radius-card);
  padding: 28px;
  display: flex;
  gap: 0;
  box-shadow: var(--shadow-md);
  min-width: 0;
  min-height: calc(100vh - 56px);
}

.detail-main { flex: 1; min-width: 0; }

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

/* The title/subtitle block. It's the flex child here, so this is what has to
   be allowed to shrink — a flex item won't go below its content's minimum
   width without it, and the heading inside then pushed the whole block out
   over the link panel. */
.detail-header > div { min-width: 0; }

.detail-header h3 {
  margin: 0 0 4px;
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  /* A title taken from a comment that starts with a bare URL is one long
     unbreakable word, which used to run out of this column and over the link
     panel beside it. Common now that comments carry product links. Not
     `anywhere`, which also counts those break points when working out the
     minimum width and squeezes the heading to about a character a line. */
  overflow-wrap: break-word;
}

.field-block { margin-top: 18px; }

.field-block label {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.field-readonly {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.field-link-row { display: flex; }
.field-link-row button { width: 100%; }

/* Auto-detected link on a field (smart chip, hyperlink, or URL text) */
.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  margin-bottom: 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-chip:hover {
  border-color: var(--accent);
  transform: none;
  box-shadow: var(--shadow-sm);
}

.link-chip .link-chip-arrow { opacity: 0.7; }

.field-readonly + .link-chip { margin-top: 8px; margin-bottom: 0; }

.save-row {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.save-row button { flex: 1; }

.save-status {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 10px;
  min-height: 18px;
}

/* ---------- Resizable thread/doc panel ---------- */
.resize-handle {
  width: 0;
  pointer-events: none;
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
}

.resize-handle.active { width: 14px; pointer-events: auto; margin: 0 -7px; z-index: 5; }

.resize-handle.active::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: var(--rule-strong);
  border-radius: 2px;
  transition: var(--transition);
}

.resize-handle.active:hover::after,
.resize-handle.dragging::after { background: var(--accent); }

.thread-panel {
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease;
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
}

/* Sized against the pane it sits in, not the viewport. 40vw was measured
   against the whole window while this panel only ever occupies the detail
   pane, so on a 1500px screen it claimed 520 of the pane's 732 and left the
   task itself 154px — narrow enough that the heading spilled over the panel.
   A percentage keeps the split honest at any width; the drag handle and the
   remembered width still override it. */
.thread-panel.open { width: min(52%, 520px); padding-left: 24px; }
.thread-panel.no-transition { transition: none; }

.thread-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}

.thread-panel-header span {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-frame-wrap {
  flex: 1;
  border-radius: var(--radius-card);
  overflow-y: auto;
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.thread-frame-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: 460px;
  border: none;
  border-radius: var(--radius-sm);
}

/* ---------- Unsent draft notice ----------
   After drafts moved server-side, "saved" and "in the spreadsheet" stopped
   meaning the same thing. Someone who saves a draft, opens the sheet and finds
   an empty cell would reasonably think their work was lost, so this says so
   plainly rather than relying on a subtle status line. */
.draft-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.4;
}
.draft-banner svg { flex: none; width: 15px; height: 15px; color: var(--gold); }
.draft-banner b { color: var(--ink); font-weight: 600; }
.draft-banner-warn { border-left-color: var(--danger); background: var(--danger-soft); color: var(--ink); }
.draft-banner-warn svg { color: var(--danger); }

/* ---------- The comment editor ----------
   A contenteditable box with the toolbar UNDER it, so the buttons sit next to
   the Save/Submit row rather than pushing the writing area down the screen. */
.rt-editor {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  transition: var(--transition);
}

.rt-editor:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.rt-body {
  min-height: 104px;
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* The placeholder is CSS-only: contenteditable has no placeholder attribute,
   and an empty box with no prompt reads as broken rather than empty. */
.rt-body:empty::before,
.rt-body:has(> div:only-child > br:only-child)::before {
  content: attr(data-placeholder);
  color: var(--ink-muted);
  pointer-events: none;
}

.rt-body ul, .rt-body ol { margin: 4px 0; padding-left: 22px; }
.rt-body a { color: var(--accent-strong); }

.rt-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  position: relative;
  padding: 5px 7px;
  border-top: 1px solid var(--glass-border);
}

.rt-btn {
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  color: var(--ink-soft);
  min-width: 28px;
  height: 26px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
}

.rt-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
}

.rt-btn b { font-weight: 800; }
.rt-btn i { font-style: italic; }

.rt-sep {
  width: 1px;
  height: 15px;
  background: var(--rule);
  margin: 0 5px;
}

.rt-emoji {
  position: absolute;
  bottom: 32px;
  left: 6px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.rt-emoji[hidden] { display: none; }

.rt-emoji button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  line-height: 1;
  border-radius: var(--radius-sm);
}

.rt-emoji button:hover { background: var(--accent-soft); }

/* ====================================================================
   §10 Content pieces — one row, several things to write
   ==================================================================== */

/* The strip on a queue card. Eleven segments say "a post and ten comments"
   in a way "4/11" alone doesn't: the shape shows which end you're at. */
.piece-strip {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}
.piece-seg {
  height: 4px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--ink-muted) 28%, transparent);
}
.piece-seg.done { background: var(--accent); }
.piece-strip-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--ink-muted);
}
.piece-strip-row .count {
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ---- the accordion ---- */
.pieces-block {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
}
.pieces-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-bottom: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}
.pieces-head .section-label { margin: 0; }

.piece { border-bottom: 1px solid color-mix(in srgb, var(--glass-border) 60%, transparent); }
.piece:last-child { border-bottom: 0; }

.piece-head {
  width: 100%;
  display: grid;
  grid-template-columns: 16px minmax(7rem, 10rem) 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.piece-head:hover {
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
  transform: none;
  box-shadow: none;
}
@media (max-width: 760px) {
  .piece-head { grid-template-columns: 16px 1fr auto; }
  .piece-head .piece-preview, .piece-head .piece-col { display: none; }
}

/* A filled piece is ticked. The tick is the state — the row is scanned down
   the left edge, not read. */
.piece-tick {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--glass-border);
  display: grid;
  place-items: center;
  font-size: 9px;
  line-height: 1;
}
.piece.done .piece-tick {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.piece.done .piece-tick::after { content: "✓"; font-weight: 700; }

.piece-name { font-size: 12.5px; font-weight: 600; }
.piece.done .piece-name { color: var(--ink-soft); font-weight: 500; }
.piece-doc {
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 0 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 2px;
  color: var(--accent-strong);
}
.piece-preview {
  font-size: 11.5px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.piece-col, .piece-words {
  font-size: 10px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.piece-body { padding: 0 12px 12px; }
.piece-body .field-block:first-child { margin-top: 0; }

/* ---- the Frase panel ---- */
.frase-panel {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface-2) 40%, transparent);
  margin-bottom: 14px;
  overflow: hidden;
}
.frase-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-bottom: 1px solid var(--glass-border);
}
.frase-head .pill-ghost {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink-muted) 15%, transparent);
  color: var(--ink-soft);
}
.frase-head [aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent-strong);
}

.frase-gauge { display: flex; align-items: center; gap: 14px; padding: 12px; flex-wrap: wrap; }

/* The dial is a conic sweep rather than an SVG: one element, no path maths,
   and it animates for free when the number moves. */
.frase-dial {
  --pct: 0;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background:
    conic-gradient(var(--dial-col, var(--accent)) calc(var(--pct) * 1%), color-mix(in srgb, var(--ink-muted) 20%, transparent) 0);
}
.frase-dial::before {
  content: "";
  grid-area: 1 / 1;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
}
.frase-dial > span { grid-area: 1 / 1; }
.frase-dial.good { --dial-col: var(--accent); }
.frase-dial.mid  { --dial-col: var(--gold); }
.frase-dial.bad  { --dial-col: var(--danger); }

.frase-meta { display: flex; flex-direction: column; gap: 2px; min-width: 14rem; flex: 1; }
.frase-meta b { font-size: 12.5px; }
.frase-caveat { font-size: 10.5px; }
.frase-empty { padding: 12px; }

.term-grid {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  padding: 0 12px 12px;
}
.term-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 3px;
  padding: 4px 7px;
  font-size: 11.5px;
  background: var(--surface);
}
.term-chip .w { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.term-chip .c { font-size: 10.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.term-chip.met {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}
.term-chip.met .w, .term-chip.met .c { color: var(--accent-strong); }
/* Well past the target: Frase penalises stuffing, so it shouldn't read as
   "even better than met". */
.term-chip.over .c { color: var(--gold); }

.term-paste { padding: 12px; border-top: 1px solid var(--glass-border); }
.term-paste.hidden { display: none; }
.term-paste textarea { width: 100%; font-family: var(--font-mono); font-size: 12px; }
.term-paste > label {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  margin-bottom: 5px;
}

/* A file input styled as a button: Frase's CSV arrives as a download, so it
   can be handed straight over instead of being opened and copied first. */
.file-pick { cursor: pointer; display: inline-flex; align-items: center; }

/* The parsed terms, one per line, targets a tab-stop apart. Two columns on a
   wide panel because fifty topics in one column is a scroll, not a list. */
.term-edit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2px 14px;
  max-height: 320px;
  overflow-y: auto;
  margin: 8px 0;
}
.term-edit:empty { display: none; }
.tp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 5px;
}
.tp-row:hover { background: var(--surface-2); }
.tp-w {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.tp-t {
  width: 54px;
  flex: none;
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}
.term-bulk { align-items: center; gap: 8px; }
.term-bulk.hidden { display: none; }
.term-bulk input { width: 60px; text-align: center; font-family: var(--font-mono); }

/* Whether the Doc behind the post is part of the count, said in the one place
   the number is — an unexplained 0 is worse than a low one. */
.doc-count { display: block; margin-top: 2px; }
.doc-count.ok { color: var(--ink-muted); }
.doc-count.warn { color: var(--gold); }
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.btn-link:hover { color: var(--accent-strong); }
