/* Shared components. Pages use only these t- classes; colours and sizes come from tokens.css.
   Visual reference: docs/banani/*.png. */

/* ---------- Buttons ---------- */
.t-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.t-btn .t-icon {
  width: 18px;
  height: 18px;
}

.t-btn:hover {
  text-decoration: none;
}

.t-btn--primary {
  background: var(--brand-accent);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-sm);
}

.t-btn--primary:hover {
  background: color-mix(in srgb, var(--brand-accent) 86%, black);
  color: var(--color-on-accent);
}

.t-btn--outline {
  border-color: var(--brand-accent);
  background: var(--color-surface);
  color: var(--brand-accent);
}

.t-btn--outline:hover {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.t-btn--secondary {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.t-btn--secondary:hover {
  background: var(--color-surface-sunken);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.t-btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 500;
}

.t-btn--ghost:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

.t-btn--danger {
  border-color: transparent;
  background: var(--color-danger-bg);
  color: var(--color-danger-strong);
}

.t-btn--danger:hover {
  background: color-mix(in srgb, var(--color-danger-bg) 80%, var(--color-danger));
  color: var(--color-danger-strong);
}

.t-btn--danger-solid {
  background: var(--color-danger);
  color: var(--color-on-solid);
}

.t-btn--danger-solid:hover {
  background: var(--color-danger-strong);
  color: var(--color-on-solid);
}

/* Light button on an accent surface, such as the overview hero. */
.t-btn--inverse {
  background: var(--color-surface);
  color: var(--brand-accent);
}

.t-btn--inverse:hover {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.t-btn--sm {
  min-height: var(--control-height-sm);
  padding: 0 var(--space-3);
  font-size: var(--font-size-xs);
}

.t-btn--sm .t-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

.t-btn--lg {
  min-height: var(--control-height-lg);
  padding: 0 var(--space-6);
  font-size: var(--font-size-base);
}

body.t-public .t-btn--lg {
  border-radius: var(--radius-lg);
  font-size: 17px;
}

.t-btn--icon {
  width: var(--control-height);
  min-width: var(--control-height);
  padding: 0;
}

.t-btn--block {
  width: 100%;
}

.t-btn--dashed {
  border: 1px dashed var(--brand-accent);
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.t-btn--dashed:hover {
  background: color-mix(in srgb, var(--brand-accent-soft) 70%, var(--color-surface));
  color: var(--brand-accent);
}

.t-btn--link {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-accent);
  font-weight: 600;
}

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

.t-btn:disabled,
.t-segmented button:disabled,
.t-choice:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.t-card > .t-btn:not(.t-btn--block) {
  align-self: flex-start;
}

/* ---------- Fields ---------- */
.t-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.t-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.t-label .t-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

.t-label__quiet {
  font-weight: 400;
  color: var(--color-text-muted);
}

.t-input,
.t-textarea,
.t-select {
  width: 100%;
  min-height: var(--control-height);
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.t-input::placeholder,
.t-textarea::placeholder {
  color: color-mix(in srgb, var(--color-text-muted) 80%, var(--color-surface));
}

.t-input:focus,
.t-textarea:focus,
.t-select:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 18%, transparent);
}

.t-textarea {
  min-height: 96px;
  padding: var(--space-3) 14px;
  resize: vertical;
  line-height: 1.5;
}

.t-textarea--secret {
  background: var(--color-surface);
  font-family: var(--font-mono);
}

.t-select {
  appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--color-text) 50%),
    linear-gradient(135deg, var(--color-text) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.t-field--error .t-input,
.t-field--error .t-textarea,
.t-field--error .t-select {
  border-color: var(--color-danger);
}

.t-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.t-hint .t-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  margin-top: 1px;
}

.t-hint--warning {
  color: var(--color-warning-strong);
}

.t-hint--error {
  color: var(--color-danger);
}

.t-counter {
  align-self: flex-end;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ---------- Segmented control ---------- */
.t-segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.t-segmented button {
  min-height: var(--control-height);
  padding: 0 var(--space-2);
  border: 0;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-weight: 500;
  cursor: pointer;
}

.t-segmented button:last-child {
  border-right: 0;
}

.t-segmented button:hover {
  background: var(--color-surface-sunken);
  color: var(--color-text);
}

.t-segmented button[aria-pressed="true"] {
  background: var(--brand-accent);
  color: var(--color-on-accent);
  font-weight: 600;
}

/* ---------- Stepper ---------- */
.t-stepper {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.t-stepper__group {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.t-stepper__group .t-btn {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.t-stepper__value {
  min-width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  font-size: var(--font-size-base);
  font-weight: 600;
}

.t-stepper > .t-stepper__value {
  border: 0;
  font-size: 20px;
}

/* ---------- Cards ---------- */
.t-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  max-width: 100%;
}

.t-card--flush {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.t-card--elevated {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-raised);
  padding: var(--space-7);
  gap: var(--space-5);
}

.t-card--accent {
  border-color: var(--brand-accent);
  border-width: 2px;
}

.t-card--danger {
  border-color: var(--color-danger);
}

.t-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: calc(var(--space-6) * -1) calc(var(--space-6) * -1) 0;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  min-width: 0;
}

.t-card--flush > .t-card__header {
  margin: 0;
}

.t-card--elevated > .t-card__header {
  margin: calc(var(--space-7) * -1) calc(var(--space-7) * -1) 0;
  padding: var(--space-5) var(--space-7);
}

.t-card__header .t-card__title {
  flex: 1;
  min-width: 0;
}

.t-card__header-end {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.t-card__title {
  margin: 0;
  font-size: var(--font-size-h2);
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

h1.t-card__title {
  font-size: var(--font-size-h1);
}

.t-card__title-quiet {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.t-card__body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.t-card__footer {
  margin: 0 calc(var(--space-6) * -1) calc(var(--space-6) * -1);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-sunken);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.t-step {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--brand-accent);
  color: var(--color-on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 700;
}

/* ---------- Icon tiles ---------- */
.t-icon-tile {
  width: var(--tile-size);
  height: var(--tile-size);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.t-icon-tile .t-icon {
  width: var(--icon-size);
  height: var(--icon-size);
}

.t-icon-tile--sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.t-icon-tile--sm .t-icon {
  width: 17px;
  height: 17px;
}

.t-icon-tile--lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
}

.t-icon-tile--lg .t-icon {
  width: 32px;
  height: 32px;
}

.t-icon-tile--neutral {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

.t-icon-tile--accent {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.t-icon-tile--solid {
  background: var(--brand-accent);
  color: var(--color-on-accent);
}

.t-icon-tile--dark {
  background: var(--color-sidebar);
  color: var(--color-sidebar-text);
}

.t-icon-tile--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.t-icon-tile--info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.t-icon-tile--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.t-icon-tile--danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

/* ---------- Badges ---------- */
.t-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.t-badge .t-icon {
  width: 14px;
  height: 14px;
}

.t-badge--info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.t-badge--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.t-badge--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.t-badge--danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.t-badge--neutral {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.t-badge--accent {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.t-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.t-tag--accent {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.t-tag .t-icon {
  width: 13px;
  height: 13px;
}

.t-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* ---------- Alerts and callouts ---------- */
.t-alert {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: 14px var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.t-alert .t-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  margin-top: 1px;
}

.t-alert--warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-strong);
}

.t-alert--info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.t-alert--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.t-alert--danger {
  background: var(--color-danger-bg);
  color: var(--color-danger-strong);
}

.t-alert--neutral {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text);
}

.t-callout {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.t-callout--accent {
  background: var(--brand-accent-soft);
  border-color: color-mix(in srgb, var(--brand-accent) 30%, var(--brand-accent-soft));
  color: var(--color-text);
}

.t-callout--neutral {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text);
}

.t-callout--warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-strong);
}

.t-callout__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  align-self: center;
}

.t-callout__title {
  font-weight: 600;
}

.t-callout--accent .t-callout__title {
  color: var(--brand-accent);
}

/* ---------- Progress and meters ---------- */
.t-progress {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--color-surface-muted);
  overflow: hidden;
}

.t-progress--lg {
  height: 8px;
  border-radius: 4px;
}

.t-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--brand-accent);
}

.t-progress__bar--64 {
  width: 64%;
}

.t-progress__bar--42 {
  width: 42%;
}

.t-meter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.t-meter__value {
  min-width: 2.2em;
  font-variant-numeric: tabular-nums;
}

.t-meter__bar {
  width: 64px;
  height: 4px;
}

/* ---------- Tables ---------- */
.t-table-wrap {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

.t-card .t-table-wrap,
.t-card--flush .t-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.t-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--font-size-sm);
}

.t-table th {
  padding: 12px var(--space-5);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-sunken);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.t-table td {
  padding: 14px var(--space-5);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  height: 68px;
}

.t-table tbody tr:hover td {
  background: var(--color-surface-sunken);
}

.t-table tr:last-child td {
  border-bottom: 0;
}

.t-table__subject {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.t-table__title {
  font-weight: 600;
  color: var(--color-text);
}

a.t-table__title {
  text-decoration: none;
}

a.t-table__title:hover {
  color: var(--brand-accent);
  text-decoration: underline;
}

.t-table__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.t-table__actions {
  text-align: right;
  white-space: nowrap;
}

.t-table__actions .t-btn + .t-btn {
  margin-left: var(--space-1);
}

.t-person {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  color: var(--color-text-muted);
}

.t-person__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.t-person__name {
  color: var(--color-text);
  font-weight: 600;
}

.t-person__mail {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.t-due--soon {
  color: var(--color-warning);
  font-weight: 600;
}

/* ---------- Tabs and pills ---------- */
.t-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
}

.t-tabs--inline {
  border-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.t-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-4);
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.t-tab .t-icon {
  width: 17px;
  height: 17px;
}

.t-tab:hover {
  color: var(--color-text);
  text-decoration: none;
}

.t-tab[aria-selected="true"] {
  border-bottom-color: var(--brand-accent);
  color: var(--brand-accent);
  font-weight: 600;
}

.t-tab[aria-selected="true"] .t-count {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.t-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.t-pill {
  min-height: var(--control-height);
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

.t-pill[aria-selected="true"] {
  border-color: var(--brand-accent);
  background: var(--brand-accent);
  color: var(--color-on-accent);
  font-weight: 600;
}

/* ---------- Search ---------- */
.t-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-2) 0 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  flex: 0 1 380px;
}

.t-search .t-icon {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
}

.t-search input {
  flex: 1;
  min-width: 0;
  min-height: calc(var(--control-height) - 2px);
  border: 0;
  background: transparent;
  color: var(--color-text);
}

.t-search input:focus {
  outline: none;
}

.t-search:focus-within {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 18%, transparent);
}

.t-search .t-btn {
  min-height: var(--control-height-sm);
}

/* ---------- Dropzone and files ---------- */
.t-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 160px;
  padding: var(--space-6) var(--space-4);
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-sunken);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.t-dropzone:hover {
  border-color: var(--brand-accent);
  background: var(--brand-accent-soft);
}

