/* ==========================================================================
   remiND theme (CS-364, design system CS-372): sidebar app layout on the
   TAmiRNA design system 1.0.0 tokens (vendor/tamirna-design/tamirna-tokens.css, loaded first).
   Light and dark mode: theme.js sets data-bs-theme (Bootstrap) and data-theme (design tokens)
   on <html> to the same value. The --m-* variables below only point at design system tokens.
   Fonts are vendored (static/vendor/fonts, SIL OFL); nothing is loaded from outside.
   ========================================================================== */

@font-face {
  font-family: "Asap";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("vendor/fonts/Asap-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Asap";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("vendor/fonts/Asap-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Asap";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("vendor/fonts/Asap-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Asap";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("vendor/fonts/Asap-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("vendor/fonts/JetBrainsMono-Regular.woff2") format("woff2");
}

/* ---- Tokens ------------------------------------------------------------------------------ */

:root {
  --m-bg: var(--surface);
  --m-surface: var(--surface);
  --m-surface-alt: var(--surface-alt);
  --m-fg: var(--ink);
  --m-muted: var(--ink-muted);
  --m-line: var(--line);
  --m-line-strong: var(--line-strong);
  --m-accent: var(--brand-orange);
  --m-accent-fg: var(--ink-on-brand);
  /* remiND product accent (design system 1.1.0): marks, rules and borders. Buttons keep the
     brand orange above (--m-accent, ink text). */
  --m-mark: var(--accent-remiND);
  --m-accent-hover: var(--seq-4);  /* dark mode: see the data-theme="dark" rule below */
  --m-link: var(--orange-text);
  --m-link-hover: color-mix(in srgb, var(--orange-text) 75%, var(--ink));
  --m-focus: var(--focus);
  --m-radius: var(--radius-md);
  --m-font: var(--font-sans);
  --m-mono: var(--font-mono);
  /* Two tint strengths only: 14% of a colour on the surface (badges, alerts, mismatch, hover),
     50% of the alternate surface (table zebra). */
  --m-tint: 14%;
  --m-zebra: color-mix(in srgb, var(--surface-alt) 50%, var(--surface));
  --m-hover: color-mix(in srgb, var(--brand-orange) var(--m-tint), var(--surface));
  --m-th-bg: var(--surface-alt);
  --m-code-bg: var(--surface-alt);
  --m-accent-soft: var(--surface-alt);
  --m-mm-bg: color-mix(in srgb, var(--status-critical) 30%, var(--surface));
  --m-ext-bg: var(--seq-2);

  /* Change categories (product owner decision 2026-11-11, CS-372): one chart token each.
     not_found has the neutral chart colour and a dashed outline (see .cat-not_found). */
  --c-edited: var(--chart-1);
  --c-edited_seed: var(--chart-6);
  --c-renamed: var(--chart-2);
  --c-new: var(--chart-5);
  --c-ambiguous: var(--chart-4);
  --c-removed: var(--chart-3);
  --c-identical: var(--chart-other);
  --c-not_found: var(--chart-other);

  --bs-body-font-family: var(--m-font);
  --bs-body-font-size: var(--type-body-size);
  --bs-body-line-height: 1.533;
  --bs-font-monospace: var(--m-mono);
  --bs-body-bg: var(--m-bg);
  --bs-body-color: var(--m-fg);
  --bs-emphasis-color: var(--m-fg);
  --bs-secondary-color: var(--m-muted);
  --bs-secondary-bg: var(--m-surface-alt);
  --bs-tertiary-bg: var(--m-surface-alt);
  --bs-border-color: var(--m-line);
  --bs-border-radius: var(--m-radius);
  --bs-link-color: var(--m-link);
  --bs-link-hover-color: var(--m-link-hover);
  --bs-heading-color: var(--m-fg);
  --bs-code-color: var(--m-fg);
  --bs-primary: var(--brand-orange);
  --bs-danger: var(--status-critical);
  --bs-warning: var(--status-warning);
}

/* The rail is dark in both modes (design system: dark logo on #2e3033 or darker). The only
   hard-coded colours of the app are these rail values: --ink (light mode value) as the rail
   ground in light mode and --surface (dark mode value) in dark mode, and the dark mode values of
   --ink, --ink-muted and --line-strong for text and hairlines on it, because the tokens flip
   with the mode and the rail must not. */
:root { --rail-bg: #2e3033; }
:root[data-theme="dark"] { --rail-bg: #1f2022; }
.tam-rail {
  --rail-ink: #f0f1f1;
  --rail-ink-muted: #a9abad;
  --rail-line: #6d6f72;
  --rail-hover: color-mix(in srgb, var(--rail-ink) 10%, var(--rail-bg));
  --rail-active: color-mix(in srgb, var(--rail-ink) 16%, var(--rail-bg));
  /* the rail is dark in both modes: the dark value of the accent, which is the brand orange */
  --rail-accent: var(--accent-remiND-fill);
}

/* A step darker than the brand orange for hover and pressed buttons. In dark mode the
   sequential scale is reversed, so the same colour is seq-5 there. */
:root[data-theme="dark"] { --m-accent-hover: var(--seq-5); }

/* ---- Base -------------------------------------------------------------------------------- */

body {
  -webkit-font-smoothing: antialiased;
  background: var(--m-bg);
  color: var(--m-fg);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
}
::selection { background: color-mix(in srgb, var(--brand-orange) 35%, transparent); }
strong, b { font-weight: 700; }
a { color: var(--m-link); text-underline-offset: 0.15em; }
a:hover { color: var(--m-link-hover); }
:focus-visible { outline: 2px solid var(--m-focus); outline-offset: 2px; }
code {
  background: var(--m-code-bg);
  color: var(--m-fg);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-family: var(--m-mono);
  font-size: var(--type-mono-size);
}
pre {
  background: var(--m-code-bg);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  padding: 12px 14px;
  font-family: var(--m-mono);
  font-size: var(--type-mono-size);
}
pre code { background: none; padding: 0; font-size: inherit; }
td > code { white-space: nowrap; }
.text-muted { color: var(--m-muted) !important; }

.tam-skip {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 2000;
  padding: 8px 14px;
  background: var(--m-accent);
  color: var(--m-accent-fg);
  border-radius: var(--m-radius);
  font-weight: 600;
  text-decoration: none;
}
.tam-skip:focus { top: 8px; color: var(--m-accent-fg); }

/* ---- Shell: rail and content ------------------------------------------------------------- */

.tam-shell { display: block; }

.tam-rail {
  background: var(--rail-bg);
  color: var(--rail-ink);
  padding: 16px;
}
.tam-rail a { text-decoration: none; color: inherit; }
.tam-rail :focus-visible { outline-color: var(--rail-accent); }

.tam-rail-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
/* Clear space around the logo: at least the height of the signet head (the grey circle). */
.tam-logo { display: block; flex: none; line-height: 0; padding: 12px; margin: -12px; }
.tam-logo img { width: 120px; height: auto; display: block; }
.tam-brand { flex: 1 1 140px; min-width: 0; }
.tam-brand-logo { display: block; width: 148px; }
.tam-brand-logo img { display: block; width: 100%; height: auto; }
.tam-brand-sub { display: block; font-size: var(--type-small-size); color: var(--rail-ink-muted); margin-top: 2px; }
.tam-rail-toggle {
  flex: none;
  background: transparent;
  color: var(--rail-ink);
  border: 1px solid var(--rail-line);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 600;
}
.tam-rail-toggle:hover { background: var(--rail-hover); }

.tam-nav { margin-top: 12px; }
.tam-nav-label {
  font-size: var(--type-small-size);
  color: var(--rail-ink-muted);
  font-weight: 600;
  margin: 14px 12px 4px;
}
.tam-nav-label:first-child { margin-top: 0; }
.tam-nav-link {
  display: block;
  color: var(--rail-ink);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 400;
  font-size: var(--type-body-size);
  line-height: 1.35;
}
.tam-nav-link:hover { background: var(--rail-hover); color: var(--rail-ink); }
.tam-nav-link[aria-current="page"] {
  background: var(--rail-active);
  color: var(--rail-ink);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--rail-accent);
}

.tam-rail-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rail-line); }
.tam-version { font-size: var(--type-small-size); color: var(--rail-ink-muted); margin: 0 0 10px 12px; }
.tam-theme-label { font-size: var(--type-small-size); color: var(--rail-ink-muted); font-weight: 600; margin: 0 0 6px 12px; }
.tam-theme {
  display: flex;
  margin: 0 0 4px;
  border: 1px solid var(--rail-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tam-theme button {
  flex: 1 1 0;
  background: transparent;
  color: var(--rail-ink);
  border: 0;
  border-right: 1px solid var(--rail-line);
  padding: 6px 4px;
  font-size: var(--type-small-size);
  font-weight: 400;
}
.tam-theme button:last-child { border-right: 0; }
.tam-theme button:hover { background: var(--rail-hover); }
.tam-theme button[aria-pressed="true"] {
  background: var(--rail-active);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--rail-accent);
}

/* Gutters: space-4 on phones, space-6 on desktop (design system page). */
.tam-content { min-width: 0; padding: 20px var(--space-4) 24px; }
.tam-content > * { max-width: 1200px; }
.tam-content h1 { font-size: var(--type-h2-size); line-height: var(--type-h2-line); font-weight: 700; margin-bottom: 0.75rem; }
.tam-content h2 { font-size: var(--type-h3-size); line-height: var(--type-h3-line); font-weight: 600; margin: 1.75rem 0 0.75rem; }
.tam-content h3 { font-size: var(--type-body-size); line-height: var(--type-body-line); font-weight: 600; }
.tam-lede { color: var(--m-muted); max-width: 75ch; }

@media (min-width: 900px) {
  .tam-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
  .tam-rail {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 24px 16px 16px;
    display: flex;
    flex-direction: column;
  }
  :root[data-theme="dark"] .tam-rail { border-right: 1px solid var(--m-line); }
  .tam-rail-head { flex-direction: column; align-items: flex-start; flex-wrap: nowrap; gap: 0; padding: 0 6px; }
  .tam-logo { padding: 18px; margin: -18px; }
  .tam-logo img { width: 160px; }
  .tam-brand { flex: none; width: 100%; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--rail-line); }
  .tam-brand-sub { margin-top: 4px; }
  .tam-rail-toggle { display: none; }
  .tam-rail-body, .tam-rail-body.collapse:not(.show) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
  }
  .tam-nav { margin-top: 18px; }
  .tam-rail-foot { margin-top: auto; }
  .tam-content { padding: 28px var(--space-6) 32px; }
  .tam-content h1 { font-size: var(--type-h1-size); line-height: var(--type-h1-line); }
  .tam-content h2 { font-size: var(--type-h2-size); line-height: var(--type-h2-line); }
}

.tam-footer { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--m-line); }

/* ---- Cards, callouts, alerts, forms ------------------------------------------------------ */

.tam-card, .card {
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
}
.tam-card { padding: 1.25rem 1.5rem; }
.tam-card > :first-child { margin-top: 0; }
.tam-card > :last-child { margin-bottom: 0; }
.tam-card h2:first-of-type { margin-top: 0; }
@media (max-width: 575px) { .tam-card { padding: 1rem; } }

/* Neutral note: brand orange bar, alternate surface. Not a status colour. */
.callout {
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  border: 1px solid var(--m-line);
  border-left: 4px solid var(--m-mark);
  border-radius: var(--m-radius);
  background: var(--m-surface-alt);
  color: var(--m-fg);
}
.callout p:last-child { margin-bottom: 0; }

/* Messages: warning and critical status colours on a bar and a tint, ink text, and always a
   visible label in the template ("Warning", "Error" or the existing heading). */
.alert {
  --alert-c: var(--status-warning);
  --bs-alert-color: var(--m-fg);
  --bs-alert-bg: color-mix(in srgb, var(--alert-c) var(--m-tint), var(--m-surface));
  --bs-alert-border-color: var(--m-line);
  --bs-alert-link-color: var(--m-link);
  border-radius: var(--m-radius);
  border-left: 4px solid var(--alert-c);
}
.alert-warning { --alert-c: var(--status-warning); }
.alert-danger { --alert-c: var(--status-critical); }
.alert strong { font-weight: 700; }
.alert > :last-child { margin-bottom: 0; }

.form-control, .form-select {
  background-color: var(--m-surface);
  color: var(--m-fg);
  border-color: var(--m-line-strong);
  border-radius: var(--m-radius);
}
.form-control:focus, .form-select:focus {
  background-color: var(--m-surface);
  color: var(--m-fg);
  border-color: var(--m-focus);
  box-shadow: none;
  outline: 2px solid var(--m-focus);
  outline-offset: 2px;
}
.form-control::placeholder { color: var(--m-muted); }
.form-text { color: var(--m-muted); font-size: var(--type-small-size); margin-top: 0.35rem; }
.form-label, legend.form-label { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.35rem; }
legend.form-label { float: none; width: auto; }
.form-check-input { border-color: var(--m-line-strong); background-color: var(--m-surface); }
.form-check-input:checked {
  background-color: var(--m-accent);
  border-color: var(--m-accent);
}
.form-check-input:focus { border-color: var(--m-focus); box-shadow: none; outline: 2px solid var(--m-focus); outline-offset: 2px; }
/* Marks on the orange are ink, never white (the check mark is an image: --ink-on-brand #2e3033). */
.form-check-input:checked[type="radio"] {
  background-image: radial-gradient(circle, var(--m-accent-fg) 0 32%, transparent 36%);
}
.form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%232e3033' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

/* One form grid (CS-367): Bootstrap row with g-3 gutters, label above the control, same control
   height, same help text. A row of controls is bottom aligned; help text sits only under a
   full width control, so the rows stay level. */
.tam-form { --tam-control-h: 2.375rem; }
.tam-form .form-label, .tam-form legend.form-label { display: block; margin-bottom: 0.35rem; }
.tam-form > .row > * { min-width: 0; }
.tam-fieldset { border: 0; min-width: 0; }  /* gutters come from the row, as for a column */
.tam-form-card { max-width: 900px; }
.tam-radios {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
  min-height: var(--tam-control-h);
}
.tam-radios .form-check { margin: 0; }
.tam-radios-stack { flex-direction: column; align-items: flex-start; min-height: 0; }
@media (max-width: 575px) {
  .tam-radios { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}
.tam-check { display: flex; align-items: center; gap: 0.5rem; min-height: var(--tam-control-h); padding-left: 0; margin: 0; }
.tam-check .form-check-input { float: none; margin: 0; flex: none; }
.tam-check .form-check-label { margin: 0; }
.tam-field-note { display: flex; align-items: center; min-height: var(--tam-control-h); }
.tam-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.tam-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1.5rem;
}
/* A card that starts with a row: keep the row's negative margin that cancels the first gutter. */
.tam-card.tam-form > .row:first-child { margin-top: calc(var(--bs-gutter-y) * -1); }
@media (max-width: 575px) {
  .tam-form .form-control, .tam-form .form-select { width: 100%; }
  .tam-actions .btn { width: 100%; }
  .tam-actions:has(.htmx-indicator) { flex-wrap: nowrap; }
  .tam-actions:has(.htmx-indicator) .btn { flex: 1 1 auto; width: auto; }
  .tam-actions .htmx-indicator { flex: none; }
}

/* Buttons */
.btn { font-weight: 600; border-radius: var(--m-radius); }
.btn:focus-visible { outline: 2px solid var(--m-focus); outline-offset: 2px; box-shadow: none; }
.btn-primary {
  --bs-btn-bg: var(--m-accent);
  --bs-btn-border-color: var(--m-accent);
  --bs-btn-color: var(--m-accent-fg);
  --bs-btn-hover-bg: var(--m-accent-hover);
  --bs-btn-hover-border-color: var(--m-accent-hover);
  --bs-btn-hover-color: var(--m-accent-fg);
  --bs-btn-active-bg: var(--m-accent-hover);
  --bs-btn-active-border-color: var(--m-accent-hover);
  --bs-btn-active-color: var(--m-accent-fg);
  --bs-btn-focus-shadow-rgb: 0, 0, 0;
  --bs-btn-disabled-bg: var(--m-surface-alt);
  --bs-btn-disabled-border-color: var(--m-line);
  --bs-btn-disabled-color: var(--m-muted);
}
.btn-outline-secondary {
  --bs-btn-color: var(--m-fg);
  --bs-btn-border-color: var(--m-line-strong);
  --bs-btn-hover-bg: var(--m-hover);
  --bs-btn-hover-border-color: var(--m-mark);
  --bs-btn-hover-color: var(--m-fg);
  --bs-btn-active-bg: var(--m-hover);
  --bs-btn-active-border-color: var(--m-mark);
  --bs-btn-active-color: var(--m-fg);
  --bs-btn-focus-shadow-rgb: 0, 0, 0;
  --bs-btn-disabled-color: var(--m-muted);
  --bs-btn-disabled-border-color: var(--m-line);
}

/* htmx request indicator (the library's own inline style is switched off for the CSP) */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

.tam-chip {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--m-line);
  border-radius: var(--radius-pill);
  background: var(--m-surface);
  color: var(--m-fg);
  font-size: var(--type-caption-size);
  font-weight: 400;
  line-height: 1.6;
  vertical-align: baseline;
}

