/* SFDC Logged portal - design tokens + layout.
   Token system only: no raw values below the :root blocks. */

:root {
  --font: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --bg: #f4f4f2;
  --panel: #ffffff;
  --panel-2: #fafaf8;
  --ink: #14171a;
  --ink-2: #5c646d;
  --ink-3: #8a9099;
  --line: #e2e2de;
  --line-2: #ecece9;
  --accent: #14171a;
  --accent-ink: #ffffff;
  --ok: #0f6f43;
  --ok-bg: #e7f2eb;
  --ok-line: #c9e2d3;
  --err: #a3301c;
  --err-bg: #f7ebe8;
  --err-line: #e7cdc6;
  --warn: #7a5200;
  --warn-bg: #f7f0dd;
  --warn-line: #e8ddc0;
  /* The "No prior stage" marker: a stronger orange than warn. */
  --nps: #b4560e;
  --nps-bg: #fdf0e3;
  --nps-line: #f0d3b5;
  --chg: #b42318;

  --r: 4px;
  --r-lg: 8px;
  --sp: 16px;
  --fs: 14px;
  --fs-sm: 13px;
  --fs-xs: 11px;
  --shadow: 0 1px 2px rgba(20, 23, 26, 0.05);
  --cell-x: 6.5px;
  --cell-sub-max: 160px;
  --stage-max: 150px;
  --select-max: 220px;
  /* Tracking dropdowns in a row, and the Reason not logged cell. */
  --mkt-indent: 18px;
  --cellsel-min: 140px;
  --cellsel-max: 160px;
  --reason-max: 200px;
  --reason-min-h: 72px;
  --reason-min: 110px;
  --head-wrap-max: 130px;
  --wrap-max: 1760px;
  /* The table scrolls inside its own box so the column header can stick:
     the box is one screen tall minus a strip of page chrome above it. */
  --table-max-h: calc(100vh - 64px);
  /* A pinned edge casts a soft shadow while more of the table is hidden
     behind it, so a cut-off column reads as "scroll", not as broken. */
  --scroll-cue-ink: rgba(20, 23, 26, 0.1);
  --scroll-cue-w: 10px;
}

html[data-theme="dark"] {
  --bg: #0e1013;
  --panel: #14171a;
  --panel-2: #17191d;
  --ink: #e9ebee;
  --ink-2: #9aa2ab;
  --ink-3: #6c747d;
  --line: #262a2f;
  --line-2: #1d2126;
  --accent: #e9ebee;
  --accent-ink: #0e1013;
  --ok: #4cc38a;
  --ok-bg: #12271d;
  --ok-line: #1e4031;
  --err: #e68b78;
  --err-bg: #2a1712;
  --err-line: #4a2a22;
  --warn: #d9a94e;
  --warn-bg: #292212;
  --warn-line: #4a3d1d;
  --nps: #e08a4f;
  --nps-bg: #2a1b11;
  --nps-line: #4a2e1c;
  --chg: #f97066;
  --shadow: none;
  --scroll-cue-ink: rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------ chrome */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp);
  height: 48px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: var(--fs); }
.brand .mark { width: 10px; height: 10px; background: var(--accent); display: inline-block; }
.brand .sep { color: var(--ink-3); }
.brand-sub { color: var(--ink-2); }
.top-right { display: flex; align-items: center; gap: 10px; }
.user { color: var(--ink-2); font-size: var(--fs-sm); }

/* Narrow screens: the header now carries the account chip, Audit and Sign out.
   Drop the decorative brand suffix and the name so the bar never overflows. */
@media (max-width: 560px) {
  .topbar { gap: 8px; }
  .brand-sub, .brand .sep { display: none; }
  .top-right { gap: 6px; }
  .top-right .user { display: none; }
}

.wrap { max-width: var(--wrap-max); margin: 0 auto; padding: calc(var(--sp) * 1.5) var(--sp) calc(var(--sp) * 3); }

.headline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp);
  margin-bottom: calc(var(--sp) * 1.25);
}
.headline h1 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -0.01em; }
.headline .sub { margin: 4px 0 0; color: var(--ink-2); font-size: var(--fs-sm); }

/* ------------------------------ stat bar */

