/* A-TV Prüfwerkzeug. Tokens and rules: specs/006-web-check-ui/design.md, "Visual Design"; the look
   of Ambient TV since EXP-1551: specs/010-ambient-tv-look/design.md. Breakpoints: 40rem
   (tables stack below it) and 75rem (wide wording results). Media queries cannot read custom
   properties, so these widths are written as literals there. The font (Poppins) and the logo
   are served from /static; no foreign sources. */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/poppins-400.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/poppins-600.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/poppins-700.woff2") format("woff2");
}

:root {
  color-scheme: light;

  --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-size-base: 1rem;
  --font-size-small: 0.875rem;
  --font-size-h1: 1.5rem;
  --font-size-h2: 1.125rem;
  --font-size-verdict: 1.75rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --radius: 0.375rem;
  --radius-pill: 2rem;
  --radius-card: 0.5rem;
  --border-width: 1px;
  --accent-width: 0.375rem;
  --logo-height: 2rem;

  --color-brand: #D70427;
  --color-bg: #EDF2F4;
  --color-card: #ffffff;
  --color-surface: #f5f5f4;
  --color-text: #1b1b1b;
  --color-muted: #595959;
  --color-border: #d4d4d4;
  --color-border-strong: #767676;
  --color-link: var(--color-brand);
  --color-focus: var(--color-brand);
  --color-primary: var(--color-brand);
  --color-primary-hover: #B70321;
  --color-primary-active: #96031B;
  --color-on-primary: #ffffff;
  --color-secondary-border: var(--color-brand);
  --color-selected: #e8f0fb;
  --color-selected-border: #0b57d0;
  --color-disabled-bg: #e4e4e4;
  --color-disabled-fg: #595959;
  --focus-ring: 3px solid var(--color-focus);

  --v-accepted-fg: #0f5b2a;
  --v-accepted-tint: #e7f4eb;
  --v-accepted-border: #1e7e3e;
  --v-accepted_with_notes-fg: #7a3e00;
  --v-accepted_with_notes-tint: #fff1dd;
  --v-accepted_with_notes-border: #b35900;
  --v-rejected-fg: #a0151b;
  --v-rejected-tint: #fdecec;
  --v-rejected-border: #c62828;
  --v-rejected-symbol: "\00D7";
  --v-manual_check-fg: #0b4a8b;
  --v-manual_check-tint: #e8f0fb;
  --v-manual_check-border: #1f63b5;
  --v-not_checkable-fg: #3d3d3d;
  --v-not_checkable-tint: #eeeeee;
  --v-not_checkable-border: #6b6b6b;
}

[hidden] {
  display: none !important;
}

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

html {
  scroll-padding-bottom: 5rem;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.5;
}

a {
  color: var(--color-link);
}

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

h1 {
  font-size: var(--font-size-h1);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 var(--space-4);
}

h2 {
  font-size: var(--font-size-h2);
  margin: 0 0 var(--space-2);
}

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--color-card);
  border-bottom: var(--border-width) solid var(--color-border);
}

/* A block, so that the focus ring encloses the logo; the width follows from the ratio 244:63. */
.brand-link {
  display: block;
}

.brand-logo {
  display: block;
  width: auto;
  height: var(--logo-height);
}

.brand {
  font-weight: 700;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration-thickness: 2px;
}

/* Person and "Abmelden" in one flex row (specs/007-librechat-login-roles/design.md, Layout). */
.site-user {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  margin: 0 0 0 auto;
  color: var(--color-muted);
  font-size: var(--font-size-small);
}

.site-user p,
.site-user form {
  min-width: 0;
  margin: 0;
}

#user-email {
  overflow-wrap: anywhere;
}

/* Page */

/* The one white card, with a frame of the page background on every width; margin and padding
   add up to the vertical distances of before (specs/010-ambient-tv-look/design.md, E-1). */
.page {
  width: calc(100% - 2 * var(--space-2));
  max-width: 64rem;
  margin: var(--space-2) auto;
  padding: var(--space-4) var(--space-3) var(--space-6);
  border-radius: var(--radius-card);
  background: var(--color-card);
}

@media (width >= 40rem) {
  .page {
    padding-inline: var(--space-4);
  }
}

.message {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--v-rejected-tint);
  border-left: var(--accent-width) solid var(--v-rejected-border);
  color: var(--color-text);
}

