/* ChemTrust UI kit + screen styles. Class names are kept stable (components
 * and tests depend on them); the styling is the redesign. */

/* ═══════════════════════════ Primitives ═══════════════════════════ */

/* Page header: title + one-line description + optional action. Every screen
   opens with one so a QHSE user always knows where they are and what's next. */
.ct-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.ct-page-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ct-page-title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 800;
}
.ct-page-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-md);
  max-width: 70ch;
}
.ct-page-actions {
  display: flex;
  gap: var(--space-2);
  flex: 0 0 auto;
}
.ct-page-back {
  display: inline-block;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
}
.ct-page-back:hover {
  color: var(--primary);
}

/* Card */
.ct-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.ct-section {
  margin-top: var(--space-6);
}
.ct-section-title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-lg);
  font-weight: 800;
}

/* Text that sits directly ON the shell canvas — page/section headers, the back
   link, filter labels — rather than inside a card.
   These used to be pinned to fixed light tones because the canvas was navy in
   both themes. The canvas now follows the theme, so they follow it too via the
   --canvas-text ramp: dark ink on the light canvas, light on the dark one.
   Pinning them light again would make every page title invisible in light mode.
   Scoped to `.ct-shell-active` so the login/portal public pages (own layouts)
   are unaffected. */
body.ct-shell-active .ct-page-title,
body.ct-shell-active .ct-section-title {
  color: var(--canvas-text);
}
body.ct-shell-active .ct-page-desc {
  color: var(--canvas-text-muted);
}
body.ct-shell-active .ct-page-back {
  color: var(--canvas-text-subtle);
}
body.ct-shell-active .ct-page-back:hover {
  color: var(--canvas-text);
}
body.ct-shell-active .ct-filters label {
  color: var(--canvas-text-muted);
}

/* Buttons — the eudr-x template, verbatim behavior (style.css .btn-primary /
   .btn-secondary / .btn-danger-outline): solid fills, 6px radius, 0.18s ease,
   a -1px hover LIFT on the primary action, and destructive actions as a
   quiet outline that only turns red on hover ("don't steal attention from
   the primary palette but still signal intent"). Nunito flows from --font-body. */
.ct-btn-primary,
.ct-btn-secondary,
.ct-btn-danger,
.ct-btn-ghost,
.ct-questionnaire-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font: inherit;
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.ct-btn-primary:active,
.ct-btn-secondary:active,
.ct-btn-danger:active {
  transform: translateY(1px);
}

.ct-btn-primary,
.ct-questionnaire-submit {
  background-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.ct-btn-primary:hover:not(:disabled),
.ct-questionnaire-submit:hover:not(:disabled) {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

/* eudr-x .btn-secondary: solid accent, deepens to primary on hover */
.ct-btn-secondary {
  background-color: var(--accent);
  color: #fff;
}
.ct-btn-secondary:hover:not(:disabled) {
  background-color: var(--primary);
}

/* eudr-x .btn-danger-outline: subtle by default, red on hover */
.ct-btn-danger {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--text-muted);
  font-weight: 600;
}
.ct-btn-danger:hover:not(:disabled) {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}

.ct-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 7px 10px;
}
.ct-btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.ct-btn-primary:disabled,
.ct-btn-secondary:disabled,
.ct-btn-danger:disabled,
.ct-btn-ghost:disabled,
.ct-questionnaire-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Form controls */
.ct-question input,
.ct-question select,
.ct-form input,
.ct-form select,
.ct-filters select,
.ct-extraction-actions-row input,
.ct-drawer-actions input,
.ct-drawer-actions textarea,
.ct-workqueue-complete input,
.ct-components-field input,
.ct-completeness-form input,
.ct-tenant-switcher-form input,
.ct-tenant-switcher-form select {
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--text-base);
}
.ct-question input:focus,
.ct-question select:focus,
.ct-form input:focus,
.ct-completeness-form input:focus,
.ct-filters select:focus {
  border-color: var(--focus);
  outline: none;
  /* Ring derived from the navy --focus token (was a leftover forest-green
     literal); tracks the theme via dark.css's --focus flip. */
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}

.ct-label,
.ct-question-label {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text);
}

/* ═══════════════════════════ Stat cards ═══════════════════════════ */