.t-dropzone > .t-icon {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 50%;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.t-dropzone strong {
  color: var(--color-text);
}

.t-dropzone__hint {
  font-size: var(--font-size-xs);
}

.t-dropzone--compact {
  min-height: 96px;
}

.t-file {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 60px;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.t-file--public {
  flex-wrap: wrap;
  min-height: 72px;
  padding: var(--space-3) var(--space-4);
  gap: 14px;
}

.t-file > .t-icon,
.t-file--public > .t-icon {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  color: var(--color-text);
}

.t-file__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.t-file__name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t-file__meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.t-file--public .t-file__meta {
  font-size: var(--font-size-sm);
}

.t-file__meta--success {
  color: var(--color-success);
  font-weight: 600;
}

.t-file__meta .t-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  color: currentColor;
}

.t-file__percent {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--brand-accent);
  min-width: 40px;
  text-align: right;
}

.t-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Divided list inside a card (files, recipients). */
.t-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.t-rows > li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  min-width: 0;
}

.t-rows > li:last-child {
  border-bottom: 0;
}

.t-rows .t-file {
  border: 0;
  padding: 0;
  min-height: 0;
  flex: 1;
}

/* ---------- OTP ---------- */
.t-otp {
  min-height: 64px;
  max-width: 320px;
  width: 100%;
  padding: 0 18px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.5em;
  text-align: center;
}