.message:empty {
  margin: 0;
  padding: 0;
  border: 0;
}

/* Neutral: "Sie sind abgemeldet." is neither a verdict nor an error. */
.message--info {
  background: var(--color-surface);
  border-left-color: var(--color-border-strong);
}

.help {
  margin: var(--space-1) 0 0;
  color: var(--color-muted);
  font-size: var(--font-size-small);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-4);
  border: var(--border-width) solid var(--color-secondary-border);
  border-radius: var(--radius-pill);
  background: var(--color-card);
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
}

/* A red ring around the red button shows only through the gap
   (specs/010-ambient-tv-look/design.md, E-2). */
.button:focus-visible {
  outline-offset: var(--space-1);
}

.button--primary {
  border-color: var(--color-primary);
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 600;
}

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

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

.button:disabled {
  border-color: var(--color-disabled-bg);
  background: var(--color-disabled-bg);
  color: var(--color-disabled-fg);
  cursor: default;
}

/* Page "Prüfen" */

.field {
  margin-bottom: var(--space-6);
}

.field label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 600;
}

.field input[type="file"] {
  max-width: 100%;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  overflow-wrap: anywhere;
}

.targets > legend {
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.search {
  display: block;
  margin-bottom: var(--space-3);
}

.search input {
  display: block;
  width: 100%;
  max-width: 28rem;
  margin-top: var(--space-1);
  padding: var(--space-2);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-card);
  font: inherit;
}

.choice {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  align-items: flex-start;
  min-height: 2.75rem;
  padding: var(--space-2);
  border-left: var(--accent-width) solid transparent;
  cursor: pointer;
}

.choice input {
  margin-top: 0.3rem;
}

.choice-text {
  flex: 1 1 12rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.choice:has(input:checked) {
  border-left-color: var(--color-selected-border);
  background: var(--color-selected);
}

.choice--all {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: var(--border-width) solid var(--color-border);
  font-weight: 600;
}

.channel {
  padding-top: var(--space-2);
  border-top: var(--border-width) solid var(--color-border);
}

.channel > legend {
  float: left;
  width: 100%;
  padding-top: var(--space-2);
  font-size: var(--font-size-small);
  font-weight: 700;
}

.channel > legend + * {
  clear: left;
}

.tag {
  padding: 0 var(--space-2);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: var(--font-size-small);
}

.submit-bar {
  position: sticky;
  bottom: 0;
  margin-top: var(--space-4);
  padding-block: var(--space-3);
  border-top: var(--border-width) solid var(--color-border);
  background: var(--color-card);
}

/* Page "Anmelden" */

.field input[type="email"],
.field input[type="password"],
.field input[type="text"],
.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: var(--space-2);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-card);
  font: inherit;
}

#login-form {
  max-width: 28rem;
}

#login-form .submit-bar {
  position: static;
  margin-top: 0;
  padding-block: 0;
  border-top: 0;
}

#login-help {
  margin: 0 0 var(--space-6);
}

/* Reports */

.back-link {
  margin: 0 0 var(--space-2);
}

.verdict {
  margin: 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  border-left: var(--accent-width) solid var(--v-border);
  background: var(--v-tint);
  color: var(--v-fg);
  font-size: var(--font-size-verdict);
  font-weight: 700;
  line-height: 1.25;
}

/* Only the banner: table rows and verdict marks carry data-verdict too. The second rule gives
   the sign an empty alternative text, so a screen reader reads the word alone; a browser that
   does not know that notation keeps the first rule. */
.verdict[data-verdict="rejected"]::before {
  content: var(--v-rejected-symbol);
  margin-right: var(--space-2);
}

@supports (content: "x" / "") {
  .verdict[data-verdict="rejected"]::before {
    content: var(--v-rejected-symbol) / "";
  }
}

.pill {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border: var(--border-width) solid var(--v-border);
  border-radius: var(--radius);
  background: var(--v-tint);
  color: var(--v-fg);
  font-size: var(--font-size-small);
  font-weight: 600;
}

[data-verdict="accepted"] {
  --v-fg: var(--v-accepted-fg);
  --v-tint: var(--v-accepted-tint);
  --v-border: var(--v-accepted-border);
}

[data-verdict="accepted_with_notes"] {
  --v-fg: var(--v-accepted_with_notes-fg);
  --v-tint: var(--v-accepted_with_notes-tint);
  --v-border: var(--v-accepted_with_notes-border);
}

