/*
 * Direction C components. Every page is built from these parts; shared markup
 * lives in app/views/components/. Colours come from cd/tokens.css only.
 */

/* ---------- Base type ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--cd-font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--cd-ink);
  background: var(--cd-surface);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--cd-font-display);
  color: var(--cd-ink);
  text-wrap: balance;
}
a { text-underline-offset: 2px; transition: color var(--cd-transition); }
code, kbd, pre, samp, .cd-mono {
  font-family: var(--cd-font-mono);
  font-size: 14px;
  line-height: 1.5;
}
code { color: var(--cd-ink); }
.cd-num, .table td, .cd-stat__value, .cd-amount { font-variant-numeric: tabular-nums; }
.cd-muted { color: var(--cd-muted); }
.cd-text-2 { color: var(--cd-text-2); }
.cd-small { font-size: 13px; line-height: 1.45; }
.cd-label { font-size: 14px; font-weight: 600; }
.cd-nowrap { white-space: nowrap; }
.cd-break { word-break: break-all; }
.cd-link-danger { color: var(--cd-danger); font-weight: 600; }
.cd-link-danger:hover { color: var(--cd-danger-hover); }
.cd-link { font-weight: 600; }
.cd-stack { display: grid; gap: 24px; }
.cd-stack--sm { gap: 12px; }
.cd-stack--xs { gap: 8px; }
.cd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 24px; }
.cd-actions--tight { margin-top: 16px; }
.cd-icon { flex: none; vertical-align: -0.2em; }
.cd-form { max-width: 560px; }
.cd-form .mb-3:last-of-type { margin-bottom: 0 !important; }
.cd-divider { border: 0; border-top: 1px solid var(--cd-border); margin: 28px 0; opacity: 1; }
.cd-form-errors ul { margin: 0; padding-left: 18px; }
.cd-field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; }
@media (max-width: 479.98px) { .cd-field-pair { grid-template-columns: 1fr; } }

/* Page title, card title, display numbers */
.cd-page-title {
  font-family: var(--cd-font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0;
}
.cd-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.cd-page-head__meta { color: var(--cd-muted); font-size: 14px; margin-top: 6px; }
.cd-page-head__title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cd-lead { font-size: 18px; line-height: 1.6; color: var(--cd-text-2); }
.cd-display-number {
  font-family: var(--cd-font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Brand ---------- */
.cd-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cd-ink);
  text-decoration: none;
}
.cd-lockup:hover { color: var(--cd-ink); }
.cd-wordmark {
  font-family: var(--cd-font-display);
  font-weight: 700;
  font-size: 23px;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--cd-ink);
}
.cd-lockup--sidebar .cd-wordmark { font-size: 20px; }
.cd-lockup--auth .cd-wordmark { font-size: 26px; }
.cd-lockup--install .cd-wordmark { font-size: 22px; }
.cd-mark { flex: none; color: var(--cd-ink); display: block; }
.cd-mark--grey { color: var(--cd-mark-grey); }
.cd-mark--white { color: #fff; }

/* ---------- Buttons ---------- */
.cd-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--cd-radius-pill);
  background: transparent;
  color: var(--cd-muted);
  transition: background-color var(--cd-transition), color var(--cd-transition);
}
.cd-btn-icon:hover,
.cd-btn-icon[aria-expanded="true"] { background: var(--cd-surface-3); color: var(--cd-ink); }
.cd-btn-icon:focus-visible { outline: 2px solid var(--cd-ink); outline-offset: 2px; }
.btn.w-100, .btn.cd-block { width: 100%; }
form[aria-busy="true"] [type="submit"],
.btn[aria-busy="true"] { cursor: progress; }
.button_to { display: inline; }

/* Copy buttons swap the copy icon for a check while "Copied" shows */
.cd-copied-icon { display: none; }
.is-copied .cd-copy-icon { display: none; }
.is-copied .cd-copied-icon { display: inline-block; }