.ct-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.ct-stat {
  position: relative;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
/* Status dot in the corner, as on the ops stat cards. */
.ct-stat::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neutral-status);
}
.ct-stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ct-stat-label {
  margin-top: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
}
.ct-stat.verdict-confirmed::before { background: var(--confirmed); }
.ct-stat.verdict-potential::before { background: var(--potential); }
.ct-stat.verdict-indeterminate::before { background: var(--indeterminate); }
.ct-stat.verdict-clear::before { background: var(--clear); }
.ct-stat.verdict-confirmed .ct-stat-value { color: var(--confirmed); }
.ct-stat.verdict-potential .ct-stat-value { color: var(--potential); }
.ct-stat.verdict-indeterminate .ct-stat-value { color: var(--indeterminate); }
.ct-stat.verdict-clear .ct-stat-value { color: var(--clear); }

/* ═══════════════════════════ Get-started guide ═══════════════════════════ */

.ct-getstarted {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  max-width: 980px;
}
.ct-getstarted h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
}
.ct-getstarted p {
  margin: 0 0 var(--space-5);
  color: var(--text-muted);
  max-width: 52ch;
}
.ct-getstarted-aside {
  align-self: start;
  padding: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ct-aside-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: var(--space-3);
}
.ct-aside-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ct-aside-list li {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
}
.ct-aside-list code {
  flex: 0 0 46px;
  font-weight: 700;
  color: var(--confirmed);
}
.ct-aside-list span {
  color: var(--text-muted);
}
@media (max-width: 760px) {
  .ct-getstarted {
    grid-template-columns: 1fr;
  }
}
.ct-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.ct-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
/* Scoped to .ct-steps so this 30px get-started badge doesn't leak its
   `flex: 0 0 30px` onto the Path B wizard's own `.ct-step-num` (engage.css),
   which would override its 22px width and render an oval. */
.ct-steps .ct-step-num {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: var(--text-sm);
}
.ct-step-text {
  font-weight: 600;
}
.ct-step-text small {
  display: block;
  font-weight: 500;
  color: var(--text-muted);
}

/* Generic empty state (tables, lists) */
.ct-empty {
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
}

/* ═══════════════════════════ Toolbar / filters ═══════════════════════════ */

.ct-filters,
.ct-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
.ct-question {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ct-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-6);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ct-checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ct-checkbox-field label {
  font-weight: 600;
  font-size: var(--text-sm);
}

/* ═══════════════════════════ Table ═══════════════════════════ */

.ct-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ct-table th,
.ct-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ct-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.ct-table tbody tr:last-child td {
  border-bottom: none;
}
.ct-table tbody tr {
  transition: background 0.1s ease;
}
.ct-table tbody tr:hover {
  background: var(--surface-2);
}
.ct-table-empty {
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
}
/* Verdict rail on rows (Dashboard passes rowClassName). */
.ct-table tbody tr.verdict-confirmed td:first-child { box-shadow: inset 3px 0 0 var(--confirmed); }
.ct-table tbody tr.verdict-potential td:first-child { box-shadow: inset 3px 0 0 var(--potential); }
.ct-table tbody tr.verdict-indeterminate td:first-child { box-shadow: inset 3px 0 0 var(--indeterminate); }
.ct-table tbody tr.verdict-clear td:first-child { box-shadow: inset 3px 0 0 var(--clear); }

/* Wrap tables that can overflow horizontally */
.ct-table-scroll {
  overflow-x: auto;
}

/* ═══════════════════════════ StatusBadge ═══════════════════════════ */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: var(--neutral-tint);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.status-confirmed {
  background: var(--confirmed-tint);
  color: var(--confirmed);
  border-color: var(--confirmed-edge);
}
.status-potential,
.status-open,
.status-in_review {
  background: var(--potential-tint);
  color: var(--potential);
  border-color: var(--potential-edge);
}
.status-clear,
.status-validated,
.status-signed_off,
.status-exported {
  background: var(--clear-tint);
  color: var(--clear);
  border-color: var(--clear-edge);
}
.status-indeterminate,
.status-draft,
.status-unknown {
  background: var(--indeterminate-tint);
  color: var(--indeterminate);
  border-color: var(--indeterminate-edge);
}
.status-dismissed {
  background: var(--neutral-tint);
  color: var(--text-subtle);
}

/* Extraction review state chips reuse the same visual grammar. */
.ct-review-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--border);
}
.ct-review-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.ct-review-state-auto { background: var(--neutral-tint); color: var(--text-muted); }
.ct-review-state-pending_review { background: var(--potential-tint); color: var(--potential); border-color: var(--potential-edge); }
.ct-review-state-approved { background: var(--clear-tint); color: var(--clear); border-color: var(--clear-edge); }
.ct-review-state-rejected { background: var(--confirmed-tint); color: var(--confirmed); border-color: var(--confirmed-edge); }
/* Reference rows carry no decision — deliberately the quietest chip on screen
   so a reviewer's eye skips them and lands on what still needs answering. */