.statbar {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: var(--sp);
}
.stat {
  padding: 10px 18px;
  border-right: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.stat:last-child { border-right: 0; }
.stat-n { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat-l { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.stat-wide { margin-left: auto; text-align: right; }

/* ------------------------------ toolbar */

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: var(--sp);
  flex-wrap: wrap;
}
.toolbar input[type="search"] {
  flex: 1 1 280px;
  min-width: 220px;
}
input, select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-sm);
  outline: none;
}
input::placeholder { color: var(--ink-3); }
input:focus-visible, select:focus-visible { border-color: var(--ink-2); }
.toolbar select { max-width: var(--select-max); }

.pchecks { display: inline-flex; gap: 6px; }
.pcheck {
  height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--ink-3);
  font-size: var(--fs-sm);
  font-weight: 550;
  cursor: pointer;
  user-select: none;
}
.pcheck:hover { border-color: var(--ink-3); }
.pcheck:has(input:checked) { background: var(--panel-2); border-color: var(--ink-3); color: var(--ink); }
.pcheck input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); cursor: pointer; }

/* ------------------------------ tabs */

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--sp); }
.tab {
  height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { background: var(--panel-2); border-color: var(--ink-3); }
.tab:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 1px; }
.tab.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tcount {
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  background: var(--line-2);
  color: var(--ink-2);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 7px;
}
.tab.is-active .tcount { background: transparent; border-color: currentColor; color: var(--accent-ink); }

/* ------------------------------ buttons */

.btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-2); border-color: var(--ink-3); }
.btn:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 1px; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { opacity: 0.88; }
.btn.ghost { background: transparent; }
.btn.tiny { height: 26px; padding: 0 10px; font-size: 12px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: var(--fs-sm); }

/* ------------------------------ table */

.tablewrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: auto;
  max-height: var(--table-max-h);
}
.grid { width: 100%; max-width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.grid th {
  position: sticky;
  top: 0;
  background: var(--panel);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 10px var(--cell-x);
  /* A collapsed border scrolls away from a sticky cell; an inset shadow
     stays with it. */
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--line);
  white-space: nowrap;
  z-index: 2;
}
/* Sortable headers: the label is a button; the arrow shows the active sort. */
.grid th .sort {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.grid th .sort:hover { color: var(--ink-2); }
/* Long labels wrap to two lines so their columns stay as narrow as their
   content; every label sits on the header's bottom line. */
.grid th { vertical-align: bottom; }
.grid th.th-wrap .sort { white-space: normal; max-width: var(--head-wrap-max); }
.grid th .sort:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; border-radius: 2px; }
.grid th[aria-sort="ascending"], .grid th[aria-sort="descending"] { color: var(--ink); }
.grid th[aria-sort="ascending"] .sort::after { content: "\2191"; }
.grid th[aria-sort="descending"] .sort::after { content: "\2193"; }
.grid td {
  padding: 10px var(--cell-x);
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}
.grid tbody tr:focus-visible { outline: 2px solid var(--ink-2); outline-offset: -2px; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: var(--panel-2); }
/* A queue row whose CA is a blocked manager name: red edge + pill. */
.grid tbody tr.row-flag td:first-child { border-left: 3px solid var(--err); }
.grid .empty { text-align: center; color: var(--ink-3); padding: 40px 12px; cursor: default; }
.grid tbody tr.empty-row:hover td { background: transparent; }