/* ---- Tables ------------------------------------------------------------------------------ */

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--m-fg);
  --bs-table-border-color: var(--m-line);
  --bs-table-striped-bg: var(--m-zebra);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0;
}
.table > :not(caption) > * > * { padding: 8px 12px; border-bottom-color: var(--m-line); }
.table > thead > tr > th {
  font-size: var(--type-small-size);
  font-weight: 600;
  color: var(--m-fg);
  background-color: var(--m-th-bg);
  border-bottom: 1px solid var(--m-line);
  white-space: nowrap;
  vertical-align: bottom;
}
.table-responsive { border-radius: var(--m-radius); }
.tam-card .table-responsive { margin: 0; }

/* Result tables scroll inside their card; the header stays visible. */
.tam-scroll {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  background: var(--m-surface);
}
.tam-scroll .table > thead > tr > th { position: sticky; top: 0; z-index: 2; }
.tam-results > tbody > tr:nth-child(even) > * { --bs-table-accent-bg: var(--m-zebra); }
.tam-results > tbody > tr:hover > * { --bs-table-accent-bg: var(--m-hover); }
.tam-results > tbody > tr:last-child > * { border-bottom: 0; }
.tam-nw, .tam-preview td { white-space: nowrap; }
/* Compact result tables: fit 1280px without inner scroll */
.tam-results.table > :not(caption) > * > * { padding: 6px 8px; font-size: .875rem; }
.tam-results .tam-chip { font-size: .72rem; padding: 0 .4em; }
.tam-results td { overflow-wrap: anywhere; }
.tam-results td.tam-nw, .tam-results td.tam-acc { overflow-wrap: normal; }
.tam-results .tam-qa { white-space: normal; overflow-wrap: anywhere; max-width: 14ch; }
.tam-results .tam-note { min-width: 9ch; overflow-wrap: normal; }
.tam-acc { white-space: nowrap; }
.tam-acc a, .tam-mono { font-family: var(--m-mono); font-size: 0.87em; }
.tam-acc a { text-decoration: none; }
.tam-acc a:hover { text-decoration: underline; }
.font-monospace, .tam-seq { font-size: 0.87em; }

