/*
 * Pagtanggi audit desk.
 *
 * A dense review instrument, not a dashboard. Rules, not cards. Colour is
 * reserved for meaning: the jailbreak label, flags, sign-off. Everything else is
 * neutral so the Tagalog and English text being compared is the loudest thing on
 * the page.
 *
 * No serif faces anywhere, including the monospace stack.
 */

:root {
  color-scheme: light;

  --font-sans:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans",
    Arial, sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", "Segoe UI Mono",
    "DejaVu Sans Mono", "Noto Sans Mono", Menlo, Consolas, monospace;

  --bg: #f6f7f8;
  --surface: #fff;
  --surface-sunken: #f0f2f3;
  --border: #dcdfe1;
  --border-strong: #bfc5c9;
  --text: #15181b;
  /* The three text columns all use this one value, so no column reads as more or
     less authoritative than the others. */
  --text-body: #23292d;
  --text-muted: #5a6167;
  /* Small print sits at 11px, so this has to clear 4.5:1 on the white cell, the
     sunken panel and the canvas. It measures 5.12 / 4.56 / 4.77. */
  --text-faint: #676f74;

  --accent: #1a5f86;
  --accent-hover: #164f6f;
  --focus: #1a73c4;

  --solid: #1d2124;
  --solid-hover: #33393d;

  --good-text: #14654a;
  --good-bg: #e6f4ee;
  --good-border: #a9d6c1;

  --bad-text: #a92a20;
  --bad-bg: #fceceb;
  --bad-border: #eeb2ad;

  --warn-text: #7f4e05;
  --warn-bg: #fcf3e2;
  --warn-border: #e8c689;

  --info-text: #16576f;
  --info-bg: #e7f1f5;
  --info-border: #b0cfdd;

  --shadow: 0 8px 24px rgb(16 19 22 / 14%);

  --topbar-height: 44px;
  --radius: 3px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

code {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 0.9375rem;
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: stretch;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar-nav {
  display: flex;
}

.topbar-nav a {
  display: flex;
  align-items: center;
  padding: 0 0.875rem;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.topbar-nav a:hover {
  color: var(--text);
}

.topbar-nav a[aria-current="page"] {
  border-bottom-color: var(--solid);
  color: var(--text);
}

.topbar-account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
}

.topbar-account form {
  display: flex;
  margin: 0;
}

.identity {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.identity::before {
  content: "signed in as ";
  color: var(--text-faint);
}

/* ------------------------------------------------------------------- page */

.page {
  width: min(100% - 2rem, 1800px);
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.page-narrow {
  width: min(100% - 2rem, 1180px);
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin-bottom: 1rem;
}

.page-note {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.page-note code {
  color: var(--text);
}

/* ---------------------------------------------------------------- metrics */

.metrics {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.metrics div {
  flex: 1 1 8rem;
  padding: 0.5rem 0.75rem 0.625rem;
  border-right: 1px solid var(--border);
}

.metrics div:last-child {
  border-right: 0;
}

.metrics dt {
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metrics dd {
  margin: 0;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.2;
}

/* ---------------------------------------------------------------- filters */

.filters {
  display: grid;
  align-items: end;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  grid-template-columns: repeat(auto-fit, minmax(8.25rem, 1fr));
}

.filters label {
  display: block;
  min-width: 0;
}

.filter-search {
  grid-column: span 2;
}

/* Its option text is long, so it gets two tracks like the search field. */
.filter-flip {
  grid-column: span 2;
}

label > span {
  display: block;
  margin-bottom: 0.1875rem;
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="text"],
input[type="search"],
input[type="password"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

input[type="text"],
input[type="search"],
input[type="password"],
select {
  min-height: 30px;
  padding: 0.25rem 0.375rem;
}

select {
  font-size: 0.75rem;
}

textarea {
  padding: 0.5rem;
  line-height: 1.5;
  resize: vertical;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

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

.button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 0.625rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.button:hover:not(:disabled) {
  border-color: var(--text-faint);
  background: var(--surface-sunken);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-small {
  min-height: 25px;
  padding: 0 0.5rem;
  font-size: 0.6875rem;
}

/* Secondary actions: same shape as the base button, one step back in emphasis. */
.button-quiet {
  color: var(--text-muted);
}

.button-quiet:hover:not(:disabled) {
  color: var(--text);
}

.button-primary {
  border-color: var(--solid);
  background: var(--solid);
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  border-color: var(--solid-hover);
  background: var(--solid-hover);
}

.button-caution {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.button-caution:hover:not(:disabled) {
  border-color: var(--warn-text);
  background: #f8e9cd;
}

.button-sign {
  border-color: var(--good-border);
  background: var(--good-bg);
  color: var(--good-text);
}

.button-sign:hover:not(:disabled) {
  border-color: var(--good-text);
  background: #d8ebe1;
}

.button-wide {
  width: 100%;
  min-height: 34px;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.link-button:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

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

.job {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.875rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--info-border);
  border-radius: var(--radius);
  background: var(--info-bg);
}

.job h2 {
  color: var(--info-text);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.job-body {
  flex: 1 1 18rem;
  min-width: 0;
}

.job-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
}

.job-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-meta strong {
  font-variant-numeric: tabular-nums;
}

progress {
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 3px;
  background: #fff;
}

progress::-webkit-progress-bar {
  border-radius: 3px;
  background: #fff;
}

progress::-webkit-progress-value {
  border-radius: 3px;
  background: var(--info-text);
}

progress::-moz-progress-bar {
  border-radius: 3px;
  background: var(--info-text);
}

/* ---------------------------------------------------------------- toolbar */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.select-all {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.select-all span {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-count {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.selection-count {
  margin-right: 0.125rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ table */

/*
 * Fixed layout with percentage columns that total 100%, and no scroll
 * container: the table can never be wider than the page, so there is never a
 * horizontal scrollbar. The header sticks to the bottom of the top bar during
 * ordinary page scrolling.
 */
.audit-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  table-layout: fixed;
}

.col-prompt {
  width: 26%;
}

.col-translation {
  width: 28%;
}

.col-response {
  width: 32%;
}

.col-label {
  width: 14%;
}

.audit-table thead th {
  position: sticky;
  z-index: 10;
  top: var(--topbar-height);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}


.audit-table td {
  padding: 0.625rem 0.75rem;
  overflow-wrap: anywhere;
  vertical-align: top;
}

/* Each record is two rows: the five data cells, then its control bar. A rule
   above the data cells is what separates one record from the next. */
.record td {
  border-top: 1px solid var(--border);
}

.audit-table tbody tr:first-child td {
  border-top: 0;
}

.record-actions td {
  padding-top: 0;
  padding-bottom: 0.625rem;
}

.record.is-selected td,
.record-actions.is-selected td {
  background: #eaf2f7;
}

/* Row-level state edge, scannable down a page of 25 records. A flag is the more
   urgent signal, so its rule comes second and wins. */
.record.is-signed td:first-child,
.record-actions.is-signed td:first-child {
  box-shadow: inset 3px 0 0 var(--good-border);
}

.record.is-flagged td:first-child,
.record-actions.is-flagged td:first-child {
  box-shadow: inset 3px 0 0 var(--bad-text);
}

.table-message {
  height: 8rem;
  color: var(--text-muted);
  text-align: center;
  vertical-align: middle !important;
}

/* ------------------------------------------------------------------ cells */

/* Sits under the prompt text, so this cell has no leading element the other three
   columns lack. */
.select-line {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  margin-top: 0.5rem;
  cursor: pointer;
}

/* Overrides the uppercase micro-label treatment that `label > span` would
   otherwise apply, since .select-line is a <label>. */
.row-ident {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}

.cell-text {
  min-width: 0;
}

/* Long prompts and responses are clamped so row heights stay predictable. */
.cell-body {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-body);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
  white-space: pre-wrap;
}

.cell-body.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
}

.cell-text .link-button {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
}

.cell-meta {
  margin-top: 0.375rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.35;
}

.cell-edit {
  margin-top: 0.4375rem;
  padding: 0.125rem 0.375rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
}

.cell-edit:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.label-select {
  margin-top: 0.375rem;
  min-height: 26px;
  font-size: 0.6875rem;
}

/* --------------------------------------------------- inline cell editing */

/*
 * Editing happens in the translation cell itself: the paragraph is replaced by
 * this editor in place. There is no dialog.
 */
.inline-editor {
  display: grid;
  gap: 0.375rem;
}

.inline-input {
  min-height: 5rem;
  padding: 0.375rem 0.5rem;
  border-color: var(--accent);
  font-size: 0.8125rem;
  outline: 2px solid rgb(26 95 134 / 18%);
  outline-offset: 0;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.inline-hint {
  color: var(--text-faint);
  font-size: 0.625rem;
}

/* ------------------------------------------------------------ action bar */

.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.75rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}

.action-source {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.action-label {
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.action-signoff {
  margin-left: auto;
}

.toggle {
  min-height: 24px;
  padding: 0 0.4375rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
}

.toggle:hover {
  border-color: var(--text-faint);
  color: var(--text);
}

.toggle-positive.is-active {
  border-color: var(--good-border);
  background: var(--good-bg);
  color: var(--good-text);
}

.toggle-negative.is-active {
  border-color: var(--bad-border);
  background: var(--bad-bg);
  color: var(--bad-text);
}

.signed {
  color: var(--good-text);
  font-size: 0.6875rem;
  font-weight: 600;
}

.flag-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4375rem;
  margin-top: 0.3125rem;
  padding: 0 0.5rem;
}

.flag-input {
  flex: 1 1 18rem;
  max-width: 34rem;
  min-height: 26px !important;
  font-size: 0.75rem;
}

.action-note {
  color: var(--text-muted);
  font-size: 0.6875rem;
}

/* ------------------------------------------------------------------- pills */

.pill {
  display: inline-block;
  max-width: 100%;
  padding: 0.125rem 0.3125rem;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.3;
}


.judgment.is-jailbreak {
  border-color: var(--bad-border);
  background: var(--bad-bg);
  color: var(--bad-text);
}

.judgment.is-not-jailbreak {
  border-color: var(--good-border);
  background: var(--good-bg);
  color: var(--good-text);
}


/* ----------------------------------------------------------------- tooltip */

/* position: relative is the anchor the absolutely-positioned .tooltip depends on,
   so the whole box model for this wrapper is kept here with it. */
.th-tooltip {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 0.3125rem;
}

.tooltip-trigger {
  display: inline-grid;
  width: 16px;
  height: 16px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 700;
}

.tooltip-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tooltip {
  position: absolute;
  z-index: 60;
  top: calc(100% + 0.5rem);
  right: 0;
  display: none;
  width: min(24rem, 60vw);
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.45;
  text-transform: none;
}

.th-tooltip:hover .tooltip,
.tooltip-trigger:focus-visible + .tooltip,
.tooltip.is-open {
  display: block;
}

/* ----------------------------------------------------------------- dialog */

dialog {
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
}

dialog::backdrop {
  background: rgb(21 24 27 / 45%);
}

.dialog {
  width: min(30rem, calc(100vw - 2rem));
}

.dialog form {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.dialog-facts {
  margin: 0;
  border-top: 1px solid var(--border);
}

.dialog-facts div {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.75rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--border);
}

.dialog-facts dt {
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dialog-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.dialog-warning {
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 0.75rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.375rem;
}

/* ----------------------------------------------------------------- toasts */

.toast-region {
  position: fixed;
  z-index: 100;
  right: 0.75rem;
  bottom: 0.75rem;
  display: grid;
  width: min(24rem, calc(100vw - 1.5rem));
  gap: 0.375rem;
}

.toast {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.75rem;
}

.toast.is-error {
  border-color: var(--bad-border);
  background: var(--bad-bg);
  color: var(--bad-text);
}

/* ------------------------------------------------------------------ login */

.login {
  display: grid;
  min-height: 100vh;
  padding: 1.5rem;
  place-items: center;
}

.login-form {
  width: min(100%, 20rem);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.login-form h1 {
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

/* The sign-in labels and inputs are siblings, so the rhythm is set here rather
   than by the label > span rule used elsewhere. */
.login-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.login-form input {
  min-height: 34px;
  margin-bottom: 0.75rem;
}

.login-form .button {
  margin-top: 0.25rem;
}

.form-error {
  margin-bottom: 0.875rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--bad-border);
  border-radius: var(--radius);
  background: var(--bad-bg);
  color: var(--bad-text);
  font-size: 0.75rem;
}

/* --------------------------------------------------------- judge prompts */


.config-layout {
  display: grid;
  align-items: start;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 17rem;
}

.config-form {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.config-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border);
}

.byline {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.config-form label {
  display: block;
  margin-bottom: 0.875rem;
}

.config-form textarea {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.placeholders {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  font-size: 0.6875rem;
}

.placeholders > span {
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.placeholders code {
  padding: 0.0625rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
}

.config-actions p {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.versions {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.versions h2 {
  margin-bottom: 0.5rem;
  color: var(--text-faint);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.versions ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.versions li {
  display: grid;
  gap: 0.625rem;
  padding: 0.4375rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  grid-template-columns: 2.5rem 1fr;
}

.versions li:first-child {
  border-top: 0;
}

/* The pre-fetch placeholder has no version number, so it spans both tracks. */
.versions li.is-message {
  grid-template-columns: 1fr;
  color: var(--text-muted);
}

.versions li strong {
  font-family: var(--font-mono);
}

.versions li span {
  color: var(--text-muted);
}

.versions li.is-active span {
  color: var(--good-text);
  font-weight: 600;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 899px) {
  /* The five columns stay a real table down to 900px. Below that they stop being
     readable side by side, so each record becomes a stacked block carrying its
     own labels. Either way there is never a horizontal scrollbar. */
  .audit-table,
  .audit-table thead,
  .audit-table tbody,
  .audit-table tr,
  .audit-table td {
    display: block;
    width: auto;
  }

  .audit-table thead {
    display: none;
  }

  .audit-table {
    border: 0;
    background: none;
  }

  .record {
    margin-top: 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .record td {
    border-top: 1px solid var(--border);
  }

  .record td:first-child {
    border-top: 0;
  }

  .record td[data-label]::before {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-faint);
    content: attr(data-label);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .record-actions {
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--surface);
  }

  .cell-body {
    -webkit-line-clamp: 12;
  }

  .action-signoff {
    margin-left: 0;
  }

  .config-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .page {
    width: min(100% - 1rem, 1800px);
  }

  .metrics div {
    flex-basis: 33%;
    border-bottom: 1px solid var(--border);
  }

  /* .filters is a grid, so the single-column collapse has to change the tracks. */
  .filters {
    grid-template-columns: 1fr;
  }

  .filter-search {
    grid-column: auto;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .button {
    flex: 1 1 auto;
  }
}