/* ---------- Form parts ---------- */
.cd-optional { font-weight: 400; color: var(--cd-muted); }
.cd-field-error { font-size: 13px; color: var(--cd-danger); margin-top: 6px; }
.cd-code-input {
  font-size: 20px;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
}

/* Password field with an eye button inside it (password_field_with_reveal) */
.cd-password { position: relative; }
.cd-password .form-control,
.cd-password .form-control.is-invalid { padding-right: 52px; }
.cd-password .form-control::-ms-reveal,
.cd-password .form-control::-ms-clear { display: none; } /* Edge's own eye would sit beside ours */
.cd-password__toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--cd-radius-sm);
  background: transparent;
  color: var(--cd-muted);
  cursor: pointer;
  transition: color var(--cd-transition), background-color var(--cd-transition);
}
.cd-password__toggle:hover,
.cd-password__toggle[aria-pressed="true"] { color: var(--cd-ink); }
.cd-password__toggle:hover { background: var(--cd-surface-3); }
.cd-password__toggle:focus-visible { outline: 2px solid var(--cd-ink); outline-offset: -2px; }
.cd-password__hide,
.cd-password.is-visible .cd-password__show { display: none; }
.cd-password.is-visible .cd-password__hide { display: inline-block; }

/* Two choices side by side ("Just me" / "A company"); the current one is outlined in ink */
.cd-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cd-choice {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--cd-border-float);
  border-radius: var(--cd-radius-tile);
  background: var(--cd-surface);
}
.cd-choice.is-current { border-color: var(--cd-ink); box-shadow: inset 0 0 0 1px var(--cd-ink); }
.cd-choice__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cd-choice__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--cd-radius-sm);
  background: var(--cd-surface-3);
  color: var(--cd-ink);
}
.cd-choice__title { flex: 1 1 auto; margin: 0; font-size: 16px; font-weight: 600; }
.cd-choice__body { margin: 0; color: var(--cd-text-2); font-size: 14px; line-height: 1.5; }
.cd-choice__action { margin-top: 16px; }
/* The same tiles as radio buttons (signup: "Just me" / "My company"); the whole tile is the label */
.cd-choices--pick { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 0; }
.cd-choice--pick { cursor: pointer; padding: 14px 16px; transition: border-color var(--cd-transition); }
.cd-choice--pick:hover { border-color: var(--cd-border-control); }
.cd-choice--pick:has(input:checked) { border-color: var(--cd-ink); box-shadow: inset 0 0 0 1px var(--cd-ink); }
.cd-choice--pick:has(input:focus-visible) { outline: 2px solid var(--cd-ink); outline-offset: 2px; }
.cd-choice--pick .form-check-input { flex: none; margin: 0; }
.cd-choice--pick .cd-choice__head { margin-bottom: 6px; }
.cd-choice--pick .cd-choice__icon { width: 32px; height: 32px; }
.cd-choice--pick .cd-choice__body { display: block; }