.tam-kv > tbody > tr > th {
  width: 11rem;
  font-weight: 600;
  color: var(--m-muted);
  white-space: nowrap;
}
.table-sm { --bs-table-bg: transparent; }

/* ---- Category badges and tiles ---------------------------------------------------------- */

/* One colour per category (--cat-c, a chart token). The badge is a tint of that colour on the
   surface with ink text (the tint token of chart-1 to chart-5, a 14% mix where no tint token
   exists); the colour itself is carried by the dot, never by text. */
.cat-identical { --cat-c: var(--c-identical); }
.cat-renamed { --cat-c: var(--c-renamed); --cat-bg: var(--tint-blue-1); }
.cat-edited { --cat-c: var(--c-edited); --cat-bg: var(--tint-orange-1); }
.cat-edited_seed { --cat-c: var(--c-edited_seed); }
.cat-removed { --cat-c: var(--c-removed); --cat-bg: var(--tint-olive-1); }
.cat-new { --cat-c: var(--c-new); --cat-bg: var(--tint-teal-1); }
.cat-ambiguous { --cat-c: var(--c-ambiguous); --cat-bg: var(--tint-purple-1); }
.cat-not_found { --cat-c: var(--c-not_found); }

.badge.tam-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--cat-bg, color-mix(in srgb, var(--cat-c) var(--m-tint), var(--m-surface)));
  color: var(--m-fg);
  font-size: var(--type-small-size);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge.tam-badge::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-c);
}
/* Not found: neutral colour and a dashed outline, so it differs from identical without a hue. */
.badge.tam-badge.cat-not_found { border: 1px dashed var(--cat-c); }

