:root {
  --bg: #f4f6f9;
  --card: #fff;
  --text: #1f2933;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2f6fde;
  --accent-dark: #2358b8;
  --focus: rgba(47, 111, 222, 0.22);
  --stripe: #f7f9fc;
  --hover: #e4edfc;
  --ok: #147d64;
  --ok-soft: #d8f5e9;
  --error: #b42318;
  --error-soft: #fde4e1;
  --warn: #b54708;
  --warn-soft: #fef0c7;
  --amber-row: #fff6e0;
  --amber-row-even: #fdefcf;
  --frame: #d92d20;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
}

header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 2rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

header a {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

header a.brand {
  display: flex;
  align-items: center;
  flex: none;
  line-height: 0;
}

header a.brand svg {
  display: block;
  width: 27px;
  height: 36px;
}

header nav {
  display: flex;
  gap: 1rem;
}

header nav a {
  font-size: 0.95rem;
  font-weight: 600;
}

main {
  margin: 2rem auto;
  padding: 0 2rem;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: 1.6rem;
  font-weight: 650;
}

/* Controls */

.controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.controls label,
#scope {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-weight: 600;
}

.pay-fill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0.25rem 0 1rem;
}

.pay-fill label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-weight: 600;
}

.pay-fill input[name="year"] { width: 6rem; }

select {
  appearance: none;
  min-width: 12rem;
  padding: 0.5rem 2.25rem 0.5rem 0.8rem;
  font: inherit;
  color: var(--text);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.8rem center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  cursor: pointer;
}

