/* ============================================================================
   Components — every treatment named in the THSTI spec, and nothing more.

   House rules carried over from the spec:
     · square corners (0–4px), never a pill except on status chips
     · one maroon primary button per view
     · maroon ⇄ navy swap on hover for buttons, links and tabs
     · the orange gradient appears once per view, on a table/modal header
   ========================================================================= */

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 9px 22px;
  border: 1.5px solid transparent;
  border-radius: var(--r-1);
  font-family: var(--thsti-font-body);
  font-weight: 700;
  font-size: var(--fs-sm);
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease);
}
.btn .icon { width: 16px; height: 16px; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--thsti-divider);
  border-color: var(--thsti-divider);
  color: var(--thsti-disabled);
  cursor: not-allowed;
}

.btn-primary { background: var(--thsti-maroon); border-color: var(--thsti-maroon); color: #fff; }
.btn-primary:hover { background: var(--thsti-navy); border-color: var(--thsti-navy); color: #fff; }
.btn-primary:active { background: var(--thsti-navy-dark); border-color: var(--thsti-navy-dark); }

.btn-secondary { background: var(--thsti-surface); border-color: var(--thsti-maroon); color: var(--thsti-maroon); }
.btn-secondary:hover { background: var(--thsti-maroon); color: #fff; }

.btn-navy { background: var(--thsti-navy); border-color: var(--thsti-navy); color: #fff; }
.btn-navy:hover { background: var(--thsti-maroon); border-color: var(--thsti-maroon); }

.btn-quiet {
  background: var(--thsti-surface);
  border-color: var(--thsti-border);
  color: var(--thsti-body);
  font-weight: 700;
}
.btn-quiet:hover { border-color: var(--thsti-navy); color: var(--thsti-navy); }

.btn-sm { padding: 6px 14px; font-size: var(--fs-xs); }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ chips/tags */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-1);
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.chip-active { background: var(--thsti-navy); color: #fff; }         /* selection */
.chip-neutral { background: var(--thsti-divider); color: var(--thsti-body); }
.chip-outline { background: transparent; border: 1px solid var(--thsti-border); color: var(--thsti-text-2nd); }
.chip button {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: inherit; opacity: 0.75; display: grid; place-items: center;
}
.chip button:hover { opacity: 1; }
.chip .icon { width: 13px; height: 13px; }

/* Status pills ship with a dot + a word — never colour alone. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-success { background: var(--thsti-success-bg); color: var(--thsti-success); }
.pill-warning { background: var(--thsti-warning-bg); color: #A85D0E; }
.pill-error   { background: var(--thsti-error-bg);   color: var(--thsti-error); }
.pill-info    { background: var(--thsti-info-bg);    color: var(--thsti-info); }
.pill-neutral { background: var(--thsti-divider);    color: var(--thsti-text-2nd); }

/* ------------------------------------------------------------------ card */

.card {
  background: var(--thsti-surface);
  border: 1px solid var(--thsti-border);
  border-radius: var(--r-1);
  box-shadow: var(--sh-1);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--thsti-rule);
}
.card-head h3 {
  font-family: var(--thsti-font-heading);
  font-weight: 600;
  font-size: 16px;
  color: var(--thsti-text);
}
.card-head .sub { font-size: var(--fs-xs); color: var(--thsti-text-2nd); margin-top: 2px; }
.card-body { padding: var(--sp-5); }
.card-body.tight { padding: var(--sp-4); }
.card-body.flush { padding: 0; }
.card-foot {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--thsti-rule);
  background: var(--thsti-zebra);
  font-size: var(--fs-xs);
  color: var(--thsti-text-2nd);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* ------------------------------------------------------------- KPI tiles */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--gutter);
}

/* The 3px maroon top rule is the brand mark of a card. */
.kpi {
  background: var(--thsti-surface);
  border: 1px solid var(--thsti-border);
  border-top: 3px solid var(--thsti-maroon);
  border-radius: var(--r-1);
  box-shadow: var(--sh-1);
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.kpi:hover { box-shadow: var(--sh-2); }
.kpi-navy   { border-top-color: var(--thsti-navy); }
.kpi-orange { border-top-color: var(--thsti-orange); }
.kpi-neutral{ border-top-color: var(--thsti-disabled); }

.kpi-label {
  font-weight: 700;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--thsti-text-2nd);
}
.kpi-value {
  font-family: var(--thsti-font-heading);
  font-weight: 700;
  font-size: var(--fs-kpi);
  color: var(--thsti-text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-top: var(--sp-1);
}
.kpi-value.accent { color: var(--thsti-maroon); }
.kpi-meta { font-size: var(--fs-xs); color: var(--thsti-navy); display: flex; align-items: center; gap: 5px; }
.kpi-meta .icon { width: 13px; height: 13px; }
.kpi-meta.down { color: var(--thsti-error); }
.kpi-meta.flat { color: var(--thsti-text-2nd); }
.kpi-foot { margin-top: var(--sp-3); }

/* Slim progress bar used inside tiles and tables */
.meter {
  height: 6px;
  background: var(--thsti-divider);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  background: var(--thsti-maroon);
  border-radius: var(--r-pill);
}
.meter.navy > span { background: var(--thsti-navy); }
.meter.orange > span { background: var(--thsti-orange); }
.meter-row { display: flex; align-items: center; gap: var(--sp-3); }
.meter-row .meter { flex: 1 1 auto; }
.meter-row .val { font-size: var(--fs-xs); font-weight: 700; color: var(--thsti-text-2nd); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

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

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--thsti-font-body);
  font-size: var(--fs-sm);
}
.table th {
  text-align: left;
  padding: 10px 14px;
  font-family: var(--thsti-font-heading);
  font-weight: 600;
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--thsti-rule);
  vertical-align: middle;
}
.table tbody tr:nth-child(even) { background: var(--thsti-zebra); }
.table tbody tr:hover { background: var(--thsti-maroon-100); }
.table .num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 700; color: var(--thsti-maroon); }
.table caption {
  caption-side: bottom;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--thsti-text-2nd);
  text-align: left;
}