.t-otp:focus {
  outline: none;
  border-color: var(--brand-accent);
}

/* ---------- Language switch ---------- */
.t-lang {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
}

.t-lang a,
.t-lang button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--control-height);
  min-height: var(--control-height-sm);
  padding: 0 var(--space-3);
  border: 0;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.t-lang a:last-child,
.t-lang button:last-child {
  border-right: 0;
}

.t-lang a[aria-current="true"],
.t-lang button[aria-pressed="true"] {
  background: var(--brand-accent);
  color: var(--color-on-accent);
}

.t-lang a:hover,
.t-lang button:hover {
  color: var(--color-text);
}

.t-lang a[aria-current="true"]:hover {
  color: var(--color-on-accent);
}

/* ---------- Navigation (dark sidebar) ---------- */
.t-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-height);
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  color: var(--color-sidebar-muted);
  text-decoration: none;
  font-weight: 500;
}

.t-nav__item .t-icon {
  width: var(--icon-size);
  height: var(--icon-size);
}

.t-nav__item:hover {
  background: var(--color-sidebar-raised);
  color: var(--color-sidebar-text);
  text-decoration: none;
}

.t-nav__item[aria-current="page"] {
  background: var(--color-sidebar-raised);
  color: var(--color-sidebar-text);
  font-weight: 600;
}

