/* ==========================================================================
   PaliVerse — Translation Finder & Corrector
   Visual system lifted from paliverse.org: gold masthead (#C79A51), Noto Serif
   headings, Helvetica Neue body copy, maroon primary buttons, cream panels.
   ========================================================================== */

:root {
  --pv-gold:        #c79a51;
  --pv-gold-light:  #d7ab5b;
  --pv-gold-dark:   #aa8240;
  --pv-maroon:      #8b2319;
  --pv-maroon-dark: #73160d;
  --pv-deep-red:    #7f1100;
  --pv-cream:       #f4eee2;
  --pv-cream-dark:  #eadbbc;
  --pv-slate:       #454f5e;
  --pv-ink:         #201b13;
  --pv-muted:       #666666;
  --pv-line:        #e3d8c2;
  --pv-field-bg:    #fafafa;
  --pv-white:       #ffffff;
  --pv-danger:      #c00000;
  --pv-ok:          #1f7a3d;

  --pv-serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --pv-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --pv-radius:      12px;
  --pv-radius-sm:   8px;
  --pv-shadow:      0 1px 3px rgba(0, 0, 0, .08), 0 6px 18px rgba(32, 27, 19, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--pv-white);
  color: var(--pv-slate);
  font-family: var(--pv-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--pv-serif);
  color: #000;
  font-weight: 500;
  margin: 0 0 .4em;
  line-height: 1.25;
}

a { color: var(--pv-maroon); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- masthead */

/* the "The PaliVerse Project" banner uses the site's deep-red brand colour */
.pv-header { background: var(--pv-deep-red); color: #fff; }

.pv-utility {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 26px 0;
  font-size: .86rem;
  letter-spacing: .02em;
}
.pv-utility a { color: #fff; opacity: .95; }
.pv-utility a:hover { color: var(--pv-maroon-dark); text-decoration: none; }
.pv-utility .pv-lang { opacity: .8; font-size: .8rem; }

.pv-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 6px 26px 14px;
}
.pv-brand img { width: 68px; height: auto; display: block; }
.pv-brand-text { text-align: center; }   /* centre the title + tagline together */
.pv-brand-text h1 {
  font-family: var(--pv-serif);
  color: #fff;
  font-size: 2.05rem;
  font-weight: 500;
  margin: 0;
  letter-spacing: .01em;
}
/* Tagline: pure white, medium weight, centred, no tracking — matches paliverse.org */
.pv-brand-text p {
  margin: 0;
  color: #ffffff;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: normal;
}

.pv-nav {
  border-top: 1px solid rgba(255, 255, 255, .28);
  background: var(--pv-gold);
}
.pv-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1400px;
}
.pv-nav a {
  display: block;
  padding: 13px 20px;
  font-family: var(--pv-serif);
  font-size: 1rem;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: .01em;
}
.pv-nav a:hover { color: var(--pv-maroon-dark); text-decoration: none; }
.pv-nav a.is-active { color: var(--pv-maroon-dark); }

/* ------------------------------------------------------------------ layout */

.pv-strip {
  background: var(--pv-cream);
  border-bottom: 1px solid var(--pv-line);
  padding: 18px 26px;
}
.pv-strip-inner { max-width: 1400px; margin: 0 auto; }
.pv-strip h2 { font-size: 1.6rem; margin: 0 0 4px; }
.pv-strip p { margin: 0; color: var(--pv-slate); }

/* single column: filters sit full-width on top, the search area gets the rest */
.pv-shell {
  display: block;
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 26px;
  /* clip (not scroll) horizontally so a tooltip near the right edge can never
     add a page scrollbar; overflow-y stays visible with `clip` */
  overflow-x: clip;
}

/* ------------------------------------------------- filters top bar ------- */
.pv-controls { margin-bottom: 10px; }
.pv-controls-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pv-controls-head .pv-spacer { flex: 1 1 auto; }
.pv-controls-title {
  font-size: var(--fs-lg);
  border-bottom: 2px solid var(--pv-gold);
  padding-bottom: 8px;
  margin: 0 0 14px;
}
.pv-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 22px;
  align-items: start;
}
.pv-filters-grid > .pv-field { margin-bottom: 0; }
/* the chip groups (Layer, Collection) are full-width rows so every chip sits
   inline, one after the other, on a single row */