/* Getting started checklist: numbered steps; a done step gets an ink check and quiet text */
.cd-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cd-checklist__item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--cd-divider); }
.cd-checklist__item:first-child { border-top: 0; padding-top: 4px; }
.cd-checklist__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--cd-border-control);
  font-family: var(--cd-font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--cd-ink);
}
.cd-checklist__item.is-done .cd-checklist__mark { background: var(--cd-ink); border-color: var(--cd-ink); color: #fff; }
.cd-checklist__text { min-width: 0; padding-top: 3px; }
.cd-checklist__title { margin: 0; font-weight: 600; }
.cd-checklist__item.is-done .cd-checklist__title { font-weight: 400; color: var(--cd-muted); }
.cd-checklist__body { margin: 4px 0 10px; color: var(--cd-text-2); font-size: 14px; }

/* Sites through Europe: one row per shared group, its sites behind a disclosure, a switch at the end */
.cd-list--groups > li { flex-wrap: nowrap; align-items: flex-start; }
.cd-group__text { flex: 1 1 auto; min-width: 0; }
.cd-group__entries { margin-top: 6px; color: var(--cd-muted); overflow-wrap: anywhere; }
.cd-switch { padding-left: 0; }
.cd-switch .form-check-input { width: 2.75em; height: 1.5em; margin-left: 0; float: none; cursor: pointer; }

/* Copy field: a readonly input with a "Copy link" button beside it */
.cd-copy {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.cd-copy .form-control { flex: 1 1 auto; min-width: 0; font-family: var(--cd-font-mono); font-size: 14px; }
.cd-copy .btn { flex: none; }
@media (max-width: 479.98px) {
  .cd-copy { flex-direction: column; }
  .cd-copy .btn { width: 100%; }
}

/* Quantity stepper */
.cd-quantity { display: inline-flex; align-items: center; gap: 10px; }
.cd-quantity__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--cd-border-control);
  border-radius: var(--cd-radius-pill);
  background: var(--cd-surface);
  color: var(--cd-ink);
  transition: background-color var(--cd-transition);
}
.cd-quantity__btn:hover { background: var(--cd-surface-3); }
.cd-quantity__btn:focus-visible { outline: 2px solid var(--cd-ink); outline-offset: 2px; }
.cd-quantity__btn:disabled { opacity: .45; }
.cd-quantity__input.form-control {
  width: 60px;
  min-height: 44px;
  padding: 6px 4px;
  text-align: center;
  font-family: var(--cd-font-display);
  font-weight: 700;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.cd-quantity__input::-webkit-outer-spin-button,
.cd-quantity__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Surfaces ---------- */
.cd-card {
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-card);
  padding: 24px;
  min-width: 0;
}
.cd-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.cd-card__title {
  font-family: var(--cd-font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}
.cd-card__eyebrow { font-size: 14px; color: var(--cd-muted); margin: 0 0 4px; }
.cd-card > :last-child { margin-bottom: 0; }
.cd-card--table { position: relative; padding: 0; overflow: hidden; }
.cd-card--table > .cd-card__head { padding: 20px 20px 0; margin-bottom: 12px; }
.cd-card__section + .cd-card__section { border-top: 1px solid var(--cd-border); margin-top: 24px; padding-top: 24px; }

.cd-float {
  background: var(--cd-surface);
  border: 1px solid var(--cd-border-float);
  border-radius: var(--cd-radius-float);
  box-shadow: var(--cd-shadow-float);
  padding: 36px;
}
.cd-float--hero { border-radius: var(--cd-radius-hero); padding: 44px; }

.cd-inset {
  background: var(--cd-surface-2);
  border-radius: var(--cd-radius-inset);
  padding: 16px;
}

.cd-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 16px;
}
.cd-stat {
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-tile);
  padding: 18px 20px;
  background: var(--cd-surface);
}
.cd-stat__label { font-size: 14px; color: var(--cd-muted); margin: 0 0 6px; }
.cd-stat__value {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--cd-font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}
.cd-stat__value .cd-status__marker { width: 12px; height: 14px; }