/* The primary action stays highlighted in the brand colour. */
.t-nav__item--primary,
.t-nav__item--primary[aria-current="page"],
.t-nav__item--primary:hover {
  background: var(--brand-accent);
  color: var(--color-on-accent);
  font-weight: 600;
}

.t-nav__item--primary:hover {
  background: color-mix(in srgb, var(--brand-accent) 86%, white);
}

/* ---------- Logo and avatar ---------- */
.t-logo {
  min-height: var(--control-height);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  background-color: transparent;
  background-image: var(--brand-logo-url);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.t-logo--image {
  border-style: solid;
  color: transparent;
}

/* Brand lockup: logo tile (tenant logo or shield) next to the company name. */
.t-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.t-brand__mark {
  width: var(--tile-size);
  height: var(--tile-size);
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background-color: var(--brand-accent);
  color: var(--color-on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.t-brand__mark .t-icon {
  width: var(--icon-size);
  height: var(--icon-size);
}

/* Wider than the shield tile so a rectangular logo scales inside the mark (contain). */
.t-brand__mark--image {
  width: calc(var(--tile-size) * 3.2);
  padding: var(--space-1);
  background-color: var(--color-surface);
  background-image: var(--brand-logo-url);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-origin: content-box;
  background-clip: content-box;
}

/* Saved or newly chosen logo in huisstijl. Dropzone stays hidden while this is shown. */
.t-logo-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  min-height: 96px;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-sunken);
}

.t-logo-preview__img {
  display: block;
  width: calc(var(--tile-size) * 7);
  max-width: 100%;
  height: calc(var(--tile-size) * 1.8);
  padding: var(--space-2);
  object-fit: contain;
  object-position: left center;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.t-logo-preview__img--brand {
  background-image: var(--brand-logo-url);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
  background-origin: content-box;
  background-clip: content-box;
}

.t-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.t-brand__eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.t-brand__name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-size-xs);
}

.t-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.t-avatar--lg {
  width: 44px;
  height: 44px;
  font-size: var(--font-size-sm);
}

.t-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 var(--space-2);
  font-weight: 500;
}

.t-user form {
  display: contents;
}

/* ---------- Dialog ---------- */
.t-dialog {
  width: min(480px, calc(100% - var(--space-7)));
  max-width: 480px;
  border: 0;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: var(--shadow-raised);
}

.t-dialog::backdrop {
  background: rgba(17, 24, 39, 0.5);
}

.t-dialog__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-h2);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.t-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* Card variants used by list pages (tabs on top, toolbar, flush footer). */
.t-tabs--card {
  padding: 0 var(--space-5);
}