.tam-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
}
.tam-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 2px;
  background: var(--cat-c, var(--m-mark));
}
.tam-stat.cat-not_found::before { width: 0; background: none; border-left: 4px dashed var(--cat-c); border-radius: 0; }
.tam-stat-n { font-size: var(--type-h2-size); font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tam-stat-l { font-size: var(--type-small-size); color: var(--m-muted); }
/* Per-row warning in a result table: status colour on a bar, ink text, visible label. */
.tam-warning {
  color: var(--m-fg);
  font-weight: 600;
  padding-left: 8px;
  border-left: 3px solid var(--status-warning);
}

/* ---- Sequences and alignment ------------------------------------------------------------- */

.tam-seq { word-break: break-all; }
.tam-seq-wrap { overflow-x: auto; }
.tam-align {
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.75rem 1rem;
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  background: var(--m-surface);
}
.tam-align span { display: inline-block; width: 1ch; text-align: center; }
.tam-align .tam-align-label { width: 4.5ch; text-align: left; font-weight: 400; margin-right: 1ch; color: var(--m-muted); }
.tam-key { display: inline-block; padding: 0 0.3em; font-family: var(--m-mono); }
.tam-key.mm, .tam-align .mm { background: var(--m-mm-bg); color: var(--m-fg); }
.tam-key.ext, .tam-align .ext { background: var(--m-ext-bg); color: var(--m-fg); }
.tam-key.seed, .tam-align .seed { text-decoration: underline; text-decoration-thickness: 2px; }
.tam-align .gap { color: var(--m-muted); }

/* Label with an action button on the same line (list page, CS-368). */
.tam-label-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 0.5rem; }
.tam-label-row .form-label { margin-bottom: 0; }