.pv-field-inline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; }
.pv-field-inline > .pv-flabel { margin: 0; min-width: 84px; }
.pv-field-inline > .pv-chips { flex: 0 1 auto; flex-wrap: wrap; }
/* Layer + Collection on one line */
.pv-lc-row { align-items: center; }
.pv-lc-row > .pv-flabel { min-width: 0; }
.pv-lc-sep { margin-left: 18px; }
/* book · include · results · audit on one line */
.pv-filters-line { align-items: center; gap: 8px 20px; }
.pv-filters-line > .pv-check { margin: 0; }
.pv-rowlimit-inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.pv-rowlimit-inline label { margin: 0; white-space: nowrap; }
.pv-rowlimit-inline input { width: 90px; }
.pv-below-filters { max-width: 380px; margin-top: 10px; }

/* the three result toggles on one line */
#result-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin-bottom: 6px; }
#result-toggles > .pv-check { margin: 0; }
#tg-mismatch-wrap { display: contents; }
#result-filter-note { flex-basis: 100%; margin: 4px 0 0; }
/* the lemma rebuild collapses to a compact inline control in the header */
.pv-lemma-dd { margin: 0; background: transparent; border: 0; max-width: 340px; }
.pv-lemma-dd > summary { padding: 6px 0; }
.pv-lemma-dd[open] { min-width: 300px; }

/* ------------------------------------------------------------------- cards */

.pv-card {
  background: var(--pv-white);
  border: 1px solid var(--pv-line);
  border-radius: var(--pv-radius);
  box-shadow: var(--pv-shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.pv-card > h3 {
  font-size: 1.12rem;
  border-bottom: 2px solid var(--pv-gold);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.pv-card.pv-cream { background: var(--pv-cream); }


.pv-sub {
  font-family: var(--pv-serif);
  font-size: .95rem;
  color: #000;
  margin: 16px 0 8px;
  border-top: 1px solid var(--pv-line);
  padding-top: 12px;
}
.pv-sub:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }

/* ------------------------------------------------------------------ fields */

label { display: block; font-weight: 600; font-size: .92rem; color: var(--pv-ink); margin-bottom: 4px; }
.pv-help { font-size: .84rem; color: var(--pv-muted); margin: 3px 0 0; }
.pv-field { margin-bottom: 12px; }

input[type="text"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  background: var(--pv-field-bg);
  border: 1px solid var(--pv-gold);
  border-radius: var(--pv-radius);
  padding: 10px 12px;
  font-family: var(--pv-sans);
  font-size: 1rem;
  color: #333;
}
textarea { line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pv-maroon);
  box-shadow: 0 0 0 3px rgba(139, 35, 25, .12);
}
select[multiple] { min-height: 110px; padding: 6px; }
input[disabled], select[disabled], textarea[disabled] { opacity: .55; }

.pv-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  font-weight: 500;
  font-size: .93rem;
  color: var(--pv-ink);
  margin: 0 14px 6px 0;
  cursor: pointer;
}
.pv-check input { accent-color: var(--pv-maroon); width: 16px; height: 16px; margin-top: 3px; }
.pv-check span { line-height: 1.35; }

/* plain (non-associated) field label, matches the <label> look */
.pv-flabel { display: block; font-weight: 600; font-size: .92rem; color: var(--pv-ink); margin-bottom: 6px; }