.t-card__body--toolbar {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.t-card__footer--flush {
  margin: 0;
}

/* Compact table on the overview: no forced width. */
.t-table--compact {
  min-width: 0;
}

.t-table--compact td,
.t-table--compact th {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.t-card__body--toolbar .t-search {
  flex: 1 1 420px;
  max-width: 560px;
}

/* Info list where the label is the title and the value a muted explanation. */
.t-info-list--plain .t-info dt {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.t-info-list--plain .t-info dd {
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--color-text-muted);
}

/* ---------- Page header and breadcrumbs ---------- */
.t-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

.t-page-header__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.t-page-header__title {
  font-size: var(--font-size-h1);
  font-weight: 600;
  line-height: 1.2;
}

.t-page-header__subtitle {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.t-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.t-breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.t-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.t-breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.t-breadcrumbs a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

.t-breadcrumbs [aria-current="page"] {
  color: var(--color-text);
  font-weight: 600;
}

.t-breadcrumbs .t-breadcrumbs__sep {
  width: 14px;
  height: 14px;
}

/* ---------- Hero (overview) ---------- */
.t-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-7);
  border-radius: var(--radius-xl);
  background: linear-gradient(120deg, var(--brand-accent) 0%, color-mix(in srgb, var(--brand-accent) 72%, white) 100%);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-card);
}

.t-hero__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.t-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  opacity: 0.9;
}

.t-hero__eyebrow .t-icon {
  width: 18px;
  height: 18px;
}

.t-hero__title {
  font-size: var(--font-size-display);
  font-weight: 700;
  line-height: 1.15;
}

.t-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.t-hero .t-btn--outline {
  border-color: color-mix(in srgb, var(--color-on-accent) 60%, transparent);
  background: transparent;
  color: var(--color-on-accent);
}

.t-hero .t-btn--outline:hover {
  background: color-mix(in srgb, var(--color-on-accent) 14%, transparent);
  color: var(--color-on-accent);
}

/* ---------- KPI tiles ---------- */
.t-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
}

.t-kpi {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  color: inherit;
  text-decoration: none;
}

a.t-kpi:hover {
  border-color: var(--brand-accent);
  color: inherit;
  text-decoration: none;
}

.t-kpi__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.t-kpi__value {
  font-size: var(--font-size-kpi);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.t-kpi__label {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* ---------- Info list (label/value with icons) ---------- */
.t-info-list {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.t-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.t-info:last-child {
  border-bottom: 0;
}

.t-info__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.t-info dt {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.t-info dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Inline meta row: icon + text pairs separated by space. */
.t-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.t-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.t-meta__item .t-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

.t-meta__item strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ---------- Choice cards ---------- */
.t-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.t-choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 64px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.t-choice:hover:not(:disabled) {
  border-color: var(--color-border-strong);
}

.t-choice[aria-pressed="true"] {
  border: 2px solid var(--brand-accent);
  padding: calc(var(--space-3) - 1px) calc(var(--space-4) - 1px);
  background: var(--brand-accent-soft);
}

.t-choice__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.t-choice__title {
  font-weight: 600;
}

.t-choice__desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.t-choice__check {
  width: var(--icon-size);
  height: var(--icon-size);
  color: var(--brand-accent);
}

/* ---------- Secret text box ---------- */
.t-secret {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--brand-accent) 35%, var(--color-border));
  border-radius: var(--radius-md);
  background: var(--brand-accent-soft);
}

.t-secret__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.t-secret__head .t-label {
  flex: 1;
  color: var(--brand-accent);
}

.t-secret-block {
  margin: 0;
  padding: var(--space-5);
  border-radius: var(--radius-md);
  background: var(--brand-accent-soft);
  border: 1px solid color-mix(in srgb, var(--brand-accent) 15%, var(--color-border));
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.t-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  text-align: center;
}

.t-locked__title {
  font-weight: 600;
}

/* ---------- Timeline ---------- */
.t-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.t-timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
}

.t-timeline__item::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.t-timeline__item:last-child {
  padding-bottom: 0;
}

.t-timeline__item:last-child::before {
  display: none;
}

.t-timeline__dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  position: relative;
  z-index: 1;
}