[data-verdict="rejected"] {
  --v-fg: var(--v-rejected-fg);
  --v-tint: var(--v-rejected-tint);
  --v-border: var(--v-rejected-border);
}

[data-verdict="manual_check"],
[data-verdict="no_automatic_check"] {
  --v-fg: var(--v-manual_check-fg);
  --v-tint: var(--v-manual_check-tint);
  --v-border: var(--v-manual_check-border);
}

[data-verdict="not_checkable"] {
  --v-fg: var(--v-not_checkable-fg);
  --v-tint: var(--v-not_checkable-tint);
  --v-border: var(--v-not_checkable-border);
}

.file-details {
  margin: 0 0 var(--space-6);
}

.file-details dt {
  color: var(--color-muted);
  font-size: var(--font-size-small);
}

.file-details dd {
  margin: 0 0 var(--space-2);
  overflow-wrap: anywhere;
}

@media (width >= 40rem) {
  .file-details {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: var(--space-1) var(--space-4);
  }

  .file-details dt,
  .file-details dd {
    margin: 0;
  }
}

.filename {
  overflow-wrap: anywhere;
}

.sha256 {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.reason-line {
  margin: 0 0 var(--space-6);
}

.hints {
  margin: 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  border-left: var(--accent-width) solid var(--v-manual_check-border);
  background: var(--v-manual_check-tint);
}

.hints h2 {
  color: var(--v-manual_check-fg);
}

.hints ul {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-left: var(--space-6);
}

.hints li {
  overflow-wrap: anywhere;
}

.answer-box {
  margin: var(--space-6) 0 0;
}

.answer {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-card);
  font-family: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}

.copy-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
  margin-top: var(--space-2);
}

.copy-status {
  margin: 0;
}

/* Tables: #rules, #variants, #runs */

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table caption {
  margin-bottom: var(--space-2);
  font-weight: 600;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: var(--space-2);
  border-bottom: var(--border-width) solid var(--color-border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  font-size: var(--font-size-small);
}

#rules th:nth-child(1) { width: 17%; }
#rules th:nth-child(2) { width: 23%; }
#rules th:nth-child(3) { width: 23%; }
#rules th:nth-child(4) { width: 12%; }
#rules th:nth-child(5) { width: 25%; }

#variants th:nth-child(1) { width: 28%; }
#variants th:nth-child(2) { width: 22%; }
#variants th:nth-child(3) { width: 20%; }
#variants th:nth-child(4) { width: 13%; }
#variants th:nth-child(5) { width: 17%; }

#runs th:nth-child(1) { width: 13%; }
#runs th:nth-child(2) { width: 17%; }
#runs th:nth-child(3) { width: 20%; }
#runs th:nth-child(4) { width: 20%; }
#runs th:nth-child(5) { width: 12%; }
#runs th:nth-child(6) { width: 7%; }
#runs th:nth-child(7) { width: 11%; }

#rules tr.finding td {
  border-bottom: 0;
}

#rules td.reason {
  padding-top: 0;
  color: var(--color-muted);
  font-size: var(--font-size-small);
}

tbody[data-status="pass"] .status {
  color: var(--v-accepted-fg);
}

tbody[data-status="fail"][data-severity="reject"] {
  background: var(--v-rejected-tint);
}

tbody[data-status="fail"][data-severity="reject"] .status {
  color: var(--v-rejected-fg);
  font-weight: 700;
}

tbody[data-status="fail"][data-severity="warn"] {
  background: var(--v-accepted_with_notes-tint);
}

tbody[data-status="fail"][data-severity="warn"] .status {
  color: var(--v-accepted_with_notes-fg);
  font-weight: 700;
}

tbody[data-status="not_applicable"] td {
  color: var(--color-muted);
}