/* Two cards side by side that wrap (Billing, Install link) */
.cd-pair { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.cd-pair > * { flex: 1 1 360px; }

/* ---------- Device status ---------- */
.cd-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.cd-status__marker {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 12px;
  border-radius: var(--cd-radius-marker);
}
.cd-status--active .cd-status__marker { background: var(--cd-amber); }
.cd-status--waiting .cd-status__marker { border: 2px solid var(--cd-ink); }
.cd-status--suspended .cd-status__marker { border: 2px solid var(--cd-danger); }
.cd-status--paused .cd-status__marker { background: var(--cd-off); }
.cd-status--removed .cd-status__marker { height: 2px; background: var(--cd-off); border-radius: 1px; }
.cd-status--removed { color: var(--cd-muted); }

/* ---------- Chips ---------- */
.cd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--cd-radius-pill);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  vertical-align: middle;
  background: var(--cd-surface-3);
  color: var(--cd-text-2);
  font-family: var(--cd-font-body);
  letter-spacing: 0;
}
.cd-chip--warning { background: var(--cd-amber-tint); color: var(--cd-amber-text); }
.cd-chip--danger { background: var(--cd-danger-tint); color: var(--cd-danger); }
.cd-chip--success { background: var(--cd-success-tint); color: var(--cd-success); }
.cd-chip--neutral { background: var(--cd-surface-3); color: var(--cd-text-2); }
.cd-chip--ink { background: var(--cd-ink); color: #fff; }
.cd-chip__initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--cd-ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.cd-chip--lg { font-size: 14px; padding: 6px 12px 6px 6px; }

/* ---------- Banners and flash ---------- */
.cd-banners { display: grid; gap: 12px; }
.cd-banners:empty { display: none; }
.alert,
.cd-banner {
  --bs-alert-border-width: 0;
  --bs-alert-margin-bottom: 0;
  --bs-alert-color: var(--cd-ink);
  --bs-alert-link-color: var(--cd-ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0;
  padding: 14px 18px;
  border: 0;
  border-radius: var(--cd-radius-inset);
  background: var(--cd-surface-2);
  color: var(--cd-ink);
  font-size: 15px;
  line-height: 1.5;
}
.cd-banner--stack,
.alert.cd-banner--stack { display: block; }
.cd-banner--stack > :last-child { margin-bottom: 0; }
.cd-banner__text { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 260px; min-width: 0; }
.cd-banner__text > .cd-icon { margin-top: 2px; }
.alert-warning, .cd-banner--warning { background: var(--cd-amber-tint); color: var(--cd-ink); }
.alert-danger, .cd-banner--danger { background: var(--cd-danger-tint); color: var(--cd-ink); }
.alert-danger .cd-icon, .cd-banner--danger .cd-icon { color: var(--cd-danger); }
.alert-secondary, .alert-info, .alert-light, .cd-banner--neutral { background: var(--cd-surface-2); color: var(--cd-ink); }
.alert-success, .cd-banner--success { background: var(--cd-success-tint); color: var(--cd-ink); }
.alert .cd-btn-icon { width: 32px; height: 32px; margin: -4px -8px -4px 0; color: var(--cd-text-2); }
.alert .cd-btn-icon:hover { background: rgba(14, 23, 38, .06); }
.alert ul { padding-left: 18px; }

/* ---------- Tables ---------- */
.cd-table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cd-table {
  min-width: 640px;
  margin: 0;
  font-size: 15px;
}
.cd-table--compact { min-width: 0; }
.cd-table > :not(caption) > * > * { padding: 12px 20px; border-bottom-color: var(--cd-divider); }
.cd-table > thead > tr > th {
  font-size: 13px;
  font-weight: 600;
  color: var(--cd-muted);
  padding: 10px 20px;
  border-bottom: 1px solid var(--cd-border);
  background: none;
  white-space: nowrap;
  vertical-align: bottom;
}
.cd-table > tbody > tr:last-child > * { border-bottom: 0; }
.cd-table td { vertical-align: middle; }
.cd-table .cd-cell-actions { width: 1%; text-align: right; white-space: nowrap; padding-top: 6px; padding-bottom: 6px; }
.cd-table .cd-cell-name { font-weight: 600; }
.cd-table .cd-cell-sub { display: block; font-size: 13px; font-weight: 400; color: var(--cd-muted); }
.cd-table .text-end { font-variant-numeric: tabular-nums; }
.cd-table tr.cd-row-link { cursor: pointer; }
.cd-table tr.cd-row-link:hover > * { background: var(--cd-row-hover); }
.cd-table tr.cd-row-link a { color: inherit; text-decoration: none; }
.cd-table tr.cd-row-link a:hover { text-decoration: underline; }
.cd-table tr.cd-row-danger > * { background: var(--cd-danger-tint); }
.cd-table tfoot td, .cd-table tfoot th { border-bottom: 0; }
.cd-table--card-flush > :not(caption) > * > *:first-child { padding-left: 0; }
.cd-table--card-flush > :not(caption) > * > *:last-child { padding-right: 0; }

/* Toolbar: filter chips left, search right */
.cd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--cd-border);
}
.cd-filters.nav-pills { gap: 4px; }
.cd-filters .nav-link {
  font-size: 14px;
  padding: 7px 14px;
  color: var(--cd-text-2);
  font-weight: 500;
  line-height: 1.3;
  transition: background-color var(--cd-transition), color var(--cd-transition);
}
.cd-filters .nav-link:hover { color: var(--cd-ink); background: var(--cd-surface-2); }
.cd-filters .nav-link.active,
.cd-filters .nav-link[aria-current="page"] { background: var(--cd-surface-3); color: var(--cd-ink); font-weight: 600; }
.cd-filters__count { color: var(--cd-muted); font-weight: 500; margin-left: 4px; font-variant-numeric: tabular-nums; }
.cd-search { position: relative; display: flex; gap: 8px; align-items: center; }
.cd-search .form-control { min-height: 40px; padding: 8px 12px 8px 38px; font-size: 15px; width: min(300px, 100%); }
.cd-search > .cd-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--cd-muted); pointer-events: none; }