.t-timeline__dot .t-icon {
  width: 17px;
  height: 17px;
}

.t-timeline__dot--accent {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.t-timeline__dot--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.t-timeline__dot--info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.t-timeline__dot--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.t-timeline__dot--danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.t-timeline__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 7px;
  min-width: 0;
}

.t-timeline__time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Empty state ---------- */
.t-empty {
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-6);
}

.t-empty__art {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--color-surface-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.t-empty__art > .t-icon {
  width: 40px;
  height: 40px;
  color: var(--color-text);
}

.t-empty__badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--color-surface);
  background: var(--brand-accent);
  color: var(--color-on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.t-empty__badge .t-icon {
  width: 13px;
  height: 13px;
}

.t-empty__title {
  font-size: 19px;
  font-weight: 600;
}

.t-empty__text {
  max-width: 460px;
  color: var(--color-text-muted);
}

.t-empty .t-btn {
  margin-top: var(--space-2);
}

/* ---------- Success panel (confirmation) ---------- */
.t-success-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}

.t-success-head .t-icon-tile--lg {
  width: 88px;
  height: 88px;
  background: var(--color-success-bg);
  color: var(--color-success);
}

.t-success-head__title {
  font-size: var(--font-size-h1);
  font-weight: 700;
}

.t-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.t-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ---------- Layout helpers ---------- */
.t-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.t-stack > *,
[role="tabpanel"] {
  min-width: 0;
  max-width: 100%;
}

.t-stack--sm {
  gap: var(--space-4);
}

.t-stack--xs {
  gap: var(--space-2);
}

.t-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.t-cluster--end {
  justify-content: flex-end;
}

.t-split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.t-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.t-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

/* Main column with a sticky aside on the right (new delivery, overview). */
.t-with-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--aside-width);
  gap: var(--space-6);
  align-items: start;
}

.t-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

.t-aside--sticky {
  position: sticky;
  top: calc(var(--topbar-height) + var(--space-5));
}

.t-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--control-height);
  padding: 0 var(--space-1);
  font-weight: 600;
  text-decoration: none;
}

.t-inline-link .t-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

.t-inline-link:hover {
  text-decoration: underline;
}

.t-grid-recipients {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: end;
}

.t-grid-recipients--email-only {
  grid-template-columns: minmax(0, 1fr) auto;
}

.t-grid-recipients > .t-btn {
  justify-self: start;
}

.t-grid-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

.t-narrow {
  max-width: 260px;
}

.t-narrow-md {
  max-width: 420px;
}

.t-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.t-legend {
  font-weight: 600;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-2);
  padding: 0;
}

.t-muted {
  color: var(--color-text-muted);
}

.t-small {
  font-size: var(--font-size-xs);
}

.t-strong {
  color: var(--color-text);
  font-weight: 600;
}

.t-mono {
  font-family: var(--font-mono);
}

.t-center {
  text-align: center;
}

.t-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* Summary card in the aside: stacked instead of a single row. */
.t-summary--card {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--space-4);
}

.t-summary__line {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.t-tiles {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.t-tile {
  background: var(--color-surface-muted);
  border-radius: var(--radius-md);
  padding: 14px var(--space-4);
}

.t-tile dt {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.t-tile dd {
  margin: 0;
  font-weight: 600;
}

.t-lead {
  display: flex;
  align-items: center;
  gap: 14px;
}

.t-lead h1 {
  font-size: var(--font-size-h1);
  font-weight: 600;
  line-height: 1.25;
}

.t-disclosure > button {
  min-height: var(--control-height);
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-accent);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
}

.t-disclosure > button .t-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  transition: transform 120ms ease;
}

.t-disclosure > button[aria-expanded="true"] .t-icon {
  transform: rotate(180deg);
}

.t-disclosure__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) 0 0;
}

.t-disclosure__panel[hidden] {
  display: none;
}