#runs caption {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Below 40rem every row (and every tbody of #rules) becomes a card with labelled cells. */
@media (width < 40rem) {
  .data-table,
  .data-table caption,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
  }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .data-table tr {
    padding: var(--space-3) 0;
    border-top: var(--border-width) solid var(--color-border);
  }

  #rules tbody,
  .diff-table tbody {
    padding: var(--space-3) var(--space-2);
    border-top: var(--border-width) solid var(--color-border);
  }

  #rules tr,
  .diff-table tr {
    padding: 0;
    border-top: 0;
  }

  .data-table td {
    padding: var(--space-1) var(--space-2);
    border-bottom: 0;
  }

  .data-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--color-muted);
    font-size: var(--font-size-small);
  }

  .site-user {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* "alle Kanäle" already draws the line above the first channel. */
.choice--all ~ .channel:first-of-type {
  border-top: 0;
}

/* Pages "Sollwerte", "Fassungen", the forms and "Änderung bestätigen" (EXP-1496,
   specs/008-spec-maintenance-form/design.md "Visual Design"). No new tokens: an open draft uses
   the colours of "angenommen mit Hinweisen", an error those of "abgelehnt". */

a.button {
  text-decoration: none;
}

.notice,
.pixel-check {
  margin: 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  border-left: var(--accent-width) solid var(--v-accepted_with_notes-border);
  background: var(--v-accepted_with_notes-tint);
}

.notice p {
  margin: 0 0 var(--space-2);
  overflow-wrap: anywhere;
}

.pixel-check {
  margin: var(--space-3) 0 0;
}

.pixel-check > legend {
  float: left;
  width: 100%;
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.pixel-check > legend + * {
  clear: left;
}

.pixel-check[data-missing] {
  border-left-color: var(--v-rejected-border);
  background: var(--v-rejected-tint);
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  margin-top: var(--space-3);
}

.inline-form {
  margin: 0;
}

.spec-section {
  margin: 0 0 var(--space-8);
}

.spec-channel {
  padding-top: var(--space-2);
  border-top: var(--border-width) solid var(--color-border);
}

.spec-channel > h3 {
  margin: var(--space-2) 0 0;
  font-size: var(--font-size-small);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.spec-variant,
.spec-version-entry,
.diff-variant {
  scroll-margin-top: var(--space-4);
}

.spec-variant {
  padding-block: var(--space-4);
}

.spec-variant + .spec-variant {
  border-top: var(--border-width) solid var(--color-border);
}

.spec-variant-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  align-items: baseline;
  margin-bottom: var(--space-2);
}

.spec-variant-head :is(h3, h4) {
  margin: 0;
  font-size: var(--font-size-base);
  overflow-wrap: anywhere;
}

.spec-key {
  font-family: var(--font-mono);
  font-size: var(--font-size-small);
  overflow-wrap: anywhere;
}

[data-change] {
  padding-left: var(--space-3);
  border-left: var(--accent-width) solid var(--v-accepted_with_notes-border);
}

.change-tag {
  padding: 0 var(--space-2);
  border: var(--border-width) solid var(--v-accepted_with_notes-border);
  border-radius: var(--radius-pill);
  background: var(--v-accepted_with_notes-tint);
  color: var(--v-accepted_with_notes-fg);
  font-size: var(--font-size-small);
  font-weight: 600;
}

.spec-facts {
  margin: 0;
}

.spec-facts dt {
  color: var(--color-muted);
  font-size: var(--font-size-small);
}

.spec-facts dd {
  margin: 0 0 var(--space-2);
  overflow-wrap: anywhere;
}

.spec-list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding-left: var(--space-6);
}

@media (width >= 40rem) {
  .spec-facts {
    display: grid;
    grid-template-columns: 12rem 1fr;
    gap: var(--space-1) var(--space-4);
  }

  .spec-facts dt,
  .spec-facts dd {
    margin: 0;
  }

  .severity-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 14rem);
  }
}

.spec-form {
  max-width: 40rem;
}

.form-section {
  margin-bottom: var(--space-6);
}

.form-section > legend {
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.choice-detail input[type="text"] {
  display: block;
  width: 100%;
  padding: var(--space-2);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-card);
  font: inherit;
}

.field select {
  width: auto;
  max-width: 100%;
}

.field input[inputmode],
.choice-detail input[inputmode] {
  max-width: 10rem;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
}

.field-row > .field {
  flex: 1 1 10rem;
  min-width: 0;
}

.choice-detail {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: flex-end;
  padding: 0 0 var(--space-2) calc(var(--accent-width) + var(--space-2) + 1.5rem);
}

.choice-detail .field {
  margin-bottom: 0;
}

.choice:not(:has(input:checked)) + .choice-detail label {
  color: var(--color-muted);
}

.bytes-output {
  display: block;
  margin: var(--space-1) 0 0;
  font-variant-numeric: tabular-nums;
}