.ct-review-state-reference { background: var(--surface-2); color: var(--text-subtle); border-color: var(--border); }
.ct-review-state-reference::before { display: none; }

/* ═══════════════════════════ ConfidenceBar ═══════════════════════════ */

.ct-confidence {
  position: relative;
  display: inline-block;
  width: 100%;
  min-width: 90px;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
  vertical-align: middle;
}
.ct-confidence-fill {
  height: 100%;
  background: var(--clear);
  border-radius: 4px;
}
.ct-confidence[data-level="med"] .ct-confidence-fill { background: var(--potential); }
.ct-confidence[data-level="low"] .ct-confidence-fill { background: var(--confirmed); }

/* ═══════════════════════════ FileDrop ═══════════════════════════ */

.ct-filedrop-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.ct-filedrop {
  /* Contains the visually-hidden file input: without it the 1px input is
     placed against the page and stretches the document below the scrolling
     .ct-main, giving phones a second, empty scroll. */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-5);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.ct-filedrop:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.ct-filedrop.dragover {
  border-color: var(--primary);
  border-style: solid;
  background: var(--primary-soft);
  color: var(--primary);
}
.ct-filedrop-icon {
  width: 38px;
  height: 38px;
  color: var(--accent);
}
.ct-filedrop-primary {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
}
.ct-filedrop-hint {
  font-size: var(--text-sm);
  color: var(--text-subtle);
}
.ct-filedrop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ct-filedrop-error {
  margin: 0;
  color: var(--confirmed);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ═══════════════════════════ Toast ═══════════════════════════ */

.ct-toast-viewport {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 340px;
  max-width: calc(100vw - 40px);
  z-index: 1000;
}
.ct-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--text);
  box-shadow: var(--shadow-lg);
}
.ct-toast span {
  flex: 1 1 auto;
}
.ct-toast-error { background: var(--confirmed); }
.ct-toast-success { background: var(--clear); }
.ct-toast-info { background: var(--accent); }
.ct-toast-reqid {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  opacity: 0.85;
}
.ct-toast-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
}

/* ═══════════════════════════ Questionnaire ═══════════════════════════ */

.ct-questionnaire,
.ct-pathb-questionnaire {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 660px;
}
.ct-question-error {
  margin: 0;
  color: var(--confirmed);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ═══════════════════════════ SDS upload / result ═══════════════════════════ */

.ct-sds-upload {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
/* The dropzone stays a comfortable width even though the document list below
   it spans the full content column. */
.ct-sds-upload > .ct-filedrop-wrap {
  max-width: 680px;
}
.ct-sds-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--clear-edge);
  border-radius: var(--radius);
  background: var(--clear-tint);
}
.ct-sds-result p {
  margin: 0;
  font-weight: 600;
}

/* ═══════════════════════════ Extraction review ═══════════════════════════ */

.ct-extraction-review {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.ct-extraction-failed,
.ct-extraction-error {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius);
  font-weight: 700;
}
.ct-extraction-failed {
  background: var(--potential-tint);
  color: var(--potential);
  border: 1px solid var(--potential-edge);
}
.ct-extraction-error {
  background: var(--confirmed-tint);
  color: var(--confirmed);
  border: 1px solid var(--confirmed-edge);
}
.ct-extraction-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 230px;
}
.ct-extraction-actions-row {
  display: flex;
  gap: 6px;
}
.ct-extraction-actions-row input {
  flex: 1 1 auto;
  min-width: 0;
}
/* Table cells stay one scannable line; the whole value lives in the drawer.
   A raw section-15 capture is 2000 characters and used to stretch its row to
   ~600px, which broke the table as a scan surface. */
.ct-cell-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 46ch;
}
.ct-row-pending td:first-child {
  box-shadow: inset 3px 0 0 var(--potential);
}
.ct-btn-sm {
  padding: 4px 10px;
  font-size: var(--text-xs);
}

/* ═══════════════════════════ Drawer ═══════════════════════════ */