.cell-main { font-weight: 550; }
.cell-sub { color: var(--ink-3); font-size: 12px; margin-top: 1px; max-width: var(--cell-sub-max); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Stage names wrap (full text, no ellipsis) inside a narrow column. */
.stage-cell { color: var(--ink-2); max-width: var(--stage-max); }
/* The "No prior stage" pill stacks under the stage text so the widest
   flagged row does not widen the column. */
.stage-cell .pill { display: block; margin-top: 2px; width: fit-content; font-size: 10.5px; padding: 0px 6px; }
/* The "No prior stage" flag: an orange "!" badge on an orange-highlighted
   stage cell. */
.stage-cell.nps { background: var(--nps-bg); border-left: 3px solid var(--nps); border-radius: 4px; padding: 4px 7px; }
.stage-cell .pill.nps { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; margin-top: 3px; font-size: 12px; font-weight: 700; color: var(--nps); background: var(--nps-bg); border-color: var(--nps-line); }
/* The stage filter: a checkbox multiselect in a popover. */
.ms { position: relative; }
.ms-btn { height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--ink); font-family: var(--font); font-size: var(--fs-sm); cursor: pointer; }
.ms-btn.is-on { border-color: var(--ink-2); font-weight: 550; }
.ms-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; min-width: 230px; max-height: 320px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 4px; box-shadow: 0 10px 28px rgba(10, 12, 15, 0.18); }
.ms-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: var(--fs-sm); color: var(--ink); cursor: pointer; white-space: nowrap; }
.ms-item:hover { background: var(--panel-2); }
.ms-clear { display: block; width: 100%; text-align: left; padding: 6px 8px; border: 0; border-bottom: 1px solid var(--line); margin-bottom: 4px; background: transparent; color: var(--ink-2); font-family: var(--font); font-size: var(--fs-sm); cursor: pointer; }
.ms-clear:hover { color: var(--ink); }
/* A changed value: the current one in red, the first-seen original under it. */
.kv dd.chg { color: var(--chg); font-weight: 600; }
.kv dd.chg .was, .was { color: var(--ink-3); font-weight: 400; }
.was { display: block; font-size: 12px; margin-top: 1px; }
/* The ENT form submission log in the card. */
.sub-entry { border-top: 1px solid var(--line); padding: 8px 0; }
.sub-entry:first-of-type { border-top: 0; padding-top: 2px; }
.sub-head { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.chg-line { font-size: 13px; color: var(--ink-2); }
.chg-line b { color: var(--chg); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
/* The meeting cell keeps its date on one line, with the time under it. */
td.num { white-space: nowrap; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

/* The action column hugs its buttons and stays pinned to the right edge
   when the table is wider than the screen, so Mark logged is always in
   reach. */
/* Company stays pinned to the left edge while the table scrolls sideways. */
.grid th:first-child, .grid td:first-child { position: sticky; left: 0; background: var(--panel); }
.grid th:first-child { z-index: 3; }
.grid td:first-child { z-index: 1; }
.grid tbody tr:hover td:first-child { background: var(--panel-2); }
.col-action { width: 1%; }
.grid .col-action { position: sticky; right: 0; background: var(--panel); }
.grid th.col-action { z-index: 3; }
.grid td.col-action { z-index: 1; }
/* Scroll cue: a pinned edge gets a hairline and a soft shadow while columns
   are hidden behind it (.more-left / .more-right, set by app.js). Drawn as
   pseudo-elements: Chromium does not paint box-shadow on the cells of a
   border-collapse table. */
.grid th:first-child::after, .grid td:first-child::after,
.grid .col-action::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--scroll-cue-w);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.grid th:first-child::after, .grid td:first-child::after {
  left: 100%;
  border-left: 1px solid var(--line);
  background: linear-gradient(to right, var(--scroll-cue-ink), transparent);
}
.grid .col-action::before {
  right: 100%;
  border-right: 1px solid var(--line);
  background: linear-gradient(to left, var(--scroll-cue-ink), transparent);
}
.tablewrap.more-left .grid th:first-child::after,
.tablewrap.more-left .grid td:first-child::after,
.tablewrap.more-right .grid .col-action::before { opacity: 1; }
.acts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Tracking fields: the HubSpot company dropdowns (row and drawer). */
.cellsel {
  height: 28px;
  padding: 0 6px;
  font-size: 12px;
  min-width: var(--cellsel-min);
  max-width: var(--cellsel-max);
  text-overflow: ellipsis;
  cursor: pointer;
}
.kv .cellsel { max-width: 100%; width: 100%; }
.reason-cell {
  min-width: var(--reason-min);
  max-width: var(--reason-max);
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.reason-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--reason-min-h);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-sm);
  resize: vertical;
  outline: none;
}
.reason-input:focus-visible { border-color: var(--ink-2); }
.reason-acts { display: flex; justify-content: flex-end; margin-top: 6px; }
.fieldset .h3-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.copybtn { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ------------------------------ pills */

.pill {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-2);
  background: var(--panel-2);
  white-space: nowrap;
}
.pill.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.pill.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.pill.err { color: var(--err); background: var(--err-bg); border-color: var(--err-line); }
.pill.plain { background: transparent; }
.pill.dd { background: var(--panel-2); }