.bytes-output:empty {
  display: none;
}

.severity-row {
  display: grid;
  gap: var(--space-1) var(--space-4);
  align-items: center;
  padding-block: var(--space-1);
  border-bottom: var(--border-width) solid var(--color-border);
}

.severity-row label {
  font-weight: 600;
}

.hint-row {
  padding-top: var(--space-2);
  border-top: var(--border-width) solid var(--color-border);
}

.hint-row > legend {
  float: left;
  width: 100%;
  padding-top: var(--space-2);
  font-size: var(--font-size-small);
  font-weight: 700;
}

.hint-row > legend + * {
  clear: left;
}

.fixed-value {
  color: var(--color-muted);
  font-size: var(--font-size-small);
}

.spec-form .submit-bar,
#confirm-form .submit-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
}

#confirm-form .submit-bar {
  position: static;
}

#confirm-form + #discard-form {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: var(--border-width) solid var(--color-border);
}

.field--invalid {
  padding-left: var(--space-3);
  border-left: var(--accent-width) solid var(--v-rejected-border);
}

.field--invalid :is(input, select, textarea) {
  border-color: var(--v-rejected-border);
}

.field-error {
  margin: var(--space-1) 0 0;
  color: var(--v-rejected-fg);
  font-size: var(--font-size-small);
  font-weight: 600;
}

.problem-list {
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-4) var(--space-3) var(--space-8);
  border-left: var(--accent-width) solid var(--v-rejected-border);
  background: var(--v-rejected-tint);
}

.message:not(:empty) + .problem-list {
  margin-top: calc(-1 * var(--space-4));
  padding-top: 0;
}

.diff-table th:nth-child(1) { width: 22%; }
.diff-table th:nth-child(2) { width: 26%; }
.diff-table th:nth-child(3) { width: 26%; }
.diff-table th:nth-child(4) { width: 26%; }

.diff-table tbody tr:not(:last-child) td {
  border-bottom: 0;
}

.diff-new {
  font-weight: 600;
}

.diff-users-row td {
  padding-top: 0;
}

.diff-users,
.source-note {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--font-size-small);
}

.source-note {
  display: block;
}

.diff-variant {
  margin: 0 0 var(--space-6);
}

#default-severities th:nth-child(1) { width: 60%; }
#default-severities th:nth-child(2) { width: 40%; }

.spec-version-entry {
  padding: var(--space-4) 0 var(--space-6);
  border-top: var(--border-width) solid var(--color-border);
}

/* EXP-1497 (specs/009-filename-naming-rule/design.md, "Visual Design"). No new tokens. */

/* Empty until app.js fills it; stays rendered for the live region (design.md "Accessibility"). */
#variant-prefill:empty {
  margin: 0;
}

/* Pattern and format are read character by character: braces, brackets, "-" against "_". */
#filename_pattern,
#filename_customer_format {
  font-family: var(--font-mono);
}

#filename-suggestion {
  margin-top: var(--space-4);
}

#filename-suggestion:has(+ #filename-suggestion-note) {
  margin-bottom: 0;
}

/* Wording preview (EXP-1553, specs/011-wording-check-preview/contracts/styles.md): the rules of
   docs/wording/referenz/vorschau.css. No new tokens; every rule holds only on the wording page. */

.preview-bar {
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-text);
  color: var(--color-card);
  font-size: var(--font-size-small);
  text-align: center;
}

.lead {
  margin: 0 0 var(--space-6);
  color: var(--color-muted);
}

#wording-form textarea {
  min-height: 14rem;
  resize: vertical;
  line-height: 1.5;
}

#wording-form select {
  padding: var(--space-2) var(--space-3);
  color: var(--color-text);
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-2) 0 0;
  font-size: var(--font-size-small);
}

.result {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: var(--border-width) solid var(--color-border);
  scroll-margin-top: var(--space-4);
}

#result[data-stale] {
  color: var(--color-muted);
}

.result h2 {
  margin-top: var(--space-8);
}

.result > h2:first-child,
.result > #result-changed + h2,
.result .hints h2 {
  margin-top: 0;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: 0 0 var(--space-2);
  padding: 0;
  list-style: none;
  font-weight: 600;
}

.summary [data-kind="treffer"] {
  color: var(--v-rejected-fg);
}

.summary [data-kind="kandidat"] {
  color: var(--v-accepted_with_notes-fg);
}