/* The site's striped-table header: one gradient band per view. */
.table-gradient thead tr { background: var(--thsti-gradient); }
.table-gradient thead th { background: transparent; color: #fff; }

/* The calmer alternative for dense analytical tables. */
.table-navy thead tr { background: var(--thsti-navy); }
.table-navy thead th { background: transparent; color: #fff; }

/* Quietest of all — for tables nested inside a card that already has a head. */
.table-plain thead tr { background: var(--thsti-panel); }
.table-plain thead th { color: var(--thsti-text-2nd); border-bottom: 1px solid var(--thsti-border); }

/* Sticky header for long scrolling tables */
.table-sticky thead th { position: sticky; top: 0; z-index: 2; }

/* Sortable headers */
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable::after {
  content: "";
  display: inline-block;
  width: 0; height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.35;
}
.table th.sortable[aria-sort="ascending"]::after { transform: rotate(180deg); opacity: 1; }
.table th.sortable[aria-sort="descending"]::after { opacity: 1; }

/* First column that names the row */
.table .row-name { font-weight: 700; color: var(--thsti-text); }

/* ------------------------------------------------------------------ tabs */

.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--thsti-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 16px;
  font-family: var(--thsti-font-body);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--thsti-text-2nd);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.tab:hover { color: var(--thsti-navy); }
.tab[aria-selected="true"] { color: var(--thsti-maroon); border-bottom-color: var(--thsti-maroon); }
.tab .count {
  margin-left: 6px;
  font-size: 11px;
  background: var(--thsti-divider);
  color: var(--thsti-text-2nd);
  padding: 1px 6px;
  border-radius: var(--r-pill);
}
.tab[aria-selected="true"] .count { background: var(--thsti-maroon-100); color: var(--thsti-maroon); }

.tab-panel[hidden] { display: none; }

/* ----------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label {
  font-weight: 700;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--thsti-text-2nd);
}

.input, .select, .textarea {
  width: 100%;
  padding: 8px 11px;
  background: var(--thsti-surface);
  border: 1px solid var(--thsti-border);
  border-radius: var(--r-1);
  font-size: var(--fs-sm);
  color: var(--thsti-body);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.input::placeholder { color: var(--thsti-disabled); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--thsti-muted); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--thsti-navy);
  box-shadow: 0 0 0 3px var(--thsti-navy-100);
}
.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23777' stroke-width='1.8' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.textarea { min-height: 96px; resize: vertical; }

.input-icon { position: relative; }
.input-icon .icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--thsti-muted);
  pointer-events: none;
}
.input-icon .input { padding-left: 33px; }

.check { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--thsti-maroon); cursor: pointer; }

.hint { font-size: var(--fs-xs); color: var(--thsti-text-2nd); }
.error-text { font-size: var(--fs-xs); color: var(--thsti-error); font-weight: 700; }

/* ------------------------------------------------------------- filterbar */

.filterbar {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  background: var(--thsti-surface);
  border: 1px solid var(--thsti-border);
  border-left: 3px solid var(--thsti-navy);
  border-radius: var(--r-1);
  box-shadow: var(--sh-1);
  margin-bottom: var(--gutter);
}
.filterbar .field { flex: 0 1 auto; width: 168px; }
.filterbar .field.wide { width: 240px; }
.filterbar .actions { display: flex; gap: var(--sp-2); margin-left: auto; }

@media (max-width: 640px) {
  .filterbar .field, .filterbar .field.wide { width: 100%; }
  .filterbar .actions { width: 100%; margin-left: 0; }
  .filterbar .actions .btn { flex: 1 1 auto; }
}

/* -------------------------------------------------------------- dropdown */

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  z-index: var(--z-dropdown);
  background: var(--thsti-surface);
  border: 1px solid var(--thsti-border);
  border-radius: var(--r-1);
  box-shadow: var(--sh-3);
  padding: var(--sp-2);
  display: none;
}
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-menu .menu-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: var(--r-1);
  font-size: var(--fs-sm);
  color: var(--thsti-body);
  text-align: left;
  cursor: pointer;
}
.dropdown-menu .menu-item:hover { background: var(--thsti-panel); color: var(--thsti-navy); }
.dropdown-menu .menu-item .icon { width: 15px; height: 15px; }
.dropdown-menu .menu-head {
  padding: 8px 10px;
  border-bottom: 1px solid var(--thsti-rule);
  margin-bottom: var(--sp-2);
}
.dropdown-menu .menu-sep { height: 1px; background: var(--thsti-rule); margin: var(--sp-2) 0; }
.dropdown-menu label.check { padding: 6px 10px; width: 100%; }
.dropdown-menu label.check:hover { background: var(--thsti-panel); }