select:hover { border-color: #cbd5e1; }

select:focus,
button:focus-visible,
.button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

button,
.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover,
.button:hover { background: var(--accent-dark); }

button.secondary {
  color: var(--accent);
  background: var(--card);
  border-color: var(--line);
}

button.secondary:hover { background: var(--hover); }

button:disabled,
button:disabled:hover {
  color: var(--muted);
  background: var(--bg);
  border-color: var(--line);
  cursor: default;
}

.count {
  margin: 1.1rem 0 0.6rem;
  color: var(--muted);
  font-weight: 600;
}

.count:empty { display: none; }

/* Bruce, 9 Oct 2026: the row count, net units and revenue on one line (royalties), the per-currency split on the line below. */
.count-line { margin: 1.1rem 0 0.6rem; }

.count-line .count,
.count-line .totals {
  display: inline;
  margin: 0;
}

.count-line .totals { margin-left: 0.35rem; }
.count-line .totals[hidden] { display: none; }

.totals {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.totals .split {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-weight: 400;
}

.spinner {
  width: 1.2rem;
  height: 1.2rem;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

button[hidden],
.spinner[hidden],
#scope[hidden],
#passkey-block[hidden],
#passkey-missing[hidden],
#passkey-error[hidden],
#register-error[hidden] { display: none; }

.who { margin: 0 0 0 auto; }
form.inline { display: inline; }
button.link { background: none; border: 0; color: inherit; padding: 0; cursor: pointer; text-decoration: underline; }
.login, .account { max-width: 40rem; }
.login-form label, .account form label { display: block; margin: 0.7rem 0; }
.login-form input, .account input[type="text"], .account input[type="password"], .account input:not([type]) { display: block; width: 100%; margin-top: 0.2rem; }
.signed-out { background: #fde7a8; padding: 0.6rem 1rem; }
.invite { background: var(--ok-soft); padding: 0.8rem 1rem; margin: 1rem 0; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Save messages: a small note at the bottom right. Errors stay until the next action. */

#status {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 100;
  max-width: 28rem;
  margin: 0;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 600;
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

#status.show {
  opacity: 1;
  transform: none;
}

#status.ok { color: var(--ok); background: var(--ok-soft); }
#status.error { color: var(--error); background: var(--error-soft); pointer-events: auto; }
#status.has-action { pointer-events: auto; }
#status .status-action {
  margin-left: 0.5rem;
  padding: 0.15rem 0.6rem;
  font: inherit;
  font-size: 0.9em;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  box-shadow: none;
  cursor: pointer;
}

/* Grid card, on top of the stock tabulator_modern theme */

.tabulator {
  font-size: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tabulator .tabulator-header,
.tabulator .tabulator-header .tabulator-col {
  color: #334155;
  background: #f8fafc;
  border-color: var(--line);
}

.tabulator .tabulator-header { border-bottom: 1px solid var(--line); }
.tabulator .tabulator-header .tabulator-col { border-right: 1px solid var(--line); }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: 0.55rem 0.6rem; }

.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover {
  background: #eef2f7;
}

/* The sort triangle sits on the title. Keep it above the header filter so a click on it always sorts. */
.tabulator .tabulator-header .tabulator-col .tabulator-col-title-holder,
.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter {
  z-index: 2;
}

.tabulator .tabulator-row .tabulator-cell.note-cell {
  white-space: pre-wrap;
  text-overflow: clip;
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input {
  padding: 0.25rem 0.45rem;
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus);
}

.tabulator .tabulator-row .tabulator-cell,
.tabulator .tabulator-row:nth-child(2n) .tabulator-cell {
  padding: 0.45rem 0.6rem;
  background: var(--card);
  border-right: 1px solid #f1f4f8;
}

.tabulator .tabulator-row.tabulator-row-even .tabulator-cell { background: var(--stripe); }

.tabulator .tabulator-row.deferred .tabulator-cell { background: #f4f6f8; color: #5c6b7a; }
.tabulator .tabulator-row.unresolved .tabulator-cell { background: var(--amber-row); }
.tabulator .tabulator-row.new-note { border-top: 2px dashed #c5ccd6; }
.tabulator .tabulator-row.new-note .tabulator-cell { background: #fbfcfd; color: #1f2933; }
.tabulator .tabulator-row.new-note .placeholder { color: #8a96a3; font-style: italic; }
.tabulator .tabulator-row.tabulator-row-even.unresolved .tabulator-cell { background: var(--amber-row-even); }

.tabulator .tabulator-row:hover .tabulator-cell { background: var(--hover); }
.tabulator .tabulator-row:hover .tabulator-cell:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.tabulator .tabulator-row .tabulator-cell.key { color: var(--muted); }

.tabulator .tabulator-row .tabulator-cell.tabulator-editing {
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 2px var(--focus);
  background: var(--card);
}

.tabulator .tabulator-row .tabulator-cell.saved { background: var(--ok-soft) !important; transition: background 0.3s; }
.tabulator .tabulator-row .tabulator-cell.failed { background: var(--error-soft) !important; transition: background 0.3s; }

.tabulator .tabulator-footer {
  padding: 0.35rem 0.5rem;
  color: var(--muted);
  font-weight: 600;
  background: #f8fafc;
  border-top: 1px solid var(--line);
}

.tabulator .tabulator-footer .tabulator-page,
.tabulator .tabulator-footer .tabulator-page-size {
  padding: 0.2rem 0.6rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.tabulator .tabulator-footer .tabulator-page.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.tabulator .tabulator-footer .tabulator-page:not(:disabled):hover {
  color: var(--accent);
  background: var(--hover);
}

.tabulator .tabulator-footer .tabulator-page.active:hover { color: #fff; background: var(--accent-dark); }

/* Dropdown editors and tooltips (attached to the page body, outside .tabulator) */

.tabulator-edit-list {
  font-size: 14px;
  max-height: 260px;
  padding: 0.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tabulator-edit-list .tabulator-edit-list-item {
  padding: 0.35rem 0.6rem;
  color: var(--text);
  border-radius: 6px;
}

.tabulator-edit-list .tabulator-edit-list-item.focused { outline: none; background: var(--hover); }

.tabulator-edit-list .tabulator-edit-list-item.active,
.tabulator-edit-list .tabulator-edit-list-item:hover {
  color: #fff;
  background: var(--accent);
}

.tabulator-edit-list .tabulator-edit-list-placeholder { padding: 0.5rem; color: var(--muted); }

.tabulator-tooltip {
  padding: 0.3rem 0.55rem;
  color: #fff;
  background: #1f2933;
  border-radius: 6px;
  font-size: 12px;
}

.tabulator .tabulator-row .tabulator-cell.flag-cell { color: var(--warn); }
/* A resolved flag stays visible but quiet, so it is clear the tick took */
.tabulator .tabulator-row.resolved-row .tabulator-cell.flag-cell { color: var(--muted); }
.tabulator .tabulator-row.saved-row .tabulator-cell { background: var(--ok-soft) !important; transition: background 0.3s; }

/* Defer column: one compact dropdown per flagged row ("Defer…", or "to 6 Nov" while deferred) */
.tabulator .tabulator-row .tabulator-cell.defer-cell { padding-top: 0.2rem; padding-bottom: 0.2rem; }
.tabulator .tabulator-row .tabulator-cell select.defer-select {
  width: 100%;
  min-width: 0;
  padding: 0.2rem 1.3rem 0.2rem 0.4rem;
  font-size: 0.85em;
  background-position: right 0.4rem center;
  background-size: 9px 6px;
  box-shadow: none;
  /* Clear enough to spot on a pale amber row (Bruce, 8 Oct 2026: on payments it was easy to miss) */
  border-color: #94a3b8;
  font-weight: 600;
}
.tabulator .tabulator-row.deferred .tabulator-cell select.defer-select { color: #5c6b7a; background-color: transparent; font-weight: 400; border-color: var(--line); }

/* Hovering over a flag: the flag, then any note from the server, one item per line */
.flag-tip { white-space: pre-line; max-width: 30rem; line-height: 1.45; }
/* Authors grid: the name hover is the author's current note. */
.note-tip { white-space: pre-line; max-width: 24rem; line-height: 1.45; }

/* The email editor fills the whole (wide) cell */
.tabulator .tabulator-row .tabulator-cell.email-cell input { width: 100%; box-sizing: border-box; }

.tick {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  line-height: 1.05rem;
  text-align: center;
  font-weight: 700;
  border: 2px solid var(--warn);
  border-radius: 4px;
  background: var(--card);
  cursor: pointer;
}

.tick.ticked {
  color: #fff;
  background: #94a3b8;
  border-color: #94a3b8;
}

/* Flagged (N) button next to the scope */

button.flagged {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: #fedf89;
}

button.flagged:hover { background: #fde7a8; }

button.deferred {
  color: #3d4d5c;
  background: #eef2f5;
  border-color: #d5dee6;
}

button.flagged.active {
  color: #fff;
  background: var(--warn);
  border-color: var(--warn);
}

/* Frame round every page (Bruce, 14 Oct 2026). Green when nothing is outstanding, red when a flag is
   or a download reminder is due. It never blocks a click. The green one was missing: only body.unhealthy
   drew a border, so an all-clear page had no frame at all. */

body.healthy::after,
body.unhealthy::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

body.healthy::after { border: 6px solid var(--ok); }

body.unhealthy::after { border: 6px solid var(--frame); }

/* Backup due is a modal. The frame (z-index 1000) stays visible above it. Escape and a click on the overlay do nothing. */
body[data-remind="1"] { overflow: hidden; }
.backup-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgb(0 0 0 / 30%);
}

/* Home-page reminder (Bruce, 14 Oct 2026). Its own green, so the stepper and the other buttons stay as they are. */
.save-copy {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem 0.85rem;
  background: #f4faf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
/* While the download reminder is unanswered, this box is centred above the overlay, with the same red border as the page. */
.save-copy.save-due {
  position: fixed;
  z-index: 910;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(36rem, calc(100vw - 4rem));
  margin: 0;
  background: var(--card);
  border: 6px solid var(--frame);
  text-align: center;
}
.save-due .save-actions { justify-content: center; }
.save-due .hint { margin: 0.85rem 0 0; }
.save-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.35rem 0 0.85rem; }
.save-actions form { margin: 0; }
a.yes {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--ok);
  border: 1px solid var(--ok);
  border-radius: var(--radius);
  text-decoration: none;
}
a.yes:hover,
a.yes:focus-visible { color: #fff; background: #0f6b54; border-color: #0f6b54; text-decoration: none; }
/* No thanks: dark text on a white button. */
.save-actions button.secondary {
  color: var(--text);
  background: var(--card);
  border-color: var(--line);
}
.save-actions button.secondary:hover,
.save-actions button.secondary:focus-visible {
  color: var(--text);
  background: var(--bg);
  border-color: var(--line);
}
.backup-list { padding-left: 1.1rem; }
.backup-list li { margin: 0.45rem 0; }
.backup-list .button { margin-left: 0.6rem; }

/* Home page */

.home {
  max-width: 40rem;
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.health {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
}

.health p { margin: 0; }

.health-ok { background: var(--ok-soft); }
.health-warn { background: var(--warn-soft); }

.health-failed {
  display: block;
  color: var(--error);
  background: var(--error-soft);
}

.health-icon {
  flex: none;
  width: 4rem;
  height: 4rem;
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.health-ok .health-icon { stroke: var(--ok); }
.health-ok .health-icon circle { fill: none; stroke: var(--ok); }
.health-warn .health-icon { stroke: var(--warn); }

.health-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.health-ok .health-title { color: var(--ok); }
.health-warn .health-title { color: var(--warn); }

.health-tables {
  margin: 0.5rem 0;
  padding: 0;
  list-style: none;
}

.health-tables a {
  color: var(--warn);
  font-weight: 600;
}

.health-note {
  margin: 0.25rem 0;
  color: var(--muted);
}

.health-problem {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  color: var(--error);
  background: var(--error-soft);
  border-radius: var(--radius);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.check-form { margin: 0; }

/* Suppliers help, and the import page. */

#suppliers-help {
  max-width: 46rem;
  margin: 0.5rem 0 1rem;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

#suppliers-help h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

#suppliers-help ul {
  margin: 0;
  padding-left: 1.2rem;
}

#add-supplier[hidden],
#suppliers-help[hidden],
#rates-panel[hidden] { display: none; }

#rates-panel:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin: 0.5rem 0 1rem;
}

#rates-panel form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0;
}

.flash {
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.note {
  margin: 0.4rem 0;
  color: var(--ink);
}

#add-supplier:not([hidden]) {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

#add-supplier input,
.paste-form textarea {
  padding: 0.5rem 0.7rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.paste-form textarea {
  display: block;
  width: min(100%, 52rem);
  margin: 0.75rem 0;
}

.supplier-buttons { max-width: 40rem; margin-top: 1.25rem; }

.supplier-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0.55rem 0;
  padding: 0.95rem 1.1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1f2933;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
}

.supplier-button.idle { background: #dce8f6; border-color: #b7cde8; color: #1f3a5f; }
.supplier-button.progress { background: #f8e3c8; border-color: #e8c28f; color: #6b4210; }
.supplier-button.done { background: #d4ebdb; border-color: #a7d3b3; color: #1d5a30; }
.supplier-button.problem { background: #e6e1f5; border-color: #c4b8e8; color: #3f2d76; } /* not red: Bruce, 9 Oct 2026 */
.supplier-state { font-size: 1rem; }

.import-heading,
.not-saved,
.tick-banner,
.limits {
  font-size: 1.35rem;
  font-weight: 700;
}

.tick-banner {
  color: var(--ok);
  background: var(--ok-soft);
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
}

/* Import pages (Bruce, 9 Oct 2026): no red. Points to look at are amber with dark text; a stop is a calm blue. */
.attention-list {
  margin: 1rem 0;
  padding: 1rem 1rem 1rem 2rem;
  font-size: 1.15rem;
  color: #3d2e05;
  background: #fff4d1;
  border-left: 6px solid #e0a800;
  border-radius: var(--radius);
}

.attention-list li { margin: 0.35rem 0; }
.attention-list strong { color: #3d2e05; }
.headers-mismatch { padding-left: 1rem; }
.headers-mismatch p { margin: 0.4rem 0; }
.headers-mismatch a { color: #1f3a5f; font-weight: 600; }
.headers-details { margin-top: 0.6rem; font-size: 0.95rem; }
.headers-details summary { cursor: pointer; color: #1f3a5f; }

.import-stop {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  color: #1f3a5f;
  background: #e3edf9;
  border-left: 6px solid #6b93c9;
  border-radius: var(--radius);
}

.paste-tip {
  max-width: 52rem;
  margin: 0.5rem 0;
  padding: 0.6rem 0.9rem;
  color: #1f3a5f;
  background: #e3edf9;
  border-radius: var(--radius);
}

.problems {
  margin: 1rem 0;
  padding: 1rem 1rem 1rem 2rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--error);
  background: var(--error-soft);
  border-radius: var(--radius);
}

.limits {
  padding: 0.9rem 1.2rem;
  background: var(--ok-soft);
  border-radius: var(--radius);
}

.import-stats {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.35rem 1rem;
  margin: 1.25rem 0;
}

.import-stats div { display: contents; }
.import-stats dt { color: var(--muted); font-weight: 600; }
.import-stats dd { margin: 0; font-weight: 650; }

.not-saved { margin: 1.25rem 0; }

button.danger {
  background: var(--error);
  border-color: var(--error);
}

.delete-import {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  background: var(--error-soft);
  border-radius: var(--radius);
}

.add-form {
  display: grid;
  gap: 0.9rem;
  max-width: 36rem;
  margin-top: 1rem;
}

.add-field label {
  display: block;
  font-weight: 650;
}

.add-field.optional label { color: var(--muted); font-weight: 500; }

.add-field input,
.add-field select {
  width: 100%;
  margin-top: 0.2rem;
}

.add-field.bad input,
.add-field.bad select {
  outline: 2px solid var(--error);
}

.req {
  margin-left: 0.4rem;
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 700;
}

.quiet, .hint {
  color: var(--muted);
  font-weight: 400;
}

.hint { margin: 0.2rem 0 0; font-size: 0.9rem; }

.companions {
  max-width: 36rem;
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tabulator-row.just-added { background: var(--ok-soft); }

.archive-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.archive-choice label { font-weight: 650; }
.archive-query { flex-basis: 100%; }
.archive-query input { margin-left: 0.35rem; min-width: 16rem; font-weight: 400; }
.archive-entry h2 { font-size: 1rem; margin: 0 0 0.4rem; }
.archive-choice select { margin-left: 0.35rem; font-weight: 400; }

.archive-entry {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.archive-entry summary { cursor: pointer; font-weight: 650; }
.archive-bad { color: var(--error); font-weight: 650; }
.archive-raw-toggle { margin-left: 1rem; font-weight: 400; }
.archive-raw {
  max-height: 16rem;
  overflow: auto;
  padding: 0.8rem;
  background: var(--stripe);
  white-space: pre;
}
.archive-search { margin-left: 0.35rem; }

.archive-scroll { max-height: 28rem; overflow: auto; margin-top: 0.6rem; }
.archive-scroll table { border-collapse: collapse; font-size: 0.85rem; }
.archive-scroll td {
  padding: 0.2rem 0.55rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.archive-scroll tr.archive-header td {
  position: sticky;
  top: 0;
  background: var(--card);
  font-weight: 650;
  box-shadow: inset 0 -1px var(--line);
}
.archive-num { color: var(--muted); text-align: right; }

.notice {
  margin: 0 0 1rem;
  padding: 0.55rem 0.8rem;
  background: var(--warn-soft);
  border-radius: var(--radius);
}

.earnings-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 1rem 0 0.4rem;
  font-variant-numeric: tabular-nums;
}

.earnings-summary strong { font-size: 1.35rem; }

#earnings-count { color: var(--muted); }

#earnings-grid { max-width: 100%; }

/* Flags (Bruce, 11 Oct 2026): a short table, about 80% of the page. The stepper is not touched. */
#flags-grid { width: 80%; }
#flags-grid .tabulator-row { cursor: pointer; }
#flags-grid .tabulator-row.rule-off .tabulator-cell { color: var(--muted); background: #f3f4f6; }
#flags-grid .tabulator-row.rule-off a { color: var(--muted); }
#flags-grid .tabulator-row.rule-off a.flag-action { color: var(--accent); }
#flags-grid a.flag-action {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  cursor: pointer;
  text-decoration: none;
}
#flags-grid button.flag-action:hover,
#flags-grid a.flag-action:hover { background: var(--hover); color: var(--accent-dark); }

.footnote { color: var(--muted); margin-top: 0.8rem; }


header nav .nav-soon { font-size: 0.95rem; font-weight: 600; color: var(--muted); cursor: default; }

/* Main menu: Data and Statements open on click (public/menu.js) */
header nav.menu { align-items: center; gap: 0.25rem; }
.menu-group { display: flex; align-items: center; gap: 0.25rem; }
.menu-split { margin: 0 0.85rem; color: #c5ccd4; font-weight: 400; user-select: none; }
header nav[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.menu-drop { position: relative; }
header nav .menu-button,
header nav .menu-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--accent);
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
}
header nav .menu-button:hover,
header nav .menu-link:hover,
header nav .menu-button[aria-expanded="true"] { background: var(--hover); }
header nav .current > .menu-button,
header nav .menu-link.current { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; } /* Bruce, 8 Oct 2026: active item = a plain underline */
.menu-button .caret { font-size: 0.75em; color: var(--muted); }
.menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 50;
  min-width: 15rem;
  padding: 0.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 8px 24px rgba(15, 23, 42, 0.12);
}
.menu-panel[hidden] { display: none; }
header nav .menu-panel a,
header nav .menu-panel .nav-soon {
  display: block;
  padding: 0.4rem 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--text);
  border-radius: 6px;
  white-space: nowrap;
}
header nav .menu-panel a:hover,
header nav .menu-panel a:focus-visible { background: var(--hover); outline: none; }
header nav .menu-panel a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
header nav .menu-panel .nav-soon { color: var(--muted); font-weight: 500; }
.menu-label {
  margin: 0.4rem 0.7rem 0.15rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.menu-quiet { display: grid; grid-template-columns: 1fr 1fr; }
header nav .menu-quiet a { padding: 0.25rem 0.7rem; font-size: 0.85rem; font-weight: 400; color: var(--muted); }
header nav .menu-quiet a:hover { color: var(--text); }
header nav .menu-quiet .menu-report {
  grid-column: 1 / -1;
  margin-bottom: 0.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--line);
  border-radius: 6px 6px 0 0;
}

/* Run all checks sits in the Health Checks menu (Bruce, 14 Oct 2026). It runs the thorough check. */
#menu-health { min-width: 16.5rem; }
.menu-run { margin: 0.35rem 0.35rem 0.15rem; padding-top: 0.45rem; border-top: 1px solid var(--line); }
.menu-run button {
  width: 100%;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.menu-run button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* Content links (Bruce, 14 Oct 2026): the accent colour, no underline until hover.
   The stepper, solid buttons and the statement sheet keep their own look. */
main :where(a:not(.button, .yes, .mk-step, .supplier-button, .btn, .stmt a)) {
  color: var(--accent);
  text-decoration: none;
}
main :where(a:not(.button, .yes, .mk-step, .supplier-button, .btn, .stmt a)):hover,
main :where(a:not(.button, .yes, .mk-step, .supplier-button, .btn, .stmt a)):focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
.tabulator a.cell-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.tabulator a.cell-link:hover,
.tabulator a.cell-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

/* Add button and side panel on /view (public/add.js), like the notes panel in the to-do app */
.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.add-open { min-width: 6rem; }
.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 25, 50, 0.25);
}
.scrim[hidden] { display: none; }
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: min(440px, 100vw);
  padding: 16px 18px 24px;
  overflow-y: auto;
  background: var(--card);
  box-shadow: -8px 0 30px rgba(20, 25, 50, 0.2);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.18s, visibility 0s 0.18s;
}
.side-panel.open {
  transform: none;
  visibility: visible;
  transition: transform 0.18s;
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.side-head h2 { margin: 0; font-size: 1.15rem; color: var(--accent); }
button.icon {
  padding: 0.25rem 0.55rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
}
button.icon:hover { color: var(--text); background: var(--hover); }
.side-panel .add-form { max-width: none; }
.side-panel .problems { font-size: 1rem; }
.side-panel .companions { max-width: none; }
.tabulator .tabulator-row.just-added .tabulator-cell { background: var(--ok-soft); }
/* Add panel fields (Bruce, 7 Oct 2026): a little taller, with larger text. 16px also stops iPhone Safari zooming in on a field. */
.add-field input:not([type="checkbox"]) {
  box-sizing: border-box;
  height: 40px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.add-field select {
  box-sizing: border-box;
  height: 40px;
  font-size: 16px;
}
.add-field label { margin-bottom: 0.1rem; }
.add-field input:not([type="checkbox"]):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}
.add-field.bad input:focus { outline: 2px solid var(--error); }
.add-field input[type="checkbox"] { display: block; width: auto; margin-top: 0.35rem; }
/* Royalty rate: the rates already used, most common first, with Other… for a new one (grid list and add panel). */
.add-field .rate-pick { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.2rem; }
.add-field .rate-pick select { width: auto; flex: 0 1 16rem; margin-top: 0; }
.add-field .rate-pick input.rate-other { width: 7rem; margin-top: 0; }
.add-field .rate-pick [hidden] { display: none; }
.tabulator-edit-list .rate-count { float: right; margin-left: 1.5rem; color: var(--muted); font-size: 0.85em; }
.tabulator-edit-list .tabulator-edit-list-item.active .rate-count,
.tabulator-edit-list .tabulator-edit-list-item:hover .rate-count { color: inherit; opacity: 0.8; }

/* Delete x at the end of a row (tables that opt in, e.g. zones): grey, red on hover */
.tabulator .tabulator-row .tabulator-cell.delete-cell { padding-left: 0; padding-right: 0; }
.delete-x { display: inline-block; padding: 0 0.35rem; color: #94a3b8; font-size: 1.15rem; line-height: 1; cursor: pointer; border-radius: 4px; }
.delete-x:hover { color: #dc2626; background: #fee2e2; }

/* Flash after a page action: green when it worked, red when it did not */
.flash.ok { background: var(--ok-soft); border-color: #a6e3b8; }
.flash.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* A button that is waiting on the server */
button.busy::before { content: ""; display: inline-block; width: 0.8em; height: 0.8em; margin-right: 0.5em; vertical-align: -0.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }

/* health_checks (Bruce, 8 Oct 2026): active as an on/off switch, description edited in a wrapping box, snooze date picker with Clear. */
.switch { display: inline-block; position: relative; width: 2.2rem; height: 1.2rem; border-radius: 0.6rem; background: #c8c8c8; cursor: pointer; vertical-align: middle; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 0.15rem; left: 0.15rem; width: 0.9rem; height: 0.9rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: left 0.15s; }
.switch.on { background: #2e8b57; }
.switch.on::after { left: 1.15rem; }
textarea.text-edit { width: 100%; box-sizing: border-box; padding: 4px; font: inherit; resize: none; white-space: pre-wrap; }
.date-edit { display: flex; gap: 4px; align-items: center; }
.date-edit input { font: inherit; padding: 2px; }
.date-edit button { font-size: 0.8rem; padding: 1px 6px; }

/* Add panel hints (Bruce, 8 Oct 2026): hidden until the label or the box is hovered, or the box has focus (touch screens), then a
   small tooltip just above the field, so it never covers what is being typed. Problems at the top of the form stay as they are. */
.add-field { position: relative; }
.add-field .field-tip {
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  z-index: 20;
  max-width: min(26rem, 100%);
  margin: 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #fff;
  background: #334155;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
.add-field .field-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 1rem;
  border: 6px solid transparent;
  border-top-color: #334155;
}
.add-field:focus-within:not(.tip-quiet) .field-tip,
.add-field:has(label:hover, input:hover, select:hover, textarea:hover) .field-tip { display: block; }

/* Home page (Bruce, 8 Oct 2026): all clear, or a short list of flags by table. */
.allclear { text-align: center; margin: 0.5rem 0 1.5rem; }
.allclear-icon { width: 6rem; height: 6rem; }
.allclear-icon circle { fill: var(--ok); }
.allclear-icon path { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.allclear-title { margin: 0.5rem 0 0.25rem; font-size: 2rem; color: var(--ok); }
.allclear-note { margin: 0; font-size: 1.1rem; color: var(--muted); }
.backup-icon { width: 6rem; height: 6rem; }
.backup-title { margin: 0.5rem 0 0.25rem; font-size: 2rem; color: #E8A33D; }
.home-facts { display: grid; gap: 0.6rem; margin: 0 0 1.25rem; font-size: 1.1rem; }
.home-facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.9rem; background: var(--stripe); border-radius: var(--radius); }
.home-facts dt { color: var(--muted); }
.home-facts dd { margin: 0; font-weight: 600; text-align: right; }
.insight { margin: 0 0 1rem; padding: 0.9rem 1rem; font-size: 1.1rem; line-height: 1.45; background: var(--hover); border-left: 4px solid var(--accent); border-radius: var(--radius); }
.flags-title { margin: 0 0 0.25rem; font-size: 1.8rem; color: var(--warn); }
.flags-note { margin: 0.5rem 0; font-size: 1.05rem; color: var(--muted); }
.home p a:not(.button, .yes), .home dd a:not(.button, .yes) { color: var(--accent); text-decoration: none; }
.home p a:not(.button, .yes):hover, .home dd a:not(.button, .yes):hover, .home p a:not(.button, .yes):focus-visible, .home dd a:not(.button, .yes):focus-visible {
  text-decoration: underline; text-underline-offset: 0.15em;
}
.flag-list { margin: 0.75rem 0 1rem; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); }
.flag-list li + li { border-top: 1px solid var(--line); }
.home .flag-list a { display: flex; justify-content: space-between; padding: 0.7rem 1rem; font-size: 1.15rem; text-decoration: none; }
.home .flag-list a:hover { background: var(--hover); }
.flag-count { min-width: 2.5rem; padding: 0.05rem 0.6rem; font-weight: 700; text-align: center; color: var(--warn); background: var(--warn-soft); border-radius: 999px; }
.deferred-note { font-size: 0.95rem; }
/* Make statements (Bruce, 8 Oct 2026; 22 Oct 2026): seven steps down the left, the step's work in the middle. */
.mk-head { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.mk-head h1 { margin-right: auto; }
.mk-badge { background: var(--ok-soft); color: var(--ok); border-radius: 999px; padding: 0.2rem 0.8rem; font-weight: 600; }
.mk { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-top: 1rem; }
.mk-steps { display: flex; flex-direction: column; gap: 0.5rem; position: sticky; top: 1rem; }
.mk-step { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.9rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--card); color: var(--text); text-decoration: none; font-weight: 600; }
.mk-step .mk-dot { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: #e5e7eb; color: #475569; font-size: 0.9rem; flex: none; }
.mk-step.done { border-color: #9fd8c2; background: var(--ok-soft); }
.mk-step.done .mk-dot { background: var(--ok); color: #fff; }
.mk-step.locked { opacity: 0.45; cursor: not-allowed; }
.mk-step.current { outline: 3px solid var(--accent); outline-offset: 1px; }
a.mk-step:hover { background: var(--hover); }
a.mk-step.done:hover { background: #c4eedb; }
.mk-body { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.5rem 1.5rem; min-height: 320px; }
.mk-body h2 { margin-top: 0; }
.mk-q { color: var(--muted); font-weight: 400; font-size: 0.9em; margin-left: 0.4rem; }
.mk-ok { color: var(--ok); font-weight: 600; }
.mk-bad, .mk-problems .bad, .mk-list .bad, #send-grid .bad { color: var(--error); font-weight: 600; }
.mk-list .ok { color: var(--ok); font-weight: 700; }
.mk-note { background: var(--warn-soft); border-radius: var(--radius); padding: 0.7rem 1rem; }
.mk-small { color: var(--muted); font-size: 0.92rem; }
.mk-list, .mk-problems { padding-left: 1.2rem; line-height: 1.8; }
/* Check step (Bruce, 9 Oct 2026): each rule in plain words with the rows it found under it; calm colours, no red. */
.mk-check > li { margin-bottom: 0.6rem; }
.mk-check .mk-attn { color: var(--warn); font-weight: 600; }
.mk-check .mk-count, .mk-check .mk-why { color: var(--muted); }
.mk-items { list-style: none; padding-left: 0.9rem; margin: 0.15rem 0 0; line-height: 1.6; border-left: 3px solid var(--warn-soft); }
.mk-items li { font-size: 0.95rem; }
.mk-items .mk-more a { color: var(--muted); }
/* Resolved tickbox after each item (Bruce, 9 Oct 2026): small and calm; a resolved row greys and strikes through. */
.mk-resolve { display: inline-flex; align-items: center; gap: 0.25rem; margin-left: 0.5rem; color: var(--muted); font-size: 0.88rem; cursor: pointer; white-space: nowrap; }
.mk-resolve input { margin: 0; width: 0.95rem; height: 0.95rem; accent-color: var(--ok); cursor: pointer; }
.mk-item.mk-resolved > a { color: var(--muted); text-decoration: line-through; }
.mk-item.mk-resolved .mk-resolve { color: var(--ok); }
.mk-undo-wrap { color: var(--muted); font-size: 0.88rem; }
.mk-no-tick { color: var(--muted); font-size: 0.85rem; cursor: help; margin-left: 0.3rem; }
.mk-tick-error { background: var(--warn-soft); border-radius: var(--radius); padding: 0.5rem 0.9rem; }
#mk-check-again.mk-ready { box-shadow: 0 0 0 3px var(--ok-soft); }
.mk-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 1rem; }
.mk-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin: 0.75rem 0; }
.mk-review { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 0.75rem 0 1rem; }
.mk-review input[type=search] { min-width: 220px; }
.mk-preview { border-radius: var(--radius); padding: 1px 12px; max-height: 75vh; overflow: auto; }
.mk-preview .sheet { margin: 16px auto; }
.mk-preview header.mast { padding: 0 0 22px; background: none; } /* the statement's own header, not the page header above */
.mk-summary { border-collapse: collapse; margin: 0.75rem 0 1rem; min-width: 380px; }
.mk-summary th, .mk-summary td { padding: 0.45rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; }
.mk-summary td { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.mk-publish { border: 2px solid var(--warn); border-radius: var(--radius); padding: 0.8rem 1rem 1rem; max-width: 640px; }
.mk-publish label { display: block; margin: 0.6rem 0; }
.mk-newlink { border: 2px solid var(--accent); border-radius: var(--radius); padding: 0.6rem 1rem; margin: 0.75rem 0; }
.mk-newlink input { width: min(100%, 560px); }
a.button, a.button:hover, a.button:focus-visible { display: inline-block; text-decoration: none; color: #fff; }
button.secondary-solid { background: #475569; border-color: #475569; color: #fff; }
button.secondary-solid:hover { background: #334155; }
button.small { padding: 0.25rem 0.6rem; font-size: 0.85rem; }
#send-grid form.inline { display: inline; }
@media (max-width: 760px) { .mk { grid-template-columns: 1fr; } .mk-steps { position: static; flex-direction: row; flex-wrap: wrap; } }

/* Make statements: warnings, trial banner, old-vs-new comparison (Bruce, 8 Oct 2026) */
.mk-warn { margin: 0.75rem 0; padding: 0.6rem 0.8rem; border: 1px solid #d9a400; background: #fff8db; border-radius: 8px; }
.mk-trial { border-color: #c2410c; background: #fff1e6; }
.mk-compare { border-collapse: collapse; margin: 0.5rem 0 1rem; font-size: 0.9rem; }
.mk-compare th, .mk-compare td { padding: 0.25rem 0.6rem; border-bottom: 1px solid #e5e5e5; text-align: right; }
.mk-compare th:first-child, .mk-compare td:first-child { text-align: left; }
.mk-compare tr.match td { background: #ecfdf3; }
.mk-compare tr.differs td { background: #fff1f0; }

/* Search boxes on the author royalty add form (Bruce, 9 Oct 2026): type a few letters, pick from the list under the box (all matches; it scrolls). */
.add-field .search-pick { position: relative; }
.add-field .search-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  max-height: 300px; /* every match is listed (Bruce, 9 Oct 2026); the list scrolls */
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 0.2rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}
.add-field .search-list[hidden] { display: none; }
.add-field .search-pick .search-input { padding-right: 1.8rem; }
.add-field .search-toggle {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 0.45rem;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  cursor: pointer;
}
.add-field .search-toggle:hover { color: var(--text); background: none; }
.add-field .search-list li { padding: 0.35rem 0.75rem; cursor: pointer; line-height: 1.3; }
.add-field .search-list li.active,
.add-field .search-list li[data-k]:hover { background: var(--hover); }
.add-field .search-list li.search-none { color: var(--muted); cursor: default; }
.add-field .search-meta { margin-left: 0.6rem; color: var(--muted); font-size: 0.8rem; }

/* Printing the Review step of Make statements (Bruce, 9 Oct 2026): only the statement, no menu, steps, form or buttons.
   Everything that neither holds the statement nor is inside it is hidden; what holds it loses its spacing. */
@media print {
  body:has(.mk-preview) *:not(:has(.mk-preview)):not(.mk-preview):not(.mk-preview *) { display: none !important; }
  body:has(.mk-preview), body:has(.mk-preview) *:has(.mk-preview) {
    display: block !important; margin: 0 !important; padding: 0 !important; border: 0 !important;
    box-shadow: none !important; background: #fff !important; max-width: none !important; width: auto !important;
  }
  .mk-preview { max-height: none !important; overflow: visible !important; padding: 0 !important; border: 0 !important; }
  .mk-preview .sheet { margin: 0 !important; }
  body:has(.mk-preview)::before, body:has(.mk-preview)::after { display: none !important; }
}

/* Row panel on a table grid (Bruce, 11 Oct 2026): the grid stays beside it, like an inbox. */
:root { --row-panel: 460px; }
body.row-panel-open main { margin-right: min(var(--row-panel), 100vw); }
.row-panel { width: min(var(--row-panel), 100vw); }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.25rem 0 0.35rem; }
.row-actions .resolve-big {
  font-size: 1.05rem;
  padding: 0.55rem 1.05rem;
  color: #fff;
  background: var(--ok);
  border-color: var(--ok);
}
.row-actions .resolve-big:hover { background: #0f6b54; border-color: #0f6b54; }
.row-actions .resolve-big:disabled { color: var(--muted); background: var(--ok-soft); border-color: var(--ok-soft); }
.row-keys { margin: 0 0 0.85rem; color: var(--muted); font-size: 0.85rem; }
.row-flag {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  background: var(--amber-row);
  border-radius: 8px;
}
.row-flag h3 { margin: 0.65rem 0 0.15rem; font-size: 1rem; }
.row-flag h3:first-child { margin-top: 0; }
.row-flag p { margin: 0; white-space: pre-wrap; }
.row-flag .row-note { margin-top: 0.65rem; color: var(--muted); }
.row-links { margin: 0 0 1rem; }
.row-links a { font-weight: 650; }
.row-fields { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.35rem 0.75rem; margin: 0; }
.row-fields dt { margin: 0; color: var(--muted); }
.row-fields dd { margin: 0; }
.row-fields input {
  box-sizing: border-box;
  width: 6.5rem;
  height: 36px;
  padding: 0.3rem 0.6rem;
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.row-fields input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.row-fields input[type="checkbox"] { width: 1.15rem; height: 1.15rem; padding: 0; box-shadow: none; }
.row-fields .note-span { grid-column: 1 / -1; }
.row-fields textarea.row-note-edit {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 9rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
  white-space: pre-wrap;
}
.row-fields textarea.row-note-edit:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.row-fields .row-note-save { margin-top: 0.5rem; }
.row-save-msg { margin: 0.55rem 0 0; color: var(--muted); font-size: 0.92rem; }
.tabulator .tabulator-row.panel-row .tabulator-cell,
.tabulator .tabulator-row.panel-row.unresolved .tabulator-cell,
.tabulator .tabulator-row.tabulator-row-even.panel-row .tabulator-cell,
.tabulator .tabulator-row.tabulator-row-even.panel-row.unresolved .tabulator-cell {
  background: #dbe7fb;
  box-shadow: inset 4px 0 0 var(--accent);
}