.summary [data-kind="hinweis"] {
  color: var(--v-manual_check-fg);
}

.result > .rules-details {
  margin-top: var(--space-6);
}

/* Only the wording page widens; the DOM and reading order stay text, findings, hints. */
@media (width >= 75rem) {
  .page--wording {
    max-width: 80rem;
  }

  .page--wording .result-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--space-6);
    align-items: start;
  }

  .page--wording .result-columns > h2:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .page--wording .result-columns > .checked-text {
    grid-column: 1;
    grid-row: 2 / span 2;
    position: sticky;
    top: var(--space-4);
    max-height: calc(100vh - 2 * var(--space-4));
    overflow-y: auto;
    min-width: 0;
  }

  .page--wording .result-columns > h2:not(:first-child) {
    grid-column: 2;
    grid-row: 1;
  }

  .page--wording .result-columns > .finding-list {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }

  .page--wording .result-columns > .hints {
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
  }

  .page--wording .result-columns:not(:has(> .finding-list)) > .hints {
    grid-row: 2;
  }
}

.checked-text {
  margin: 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-card);
  font-family: inherit;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Not colour alone: a hit is underlined solid, a candidate dashed, and both carry their number. */
.checked-text mark {
  padding: 0 0.15em;
  border-radius: 0.2em;
  color: inherit;
}

.checked-text mark[data-kind="treffer"] {
  background: var(--v-rejected-tint);
  border-bottom: 2px solid var(--v-rejected-border);
}

.checked-text mark[data-kind="kandidat"] {
  background: var(--v-accepted_with_notes-tint);
  border-bottom: 2px dashed var(--v-accepted_with_notes-border);
}

.checked-text mark sup,
.finding-number {
  font-size: 0.75em;
  font-weight: 700;
}

.checked-text mark sup {
  white-space: nowrap;
}

.checked-text mark sup a {
  color: inherit;
  text-decoration: none;
}

.checked-text mark:focus,
.finding-item:focus,
.checked-text mark sup a:focus-visible,
.finding-back:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.finding-back {
  color: inherit;
  font-size: var(--font-size-small);
}

.finding-copy {
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-small);
}

.finding-list {
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
}

.finding-item {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-left: var(--accent-width) solid var(--color-border-strong);
  background: var(--color-surface);
}

.finding-item[data-kind="treffer"] {
  border-left-color: var(--v-rejected-border);
  background: var(--v-rejected-tint);
}

.finding-item[data-kind="kandidat"] {
  border-left-color: var(--v-accepted_with_notes-border);
  background: var(--v-accepted_with_notes-tint);
}

.finding-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
  margin: 0 0 var(--space-1);
}

.finding-word {
  font-weight: 700;
}

.finding-item p {
  margin: 0;
}

.finding-item .missing {
  font-weight: 600;
}

.inactive-rows {
  margin: var(--space-6) 0 0;
}

.inactive-rows summary {
  cursor: pointer;
  color: var(--color-link);
}

.inactive-rows ul {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-6);
  font-size: var(--font-size-small);
}

.wording-notes {
  margin-top: var(--space-6);
}

.wording-notes > .help {
  margin: 0 0 var(--space-3);
}

/* The wait after a click on the wording form (app.js, waitSign): a ring turns in the clicked
   button, the other one looks switched off. */

#wording-form[aria-busy="true"] .button {
  cursor: progress;
}

#wording-form .button[aria-disabled="true"]:not([data-waiting]) {
  border-color: var(--color-disabled-bg);
  background: var(--color-disabled-bg);
  color: var(--color-disabled-fg);
}

#wording-form .button[data-waiting]::after {
  flex: none;
  width: 1em;
  height: 1em;
  margin-left: var(--space-2);
  border: 0.125em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: wait-turn 0.8s linear infinite;
}

@keyframes wait-turn {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  #wording-form .button[data-waiting]::after {
    animation: none;
  }
}

/* Mail files on the wording page (EXP-1620, specs/015-wording-mail-files/design.md): the block
   of the file form, one card per file, the quoted history. No new tokens. Since EXP-1638 the
   block and the cards of a drop stand above the text form: the rule that kept the block apart
   from the text form above it now keeps the text form apart from them, cards or none. */

#files-section ~ #wording-form {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: var(--border-width) solid var(--color-border);
}