/* User button in the topbar */
.user-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px 10px 5px 6px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.user-btn:hover { background: var(--thsti-panel); }
.avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--thsti-navy);
  color: #fff;
  font-family: var(--thsti-font-heading);
  font-weight: 700;
  font-size: 12px;
  border-radius: var(--r-pill);
}
.user-btn .who { font-size: var(--fs-xs); font-weight: 700; color: var(--thsti-text); line-height: 1.2; }
.user-btn .role { font-size: 11px; color: var(--thsti-text-2nd); }

/* ----------------------------------------------------------------- modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: var(--sp-8) var(--sp-4);
  background: rgba(34, 34, 34, 0.55);
  overflow-y: auto;
}
.modal.is-open { display: flex; }
.modal-box {
  width: 100%;
  max-width: 560px;
  background: var(--thsti-surface);
  border-radius: var(--r-1);
  box-shadow: var(--sh-3);
  overflow: hidden;
  animation: modal-in var(--dur-3) var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* Modal header carries the signature gradient, as on the site. */
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--thsti-gradient);
  color: #fff;
}
.modal-head h3 { font-family: var(--thsti-font-heading); font-weight: 600; font-size: 17px; color: #fff; }
.modal-head .icon-btn { color: #fff; }
.modal-head .icon-btn:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.modal-body { padding: var(--sp-5); }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--thsti-rule);
  background: var(--thsti-zebra);
}