.t-name-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.t-name-list li {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.t-divider {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.t-divider > .t-btn {
  align-self: flex-start;
}

.t-page {
  max-width: var(--content-max);
  min-width: 0;
}

.t-page--table {
  max-width: var(--content-max-table);
}

.t-page--narrow {
  max-width: var(--content-max-narrow);
  margin: 0 auto;
}

.t-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
}

.t-card > .t-toolbar,
.t-card--flush > .t-toolbar {
  padding: var(--space-4) var(--space-5);
}

.t-card--flush > .t-toolbar {
  border-bottom: 1px solid var(--color-border);
}

.t-toolbar .t-search {
  flex: 1 1 12rem;
  min-width: 0;
  max-width: none;
}

.t-toolbar .t-btn,
.t-toolbar__key {
  flex: 0 0 auto;
}

.t-toolbar__key {
  width: auto;
  min-width: 11rem;
  max-width: 16rem;
}

.t-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.t-form-actions--end {
  justify-content: flex-end;
}

.t-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.t-form-row > :only-child {
  grid-column: 1 / -1;
}

.t-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 var(--space-6);
}

.t-color {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.t-color__picker {
  width: var(--control-height);
  height: var(--control-height);
  padding: var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}

.t-color .t-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
}

.t-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Settings row: label and explanation on the left, control on the right. */
.t-setting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.t-setting:last-of-type {
  border-bottom: 0;
}

.t-setting__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 260px;
  min-width: 0;
}

.t-setting__title {
  font-weight: 600;
}