/* --------------------------------------------- explanation bubbles (ⓘ) --- */
.pv-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--pv-gold);
  color: #fff;
  font-family: var(--pv-serif);
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  margin-left: 5px;
  cursor: help;
  position: relative;
  vertical-align: middle;
  flex: none;
}
.pv-info:hover { background: var(--pv-maroon); }
.pv-info::after {
  content: attr(data-tip);
  position: absolute;
  /* drop DOWN from the icon so it never collides with the masthead or the top
     of a card, and never gets clipped by an ancestor above it */
  top: 150%;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  max-width: 70vw;
  background: #241f18;
  color: #f4eee2;
  padding: 8px 11px;
  border-radius: 8px;
  font-family: var(--pv-sans);
  font-size: .8rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  /* display:none when idle so the (absolutely-positioned) bubble never adds to
     the page's scroll width; shown only on hover/focus */
  display: none;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 6px 20px rgba(32, 27, 19, .35);
}
.pv-info:hover::after,
.pv-info:focus::after { display: block; }
/* the hovered icon (and its live bubble) must sit above sibling controls */
.pv-info:hover, .pv-info:focus { z-index: 1000; }
/* edge-aware alignment (set from JS) so a bubble never runs off the screen:
   near the left edge it opens rightward, near the right edge leftward */
.pv-info.tip-left::after  { left: 0;   right: auto; transform: none; }
.pv-info.tip-right::after { left: auto; right: 0;    transform: none; }

/* ------------------------------------------------- chips (pill toggles) --- */
/* a checkbox toggle paired with its own explanation bubble */
.pv-toggle { display: inline-flex; align-items: center; gap: 1px; }
.pv-toggle .pv-check { margin: 0; }

/* Single Language Finder condition line */
.pv-cond-line { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 10px; }
.pv-cond-line .pv-col-sel { width: auto; min-width: 96px; }
.pv-cond-line .pv-cond-term { flex: 1 1 180px; min-width: 140px; }
.pv-cond-line > select { width: auto; }

.pv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-chip {
  background: var(--pv-cream);
  border: 1px solid var(--pv-line);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--pv-slate);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.pv-chip:hover { background: var(--pv-gold); color: #fff; border-color: var(--pv-gold); }
.pv-chip.is-on {
  background: var(--pv-maroon);
  color: #fff;
  border-color: var(--pv-maroon);
}
.pv-chip.is-on::before { content: "✓ "; }

/* --------------------------------------------- checklist (long option sets) */
.pv-checklist {
  border: 1px solid var(--pv-gold);
  border-radius: var(--pv-radius);
  background: var(--pv-field-bg);
  overflow: hidden;
}
.pv-checklist-search {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--pv-line);
  border-radius: 0;
  background: #fff;
  padding: 8px 12px;
  font-size: .92rem;
}
.pv-checklist-search:focus { box-shadow: none; border-bottom-color: var(--pv-maroon); }
.pv-checklist-items { max-height: 230px; overflow-y: auto; padding: 8px 12px; }
.pv-checklist-items .pv-check { display: flex; margin: 0 0 5px; font-weight: 500; }
.pv-checklist-empty { padding: 8px 4px; color: var(--pv-muted); font-size: .88rem; }