.logcell { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.campchk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
}
.campchk:has(input:checked) { color: var(--ink); }
.campchk span { white-space: nowrap; }
.campchk input { width: 13px; height: 13px; margin: 0; accent-color: var(--accent); cursor: pointer; }
/* Marketing data complete sits under Fill in marketing data. */
.campchk.mkt-done { margin-left: var(--mkt-indent); }
/* Marketing data rows in the drawer: the value, then its Copy button. */
.kv-copy dd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kv-copy .kv-val { min-width: 0; overflow-wrap: anywhere; }
.kv-copy .copybtn { flex: none; }

/* ------------------------------ drawer */

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 14, 0.32);
  z-index: 40;
}
.drawer:focus { outline: none; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 460px;
  max-width: 94vw;
  background: var(--panel);
  border-left: 1px solid var(--line);
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: var(--sp);
  border-bottom: 1px solid var(--line);
}
.drawer-title h2 { margin: 0; font-size: 17px; font-weight: 650; }
.drawer-sub { margin-top: 5px; display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: var(--fs-sm); }
.drawer-body { padding: var(--sp); overflow-y: auto; flex: 1; }
.drawer-foot {
  border-top: 1px solid var(--line);
  padding: var(--sp);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel-2);
  /* A narrow drawer puts the actions under the log state. */
  flex-wrap: wrap;
}
.drawer-actions { display: flex; gap: 8px; align-items: center; }
/* The record's checkboxes stack beside the buttons. */
.drawer-checks { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.drawer-checks .campchk { margin-top: 0; }
.logstate { font-size: var(--fs-sm); color: var(--ink-2); }

.fieldset { margin: 0 0 18px; }
.fieldset h3 {
  margin: 0 0 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.kv { display: grid; grid-template-columns: 132px 1fr; row-gap: 6px; column-gap: 12px; font-size: var(--fs-sm); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.note { white-space: pre-wrap; font-size: var(--fs-sm); color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; }
.ca-notice {
  margin: 0 0 18px;
  padding: 8px 10px;
  border: 1px solid var(--err-line);
  border-radius: var(--r);
  background: var(--err-bg);
  color: var(--err);
  font-size: var(--fs-sm);
}
.mono { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* ------------------------------ toast */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 9px 14px;
  font-size: var(--fs-sm);
  z-index: 60;
  max-width: 88vw;
}
.toast.err { border-color: var(--err-line); background: var(--err-bg); color: var(--err); }

/* ------------------------------ responsive */

@media (max-width: 900px) {
  .wrap { padding: var(--sp) 10px 60px; }
  .col-md { display: none; }
  .stat-wide { display: none; }
  .headline { flex-direction: column; align-items: stretch; }
  .drawer { width: 100%; max-width: 100%; }
}


/* ---------------------------------------------------------------- auth + audit */
body.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: var(--bg);
}
.authwrap { width: 100%; max-width: 430px; padding: 24px; }
.authcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 26px;
}
.authhead { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; color: var(--ink); }
.authcard h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -0.01em; color: var(--ink); }
.authcard .sub { color: var(--ink-2); font-size: var(--fs-sm); margin: 0 0 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: var(--fs-sm); color: var(--ink-2); }
.field input, .field select {
  font: inherit;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 10px;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--line-2);
}
.authcard .btn { width: 100%; margin-top: 4px; }
.auth-err {
  background: var(--err-bg);
  border: 1px solid var(--err-line);
  color: var(--err);
  padding: 8px 10px;
  border-radius: var(--r);
  font-size: var(--fs-sm);
  margin: 0 0 14px;
}
.authfoot { margin: 16px 0 0; font-size: var(--fs-sm); color: var(--ink-2); text-align: center; }
.authfoot a { color: var(--ink); }
form.inline { display: inline; }
.audit-filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 0 0 14px; }
.inline-field { margin: 0; min-width: 140px; }
.auditwrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
table.audit { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.audit th {
  text-align: left;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.audit td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.audit tr:last-child td { border-bottom: none; }
table.audit .was { color: var(--ink-3); text-decoration: line-through; }
table.audit .now { color: var(--ink); }
.pill {
  font-size: var(--fs-xs);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill.login { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.pill.login_failed { color: var(--err); background: var(--err-bg); border-color: var(--err-line); }
.pill.edit { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.pill.register { color: var(--ink); background: var(--panel-2); }