/* Wizard steps inside a modal */
.steps { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.step { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--thsti-text-2nd); }
.step .dot {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--thsti-divider);
  color: var(--thsti-text-2nd);
  font-weight: 700;
  font-size: 11px;
}
.step.is-current .dot { background: var(--thsti-maroon); color: #fff; }
.step.is-done .dot { background: var(--thsti-success); color: #fff; }
.step.is-current, .step.is-done { color: var(--thsti-text); font-weight: 700; }
.step-line { flex: 1 1 auto; height: 1px; background: var(--thsti-border); }

/* ---------------------------------------------------------------- alerts */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-1);
  border-left: 3px solid;
  font-size: var(--fs-sm);
}
.alert .icon { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.alert-info    { background: var(--thsti-info-bg);    border-color: var(--thsti-info);    color: var(--thsti-navy-dark); }
.alert-success { background: var(--thsti-success-bg); border-color: var(--thsti-success); color: #1F5C32; }
.alert-warning { background: var(--thsti-warning-bg); border-color: var(--thsti-orange);  color: #8A4A0B; }
.alert-error   { background: var(--thsti-error-bg);   border-color: var(--thsti-error);   color: #96201F; }

/* ------------------------------------------------------------ pagination */

.pager { display: flex; align-items: center; gap: var(--sp-1); }
.pager button {
  min-width: 32px; height: 32px;
  padding: 0 8px;
  background: var(--thsti-surface);
  border: 1px solid var(--thsti-border);
  border-radius: var(--r-1);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--thsti-body);
  cursor: pointer;
  transition: all var(--dur-1) var(--ease);
}
.pager button:hover:not(:disabled) { border-color: var(--thsti-navy); color: var(--thsti-navy); }
.pager button[aria-current="page"] {
  background: var(--thsti-maroon);
  border-color: var(--thsti-maroon);
  color: #fff;
}
.pager button:disabled { color: var(--thsti-disabled); cursor: not-allowed; }

/* ------------------------------------------------------------ empty/skel */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-12) var(--sp-5);
  text-align: center;
  color: var(--thsti-text-2nd);
}
.empty .icon { width: 34px; height: 34px; color: var(--thsti-disabled); }
.empty h4 { font-family: var(--thsti-font-heading); font-weight: 600; font-size: 16px; color: var(--thsti-text); }

.skeleton {
  background: linear-gradient(90deg, var(--thsti-divider) 25%, var(--thsti-zebra) 37%, var(--thsti-divider) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-1);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

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

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--thsti-rule);
}
.toolbar .search { width: 250px; }
@media (max-width: 640px) { .toolbar .search { width: 100%; } }

/* --------------------------------------------------------- swatch (docs) */

.swatch { border: 1px solid var(--thsti-border); border-radius: var(--r-1); overflow: hidden; background: var(--thsti-surface); }
.swatch .fill { height: 92px; display: flex; align-items: flex-end; padding: 10px 12px; color: #fff; font-family: var(--thsti-font-mono); font-size: var(--fs-xs); }
.swatch .meta { padding: 10px 12px; }
.swatch .meta .name { font-family: var(--thsti-font-heading); font-weight: 600; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: var(--ls-heading); }
.swatch .meta .note { font-size: var(--fs-xs); color: var(--thsti-text-2nd); margin-top: 2px; }

.spec-note {
  font-size: var(--fs-xs);
  color: var(--thsti-text-2nd);
  border-left: 2px solid var(--thsti-border);
  padding-left: var(--sp-3);
  margin-top: var(--sp-3);
}

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

.toast-host {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 340px;
  padding: 10px 14px;
  background: var(--thsti-text);
  color: #fff;
  border-left: 3px solid var(--thsti-orange);
  border-radius: var(--r-1);
  box-shadow: var(--sh-3);
  font-size: var(--fs-xs);
  animation: toast-in var(--dur-2) var(--ease);
}
.toast .icon { width: 16px; height: 16px; flex: 0 0 auto; }
.toast.is-leaving { opacity: 0; transition: opacity var(--dur-3) var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .toast-host { left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4); }
  .toast { max-width: none; }
}