.pv-radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pv-radio-row label {
  font-weight: 500;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pv-cream);
  border: 1px solid var(--pv-line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.pv-radio-row input { accent-color: var(--pv-maroon); }

/* ----------------------------------------------------------------- buttons */

button, .pv-btn {
  font-family: var(--pv-sans);
  font-size: .95rem;
  border: 0;
  border-radius: var(--pv-radius-sm);
  padding: 10px 20px;
  cursor: pointer;
  background: var(--pv-cream-dark);
  color: var(--pv-ink);
  transition: background .15s ease, opacity .15s ease;
}
button:hover, .pv-btn:hover { background: var(--pv-gold); color: #fff; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:disabled:hover { background: var(--pv-cream-dark); color: var(--pv-ink); }

.pv-primary { background: var(--pv-maroon); color: #fff; padding: 12px 34px; font-size: 1rem; }
.pv-primary:hover { background: var(--pv-maroon-dark); color: #fff; }
.pv-gold { background: var(--pv-gold-light); color: #fff; border-radius: 10px; }
.pv-gold:hover { background: var(--pv-gold-dark); color: #fff; }
.pv-ghost { background: transparent; border: 1px solid var(--pv-gold); color: var(--pv-maroon); }
.pv-ghost:hover { background: var(--pv-cream); color: var(--pv-maroon); }
.pv-tiny { padding: 5px 10px; font-size: .82rem; border-radius: 6px; }
.pv-danger { background: #f3dcd9; color: var(--pv-maroon); }
.pv-danger:hover { background: var(--pv-maroon); color: #fff; }

.pv-btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }

/* -------------------------------------------------------------------- tabs */

.pv-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--pv-gold);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.pv-tab {
  font-family: var(--pv-serif);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 12px 24px;
  color: var(--pv-slate);
}
.pv-tab:hover { background: var(--pv-cream); color: var(--pv-maroon); }
.pv-tab.is-active { color: var(--pv-maroon); border-bottom-color: var(--pv-maroon); background: transparent; }

.pv-modes { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.pv-mode {
  font-family: var(--pv-serif);
  background: var(--pv-cream);
  border: 1px solid var(--pv-line);
  border-radius: 999px;
  padding: 9px 22px;
  color: var(--pv-slate);
}
.pv-mode.is-active { background: var(--pv-maroon); border-color: var(--pv-maroon); color: #fff; }
.pv-mode:hover { background: var(--pv-gold); border-color: var(--pv-gold); color: #fff; }

/* --------------------------------------------------------------- disclosure */

details.pv-disclosure {
  border: 1px solid var(--pv-line);
  border-radius: var(--pv-radius);
  background: var(--pv-cream);
  margin: 12px 0;
  /* visible so an explanation bubble on the summary isn't clipped */
  overflow: visible;
}
details.pv-disclosure > summary {
  cursor: pointer;
  padding: 11px 16px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--pv-ink);
  list-style: none;
}
details.pv-disclosure > summary::-webkit-details-marker { display: none; }
details.pv-disclosure > summary::before { content: "▸ "; color: var(--pv-gold-dark); }
details.pv-disclosure[open] > summary::before { content: "▾ "; }
details.pv-disclosure > .pv-disclosure-body {
  padding: 4px 16px 16px;
  background: var(--pv-white);
  border-top: 1px solid var(--pv-line);
  border-radius: 0 0 var(--pv-radius) var(--pv-radius);
}

/* ------------------------------------------------------------ pair / cond */

.pv-row {
  border: 1px solid var(--pv-line);
  border-radius: var(--pv-radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--pv-white);
}
.pv-row-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.pv-row-head strong { font-family: var(--pv-serif); font-size: 1rem; color: #000; }
.pv-row-head .pv-spacer { flex: 1; }
.pv-row-head select { width: auto; min-width: 90px; padding: 6px 10px; }

.pv-line {
  display: grid;
  grid-template-columns: 58px minmax(0, 3fr) minmax(0, 2.4fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.pv-line > .pv-line-label {
  font-family: var(--pv-serif);
  font-size: .95rem;
  color: #000;
}
@media (max-width: 820px) {
  .pv-line { grid-template-columns: minmax(0, 1fr); }
}

.pv-cond {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.5fr) minmax(0, 2.2fr) auto auto auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
@media (max-width: 1000px) {
  .pv-cond { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.pv-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 820px) { .pv-two { grid-template-columns: minmax(0, 1fr); } }

.pv-x {
  background: transparent;
  color: var(--pv-maroon);
  padding: 4px 9px;
  font-size: 1rem;
  border-radius: 6px;
}
.pv-x:hover { background: var(--pv-maroon); color: #fff; }

/* ------------------------------------------------------------------ notes */

.pv-note { font-size: .88rem; color: var(--pv-muted); margin: 6px 0; }
.pv-msg {
  border-radius: var(--pv-radius-sm);
  padding: 11px 14px;
  margin: 10px 0;
  font-size: .93rem;
  border-left: 4px solid;
}
.pv-msg.info    { background: #f2f6fa; border-color: #5b7f9e; color: #2c4459; }
.pv-msg.success { background: #eef7f0; border-color: var(--pv-ok);  color: #16532a; }
.pv-msg.warn    { background: #fdf5e3; border-color: var(--pv-gold-dark); color: #6b4c10; }
.pv-msg.error   { background: #fbeceb; border-color: var(--pv-maroon); color: #7a1a12; }

.pv-metrics { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0 16px; }
.pv-metric {
  background: var(--pv-cream);
  border: 1px solid var(--pv-line);
  border-radius: var(--pv-radius);
  padding: 10px 20px;
  min-width: 130px;
}
.pv-metric .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--pv-muted); }
.pv-metric .v { font-family: var(--pv-serif); font-size: 1.5rem; color: var(--pv-maroon); }

.pv-status { font-size: .88rem; padding: 9px 12px; border-radius: var(--pv-radius-sm); }
.pv-status.ok   { background: #eef7f0; color: #16532a; }
.pv-status.bad  { background: #fbeceb; color: #7a1a12; }

/* ------------------------------------------------------------------ tables */

.pv-scroll { overflow-x: auto; max-height: 560px; overflow-y: auto; border: 1px solid var(--pv-line); border-radius: var(--pv-radius); }
.pv-grid { border-collapse: collapse; width: 100%; font-size: .86rem; }
.pv-grid th {
  position: sticky; top: 0;
  background: var(--pv-cream-dark);
  font-family: var(--pv-serif);
  font-weight: 500;
  text-align: left;
  padding: 8px 10px;
  white-space: nowrap;
  color: #000;
}
.pv-grid td { padding: 7px 10px; border-bottom: 1px solid var(--pv-line); vertical-align: top; max-width: 460px; }
.pv-grid tr:nth-child(even) td { background: #fcfaf5; }

.pv-result-html { overflow-x: auto; }
/* Segment tables squeeze the Location column to one word per line on narrow
   viewports; give them a floor and let the wrapper scroll instead. */
.pv-result-html table { width: 100%; min-width: 780px; }
/* Column 1 is '#', column 2 is Location in both the results and the corrections
   tables — keep it from collapsing to one word per line. */
.pv-result-html td:nth-child(1), .pv-result-html th:nth-child(1) { width: 34px; }
.pv-result-html td:nth-child(2), .pv-result-html th:nth-child(2) { min-width: 165px; }
.pv-result-html th { font-family: var(--pv-serif); color: #000; }
.pv-result-html td { color: var(--pv-slate); }

pre.pv-sql {
  background: #ffffff;
  color: #000000;
  border: 1px solid var(--pv-line);
  border-radius: var(--pv-radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: .84rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
pre.pv-prompt {
  background: var(--pv-cream);
  border: 1px solid var(--pv-line);
  border-radius: var(--pv-radius);
  padding: 14px 16px;
  font-size: .84rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow-y: auto;
  margin: 0;
  color: var(--pv-ink);
}

/* --------------------------------------------------------------- word list */

.pv-wordlist {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--pv-line);
  border-radius: var(--pv-radius);
  padding: 10px 14px;
  background: var(--pv-field-bg);
}
.pv-wordlist .pv-check { display: flex; margin: 0 0 4px; }

/* -------------------------------------------------------------- progress */

.pv-progress {
  height: 10px;
  background: var(--pv-cream-dark);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}
.pv-progress > i { display: block; height: 100%; width: 0; background: var(--pv-maroon); transition: width .25s ease; }

.pv-spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(139, 35, 25, .25);
  border-top-color: var(--pv-maroon);
  border-radius: 50%;
  animation: pv-spin .7s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}
@keyframes pv-spin { to { transform: rotate(360deg); } }

.pv-busy { display: none; align-items: center; font-size: .92rem; color: var(--pv-maroon); }
.pv-busy.on { display: inline-flex; }

/* ------------------------------------------------------------- writeback */

.pv-wb-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.pv-wb-table th {
  background: var(--pv-cream-dark);
  font-family: var(--pv-serif);
  font-weight: 500;
  text-align: left;
  padding: 8px 10px;
  color: #000;
}
.pv-wb-table td { border-bottom: 1px solid var(--pv-line); padding: 7px 10px; vertical-align: top; }
.pv-wb-table tr:nth-child(even) td { background: #fcfaf5; }
.pv-wb-table textarea { min-height: 96px; font-size: .88rem; width: 100%; }

/* single corrections table: location, PaliVerse link, and the two-part diff */
.pv-loc { font-size: .8rem; color: var(--pv-muted); }
.pv-pvlink {
  display: inline-block;
  margin-top: 5px;
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
  background: var(--pv-maroon);
  border-radius: 6px;
  padding: 3px 9px;
  white-space: nowrap;
}
.pv-pvlink:hover { background: var(--pv-maroon-dark); color: #fff; text-decoration: none; }
.pv-diff-cell, .pv-corr-cell, .pv-orig-cell { font-size: .86rem; }
.pv-diff-orig { padding-bottom: 5px; margin-bottom: 5px; border-bottom: 1px dashed var(--pv-line); }
.pv-corr-edit { width: 100%; min-height: 92px; font-size: .88rem; }
#corr-unified { min-width: 920px; }

/* ------------------------------------------------ confirmation dialog --- */
.pv-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 27, 19, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.pv-modal {
  background: var(--pv-white);
  border-radius: var(--pv-radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  padding: 22px 24px;
  max-width: 460px;
  width: 100%;
  border-top: 5px solid var(--pv-maroon);
}
.pv-modal h3 { font-family: var(--pv-serif); font-size: 1.2rem; margin: 0 0 10px; color: #000; }
.pv-modal .pv-note { font-size: var(--fs-base); }

/* skipped write-back rows — richer, with the reviewed-vs-stored difference */
.pv-serious-badge {
  background: var(--pv-danger); color: #fff; border-radius: 6px;
  padding: 1px 8px; font-size: .78rem; font-weight: 600; margin-left: 8px;
}
.pv-skip {
  border: 1px solid var(--pv-line); border-radius: var(--pv-radius);
  padding: 10px 12px; margin-bottom: 10px; background: #fcfaf5;
}
.pv-skip-serious { border-left: 4px solid var(--pv-danger); background: #fbeceb; }
.pv-skip-head { margin-bottom: 6px; }
.pv-skip-diff { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.pv-skip-lbl { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pv-muted); margin-bottom: 3px; }
.pv-skip-text { font-size: .85rem; margin-bottom: 4px; }

/* startup database-mode chooser */
.pv-mode-choices { display: grid; gap: 12px; margin-top: 14px; }
.pv-mode-choice {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 14px 16px; border: 1px solid var(--pv-line); border-radius: var(--pv-radius);
  background: var(--pv-cream); cursor: pointer;
}
.pv-mode-choice:hover { border-color: var(--pv-maroon); background: #fff; }
.pv-mode-choice strong { font-family: var(--pv-serif); color: #000; font-size: 1.05rem; }
.pv-mode-choice span { font-size: .88rem; color: var(--pv-slate); font-weight: 400; }
.pv-mode-choice:disabled { opacity: .5; cursor: not-allowed; }

.pv-hidden { display: none !important; }

/* ----------------------------------------- persistent DB connection bar --- */
/* Moved out of the filters block to the foot of the shell: the connection
   status + data date + word-list rebuild, kept visible on every tab. */
.pv-connbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding: 12px 16px;
  border-top: 2px solid var(--pv-gold);
  background: var(--pv-cream);
  border-radius: var(--pv-radius-sm);
  font-size: .86rem;
}
.pv-connbar .pv-spacer { flex: 1 1 auto; }

/* ----------------------------------------------------- results pagination - */
.pv-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 14px 0 4px;
}
.pv-pager .pv-note { margin: 0; }

/* right-align the trailing button in a split action row */
.pv-btn-row-split { width: 100%; }
.pv-push-right { margin-left: auto; }

/* the fixed (read-only) SELECT … FROM prefix shown above the Raw SQL editor */
pre.pv-sql-fixed {
  background: var(--pv-cream);
  opacity: .95;
  border-style: dashed;
  margin: 0;
}

.pv-allforms { font-weight: 500; }

/* ==========================================================================
   Type normalization — one consistent scale so text sizes/weights line up
   across the whole app (sidebar, cards, tables, dialogs).
   ========================================================================== */
:root {
  --fs-xs:  0.80rem;   /* fine print, table cells        */
  --fs-sm:  0.88rem;   /* help / notes                   */
  --fs-base:0.95rem;   /* labels, controls, body copy    */
  --fs-md:  1.05rem;   /* h4 / sub-headings              */
  --fs-lg:  1.18rem;   /* card h3                        */
}

/* single base so every rem is uniform */
html { font-size: 15px; }
body { font-size: var(--fs-base); line-height: 1.55; }

/* headings — Noto Serif kept for the brand identity, sizes normalized */
.pv-strip h2      { font-size: 1.55rem; }
.pv-card > h3,
.pv-controls-title { font-size: var(--fs-lg); }
h4                { font-size: var(--fs-md); font-family: var(--pv-serif); font-weight: 500; color: #000; }

/* controls + copy — all one size, one family */
label, .pv-flabel,
.pv-check, .pv-check span,
.pv-chip, .pv-radio-row label,
button, .pv-btn,
input, select, textarea { font-size: var(--fs-base); }

.pv-help          { font-size: var(--fs-sm); }
.pv-note          { font-size: var(--fs-sm); }
.pv-mode          { font-size: var(--fs-base); }
.pv-tab           { font-size: var(--fs-base); }
.pv-metric .v     { font-size: 1.4rem; }
.pv-metric .k     { font-size: var(--fs-xs); }

/* every data table shares one cell size */
.pv-grid, .pv-wb-table, .pv-result-html table,
.pv-result-html th, .pv-result-html td { font-size: var(--fs-xs); }

/* the earlier per-widget bumps are superseded by the scale above */
.stMarkdown p { font-size: var(--fs-base); }

/* ------------------------------------------------- live query logic line -- */
.pv-logic {
  margin: 10px 0 2px;
  padding: 8px 12px;
  background: var(--pv-cream);
  border: 1px solid var(--pv-line);
  border-radius: var(--pv-radius-sm);
  font-family: var(--pv-serif);
  font-size: var(--fs-xs);
  color: var(--pv-ink);
  line-height: 1.5;
}
.pv-logic-label {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  background: var(--pv-gold);
  color: #fff;
  border-radius: 999px;
  font-family: var(--pv-sans);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pv-logic-expr { color: var(--pv-ink); }
.pv-logic-and {
  font-family: var(--pv-sans);
  font-weight: 600;
  color: var(--pv-maroon);
}
.pv-logic-scope {
  color: var(--pv-muted);
  font-family: var(--pv-sans);
  font-size: var(--fs-xs);
}

/* -------------------------------------------------------- saved searches -- */
.pv-saved-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.pv-saved-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px;
  background: var(--pv-field-bg);
  border: 1px solid var(--pv-line);
  border-radius: var(--pv-radius-sm);
}
.pv-saved-item .pv-link { flex: 1; text-align: left; }
.pv-link {
  background: none; border: none; padding: 0;
  color: var(--pv-maroon); font-family: var(--pv-serif);
  font-size: var(--fs-base); cursor: pointer;
}
.pv-link:hover { color: var(--pv-maroon-dark); text-decoration: underline; }

/* a slightly larger button (the prompt-save action) */
.pv-btn-lg { padding: 11px 20px; font-size: 1.02rem; }

/* "applies to N identical pairs" note in the corrections review table */
.pv-dup-note {
  margin: 4px 0 2px;
  color: #6b4c10;
  font-size: var(--fs-xs);
}
.pv-dup-note strong { font-weight: 700; }