/* Empty state */
.cd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 48px 24px;
}
.cd-empty__title { font-family: var(--cd-font-display); font-size: 19px; font-weight: 600; margin: 8px 0 0; }
.cd-empty__body { color: var(--cd-muted); margin: 0 0 8px; max-width: 32em; }

.cd-pager { display: flex; justify-content: flex-end; margin-top: 16px; }
.cd-pager .pagination { margin: 0; }

/* ---------- Navigation ---------- */
.cd-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cd-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--cd-radius-nav);
  color: var(--cd-text-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--cd-transition), color var(--cd-transition);
}
.cd-nav__link:hover { background: var(--cd-border); color: var(--cd-ink); }
.cd-nav__link[aria-current="page"] {
  background: var(--cd-surface);
  box-shadow: var(--cd-shadow-nav);
  color: var(--cd-ink);
  font-weight: 600;
}

.cd-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--cd-surface);
  border: 1px solid var(--cd-border-float);
  border-radius: var(--cd-radius-input);
  color: var(--cd-ink);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.cd-switcher:hover { background: var(--cd-row-hover); }
.cd-switcher:focus-visible { outline: 2px solid var(--cd-ink); outline-offset: 2px; }
.cd-switcher__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-company-name { font-weight: 600; padding: 0 12px; overflow-wrap: anywhere; }
.cd-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.dropdown-item { display: flex; align-items: center; gap: 10px; }
.dropdown-item.cd-danger-item { color: var(--cd-danger); }
.dropdown-item.cd-danger-item:hover { color: var(--cd-danger); background: var(--cd-danger-tint); }
.dropdown-item .cd-icon { color: var(--cd-muted); }
.dropdown-menu form { margin: 0; }
.dropdown-menu button.dropdown-item { width: 100%; }

.cd-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--cd-radius-nav);
  background: transparent;
  color: var(--cd-ink);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.cd-user:hover, .cd-user[aria-expanded="true"] { background: var(--cd-border); }
.cd-user:focus-visible { outline: 2px solid var(--cd-ink); outline-offset: 2px; }
.cd-user__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-user__meta { display: block; font-size: 13px; font-weight: 400; color: var(--cd-muted); }
.cd-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cd-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- Signup stepper ---------- */
.cd-stepper { margin-bottom: 24px; }
.cd-stepper__bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cd-stepper__segment { height: 4px; border-radius: var(--cd-radius-pill); background: var(--cd-border-float); }
.cd-stepper__segment.is-done { background: var(--cd-ink); }
.cd-stepper__label { font-size: 14px; color: var(--cd-muted); margin: 10px 0 0; }