/* ------------------------------------------------------- small additions */

.text-left { text-align: left; }
.user-btn .who, .user-btn .role { display: block; }
.dropdown-menu.align-left { left: 0; right: auto; }

/* A button that reads as a select — used for multi-select filters. */
.picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  width: 100%;
  padding: 8px 11px;
  background: var(--thsti-surface);
  border: 1px solid var(--thsti-border);
  border-radius: var(--r-1);
  font-size: var(--fs-sm);
  color: var(--thsti-body);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease);
}
.picker:hover { border-color: var(--thsti-muted); }
.picker .icon { width: 14px; height: 14px; flex: 0 0 auto; color: var(--thsti-muted); }
.picker .val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Matrix cell used by the form-status grid */
.cellbar {
  display: block;
  height: 22px;
  min-width: 44px;
  border-radius: var(--r-1);
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  color: #fff;
}
.cellbar.q1 { background: var(--seq-1); color: var(--thsti-maroon-dark); }
.cellbar.q2 { background: var(--seq-2); color: var(--thsti-maroon-dark); }
.cellbar.q3 { background: var(--seq-3); }
.cellbar.q4 { background: var(--seq-4); }
.cellbar.q5 { background: var(--seq-5); }

.scale-legend { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--thsti-text-2nd); }
.scale-legend .ramp { display: flex; }
.scale-legend .ramp i { width: 26px; height: 10px; display: block; }

/* A frozen first column, for wide matrices that scroll sideways. */
.table-stickycol th:first-child,
.table-stickycol td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--thsti-surface);
}
.table-stickycol tbody tr:nth-child(even) td:first-child { background: var(--thsti-zebra); }
.table-stickycol tbody tr:hover td:first-child { background: var(--thsti-maroon-100); }
.table-stickycol thead th:first-child { z-index: 3; }
.table-navy.table-stickycol thead th:first-child { background: var(--thsti-navy); }
.table-plain.table-stickycol thead th:first-child { background: var(--thsti-panel); }

/* One-time-code entry (payment transfer wizard) */
.otp { display: flex; gap: var(--sp-2); }
.otp input {
  width: 46px; height: 54px;
  padding: 0;
  text-align: center;
  font-family: var(--thsti-font-heading);
  font-weight: 700;
  font-size: 20px;
  color: var(--thsti-text);
  background: var(--thsti-surface);
  border: 1px solid var(--thsti-border);
  border-radius: var(--r-1);
}
.otp input:focus {
  outline: none;
  border-color: var(--thsti-navy);
  box-shadow: 0 0 0 3px var(--thsti-navy-100);
}
@media (max-width: 420px) { .otp input { width: 40px; height: 48px; font-size: 17px; } }

/* Definition rows inside a modal or a detail panel */
.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); }
.dl dt { color: var(--thsti-text-2nd); font-weight: 700; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--ls-label); align-self: center; }
.dl dd { margin: 0; color: var(--thsti-text); }
@media (max-width: 480px) { .dl { grid-template-columns: minmax(0, 1fr); gap: 2px var(--sp-4); } .dl dd { margin-bottom: var(--sp-2); } }

/* On a narrow topbar the avatar alone identifies the user. */
@media (max-width: 560px) {
  .user-btn .who, .user-btn .role { display: none; }
  .user-btn > .icon { display: none; }
  .user-btn { padding: 4px; }
}