.ct-drawer-wrap {
  position: fixed;
  inset: 0;
  z-index: 4000;
}
.ct-drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 41, 0.38);
}
.ct-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 40px rgba(15, 27, 41, 0.18);
  outline: none;
}
.ct-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.ct-drawer-title {
  margin: 0;
  font-size: var(--text-md);
  line-height: 1.35;
  color: var(--text);
}
.ct-drawer-subtitle {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-subtle);
}
.ct-drawer-close {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 4px 9px;
  cursor: pointer;
}
.ct-drawer-close:hover {
  background: var(--surface-3);
  color: var(--text);
}
.ct-drawer-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  overflow-y: auto;
}
.ct-drawer-ask {
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--text);
  font-weight: 700;
}
.ct-drawer-state {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.ct-drawer-meta {
  flex-wrap: wrap;
}
.ct-drawer-section {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}
.ct-evidence-quote {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  white-space: pre-wrap;
}
.ct-evidence-quote mark {
  background: var(--potential-tint);
  color: var(--potential);
  font-weight: 700;
  border-radius: 3px;
  padding: 0 2px;
}
.ct-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.ct-drawer-actions-row {
  display: flex;
  gap: 6px;
}
.ct-drawer-actions-row button {
  flex: 1 1 0;
}
.ct-drawer-label {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
}
.ct-drawer-textarea {
  width: 100%;
  resize: vertical;
  font-family: inherit;
}
body.ct-drawer-open {
  overflow: hidden;
}

/* ═══════════════════════════ Products / detail ═══════════════════════════ */

.ct-product-meta {
  display: flex;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.ct-evidence {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ═══════════════════════════ Campaigns ═══════════════════════════ */

.ct-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.ct-campaign-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-6);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.ct-campaign-links-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ct-campaign-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.ct-campaign-link-supplier {
  font-weight: 700;
  min-width: 140px;
}
.ct-campaign-link-url {
  flex: 1 1 auto;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  word-break: break-all;
}

/* ═══════════════════════════ Path B wizard ═══════════════════════════ */

.ct-pathb-process-context {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.ct-pathb-summary,
.ct-pathb-match {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}
.ct-pathb-summary {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ═══════════════════════════ Submissions ═══════════════════════════ */

.ct-legal-caveat {
  padding: var(--space-4) var(--space-5);
  margin: var(--space-3) 0;
  border-radius: var(--radius);
  background: var(--potential-tint);
  color: var(--potential);
  border: 1px solid var(--potential-edge);
  font-weight: 600;
}
.ct-submission-actions {
  display: flex;
  flex-wrap: wrap; /* XLSX + JSON export + hint no longer fit one phone row */
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

/* ═══════════════════════════ Ops console ═══════════════════════════ */

.ct-tenant-switcher {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.ct-tenant-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 11px 16px;
  border-radius: var(--radius);
  background: var(--clear-tint);
  color: var(--clear);
  border: 1px solid var(--clear-edge);
  font-weight: 700;
}
.ct-tenant-banner-empty {
  background: var(--potential-tint);
  color: var(--potential);
  border-color: var(--potential-edge);
}
.ct-tenant-switcher-form {
  display: flex;
  gap: var(--space-2);
  margin: 0;
}
/* Phones: the switcher is pinned above the page's scroller, so every pixel it
   takes is lost to the page. One compact banner line + the client select; the
   "act as" button only shows once a different client is picked. */
@media (max-width: 600px) {
  .ct-tenant-switcher {
    gap: 6px;
    margin-bottom: var(--space-3);
  }
  .ct-tenant-banner {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 8px 12px;
    font-size: var(--text-sm);
  }
  .ct-tenant-banner > span {
    flex: 1 1 10rem;
    min-width: 0;
  }
  .ct-tenant-banner .ct-btn-secondary {
    padding: 5px 10px;
    font-size: var(--text-xs);
    white-space: normal;
  }
  .ct-tenant-switcher-form {
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
  }
  .ct-tenant-switcher-form .ct-question {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
  }
  .ct-tenant-switcher-form .ct-question label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .ct-tenant-switcher-form select {
    width: 100%;
  }
  .ct-tenant-switcher-form .ct-btn-primary {
    flex: 0 1 auto;
    max-width: 45%;
    white-space: normal;
  }
  .ct-tenant-switcher-form .ct-btn-primary:disabled {
    display: none;
  }
}
.ct-workqueue-complete {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 230px;
}
.ct-workqueue-complete input[type="number"] {
  width: 96px;
}
.ct-validation-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  max-width: 440px;
}
.ct-evidence-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ct-evidence-list .ct-evidence {
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ═══════════════════════════ Supplier portal ═══════════════════════════ */

.ct-portal-invalid,
.ct-portal-confirmation {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 640px;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.ct-portal-landing {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 720px;
}
.ct-portal-context {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ct-portal-attachments {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ct-portal-attachments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ct-portal-attachments-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

/* ═══════════════════════════ CMR components widget ═══════════════════════════ */

.ct-components-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ct-components-field input {
  width: 100%;
}