/* ---------- Modals ---------- */
.cd-modal-title {
  font-family: var(--cd-font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}
.modal-header { align-items: flex-start; gap: 16px; }
.modal-header .cd-btn-icon { margin: -8px -10px 0 auto; }
.modal-body { color: var(--cd-text-2); }
.modal-body > :last-child { margin-bottom: 0; }
.modal-footer { padding-top: 4px; }
.modal-footer > * { margin: 0; }

/* ---------- Definition lists and money boxes ---------- */
.cd-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 0;
  align-items: center;
}
.cd-dl dt { color: var(--cd-muted); font-weight: 400; }
.cd-dl dd { margin: 0; font-weight: 500; color: var(--cd-ink); display: flex; align-items: center; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.cd-dl .cd-btn-icon { width: 32px; height: 32px; margin: -4px 0; }
.cd-dl--stack { grid-template-columns: 1fr; gap: 2px; }

.cd-breakdown { width: 100%; border-collapse: collapse; font-size: 15px; }
.cd-breakdown td, .cd-breakdown th { padding: 4px 0; vertical-align: top; }
.cd-breakdown td + td, .cd-breakdown th + td { text-align: right; padding-left: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cd-breakdown__label { color: var(--cd-text-2); font-weight: 400; text-align: left; }
.cd-breakdown__total > * { border-top: 1px solid var(--cd-border-float); padding-top: 10px; margin-top: 6px; font-weight: 600; color: var(--cd-ink); }
.cd-breakdown__total th { font-weight: 600; }
.cd-breakdown tr.cd-breakdown__total + tr > *,
.cd-breakdown tbody + tfoot tr:first-child > * { }
.cd-note { font-size: 13px; line-height: 1.45; color: var(--cd-muted); margin: 12px 0 0; }

/* Recovery codes */
.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 24px;
  margin: 0;
  padding: 16px;
  list-style: none;
  font-family: var(--cd-font-mono);
  font-size: 14px;
  background: var(--cd-surface-2);
  border-radius: var(--cd-radius-inset);
}
.cd-qr {
  width: 180px;
  height: 180px;
  background: #fff;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-input);
  padding: 8px;
  image-rendering: pixelated;
}
.cd-secret { font-family: var(--cd-font-mono); font-size: 14px; word-break: break-all; background: var(--cd-surface-2); padding: 2px 6px; border-radius: 6px; }

/* Lists inside cards */
.cd-list { list-style: none; margin: 0; padding: 0; }
.cd-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--cd-divider); }
.cd-list > li:first-child { padding-top: 0; }
.cd-list > li:last-child { border-bottom: 0; padding-bottom: 0; }

turbo-frame[busy] { opacity: .6; transition: opacity var(--cd-transition); }

/* Details: long audit details */
.cd-details summary { cursor: pointer; color: var(--cd-text-2); }
.cd-details[open] summary { margin-bottom: 4px; }
.cd-pre {
  margin: 0;
  padding: 16px;
  background: var(--cd-surface-2);
  border-radius: var(--cd-radius-inset);
  font-family: var(--cd-font-mono);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Two-step setup: the code field sits beside its button */
.cd-two-factor { flex: 1 1 260px; min-width: 0; }
.cd-code-input--inline { flex: 1 1 160px; width: auto; }

/* A card that opens on click (Invite people: Open link). No JavaScript: <details>. */
.cd-collapse > .cd-collapse__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
}
.cd-collapse > .cd-collapse__summary::-webkit-details-marker { display: none; }
.cd-collapse > .cd-collapse__summary:focus-visible { outline: 2px solid var(--cd-ink); outline-offset: 4px; border-radius: 4px; }
.cd-collapse[open] > .cd-collapse__summary { margin-bottom: 16px; }
.cd-collapse__chevron { flex: none; color: var(--cd-muted); transition: transform var(--cd-transition); }
.cd-collapse[open] .cd-collapse__chevron { transform: rotate(180deg); }

/* A select that holds a small number (PCs per person) */
.cd-select-narrow { width: auto; min-width: 96px; }