#files-form .field {
  margin-bottom: var(--space-3);
}

#files-form .submit-bar {
  position: static;
  margin-top: 0;
  padding-block: 0;
  border-top: 0;
}

.mail-card {
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-3);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-card);
  overflow-wrap: anywhere;
  scroll-margin-top: var(--space-4);
}

@media (width >= 40rem) {
  .mail-card {
    padding-inline: var(--space-4);
  }
}

.mail-card[data-kind="grund"] {
  border-style: dashed;
  border-color: var(--color-border-strong);
}

.mail-card .result {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
}

.mail-head {
  margin-bottom: var(--space-2);
}

.card-form {
  margin-top: var(--space-4);
}

.quoted {
  margin-top: var(--space-6);
}

.quoted summary {
  cursor: pointer;
  color: var(--color-link);
  font-weight: 600;
}

.quoted-text {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) dashed var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The overview above the cards from two cards on (EXP-1865,
   specs/030-exp-1865/contracts/page.md 4): one line per file with its name as a link to the
   heading of its card and a short status in one muted colour for every kind. The heading of a
   card lands below the top edge after a jump, with the border of its card in view. */

.cards-overview {
  margin-top: var(--space-6);
  overflow-wrap: anywhere;
}

.cards-overview-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cards-overview-list > li {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
}

.cards-overview-status {
  color: var(--color-muted);
}

.mail-card-title {
  scroll-margin-top: var(--space-8);
}

/* The drop zone of the file form (EXP-1621, specs/016-wording-drop-zone/design.md): it looks
   like one only after app.js has armed it (dropZone), so without the script the block stays as
   in EXP-1620. Its gutters are those of a mail card; the wait sign of its button is the ring of
   the wording form. No new tokens. */

#files-drop[data-drop-ready] {
  margin-bottom: var(--space-3);
  padding: var(--space-4) var(--space-3);
  border: var(--border-width) dashed var(--color-border-strong);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

@media (width >= 40rem) {
  #files-drop[data-drop-ready] {
    padding-inline: var(--space-4);
  }
}

#files-drop[data-drag-over] {
  border-style: solid;
  border-color: var(--color-selected-border);
  outline: var(--border-width) solid var(--color-selected-border);
  background: var(--color-selected);
}

#files-drop[data-drop-ready] .field {
  margin-bottom: 0;
}

#files-drop-text {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-h2);
  font-weight: 600;
}

#files-drop-message:not(:empty) {
  margin: var(--space-3) 0 0;
}

#files-button[data-waiting] {
  cursor: progress;
}

#files-button[data-waiting]::after {
  flex: none;
  width: 1em;
  height: 1em;
  margin-left: var(--space-2);
  border: 0.125em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: wait-turn 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  #files-button[data-waiting]::after {
    animation: none;
  }
}

/* U4: a native, closed model choice; the script only adds the selected name. */
.model-details {
  margin-block: var(--space-4);
}

.model-details summary {
  cursor: pointer;
  font-size: var(--font-size-small);
  overflow-wrap: anywhere;
}

.model-details .field {
  margin-top: var(--space-3);
}

/* The places of the KI hints in the text of the KI part (EXP-1623): framed all round, not
   underlined as a place of the fixed check, and lettered where that one is numbered. */
.checked-text mark[data-kind="ki"] {
  background: var(--v-manual_check-tint);
  border: 2px solid var(--v-manual_check-border);
}

.hint-letter {
  font-size: 0.75em;
  font-weight: 700;
}

/* KI hints of the wording preview: apart from the result, in the colour of a manual check. */

#ki-button {
  margin-left: var(--space-3);
}

.ki-hints {
  margin-top: var(--space-8);
  padding: var(--space-4);
  border: var(--border-width) dashed var(--v-manual_check-border);
  border-radius: var(--radius-card);
  background: var(--v-manual_check-tint);
}

.ki-hints h2 {
  margin-top: 0;
  color: var(--v-manual_check-fg);
}

.ki-model {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: var(--border-width) solid var(--color-border);
}

.ki-model h3 {
  margin: 0 0 var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--font-size-small);
}

.ki-list {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.ki-item {
  margin: 0 0 var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-left: var(--accent-width) solid var(--v-manual_check-border);
  background: var(--color-card);
}

.ki-item p,
.ki-none {
  margin: 0;
}

.ki-model {
  overflow-wrap: anywhere;
}