.t-setting__hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.t-email-preview {
  min-height: 28rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.t-email-text {
  margin: 0;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.t-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.t-copyline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.t-copyline:last-child {
  border-bottom: 0;
}

.t-copyline__url {
  flex: 1 1 16rem;
  min-width: 0;
  color: var(--color-text-muted);
  background: var(--color-surface-sunken);
}

.t-copylist {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .t-with-aside {
    grid-template-columns: minmax(0, 1fr);
  }

  .t-aside--sticky {
    position: static;
  }

  .t-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .t-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .t-grid-recipients {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .t-grid-recipients > .t-field:nth-child(2) {
    grid-column: 1;
  }

  .t-hero {
    padding: var(--space-6);
  }

  .t-hero__title {
    font-size: var(--font-size-h1);
  }
}

@media (min-width: 1024px) {
  .t-toolbar,
  .t-card__body--toolbar {
    flex-wrap: nowrap;
  }

  .t-form-row--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .t-form-row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .t-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .t-tiles {
    grid-template-columns: 1fr;
  }

  .t-search,
  .t-toolbar__key {
    flex-basis: 100%;
    max-width: none;
  }
}

/* Upload progress, one class per percent so pages stay free of inline styles. */
.t-progress__bar--p0 { width: 0%; }
.t-progress__bar--p1 { width: 1%; }
.t-progress__bar--p2 { width: 2%; }
.t-progress__bar--p3 { width: 3%; }
.t-progress__bar--p4 { width: 4%; }
.t-progress__bar--p5 { width: 5%; }
.t-progress__bar--p6 { width: 6%; }
.t-progress__bar--p7 { width: 7%; }
.t-progress__bar--p8 { width: 8%; }
.t-progress__bar--p9 { width: 9%; }
.t-progress__bar--p10 { width: 10%; }
.t-progress__bar--p11 { width: 11%; }
.t-progress__bar--p12 { width: 12%; }
.t-progress__bar--p13 { width: 13%; }
.t-progress__bar--p14 { width: 14%; }
.t-progress__bar--p15 { width: 15%; }
.t-progress__bar--p16 { width: 16%; }
.t-progress__bar--p17 { width: 17%; }
.t-progress__bar--p18 { width: 18%; }
.t-progress__bar--p19 { width: 19%; }
.t-progress__bar--p20 { width: 20%; }
.t-progress__bar--p21 { width: 21%; }
.t-progress__bar--p22 { width: 22%; }
.t-progress__bar--p23 { width: 23%; }
.t-progress__bar--p24 { width: 24%; }
.t-progress__bar--p25 { width: 25%; }
.t-progress__bar--p26 { width: 26%; }
.t-progress__bar--p27 { width: 27%; }
.t-progress__bar--p28 { width: 28%; }
.t-progress__bar--p29 { width: 29%; }
.t-progress__bar--p30 { width: 30%; }
.t-progress__bar--p31 { width: 31%; }
.t-progress__bar--p32 { width: 32%; }
.t-progress__bar--p33 { width: 33%; }
.t-progress__bar--p34 { width: 34%; }
.t-progress__bar--p35 { width: 35%; }
.t-progress__bar--p36 { width: 36%; }
.t-progress__bar--p37 { width: 37%; }
.t-progress__bar--p38 { width: 38%; }
.t-progress__bar--p39 { width: 39%; }
.t-progress__bar--p40 { width: 40%; }
.t-progress__bar--p41 { width: 41%; }
.t-progress__bar--p42 { width: 42%; }
.t-progress__bar--p43 { width: 43%; }
.t-progress__bar--p44 { width: 44%; }
.t-progress__bar--p45 { width: 45%; }
.t-progress__bar--p46 { width: 46%; }
.t-progress__bar--p47 { width: 47%; }
.t-progress__bar--p48 { width: 48%; }
.t-progress__bar--p49 { width: 49%; }
.t-progress__bar--p50 { width: 50%; }
.t-progress__bar--p51 { width: 51%; }
.t-progress__bar--p52 { width: 52%; }
.t-progress__bar--p53 { width: 53%; }
.t-progress__bar--p54 { width: 54%; }
.t-progress__bar--p55 { width: 55%; }
.t-progress__bar--p56 { width: 56%; }
.t-progress__bar--p57 { width: 57%; }
.t-progress__bar--p58 { width: 58%; }
.t-progress__bar--p59 { width: 59%; }
.t-progress__bar--p60 { width: 60%; }
.t-progress__bar--p61 { width: 61%; }
.t-progress__bar--p62 { width: 62%; }
.t-progress__bar--p63 { width: 63%; }
.t-progress__bar--p64 { width: 64%; }
.t-progress__bar--p65 { width: 65%; }
.t-progress__bar--p66 { width: 66%; }
.t-progress__bar--p67 { width: 67%; }
.t-progress__bar--p68 { width: 68%; }
.t-progress__bar--p69 { width: 69%; }
.t-progress__bar--p70 { width: 70%; }
.t-progress__bar--p71 { width: 71%; }
.t-progress__bar--p72 { width: 72%; }
.t-progress__bar--p73 { width: 73%; }
.t-progress__bar--p74 { width: 74%; }
.t-progress__bar--p75 { width: 75%; }
.t-progress__bar--p76 { width: 76%; }
.t-progress__bar--p77 { width: 77%; }
.t-progress__bar--p78 { width: 78%; }
.t-progress__bar--p79 { width: 79%; }
.t-progress__bar--p80 { width: 80%; }
.t-progress__bar--p81 { width: 81%; }
.t-progress__bar--p82 { width: 82%; }
.t-progress__bar--p83 { width: 83%; }
.t-progress__bar--p84 { width: 84%; }
.t-progress__bar--p85 { width: 85%; }
.t-progress__bar--p86 { width: 86%; }
.t-progress__bar--p87 { width: 87%; }
.t-progress__bar--p88 { width: 88%; }
.t-progress__bar--p89 { width: 89%; }
.t-progress__bar--p90 { width: 90%; }
.t-progress__bar--p91 { width: 91%; }
.t-progress__bar--p92 { width: 92%; }
.t-progress__bar--p93 { width: 93%; }
.t-progress__bar--p94 { width: 94%; }
.t-progress__bar--p95 { width: 95%; }
.t-progress__bar--p96 { width: 96%; }
.t-progress__bar--p97 { width: 97%; }
.t-progress__bar--p98 { width: 98%; }
.t-progress__bar--p99 { width: 99%; }
.t-progress__bar--p100 { width: 100%; }

.t-passkey {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
}

.t-passkey:first-child {
  border-top: 0;
  padding-top: 0;
}

.t-passkey__name {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 10rem;
  flex: 1;
}

.t-passkey__rename {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2);
  margin-left: auto;
}

.t-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: 48px;
  cursor: pointer;
}

.t-check input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  flex: 0 0 auto;
  accent-color: var(--brand-accent);
}
