/* TheGM Command Center - the new look, on top of the Tabler kit (vendor/tabler-core-*, loaded before this file).
 *
 * What is here, and nothing else:
 *   1. the owner's colours (dark and gold, approved 2026-10-01) put onto Tabler's own variables, and with them
 *      the SCALE of the approved drawing (text sizes, weights, corners, shadows); 1b. the same scale on the kit's
 *      parts (button, pill, field, table, card, menu, window, message) - a part is sized THERE, once, not where
 *      it is used. tests/test_cc_look.py reads the sizes back from a real browser;
 *   2. our own files for the small pictures Tabler embeds as data: addresses - the Content-Security-Policy
 *      (img-src 'self') blocks those, and the policy is not weakened;
 *   3. the frame: side menu, top bar, search, bell;
 *   4. the few parts the kit does not have (status colours, the red counter, the opening row);
 *      4b. the tools of a list page (filter field, chips, pager); 4c. the inside of an opened line;
 *      4d. alerts (the alert card, the red lines of an account table, the window of the full proof);
 *      4e. the actions on a trading account (each button has its own place; a new button waits a moment);
 *      4f. the user himself: the menu of his line, his switches, his PCs, a question that asks first, Undo;
 *   5. phone and keyboard rules.
 * No @import, no address outside this site, no data: address (tests/test_cc_csp.py).
 */

/* ------------------------------------------------------------------------------------------ 1. colours */
:root,
[data-bs-theme="dark"] {
  color-scheme: dark;

  /* The owner's palette. Contrast on the page background, computed 2026-10-07: gold 10:1, text 16:1,
     dim text 6:1, danger 6:1. Text ON gold and ON red is dark, never white (white on red is 3.0:1). */
  --cc-bg: #0b0d12;
  --cc-bg-2: #10131b;
  --cc-panel: #12151c;
  --cc-panel-2: #171b25;
  --cc-panel-3: #1d2230;
  --cc-line: #232838;
  --cc-line-2: #2f3649;
  --cc-line-3: #3d4560;
  --cc-gold: #e2b755;
  --cc-gold-bright: #f4d58c;
  --cc-gold-deep: #c89a45;
  --cc-ink: #15110a;
  --cc-text: #f6f1e8;
  --cc-muted: #c9ccd1;
  --cc-dim: #9b968d;
  --cc-ok: #7fc98a;
  --cc-warn: #e0a85a;
  --cc-danger: #e8736a;
  --cc-ice: #7fd0e0;
  --cc-slate: #9bb0dc;

  --tblr-body-bg: var(--cc-bg);
  --tblr-body-color: var(--cc-text);
  --tblr-emphasis-color: var(--cc-text);
  --tblr-heading-color: var(--cc-text);
  --tblr-bg-surface: var(--cc-panel);
  --tblr-bg-surface-secondary: var(--cc-bg-2);
  --tblr-bg-surface-tertiary: var(--cc-panel-2);
  --tblr-bg-forms: var(--cc-bg-2);
  --tblr-secondary-bg: var(--cc-panel-2);
  --tblr-tertiary-bg: var(--cc-panel-2);
  --tblr-active-bg: var(--cc-panel-2);
  --tblr-border-color: var(--cc-line);
  --tblr-border-color-translucent: var(--cc-line);
  --tblr-secondary: var(--cc-muted);
  --tblr-secondary-color: var(--cc-muted);
  --tblr-tertiary: var(--cc-dim);
  --tblr-tertiary-color: var(--cc-dim);
  --tblr-muted: var(--cc-dim);
  --tblr-disabled-color: var(--cc-dim);
  --tblr-link-color: var(--cc-gold-bright);
  --tblr-link-hover-color: var(--cc-gold);
  --tblr-code-color: var(--cc-muted);

  --tblr-primary: var(--cc-gold);
  --tblr-primary-fg: var(--cc-ink);
  --tblr-primary-darken: var(--cc-gold-deep);
  --tblr-success: var(--cc-ok);
  --tblr-success-fg: var(--cc-ink);
  --tblr-warning: var(--cc-warn);
  --tblr-warning-fg: var(--cc-ink);
  --tblr-danger: var(--cc-danger);
  --tblr-danger-fg: var(--cc-ink);
  --tblr-danger-darken: #d9584e;
  --tblr-info: var(--cc-ice);
  --tblr-info-fg: var(--cc-ink);

  /* THE SCALE of the approved drawing (its :root: type 12 / 13 / 14 / 16 / 20 px, weights 400 / 500 / 600, lines
     1.5, corners 6 / 8 / 10 / 12 / 14 px). No shadow on a card, a button or a field; ONE deep shadow under what
     floats over the page (menu, window, message, the list of the search). */
  --tblr-font-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tblr-body-line-height: 1.5;
  --tblr-border-radius-sm: 6px;
  --tblr-border-radius: 8px;
  --tblr-border-radius-lg: 12px;
  --cc-radius-inner: 10px;
  --cc-radius-window: 14px;
  --cc-shadow: 0 16px 40px rgb(0 0 0 / 50%), 0 2px 8px rgb(0 0 0 / 40%);
  --cc-hover: rgb(255 255 255 / 7%);
  --tblr-shadow-input: 0 0 transparent;
  --tblr-shadow-card: 0 0 transparent;
  --tblr-shadow-dropdown: var(--cc-shadow);
  --tblr-sidebar-width: 15rem;
  --tblr-font-monospace: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", "Courier New", monospace;

  /* One solid gold outline wherever the keyboard is (Tabler's own ring is too faint on this background). */
  --tblr-focus-ring: 2px solid var(--cc-gold);
  --tblr-focus-ring-offset: 2px;

  scrollbar-color: #2a3043 var(--cc-bg);
  /* The top bar sticks: a focused or linked element is never hidden under it. */
  scroll-padding-top: 5rem;
}

::selection {
  background: rgb(226 183 85 / 30%);
}

:focus-visible {
  outline: var(--tblr-focus-ring);
  outline-offset: var(--tblr-focus-ring-offset);
}

/* -------------------------------------------------------------- 1b. the drawing's scale on the kit's parts */
/* The kit keeps the sizes of a part in variables of the part itself (--tblr-btn-*, --tblr-status-*, ...): they
   are set here, on the part, once. Where the kit wrote a size as a plain value, with no variable to set, the
   rule sets the property and says "no variable". On a phone section 5 keeps what a finger hits at 44 px. */

/* Icons: 16 px, stroke 1.75. */
.icon {
  --tblr-icon-size: 1rem;

  stroke-width: 1.75;
}

/* Buttons: 36 px high (7 + 20 + 7 + the edge), 13 px, weight 600; the small one 28 px, 12 px, the same corners. */
.btn {
  --tblr-btn-padding-y: 0.4375rem;
  --tblr-btn-font-size: 0.8125rem;
  --tblr-btn-font-weight: var(--tblr-font-weight-semibold);
  --tblr-btn-icon-size: 1rem;
  --tblr-btn-disabled-opacity: 0.5;
}

.btn-sm {
  --tblr-btn-padding-y: 0.3125rem;
  --tblr-btn-padding-x: 0.75rem;
  --tblr-btn-font-size: 0.75rem;
  --tblr-btn-border-radius: var(--tblr-border-radius);
}

/* The quiet button - every button that is not the gold or the red one: see-through, a thin edge, grey words.
   (:where() adds no weight: a part of sections 3 and 4 that sets one of these wins.) */
.btn:where(:not(.btn-primary, .btn-danger)) {
  --tblr-btn-bg: transparent;
  --tblr-btn-color: var(--cc-muted);
  --tblr-btn-border-color: var(--cc-line-2);
  --tblr-btn-hover-bg: var(--cc-panel-2);
  --tblr-btn-hover-color: var(--cc-text);
  --tblr-btn-hover-border-color: var(--cc-line-3);
  --tblr-btn-active-bg: var(--cc-panel-2);
  --tblr-btn-active-color: var(--cc-text);
  --tblr-btn-active-border-color: var(--cc-line-3);
}

/* Status pills: 22 px high, 12 px, a 6 px dot. (The text size: no variable.) */
.status {
  --tblr-status-height: 1.375rem;
  --tblr-status-padding-x: 0.5rem;
  --tblr-status-padding-y: 0;
  --tblr-status-gap: 0.375rem;

  font-size: 0.75rem;
}

.status-dot {
  --tblr-status-size: 0.375rem;
}

/* Badges: pills, 22 px high, 12 px. (The letter spacing: no variable.) */
.badge {
  --tblr-badge-padding-x: 0.5rem;
  --tblr-badge-padding-y: 0.25rem;
  --tblr-badge-font-size: 0.75rem;
  --tblr-badge-border-radius: var(--tblr-border-radius-pill);

  letter-spacing: 0;
}

/* Round pictures of people: 36 px, soft blue-grey. */
.avatar {
  --tblr-avatar-size: 2.25rem;
  --tblr-avatar-font-size: 0.8125rem;
  --tblr-avatar-bg: hsl(220deg 22% 19%);
  --tblr-avatar-box-shadow-color: hsl(220deg 20% 29%);
}

/* Text fields: 36 px high on the darker fill. (No variable: the kit wrote the padding, and the height of the
   icon inside a field, as plain values.) Clicked into: a gold edge and a soft glow, not the ring of a button. */
.form-control,
.form-select {
  padding-block: 0.4375rem;
}

.form-control:hover,
.form-select:hover {
  border-color: var(--cc-line-2);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--cc-gold-deep);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(226 183 85 / 16%);
}

.input-icon {
  --tblr-input-icon-padding-start: 2.25rem;
}

.input-icon-addon {
  height: auto;
}

/* Tables: cells 12 px / 16 px; the header row 40 px, small capitals weight 600 on the darker fill. (No variable:
   the kit wrote the paddings and the header's look as plain values.) */
.table > :not(caption) > * > * {
  padding: 0.75rem 1rem;
}

.card-table tr td:first-child,
.card-table tr th:first-child {
  padding-inline-start: 1rem;
}

.card-table tr td:last-child,
.card-table tr th:last-child {
  padding-inline-end: 1rem;
}

.table thead th {
  height: 2.5rem;
  padding-block: 0;
  font-weight: var(--tblr-font-weight-semibold);
  color: var(--cc-dim);
  letter-spacing: 0.07em;
  background: var(--cc-bg-2);
}

.table-sort.asc,
.table-sort.desc {
  color: var(--cc-gold-bright);
}

/* (the kit rounds the upper corners of EVERY first and last cell of a table in a card: under the card's head
   they are square, or a line that is open or under the pointer shows a round corner in the middle of the list) */
.card-header ~ .card-table tr > *,
.card-header ~ .table-responsive > .card-table tr > * {
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}

/* Cards: the title weight 600 (no variable). */
.card-title {
  font-weight: var(--tblr-font-weight-semibold);
}

/* Menus: one step lighter than the card behind them, 10 px corners, 4 px room around things 36 px high in
   13 px grey. (The height of a thing: no variable.) */
.dropdown-menu {
  --tblr-dropdown-min-width: 13.25rem;
  --tblr-dropdown-padding-x: 0.25rem;
  --tblr-dropdown-padding-y: 0.25rem;
  --tblr-dropdown-font-size: 0.8125rem;
  --tblr-dropdown-bg: var(--cc-panel-2);
  --tblr-dropdown-border-color: var(--cc-line-2);
  --tblr-dropdown-border-radius: var(--cc-radius-inner);
  --tblr-dropdown-divider-margin-y: 0.25rem;
  --tblr-dropdown-link-color: var(--cc-muted);
  --tblr-dropdown-link-hover-color: var(--cc-text);
  --tblr-dropdown-link-hover-bg: var(--cc-hover);
  --tblr-dropdown-item-border-radius: 6px;
  --tblr-dropdown-item-icon-size: 1rem;
  --tblr-dropdown-header-color: var(--cc-dim);
}

.dropdown-item {
  min-height: 2.25rem;
}

.dropdown-header {
  color: var(--cc-dim);
  text-transform: none;
  letter-spacing: 0;
}

/* Windows: 14 px corners, a thin edge, the deep shadow. */
.modal {
  --tblr-modal-border-color: var(--cc-line-2);
  --tblr-modal-border-radius: var(--cc-radius-window);
  --tblr-modal-box-shadow: var(--cc-shadow);
}

/* Messages: as wide as their words, 280 to 420 px, 13 px, 10 px corners. (The least width: no variable.) */
.toast {
  --tblr-toast-max-width: 26.25rem;
  --tblr-toast-font-size: 0.8125rem;
  --tblr-toast-border-radius: var(--cc-radius-inner);
  --tblr-toast-spacing: 0.5rem;

  width: auto;
  min-width: 17.5rem;
  max-width: var(--tblr-toast-max-width);
}

/* Nothing to show: a 48 px ring around a 20 px icon (the ring is ours, the kit has none), title 16 px, one dim
   line of 13 px. */
.empty {
  --tblr-empty-padding-md: 4rem;
  --tblr-empty-title-margin-bottom: 0.25rem;
  --tblr-empty-action-margin-top: 1rem;
}

.empty-icon {
  display: grid;
  place-items: center;
  color: var(--cc-dim);
  background: var(--cc-panel-2);
  border: 1px solid var(--cc-line-2);
  border-radius: 50%;
}

.empty-icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.empty-title {
  font-size: 1rem;
  line-height: 1.5;
}

.empty-subtitle {
  max-width: 23.75rem;
  font-size: 0.8125rem;
  color: var(--cc-dim);
}

/* --------------------------------------------------------------- 2. our files instead of data: addresses */
/* (Tabler sets the select's arrow once more for the dark theme: the first selector outweighs that rule.) */
[data-bs-theme="dark"] .form-select,
.form-select {
  --tblr-form-select-bg-img: url("/static/cc/img/select-arrow.svg");
}

.form-check-input[type="checkbox"] {
  --tblr-form-check-icon: url("/static/cc/img/check.svg");
}

.form-check-input[type="radio"] {
  --tblr-form-check-icon: url("/static/cc/img/radio.svg");
}

.form-check-input {
  --tblr-form-check-icon-color: var(--cc-ink);
}

/* An empty tick box or radio button shows its edge. The kit draws it in the colour of a card's line, which is
   not told from the card it stands on (the same edge as a switch that is off, 4f). */
.form-check-input:not(:checked) {
  border-color: #6b748e;
}

.form-control.is-invalid {
  background-image: url("/static/cc/img/invalid.svg");
}

.btn-close {
  --tblr-btn-close-bg: url("/static/cc/img/close.svg");
  --tblr-btn-close-opacity: 0.75;
  --tblr-btn-close-hover-opacity: 1;
}

.table-sort::after {
  mask-image: url("/static/cc/img/sort.svg");
}

.table-sort.asc::after {
  mask-image: url("/static/cc/img/sort-asc.svg");
}

.table-sort.desc::after {
  mask-image: url("/static/cc/img/sort-desc.svg");
}

/* ------------------------------------------------------------------------------------------- 3. the frame */
.cc-skip {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 2000;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: var(--cc-ink);
  text-decoration: none;
  background: var(--cc-gold);
  border-radius: 8px;
}

.cc-skip:focus {
  top: 0.5rem;
  color: var(--cc-ink);
}

/* The side menu. Wide screen: Tabler's fixed column. Below 992 px: Bootstrap's drawer (offcanvas-lg).
   Its links are styled by the menu's id, so that these rules outweigh the kit's own (four classes deep). */
.cc-sidebar {
  --tblr-navbar-bg: var(--cc-bg-2);
  --tblr-offcanvas-bg: var(--cc-bg-2);
  --tblr-offcanvas-width: 16.5rem;
  --tblr-navbar-color: var(--cc-muted);
  --tblr-navbar-hover-color: var(--cc-text);
  --tblr-navbar-active-color: var(--cc-gold-bright);
  --tblr-navbar-active-bg: var(--cc-panel-2);
  padding: 0;
  background-color: var(--cc-bg-2) !important;
  border-inline-end: 1px solid var(--cc-line);
  box-shadow: none;
}

.cc-sidebar-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.cc-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem 1rem;
}

.cc-brand img {
  display: block;
  width: auto;
  height: 3rem;
}

.cc-nav {
  flex: 1 1 auto;
}

#cc-menu .navbar-nav {
  --tblr-sidebar-inset: 0;

  flex-direction: column;
  flex-grow: 0;
  gap: 2px;
  margin: 0;
}

.cc-nav-group {
  margin: 1.25rem 0 0.375rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--cc-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* A list of the menu that stands apart, under no group name (Settings, the owner's). */
#cc-menu .cc-nav-apart {
  margin-top: 1.25rem;
}

#cc-menu .nav-link {
  position: relative;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  color: var(--cc-muted);
  text-align: start;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

#cc-menu .nav-link:hover,
#cc-menu .nav-link:focus-visible {
  color: var(--cc-text);
  background: var(--cc-panel-2);
}

#cc-menu .nav-item.active > .nav-link {
  font-weight: 400;
  color: var(--cc-gold-bright);
  background: var(--cc-panel-2);
}

/* The gold bar that marks the page one is on. */
#cc-menu .nav-item.active > .nav-link::before {
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 0;
  width: 3px;
  content: "";
  background: var(--cc-gold);
  border-radius: 0 3px 3px 0;
}

#cc-menu .nav-item.active::after {
  content: none;
}

#cc-menu .nav-link-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  margin: 0;
  color: inherit;
  opacity: 1;
}

.cc-sidebar-foot {
  padding-top: 0.75rem;
  margin-top: 1rem;
  border-top: 1px solid var(--cc-line);
}

.cc-sidebar-note {
  margin: 0.5rem 0 0;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  color: var(--cc-dim);
}

/* The top bar. */
.cc-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  min-height: 4rem;
  padding: 0.5rem 2rem;
  background: rgb(11 13 18 / 92%);
  border-bottom: 1px solid var(--cc-line);
  backdrop-filter: saturate(1.2) blur(10px);
}

/* The page starts where the title of the bar starts and ends where the bar's content ends, as approved: the
   bar's own side padding, from the left, at most 1400 px wide (the kit centres a narrower column). */
.page-body > .container-xl {
  max-width: 87.5rem;
  padding-inline: 2rem;
  margin-inline: 0;
}

.cc-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-bar-btn {
  --tblr-btn-border-color: transparent;
  --tblr-btn-hover-border-color: var(--cc-line);
  --tblr-btn-active-border-color: var(--cc-line);

  position: relative;
  flex: none;
}

.cc-bar-btn[aria-expanded="true"],
.cc-me-btn[aria-expanded="true"] {
  color: var(--cc-text);
  background: var(--cc-panel-2);
  border-color: var(--cc-line);
}

/* The bell: a square with a thin edge, as in the approved alert drawing. */
.cc-bell .cc-bar-btn {
  --tblr-btn-border-color: var(--cc-line);
}

/* Search everything. */
.cc-search {
  position: relative;
  flex: 0 1 24rem;
}

.cc-search .form-control {
  padding-inline-end: 4.5rem;
}

/* The key hint in a field: a small key with a thicker lower edge. */
.cc-kbd {
  inset-inline: auto 0.5rem;
  min-width: 0;
}

.cc-kbd kbd {
  height: 1.375rem;
  padding: 0 0.5rem;
  font-family: var(--tblr-font-monospace);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
  color: var(--cc-dim);
  background: var(--cc-panel-2);
  border: 1px solid var(--cc-line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
}

.cc-search-panel {
  position: absolute;
  inset: calc(100% + 0.5rem) 0 auto;
  z-index: 1030;
  max-height: min(27.5rem, 70vh);
  overflow-y: auto;
  background: var(--cc-panel-2);
  border: 1px solid var(--cc-line-2);
  border-radius: 12px;
  box-shadow: var(--cc-shadow);
}

.cc-search-panel:empty,
html.js .cc-search:not(:focus-within) .cc-search-panel {
  display: none;
}

/* What was found, each kind in a group: a picture or an icon, the title, one line that says whose it is. The
   same line is a plain link on the page of the search (.cc-found-hit). */
.cc-search-list {
  padding: 0.5rem;
}

.cc-search-kind {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cc-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cc-search-hit,
.cc-found-hit {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-height: 2.75rem;
  color: var(--cc-text);
  text-decoration: none;
}

.cc-search-hit {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.cc-search-hit .cc-avatar,
.cc-found-hit .cc-avatar,
.cc-search-icon {
  --tblr-avatar-size: 1.75rem;
  --tblr-avatar-font-size: 0.75rem;

  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
}

.cc-search-icon {
  display: grid;
  place-items: center;
  color: var(--cc-muted);
  background: var(--cc-panel-3);
  border-radius: 8px;
}

.cc-search-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.cc-search-text > strong,
.cc-search-text > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-search-text > strong {
  font-size: 0.8125rem;
  font-weight: 600;
}

.cc-search-text > span {
  font-size: 0.75rem;
  color: var(--cc-dim);
}

/* What was typed, marked in what was found (gold on a gold tint: 8:1). */
.cc-search-text mark {
  padding: 0 1px;
  color: var(--cc-gold-bright);
  background: rgb(226 183 85 / 22%);
  border-radius: 3px;
}

/* The line the arrow keys are on - and the first line, which Enter opens while no other is chosen. */
.cc-search-hit:hover,
.cc-search-hit[aria-selected="true"],
.cc-search-hit[data-combobox-option-default="true"] {
  color: var(--cc-text);
  text-decoration: none;
  background: var(--cc-hover);
}

.cc-search-none,
.cc-search-more {
  margin: 0;
  padding: 1rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--cc-dim);
}

.cc-search-more {
  padding-block: 0.5rem;
  font-size: 0.75rem;
  border-top: 1px solid var(--cc-line);
}

/* The page of the search: the same lines, as cards. */
.cc-found > .card {
  margin-bottom: 1rem;
}

.cc-found-for,
.cc-found-more {
  color: var(--cc-muted);
}

.cc-found-hit:hover {
  color: var(--cc-text);
  text-decoration: none;
}

/* The bell and the red counter: dark text on red (6.4:1). */
.cc-count {
  color: var(--cc-ink);
  background: var(--cc-danger);
  border-color: transparent;
}

/* The alert badge beside a client's name and in the head of his Trading accounts: a tinted red pill, as in the
   approved alert drawing (red on the tint: 5.4:1). The counters of the bell and of the side menu stay solid. */
.cc-row .cc-count,
.card-title > .cc-count {
  color: var(--cc-danger);
  background: rgb(232 115 106 / 10%);
  border-color: rgb(232 115 106 / 30%);
}

.cc-bell-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 1.125rem;
  padding: 0.125rem 0.25rem;
  font-size: 0.6875rem;
  line-height: 1;
  transform: translate(25%, -25%);
}

.cc-bell-menu {
  --tblr-dropdown-padding-x: 0.625rem;
  --tblr-dropdown-padding-y: 0.625rem;
  --tblr-dropdown-header-padding-x: 0.25rem;

  width: 20.625rem;
  max-width: calc(100vw - 2rem);
}

.cc-bell-menu .dropdown-header {
  font-size: 0.8125rem;
  white-space: normal;
}

/* Each alert is a small box, as in the approved alert drawing. */
.cc-bell-menu .dropdown-item {
  flex-direction: column;
  gap: 0.125rem;
  align-items: flex-start;
  white-space: normal;
}

.cc-bell-menu .dropdown-item:not(.cc-bell-all) {
  --tblr-dropdown-item-padding-x: 0.625rem;

  margin-bottom: 0.375rem;
  background: var(--cc-panel);
  border: 1px solid var(--cc-line);
  border-radius: 8px;
}

.cc-bell-menu .dropdown-item:not(.cc-bell-all):hover,
.cc-bell-menu .dropdown-item:not(.cc-bell-all):focus {
  background: var(--cc-panel-3);
  border-color: var(--cc-line-2);
}

.cc-bell-what {
  display: inline-flex;
  gap: 0.375rem;
  align-items: center;
  font-weight: 600;
  color: var(--cc-danger);
}

.cc-bell-who {
  font-size: 0.75rem;
  color: var(--cc-dim);
}

/* The signed-in person. */
.cc-me-btn {
  --tblr-btn-color: var(--cc-text);
  --tblr-btn-border-color: transparent;
  --tblr-btn-hover-border-color: var(--cc-line);
  --tblr-btn-active-border-color: var(--cc-line);
  --tblr-btn-border-radius: var(--tblr-border-radius-pill);

  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 0.5rem 0 0.25rem;
}

.cc-me-btn > .icon {
  color: var(--cc-dim);
}

.cc-me-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}

.cc-me-name {
  font-size: 0.8125rem;
  font-weight: 600;
}

.cc-me-role {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--cc-dim);
}

/* The round picture of a person (size and fill: section 1b); the owner's, and the signed-in person's, is gold. */
.cc-avatar {
  flex: none;
  font-weight: 600;
  color: hsl(220deg 55% 82%);
  letter-spacing: 0.02em;
}

.cc-me-btn .cc-avatar,
.cc-row:has(.cc-role-owner) .cc-avatar {
  --tblr-avatar-box-shadow: none;

  color: var(--cc-ink);
  background: linear-gradient(135deg, var(--cc-gold), var(--cc-gold-deep));
}

/* (the kit draws a picture inside a button as small as an icon) */
.cc-me-btn .cc-avatar {
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
}

/* The staging banner: the same words as on the old pages. */
.cc-staging {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  justify-content: center;
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  color: var(--cc-ink);
  background: var(--cc-warn);
}

/* Messages (toasts), bottom right; on a phone across the bottom. */
.cc-toasts {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 1090;
  padding: 1.5rem;
}

/* (the kit draws a message's edge and shadow a second time with plain values: both are set here) */
.cc-toasts .toast {
  --tblr-toast-bg: var(--cc-panel-2);
  --tblr-toast-border-color: var(--cc-line-2);
  --tblr-toast-color: var(--cc-text);

  border-color: var(--tblr-toast-border-color);
  box-shadow: var(--cc-shadow);
}

.cc-toasts .toast-body {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-inline-start: 1rem;
}

.cc-toasts .toast-body > .icon {
  --tblr-icon-size: 1.125rem;
}

.cc-toasts .btn-close {
  margin: 0 0 0 auto;
}

.cc-toast-text {
  flex: 1 1 auto;
  min-width: 0;
}

.cc-toast-ok .icon {
  flex: none;
  color: var(--cc-ok);
}

.cc-toast-error {
  --tblr-toast-border-color: var(--cc-danger);
}

.cc-toast-error .icon {
  flex: none;
  color: var(--cc-danger);
}

/* ----------------------------------------------------------------------------------- 4. the small parts */
/* Buttons: the main one is gold with dark text. */
.btn-primary {
  --tblr-btn-color: var(--cc-ink);
  --tblr-btn-hover-color: var(--cc-ink);
  --tblr-btn-active-color: var(--cc-ink);
  --tblr-btn-disabled-color: var(--cc-ink);

  background-image: linear-gradient(135deg, var(--cc-gold), var(--cc-gold-deep));
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-danger {
  --tblr-btn-color: var(--cc-ink);
  --tblr-btn-hover-color: var(--cc-ink);
  --tblr-btn-active-color: var(--cc-ink);
}

/* Status: Tabler's "status" part with the owner's colours. The word is always there beside the dot. */
.status.cc-ok {
  --tblr-status-color: var(--cc-ok);
}

.status.cc-warn {
  --tblr-status-color: var(--cc-warn);
}

.status.cc-danger {
  --tblr-status-color: var(--cc-danger);
}

.status.cc-ice {
  --tblr-status-color: var(--cc-ice);
}

.status.cc-plain {
  --tblr-status-color: var(--cc-muted);
}

.status {
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--tblr-status-color) 30%, transparent);
}

.cc-pill {
  color: var(--cc-muted);
  background: rgb(201 204 209 / 7%);
  border-color: rgb(201 204 209 / 20%);
}

/* A platform (NT8, MT5) is a tag, not a pill: 6 px corners, weight 600, all of one width. */
.cc-accounts td:first-child .cc-pill,
.cc-alert-list .cc-pill,
.cc-part-facts .cc-pill {
  --tblr-badge-border-radius: 6px;
  --tblr-badge-font-weight: var(--tblr-font-weight-semibold);

  min-width: 2.75rem;
  letter-spacing: 0.04em;
  background: var(--cc-panel-3);
  border-color: var(--cc-line-2);
}

/* How many of them: a small dim counter beside the title of a card, 20 px high. */
.card-title > .cc-pill {
  --tblr-badge-padding-y: 0.1875rem;

  color: var(--cc-dim);
  background: var(--cc-panel-3);
  border-color: transparent;
}

/* The role of a user, as approved: the owner gold, an admin blue-grey, a client plain. The word says it too.
   ("Owner only" beside a setting is gold too.) */
.cc-setting .cc-pill,
.cc-pill.cc-role-owner {
  color: var(--cc-gold-bright);
  background: color-mix(in srgb, var(--cc-gold) 10%, transparent);
  border-color: color-mix(in srgb, var(--cc-gold) 36%, transparent);
}

.cc-pill.cc-role-admin {
  color: var(--cc-slate);
  background: color-mix(in srgb, var(--cc-slate) 10%, transparent);
  border-color: color-mix(in srgb, var(--cc-slate) 30%, transparent);
}

.cc-dim {
  font-size: 0.8125rem;
  color: var(--cc-dim);
}

.cc-mono {
  font-family: var(--tblr-font-monospace);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* An account number is one word: it is never broken at its hyphen. Nor are the two words of its type. */
td > .cc-mono,
.cc-accounts td[data-label="Type"] {
  white-space: nowrap;
}

.cc-note {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  color: var(--cc-text);
}

.cc-note .icon {
  flex: none;
  color: var(--cc-warn);
}

.cc-gap {
  margin-top: 1rem;
}

.cc-gap-s {
  margin-top: 0.75rem;
}

.cc-box {
  padding: 0.75rem;
  border: 1px dashed var(--cc-line-2);
  border-radius: 8px;
}

/* Tabs: the ones one is not on are still readable (the kit's own grey is too faint on this background). */
.nav-tabs .nav-link {
  color: var(--cc-muted);
}

.nav-tabs .nav-link:hover {
  color: var(--cc-text);
}

.nav-tabs .nav-link.active {
  color: var(--cc-gold-bright);
}

/* A row that opens. The whole first cell is the link; the arrow turns when the row is open. (.cc-who: the same
   picture, name and dim line as a plain link that opens the person - the lines of the Dashboard.) */
.cc-row-toggle,
.cc-who {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--cc-text);
  text-decoration: none;
}

.cc-row-toggle:hover,
.cc-who:hover {
  color: var(--cc-text);
  text-decoration: none;
}

.cc-row-arrow {
  display: inline-flex;
  color: var(--cc-dim);
  transition: transform 0.15s;
}

.cc-row-toggle[aria-expanded="true"] .cc-row-arrow {
  color: var(--cc-gold);
  transform: rotate(90deg);
}

/* A line of a list: 64 px high, 13 px grey; only the name and the date are bright. Under the pointer it lights
   up a little (the kit's own variable for the state of a table row). On a phone the line is a card, and the
   light is the card's, not each cell's (the 767 px block below). */
.cc-row > td {
  font-size: 0.8125rem;
  color: var(--cc-muted);
}

@media (min-width: 768px) {
  .cc-row > td {
    height: 4rem;
  }

  .cc-row:hover > td {
    --tblr-table-bg-state: rgb(255 255 255 / 2.5%);
  }
}

.cc-row-who > strong {
  font-size: 0.875rem;
  line-height: 1.35;
}

.cc-row time,
.cc-row > td[data-label="License"] {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The open row and what it shows are held together by a gold line on the left, as approved; the open row has a
   faint gold tint. */
.cc-row:has(.cc-row-toggle[aria-expanded="true"]) > td {
  background: color-mix(in srgb, var(--cc-gold) 4%, var(--cc-panel));
}

.cc-row:has(.cc-row-toggle[aria-expanded="true"]) > td:first-child,
.cc-detail > td {
  box-shadow: inset 2px 0 0 var(--cc-gold);
}

.cc-row-who {
  display: block;
  min-width: 0;
}

.cc-row-mail {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--cc-dim);
}

.cc-row-menu {
  width: 1%;
  text-align: end;
}

/* A table row cannot animate its height: it opens and closes at once (and two quick clicks cannot leave two
   rows open, which Bootstrap allows while one is still moving). */
.cc-detail.collapsing {
  transition: none;
}

.cc-rows > tbody > .cc-detail > td {
  padding: 1.5rem;
  background: var(--cc-bg-2);
}

.cc-danger-item {
  --tblr-dropdown-link-hover-bg: rgb(232 115 106 / 10%);
}

.cc-danger-item,
.cc-danger-item:hover {
  color: var(--cc-danger);
}

/* What lies behind a window or the drawer is clearly out of reach (the kit's own veil is too thin here). */
.modal-backdrop {
  --tblr-backdrop-opacity: 0.72;
}

.offcanvas-backdrop.show {
  opacity: 0.72;
}

/* The native progress bar: grey; orange or red when the card's head says that little is left. */
.cc-progress {
  --cc-progress: var(--cc-muted);

  display: block;
  width: 100%;
  height: 0.375rem;
  margin: 0.75rem 0 0.5rem;
  overflow: hidden;
  appearance: none;
  background: var(--cc-panel-3);
  border: 0;
  border-radius: 999px;
}

.cc-progress::-webkit-progress-bar {
  background: var(--cc-panel-3);
}

.cc-progress::-webkit-progress-value {
  background: var(--cc-progress);
  border-radius: 999px;
}

.cc-progress::-moz-progress-bar {
  background: var(--cc-progress);
  border-radius: 999px;
}

.card-header:has(> .card-actions.cc-warn-text) ~ .card-body .cc-progress {
  --cc-progress: var(--cc-warn);
}

.card-header:has(> .card-actions.cc-danger-text) ~ .card-body .cc-progress {
  --cc-progress: var(--cc-danger);
}

.cc-progress ~ .cc-dim {
  font-size: 0.75rem;
}

/* ------------------------------------------------------------------------------------ 4b. a list page */
/* The top of a list page: what it is in one sentence, and its main button. */
.cc-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.cc-head p {
  max-width: 44rem;
  margin: 0;
  color: var(--cc-muted);
}

.cc-back {
  margin: 0 0 1rem;
}

/* A link inside a sentence is underlined: it is told from the words around it by more than its colour (WCAG 1.4.1;
   axe "link-in-text-block") - in a paragraph, in the words under a choice, in the foot of a card, on a line of words
   (`cc-says`). */
.page-body p > a:not(.btn),
.page-body .form-check-description a:not(.btn),
.page-body .card-footer a:not(.btn),
.page-body .cc-says a:not(.btn) {
  text-decoration: underline;
}

/* The filter field of a list. Without the script it is sent by its button. */
.cc-filter {
  display: flex;
  gap: 0.5rem;
  max-width: 25rem;
  margin-bottom: 0.75rem;
}

.cc-filter .input-icon {
  flex: 1 1 auto;
}

html.js .cc-no-js-only {
  display: none !important;
}

/* Chips: plain links drawn as the kit's pill button; the chosen one is gold. Each carries how many it shows. */
.cc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.cc-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* (a thin upright line between the two groups, where they stand on one row) */
@media (min-width: 1400px) {
  .cc-chip-row + .cc-chip-row {
    padding-inline-start: 1rem;
    background: linear-gradient(var(--cc-line), var(--cc-line)) left center / 1px 1.25rem no-repeat;
  }
}

/* A chip: 32 px high, 13 px, see-through with a thin edge. (Its side room: no variable - the kit's pill button
   wrote it as a plain value.) */
.cc-chip {
  --tblr-btn-padding-y: 0.3125rem;
  --tblr-btn-font-weight: var(--tblr-font-weight-medium);
  --tblr-btn-border-color: var(--cc-line);
  --tblr-btn-hover-border-color: var(--cc-line-2);

  gap: 0.375rem;
  padding-inline: 0.75rem;
}

.cc-chip.active,
.cc-chip.active:hover {
  color: var(--cc-gold-bright);
  background: rgb(226 183 85 / 12%);
  border-color: rgb(226 183 85 / 50%);
}

.cc-chip-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--cc-dim);
}

.cc-chip.active .cc-chip-count {
  color: var(--cc-gold);
}

/* Something waits for his word (a trading account to approve): gold-orange, always with the words. */
.cc-wait {
  --tblr-badge-gap: 0.375rem;

  color: var(--cc-warn);
  background: color-mix(in srgb, var(--cc-warn) 10%, transparent);
  border-color: color-mix(in srgb, var(--cc-warn) 30%, transparent);
}

.cc-wait::before {
  flex: none;
  width: 0.375rem;
  height: 0.375rem;
  content: "";
  background: currentcolor;
  border-radius: 50%;
}

/* A fact of two lines in a list (a date, and a few words under it). The colour never stands alone. */
.cc-fact {
  line-height: 1.4;
}

.cc-fact > :not(.cc-dim) {
  font-variant-numeric: tabular-nums;
  color: var(--cc-text);
}

.cc-fact > .cc-dim {
  font-size: 0.75rem;
}

/* The band above a list (how many it shows) and the band under it: small and quiet. */
#users-list > .card {
  --tblr-card-cap-padding-y: 0.5rem;
  --tblr-card-cap-padding-x: 1rem;
  --tblr-card-footer-bg: transparent;
}

#users-list > .card > .card-header {
  min-height: 2.5rem;
}

#users-list > .card > .card-header > .card-title {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--cc-dim);
}

.cc-warn-text {
  color: var(--cc-warn);
}

.cc-danger-text {
  color: var(--cc-danger);
}

.cc-words {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  justify-content: flex-end;
}

/* The page one is on: dark text on gold (the kit writes white there, which nobody can read on gold). */
.pagination {
  --tblr-pagination-active-color: var(--cc-ink);
}

.page-link.active,
.active > .page-link {
  font-weight: 600;
}

.cc-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
}

/* ------------------------------------------------------------------------ 4c. inside an opened line */
/* How to reach him and since when he is a user: one quiet line above the cards. */
.cc-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--cc-muted);
}

/* A card of his record: 10 px corners, a head of 48 px with a 14 px title, 16 px room at the sides. */
.cc-record .card {
  --tblr-card-cap-padding-y: 0.5rem;
  --tblr-card-cap-padding-x: 1rem;
  --tblr-card-spacer-y: 0.75rem;
  --tblr-card-spacer-x: 1rem;
  --tblr-card-border-radius: var(--cc-radius-inner);
}

.cc-record .card-header {
  min-height: 3rem;
}

.cc-record .card-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.5rem;
  align-items: center;
  font-size: 0.875rem;
}

.cc-record .card-actions.cc-dim {
  font-size: 0.75rem;
}

.cc-record .list-group {
  --tblr-list-group-item-padding-x: 1rem;
  --tblr-list-group-item-padding-y: 0.75rem;
}

/* His trading accounts: a header row of 32 px, lines of 56 px in 13 px grey with a thin line between them (the
   kit takes the lines away from a table that ends a table - the one of the list's last row). The columns are as
   wide as drawn and grow when their words need more; the name takes the room that is left. */
.cc-accounts > tbody > tr > td {
  font-size: 0.8125rem;
  color: var(--cc-muted);
}

.cc-accounts td > .cc-mono {
  color: var(--cc-text);
}

@media (min-width: 768px) {
  .cc-accounts > thead th {
    height: 2rem;
    background: rgb(255 255 255 / 1.5%);
    border-radius: 0;
  }

  .cc-accounts td:first-child .cc-pill {
    display: flex;
  }

  .cc-accounts > * > tr > * {
    padding-inline: 0.375rem;
  }

  .cc-accounts > thead th:nth-child(1) {
    width: 6.375rem;
  }

  .cc-accounts > thead th:nth-child(2) {
    width: 7rem;
  }

  .cc-accounts > thead th:nth-child(3) {
    width: 8.5rem;
  }

  .cc-accounts > thead th:nth-child(5) {
    width: 8.5rem;
  }

  .cc-accounts > thead th:nth-child(6) {
    width: 12.625rem;
  }

  .cc-accounts > tbody > tr > td {
    height: 3.5rem;
    padding-block: 0.5rem;
  }

  .cc-accounts > tbody > tr:not(:last-child) > td {
    border-bottom: 1px solid var(--cc-line);
  }
}

/* A licence and the PCs that used it. */
.cc-licence {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.625rem;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--cc-bg-2);
  border-bottom: 1px solid var(--cc-line);
}

/* A PC: a line of 56 px - its icon in a 32 px tile, its name, and small dim words under it. The PC that holds
   the seat has a faint green line and a green tile; a PC that does not is "Idle", a plain dim word. */
.cc-pc {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-height: 3.5rem;
  padding-block: 0.5rem;
}

.cc-pc:has(.cc-pc-seat) {
  background: rgb(127 201 138 / 4%);
}

.cc-pc-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: var(--cc-muted);
  background: var(--cc-panel-3);
  border-radius: 8px;
}

.cc-pc-seat {
  color: var(--cc-ok);
  background: rgb(127 201 138 / 12%);
}

.cc-pc strong {
  font-size: 0.8125rem;
  line-height: 1.35;
}

.cc-pc .cc-dim,
.cc-pc .cc-mono {
  font-size: 0.75rem;
  line-height: 1.35;
}

.cc-pc .cc-mono {
  font-weight: 400;
  color: var(--cc-muted);
}

.cc-pc-top > .status.cc-plain {
  --tblr-status-height: auto;
  --tblr-status-padding-x: 0;

  font-weight: 400;
  color: var(--cc-dim);
  background: none;
  border: 0;
}

.cc-pc-top > .status.cc-plain > .status-dot {
  display: none;
}

.cc-pc-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.cc-pc-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.125rem;
}

/* A setting: its name and what it does on the left, how it is set on the right. */
.cc-setting {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.cc-setting .status {
  flex: none;
}

.cc-setting strong {
  font-size: 0.8125rem;
}

.cc-setting .cc-dim {
  margin-top: 2px;
  font-size: 0.75rem;
}

/* A few named facts side by side (started, ends, plan): the name small above the fact. */
.cc-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.cc-facts dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cc-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.cc-facts dd {
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* A table of facts that may hold long words (Billing health: the permissions of a payment key, as Whop names them -
   `access_pass:resolution_center_case:read`): every cell and code wraps, even inside a word, so the table never
   makes the page scroll sideways on a phone (task finish-2 T5c). */
.cc-wraps {
  table-layout: fixed;
  width: 100%;
}

.cc-wraps th,
.cc-wraps td,
.cc-wraps code,
.cc-wraps .status {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* (a status of the kit is one line of a fixed height: in these tables it may take two) */
.cc-wraps .status {
  height: auto;
  max-width: 100%;
}

/* On a phone a facts table reads as a list: the name of a fact above its value, each the full width, instead of
   two narrow columns (platform-small-2 T3: Billing health was 5,811 px tall at 375 px). Only the cells change their
   display: the table and its rows keep theirs, so a screen reader still pairs each value with its name. */
@media (max-width: 575.98px) {
  .cc-wraps th,
  .cc-wraps td {
    display: block;
    width: 100%;
  }

  .cc-wraps th {
    padding-bottom: 0;
    border-bottom: 0;
  }
}

/* A long list of names (the permissions of a payment key) folded under one line that gives the count; opened, the
   names flow side by side and wrap, never one long column (platform-small-2 T3). */
.cc-names {
  margin-top: 0.25rem;
}

.cc-names > summary {
  cursor: pointer;
}

.cc-names[open] .cc-names-hint {
  display: none;
}

.cc-name-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

/* ------------------------------------------------------------------------------------------ 4d. alerts */
/* The alert card: the first thing in the record of a client who has an alert that waits. The kit's alert, red:
   the icon and the title in red, the words in the text colour (red text on the red tint: 5:1, the title only). */
.cc-alert {
  --tblr-alert-color: var(--cc-danger);
  --tblr-alert-padding-x: 0.875rem;
  --tblr-alert-padding-y: 0.875rem;
  --tblr-alert-border-radius: var(--cc-radius-inner);

  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0 0 1rem;
  color: var(--cc-text);
  background: color-mix(in srgb, var(--cc-danger) 9%, var(--cc-panel));
  border: 1px solid color-mix(in srgb, var(--cc-danger) 45%, transparent);
}

.cc-alert > .icon {
  --tblr-icon-size: 1.25rem;

  flex: none;
  margin-top: 1px;
  color: var(--cc-danger);
}

.cc-alert-text {
  flex: 1 1 auto;
  min-width: 0;
}

.cc-alert .alert-heading {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--cc-danger);
}

.cc-alert-sentence {
  margin: 0 0 0.625rem;
  font-weight: 600;
}

.cc-alert-what {
  margin: 0 0 0.25rem;
  color: var(--cc-muted);
}

.cc-alert-list {
  padding-inline-start: 1.125rem;
  margin: 0 0 0.75rem;
  overflow-wrap: anywhere;
}

.cc-alert-list li + li {
  margin-top: 0.25rem;
}

.cc-alert-when,
.cc-alert-note,
.cc-alert-todo,
.cc-alert-none {
  font-size: 0.75rem;
  color: var(--cc-dim);
}

.cc-alert-note {
  max-width: 48rem;
  margin: 0 0 0.375rem;
}

/* What can be done about each kind of account that waits: one short line per kind. */
.cc-alert-todo {
  max-width: 48rem;
  padding-inline-start: 1.125rem;
  margin: 0 0 0.875rem;
}

.cc-alert-todo li + li {
  margin-top: 0.125rem;
}

.cc-alert-buttons {
  align-items: center;
}

/* Where the bell leads (#alert). On a wide screen his line stays in sight above the card. */
@media (min-width: 768px) {
  #alert {
    scroll-margin-top: 7.25rem;
  }
}

/* An account his PC names without approval: a red line of his Trading accounts. The words say it too. */
.cc-line-alert > td {
  background: color-mix(in srgb, var(--cc-danger) 8%, transparent);
}

.cc-line-alert > td:first-child {
  box-shadow: inset 3px 0 0 var(--cc-danger);
}

/* The bell's last line: all of them, in the Users list. */
.cc-bell-menu .cc-bell-all {
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
  color: var(--cc-gold-bright);
}

/* The full proof: in its window, and on a page of its own without the script. */
.cc-proof-card {
  margin-bottom: 1rem;
}

.cc-proof-who {
  margin: 0 0 1rem;
}

.cc-proof-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.cc-proof-table {
  margin-bottom: 1.25rem;
  border: 1px solid var(--cc-line);
}

.cc-proof-table td {
  overflow-wrap: anywhere;
}

.cc-proof-note {
  max-width: 52rem;
  margin: 0;
}

/* The window while its proof is on the way, and when nothing came (htmx marks the window while it asks). */
.cc-proof-wait,
.cc-proof-none {
  display: none;
  margin: 0;
  color: var(--cc-muted);
}

#cc-proof-window.htmx-request .cc-proof-wait,
#cc-proof-window:not(.htmx-request) #cc-proof-body:empty ~ .cc-proof-none,
#cc-part-window.htmx-request .cc-proof-wait,
#cc-part-window:not(.htmx-request) #cc-part-body:empty ~ .cc-proof-none,
#cc-ask-window.htmx-request .cc-proof-wait,
#cc-ask-window:not(.htmx-request) #cc-ask-body:empty ~ .cc-proof-none {
  display: block;
}

#cc-proof-window.htmx-request #cc-proof-body,
#cc-part-window.htmx-request #cc-part-body,
#cc-ask-window.htmx-request #cc-ask-body {
  display: none;
}

/* (the body of the window can take the keyboard, to be scrolled: its outline is drawn inside the window) */
#cc-proof-window .modal-body:focus-visible {
  outline-offset: -2px;
}

/* ------------------------------------------------------------ 4e. the actions on his trading accounts */
/* The buttons of an account's line stand at its end, as approved: Approve (gold), Deny, and "More" (the
   account's window). A form with one button takes no room of its own. */
.cc-line-acts {
  width: 1%;
  white-space: nowrap;
}

.cc-line-acts > .cc-acts {
  flex-wrap: nowrap;
}

.cc-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.cc-act {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
}

/* The three dots: dim, in a 32 px square that lights up a little under the pointer. */
.cc-more {
  --tblr-btn-padding-y: 0.3125rem;
  --tblr-btn-color: var(--cc-dim);
  --tblr-btn-border-color: transparent;
  --tblr-btn-hover-bg: var(--cc-hover);
  --tblr-btn-hover-border-color: transparent;
  --tblr-btn-active-bg: var(--cc-hover);
  --tblr-btn-active-border-color: transparent;
}

/* THE PLACE OF A BUTTON NEVER CHANGES (review of ui-04). After an action the line is renewed in place, under a
   pointer that has not moved. Approve, Deny and "More" each have a place of their own on the line, as wide as
   the button, and the place of a button that is gone stays empty: Approve never slides to where Deny was.
   (The lines themselves never change their order: app/cc/users.py.) */
.cc-line-acts > .cc-acts-line {
  display: grid;
  grid-template-columns: 4.75rem 3.5rem 2rem;
  justify-content: end;
}

/* Deny turns red under the pointer, as approved. */
.cc-act-deny > .btn {
  --tblr-btn-hover-color: var(--cc-danger);
  --tblr-btn-hover-bg: rgb(232 115 106 / 8%);
  --tblr-btn-hover-border-color: rgb(232 115 106 / 55%);
}

.cc-acts-line > .cc-act-approve {
  grid-column: 1;
}

.cc-acts-line > .cc-act-deny {
  grid-column: 2;
}

.cc-acts-line > .cc-more {
  grid-column: 3;
}

.cc-acts-line > .cc-act > .btn,
.cc-alert-buttons > .cc-act > .btn {
  width: 100%;
}

/* A line that is not in his list keeps the place of "More" free: once the account is in his list, "More" stands
   where no button was. */
.cc-line-acts > .cc-acts-unlisted {
  padding-inline-end: 2.5rem;
}

/* "Add it to his list": a link on a line of its own under the words "Not in his list". Two lines of words are as
   high as a button, so the line keeps the height of every other line. */
.cc-add {
  display: block;
  width: fit-content;
  text-decoration: underline;
}

/* Wide screen: two statuses of an account stand one under the other, so the column is as wide as ONE of them and
   the account's name keeps its room. */
@media (min-width: 768px) {
  .cc-accounts .cc-words {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* A button that was just put on the page takes no press for half a second. What stood under the pointer a moment
   ago may have been another button: a record renewed in place, a question that took the place of a link in a
   window. (Browsers guard their own permission windows the same way.) Only the pointer waits - the script moves
   the keyboard to the line, never onto a button - and only with the script: without it nothing is renewed in
   place. Not a movement: it holds for somebody who asked his device for less motion too. */
@keyframes cc-arm {
  from {
    pointer-events: none;
  }
}

html.js .cc-act > .btn {
  animation: cc-arm 0.5s step-end;
}

/* The line that was acted on takes the keyboard when its button is gone (static/cc/thegm.js): the outline is
   drawn around its words, inside the cell. */
.cc-words:focus-visible,
td > .cc-mono:focus-visible,
.card-title:focus-visible {
  border-radius: 4px;
  outline-offset: 3px;
}

/* A window of his trading accounts (and the same part on a page of its own, without the script). */
.cc-part-card {
  max-width: 40rem;
}

.cc-part-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.form-hint {
  color: var(--cc-dim);
}

.cc-part-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.75rem;
  align-items: center;
  margin: 0 0 0.75rem;
}

.cc-part-none {
  color: var(--cc-muted);
}

.cc-part-list {
  border-top: 1px solid var(--cc-line);
}

.cc-part-item {
  display: flex;
  gap: 0.75rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.875rem 0;
  background: transparent;
}

.cc-part-item > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.cc-part-item > .cc-act,
.cc-part-item > .cc-acts,
.cc-part-item > .btn {
  flex: none;
}

.cc-amount {
  width: 7.5rem;
}

.cc-act-wide {
  display: block;
}

.cc-act-wide > .btn {
  margin-top: 1.25rem;
}

.cc-part-note {
  margin: 0;
}

.cc-part-ask {
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* A button that leads to something that cannot be taken back lightly: red words, and it asks first. */
.cc-danger-btn {
  --tblr-btn-color: var(--cc-danger);
  --tblr-btn-hover-color: var(--cc-danger);
  --tblr-btn-border-color: color-mix(in srgb, var(--cc-danger) 45%, transparent);
  --tblr-btn-hover-border-color: var(--cc-danger);
}

/* ------------------------------------------- 4f. the user himself: menu, switches, PCs, a question, Undo */
/* The menu of a line: three quiet dots at its end, as approved. Each thing of the menu has its icon; the one
   that archives is red and stands apart. */
th.cc-row-menu {
  padding: 0;
}

.cc-row-menu .dropdown-item {
  gap: 0.75rem;
}

.cc-row-menu .dropdown-item .icon {
  flex: none;
}

.cc-row-menu .cc-danger-item,
.cc-row-menu .cc-danger-item:focus,
.cc-row-menu .cc-danger-item:active,
.cc-row-menu .cc-danger-item .icon {
  color: var(--cc-danger);
}

/* A switch of his Settings: the kit's switch, gold when it is on, with the word On or Off beside it - the word
   follows the box itself, so it is right the moment the switch is flipped, with and without the script. */
.cc-switch {
  flex: none;
}

.cc-switch .form-switch {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 0.5rem;
  align-items: center;
  min-height: 1.75rem;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

/* 40 x 24 px with a knob of 18 px (the knob: the kit's variables; the track: no variable). Off: a dark track
   with a clear edge and a grey knob; on: gold with a dark knob. */
.cc-switch .form-check-input {
  --tblr-form-switch-knob-size: 1.125rem;
  --tblr-form-switch-knob-offset: 0.125rem;

  flex: none;
  float: none;
  width: 2.5rem;
  height: 1.5rem;
  margin: 0;
  cursor: pointer;
}

.cc-switch .form-check-input:not(:checked) {
  --tblr-form-switch-color: #aab0c0;

  background-color: #2a3043;
  border-color: #6b748e;
}

.cc-switch .form-check-input:checked {
  --tblr-form-switch-color: var(--cc-ink);

  border-color: var(--cc-gold-deep);
}

.cc-switch .form-check-label {
  min-width: 1.5rem;
  font-size: 0.8125rem;
  color: var(--cc-muted);
  text-align: end;
}

.cc-switch .form-check-input:checked ~ .cc-switch-off,
.cc-switch .form-check-input:not(:checked) ~ .cc-switch-on {
  display: none;
}

/* (a switch that was just put on the page takes no press for a moment, like a button: section 4e) */
html.js .cc-ask-form .btn-primary,
html.js .cc-switch .form-check-input,
html.js .cc-ask-form .btn-danger {
  animation: cc-arm 0.5s step-end;
}

/* What can be done about a licence's PCs: two small buttons at the end of the licence's line. */
.cc-licence-acts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-inline-start: auto;
}

/* What the licence's PCs say about open trades (app/opentrades.py): a line of its own under the licence's line. */
.cc-licence-trades {
  flex-basis: 100%;
}

/* A question that asks first: what is asked beside its icon, what it does under it, then Cancel and the one
   button that does it. */
.cc-ask {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}

.cc-ask-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--cc-danger);
  background: color-mix(in srgb, var(--cc-danger) 12%, transparent);
  border-radius: 50%;
}

.cc-ask-icon > .icon {
  --tblr-icon-size: 1.25rem;
}

.cc-ask-words {
  flex: 1 1 auto;
  min-width: 0;
}

.cc-ask-words .cc-part-title {
  margin-bottom: 0.25rem;
}

.cc-ask-words p,
.cc-ask-words ul {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--cc-muted);
}

.cc-ask-words ul {
  padding-inline-start: 1rem;
  margin-top: 0.75rem;
}

.cc-ask-words li + li {
  margin-top: 0.5rem;
}

.cc-ask-words li::marker {
  font-size: 0.75em;
  color: var(--cc-dim);
}

/* The window of a question is the small one that was approved, 440 px. */
#cc-ask-window {
  --tblr-modal-width: 27.5rem;
}

.cc-ask-form {
  display: block;
}

.cc-ask-tick {
  padding: 0.75rem;
  margin-top: 1rem;
  border: 1px solid var(--cc-line-2);
  border-radius: 8px;
}

.cc-ask-tick .form-check {
  margin: 0;
}

.cc-ask-tick .form-hint {
  margin-top: 0.25rem;
}

/* "Undo" in the message that says a user was archived. */
.cc-toast-act {
  flex: none;
}

/* (gold words without a box, as approved) */
.cc-toast-act > .btn {
  --tblr-btn-padding-x: 0.5rem;
  --tblr-btn-font-size: inherit;
  --tblr-btn-color: var(--cc-gold);
  --tblr-btn-hover-color: var(--cc-gold-bright);
  --tblr-btn-hover-bg: rgb(226 183 85 / 10%);
  --tblr-btn-border-color: transparent;
  --tblr-btn-hover-border-color: transparent;
}

@media (max-width: 767.98px) {
  /* (a finger can hit a switch: the whole of it, with its word, is 44 px high) */
  .cc-switch .form-switch {
    min-height: 2.75rem;
  }

  .cc-licence-acts {
    flex: 1 0 100%;
    margin-inline-start: 0;
  }

  /* (the kit makes a button of a card a block: its words would not be centred; and a finger's button is as
     wide as its words need) */
  .cc-licence-acts > .btn {
    display: inline-flex;
    padding-inline: 0.875rem;
    font-size: 0.8125rem;
  }

  .cc-toast-act > .btn {
    min-width: 4.5rem;
  }
}

/* --------------------------------------------------------------------------- 5. script, phone, keyboard */
/* Only useful with the script: hidden without it. */
html:not(.js) .cc-js-only,
html:not(.js) .cc-search-open {
  display: none !important;
}

/* Wide screen: the search field is always in the bar (the phone's search button opens it below 992 px). */
@media (min-width: 992px) {
  .cc-topbar .cc-search.collapse:not(.show) {
    display: block;
  }
}

/* Without the script nothing can be opened by a button: the search field is simply there, and on a narrow
   screen the menu is drawn above the page instead of in a drawer. */
html:not(.js) .cc-topbar .cc-search.collapse:not(.show) {
  display: block;
}

html:not(.js) [data-bs-toggle="offcanvas"],
html:not(.js) [data-bs-dismiss="offcanvas"] {
  display: none !important;
}

@media (max-width: 991.98px) {
  html:not(.js) .cc-sidebar {
    position: static;
    width: auto;
    visibility: visible;
    border-bottom: 1px solid var(--cc-line);
    transform: none;
  }
}

@media (max-width: 991.98px) {
  .cc-topbar {
    gap: 0.25rem 0.5rem;
    padding: 0.5rem 1rem;
  }

  .page-body > .container-xl {
    padding-inline: 1rem;
  }

  .cc-search {
    flex: 1 0 100%;
    order: 10;
  }

  .cc-kbd,
  .cc-me-text,
  .cc-me-btn > .icon {
    display: none;
  }

  .cc-search .form-control {
    height: 2.75rem;
    padding-inline-end: 1rem;
  }

  #cc-menu .nav-link {
    min-height: 2.75rem;
  }

  .cc-rows > tbody > .cc-detail > td {
    padding: 1rem;
  }
}

/* Phone: every button a finger can hit (44 px), messages across the bottom, and a row of a list is a card -
   the person on top with the row's menu in the corner, then one line per fact: its name left, the fact right.
   The cards of the Users list and of a client's trading accounts are the compact ones that were approved
   (further down in this block). */
@media (max-width: 767.98px) {
  .cc-cards > tbody > tr:not(.cc-detail) {
    position: relative;
    padding: 0.5rem 0;
  }

  .cc-cards > tbody > tr:not(.cc-detail) > td {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 1rem !important;
    text-align: end;
  }

  .cc-cards > tbody > tr:not(.cc-detail) > td[data-label]::before {
    flex: none;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--cc-dim);
    text-transform: none;
    letter-spacing: 0;
  }

  .cc-rows > tbody > .cc-row > td:first-child {
    padding-inline-end: 3.75rem !important;
    text-align: start;
  }

  .cc-rows > tbody > .cc-row > td:first-child::before {
    content: none;
  }

  .cc-rows > tbody > .cc-row > .cc-row-menu {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: auto;
    padding: 0 !important;
  }

  .cc-row-toggle,
  .cc-who {
    min-height: 2.75rem;
  }

  /* A cell of a card that has no label before it - a person, a sentence (the Dashboard) - reads from the left. */
  .cc-cards > tbody > tr:not(.cc-detail) > .cc-told {
    text-align: start;
  }

  .btn:not(.btn-icon, .btn-close),
  .page-link,
  .dropdown-item {
    min-height: 2.75rem;
  }

  .btn-icon,
  .cc-me-btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  /* The buttons of an alert card: one under the other, each as wide as the card (ONE column, never wrapped:
     a column that may wrap is as wide as its longest part, and would stand out of the card). */
  .cc-alert-buttons {
    flex-flow: column nowrap;
    align-items: stretch;
  }

  /* The top of the page: the title 16 px, the main button as wide as the screen; the chips of a group stand on
     ONE row that slides sideways (a little room above and under it, for the outline of the keyboard). */
  .cc-title {
    flex-basis: 0;  /* a long title shrinks (and ends in "...") instead of pushing the person to a second row */
    font-size: 1rem;
  }

  .cc-head > .btn {
    flex: 1 0 100%;
  }

  .cc-chips {
    flex-flow: column nowrap;
  }

  .cc-chip-row {
    flex-wrap: nowrap;
    padding: 0.25rem 1rem;
    margin: -0.25rem -1rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .cc-chip {
    flex: none;
  }

  /* Every user is a card of his own, as approved: 12 px corners, 12 px between two cards and no box around
     them all (ours: the kit's phone table has no separate cards). The open card has a gold edge, and his record
     hangs on it. */
  .card:has(> .table-responsive > .cc-rows) {
    background: none;
    border: 0;
  }

  .card:has(> .table-responsive > .cc-rows) > .card-header,
  .card:has(> .table-responsive > .cc-rows) > .card-footer {
    padding-inline: 0;
    background: none;
    border: 0;
  }

  .cc-cards.cc-rows > tbody > .cc-row + .cc-detail + .cc-row {
    margin-top: 0.75rem;
  }

  .cc-cards.cc-rows > tbody > .cc-detail {
    overflow: hidden;
    border: 1px solid rgb(226 183 85 / 40%);
    border-top: 0;
    border-radius: 0 0 12px 12px;
  }

  /* (the kit writes the room of a phone table's cell with "!important") */
  .cc-cards.cc-rows > tbody > .cc-detail > td {
    padding: 1rem !important;
  }

  .cc-record .row-cards {
    --tblr-gutter-y: 0.75rem;
  }

  /* A user is a compact card, as approved: his name; his role, his status and his licence in one row; then the
     subscription and when he was last seen, each on a line with its name. */
  .cc-cards.cc-rows > tbody > .cc-row {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 0.5rem;
    align-items: center;
    padding: 1rem;
    background: var(--cc-panel);
    border: 1px solid var(--cc-line);
    border-radius: 12px;
  }

  .cc-cards.cc-rows > tbody > .cc-row > td {
    padding: 0 !important;
  }

  .cc-cards.cc-rows > tbody > .cc-row > td:first-child {
    grid-column: 1 / -1;
    padding-inline-end: 2.75rem !important;
  }

  .cc-cards.cc-rows > tbody > .cc-row > td:nth-child(2) {
    grid-area: 2 / 1;
  }

  .cc-cards.cc-rows > tbody > .cc-row > td:nth-child(3) {
    grid-area: 2 / 2;
  }

  /* (a role and a status say what they are; the licence keeps its name: its status is a second "Active") */
  .cc-cards.cc-rows > tbody > .cc-row > td:nth-child(2)::before,
  .cc-cards.cc-rows > tbody > .cc-row > td:nth-child(3)::before {
    content: none;
  }

  .cc-cards.cc-rows > tbody > .cc-row > td:nth-child(5) {
    flex-wrap: wrap;
    grid-area: 2 / 3;
    gap: 0.375rem;
    justify-content: flex-start;
  }

  .cc-cards.cc-rows > tbody > .cc-row > td:nth-child(4) {
    grid-area: 3 / 1 / auto / -1;
    padding-top: 0.5rem !important;
    margin-top: 0.25rem;
    border-top: 1px solid var(--cc-line);
  }

  .cc-cards.cc-rows > tbody > .cc-row > td:nth-child(6) {
    grid-area: 4 / 1 / auto / -1;
  }

  /* (a card under the pointer or the finger lights up as a whole: no lighter box inside it) */
  .cc-cards.cc-rows > tbody > .cc-row:hover {
    background: color-mix(in srgb, rgb(255 255 255) 2.5%, var(--cc-panel));
  }

  /* (the open card: its gold edge and its tint are the card's, not each fact's) */
  .cc-cards.cc-rows > tbody > .cc-row:has(.cc-row-toggle[aria-expanded="true"]) {
    background: color-mix(in srgb, var(--cc-gold) 4%, var(--cc-panel));
    border-color: rgb(226 183 85 / 40%);
    border-bottom-color: var(--cc-line);
    border-radius: 12px 12px 0 0;
  }

  .cc-cards.cc-rows > tbody > .cc-row:has(.cc-row-toggle[aria-expanded="true"]) > td {
    background: none;
    box-shadow: none;
  }

  /* A trading account is a compact card, as approved: platform, type and status in one row, the number, the
     name, then its buttons. A red line is a red card. */
  .cc-cards.cc-accounts > tbody > tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.25rem 0.5rem;
    align-items: center;
    padding: 0.75rem 1rem;
  }

  .cc-cards.cc-accounts > tbody > tr > td {
    justify-content: flex-start;
    padding: 0 !important;
    text-align: start;
  }

  .cc-cards.cc-accounts > tbody > tr > td[data-label]::before {
    content: none;
  }

  .cc-cards.cc-accounts > tbody > tr > td:nth-child(1) {
    grid-area: 1 / 1;
  }

  .cc-cards.cc-accounts > tbody > tr > td:nth-child(2) {
    grid-area: 1 / 2;
  }

  .cc-cards.cc-accounts > tbody > tr > td:nth-child(5) {
    grid-area: 1 / 3;
  }

  .cc-cards.cc-accounts > tbody > tr > td:nth-child(3) {
    grid-area: 2 / 1 / auto / -1;
    margin-top: 0.25rem;
  }

  .cc-cards.cc-accounts > tbody > tr > td:nth-child(4) {
    grid-area: 3 / 1 / auto / -1;
    font-size: 0.8125rem;
    color: var(--cc-muted) !important;
  }

  .cc-cards.cc-accounts > tbody > tr > .cc-line-acts {
    grid-area: 4 / 1 / auto / -1;
    margin-top: 0.5rem;
  }

  .cc-cards.cc-accounts > tbody > .cc-line-alert {
    background: color-mix(in srgb, var(--cc-danger) 8%, transparent);
    box-shadow: inset 3px 0 0 var(--cc-danger);
  }

  .cc-cards.cc-accounts > tbody > .cc-line-alert > td {
    background: transparent;
    box-shadow: none;
  }

  /* The buttons of an account's card stand under its facts, from the left, as approved - each in its own place,
     "More" at the end of the row, outlined like a button; a card that offers nothing has no empty line. */
  .cc-cards > tbody > tr:not(.cc-detail) > .cc-line-acts {
    width: auto;
    white-space: normal;
  }

  .cc-cards > tbody > tr:not(.cc-detail) > .cc-line-acts:not(:has(.btn, .cc-acts-none)) {
    display: none;
  }

  .cc-line-acts > .cc-acts {
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .cc-line-acts > .cc-acts-line {
    grid-template-columns: 5.5rem 4.25rem 1fr 2.75rem;
    justify-content: stretch;
  }

  .cc-acts-line > .cc-more {
    grid-column: 4;
  }

  .cc-line-acts > .cc-acts-unlisted {
    padding-inline-end: 0;
  }

  /* (a finger can hit it) */
  .cc-add {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
  }

  .cc-line-acts .cc-more {
    display: inline-flex; /* (the kit makes a button of a card a block: the three dots would not be centred) */
    margin-inline-start: auto;
  }

  /* A card that offers no action has "More" beside its number and name, not alone on a line of its own: at the
     right edge of the card, where it stands on every other card. The number and the name run under the whole
     card and only keep the place of the three dots free, so a name breaks no sooner than on a card with buttons
     (the status above them is wider than the three dots: its column must not narrow them). */
  .cc-cards.cc-accounts > tbody > tr:has(.cc-more):not(:has(.cc-act)) > td:nth-child(3),
  .cc-cards.cc-accounts > tbody > tr:has(.cc-more):not(:has(.cc-act)) > td:nth-child(4) {
    grid-column: 1 / -1;
    padding-inline-end: 3.25rem !important;
  }

  .cc-cards.cc-accounts > tbody > tr:has(.cc-more):not(:has(.cc-act)) > .cc-line-acts {
    grid-area: 2 / 3 / span 2 / auto;
    justify-self: end;
    margin-top: 0;
  }

  .cc-cards.cc-accounts > tbody > tr:has(.cc-more):not(:has(.cc-act)) .cc-acts-line {
    grid-template-columns: 2.75rem;
  }

  .cc-cards.cc-accounts > tbody > tr:has(.cc-more):not(:has(.cc-act)) .cc-more {
    grid-column: 1;
  }

  /* In a window: what an action is about above, its field and button under it. */
  .cc-part-item {
    flex-direction: column;
    align-items: stretch;
  }

  .cc-part-item > .cc-acts {
    justify-content: flex-start;
  }

  .cc-part-ask {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .cc-part-ask > .cc-act,
  .cc-part-ask > .cc-act > .btn,
  .cc-act-wide > .btn {
    width: 100%;
  }

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

  .cc-toasts {
    left: 0;
    padding: 1rem;
  }

  .cc-toasts .toast {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-row-arrow {
    transition: none;
  }
}

/* ------------------------------------------------------------------ PropAtlas (templates/cc/propatlas*.html) */
.pa-goals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.5rem;
}

.pa-goal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  text-align: left;
  white-space: normal;
}

.pa-goal-help {
  font-size: 0.8125rem;
  font-weight: 400;
}

.pa-filter + .pa-filter {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--tblr-border-color);
}

.pa-locked {
  border-left: 3px solid var(--cc-gold);
  padding-left: 0.5rem;
}

.pa-lock {
  margin-bottom: 0.5rem;
}

.pa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pa-table td,
.pa-table th {
  white-space: nowrap;
}

.pa-table thead th {
  min-width: 4rem;
  white-space: normal;
}

.pa-table .pa-name {
  min-width: 9rem;
  max-width: 16rem;
  white-space: normal;
}

.pa-cell {
  cursor: help;
}

.pa-unknown {
  color: var(--cc-dim);
  font-style: italic;
}

.pa-answer .pa-cell,
.pa-cell.pa-answer {
  text-decoration: underline dotted;
}

.pa-stale {
  color: var(--tblr-warning);
}

.pa-values th.pa-place {
  width: 30%;
  white-space: normal;
}

.pa-ref {
  font-size: 0.75rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.pa-values td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.pa-act {
  width: 1%;
  white-space: nowrap;
}

.pa-detail {
  font-size: 0.8125rem;
}

.pa-quote {
  margin: 0.25rem 0;
  padding-left: 0.5rem;
  border-left: 2px solid var(--tblr-border-color);
  font-size: 0.8125rem;
}

.pa-question {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.pa-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
}

.pa-numbers dd {
  margin: 0;
  font-size: 1.125rem;
}

.pa-diffs {
  margin: 0.25rem 0 0;
  padding-left: 1rem;
  white-space: normal;
}

.pa-banned > * {
  background-color: rgba(214, 57, 57, 0.08);
}

/* The results table scrolls inside its own box, both ways (propatlas-dash-2): the page never scrolls sideways;
   the head stays at the top and the firm and the package stay on the left (position: sticky). The box is as tall
   as the screen less the bars, so its sideways scroll bar is always in view (75vh where dvh is not known). */
.pa-scroll {
  --pa-pin-1: 9rem;
  overflow: auto;
  max-height: 75vh;
  max-height: calc(100dvh - 9rem);
  border-top: 1px solid var(--tblr-border-color);
}

.pa-scroll:focus-visible {
  outline: 2px solid var(--cc-gold);
  outline-offset: -2px;
}

.pa-scroll .pa-table {
  margin-bottom: 0;
}

.pa-scroll .pa-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  overflow-wrap: normal;
  word-break: normal;
}

/* (a heading is wide enough for its longest word; the pinned firm column keeps its own width, which the package
   column's place on the left depends on) */
.pa-scroll .pa-table thead th:not(.pa-pin-1) {
  min-width: 7.5rem;
}

.pa-table .pa-pin {
  position: sticky;
  z-index: 1;
  background: var(--tblr-bg-surface);
}

.pa-table .pa-pin-1 {
  left: 0;
  width: var(--pa-pin-1);
  min-width: var(--pa-pin-1);
  max-width: var(--pa-pin-1);
}

/* (the edge after the pinned columns is drawn in the cell's own paper: a border of a collapsed table would scroll
   away, and the look allows no shadow of its own - tests/test_cc_look.py) */
.pa-table .pa-pin-2 {
  left: var(--pa-pin-1);
  background: linear-gradient(to left, var(--tblr-border-color) 1px, var(--tblr-bg-surface) 1px);
}

.pa-scroll .pa-table thead th.pa-pin {
  z-index: 3;
  background: var(--cc-bg-2);
}

.pa-scroll .pa-table thead th.pa-pin-2 {
  background: linear-gradient(to left, var(--tblr-border-color) 1px, var(--cc-bg-2) 1px);
}

.pa-scroll-hint {
  margin: 0.75rem 1rem 0.5rem;
  font-size: 0.8125rem;
}

.pa-columns > summary {
  width: fit-content;
}

.pa-column-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem 1.5rem;
}

.pa-column-group legend {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: var(--tblr-font-weight-semibold);
}

/* A filter for every column: the groups open one by one, the columns of a group side by side as room allows. */
.pa-colgroup + .pa-colgroup {
  margin-top: 0.5rem;
}

.pa-colgroup > summary {
  padding: 0.375rem 0;
  font-weight: var(--tblr-font-weight-semibold);
  cursor: pointer;
}

.pa-colfilter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem 1.25rem;
  padding: 0.25rem 0 0.75rem;
}

.pa-colfilter {
  min-width: 0;
  padding-left: 0.5rem;
  border-left: 3px solid transparent;
}

.pa-colfilter legend {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: var(--tblr-font-weight-semibold);
}

.pa-colfilter-on {
  border-left-color: var(--cc-gold);
}

.pa-range {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.5rem;
  align-items: center;
}

.pa-range .form-label {
  margin: 0;
}

.pa-ticks {
  max-height: 12rem;
  overflow-y: auto;
}

/* The hedging rule of a row: the group, the first official quote, its link and date (it wraps, never too wide). */
.pa-table .pa-rule {
  min-width: 15rem;
  max-width: 22rem;
  white-space: normal;
}

.pa-rule-quote {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
}

/* Under a price: the promotion's words, its page and the day it was read; under a cost: the price it used. */
.pa-read,
.pa-basis {
  display: block;
  font-size: 0.75rem;
  white-space: normal;
}

/* a link inside a line of text is underlined, not only coloured (WCAG 1.4.1; axe "link-in-text-block") */
.pa-read a,
.pa-detail a {
  text-decoration: underline;
}

.pa-table .pa-price {
  min-width: 9rem;
  max-width: 16rem;
  white-space: normal;
}

.pa-sort-level {
  margin-inline-start: 0.125rem;
  font-size: 0.6875rem;
  vertical-align: super;
}

/* The proof of the filters (propatlas-real-filters-1): the filters on as tags, each with its way out; the value a
   filter reads marked (gold on a gold tint, as a search's words are marked); its heading says "filtered"; why each
   row matched, in a column of its own right after the name (it wraps, never too wide). */
.pa-chips .tags-list {
  padding: 0;
  list-style: none;
}

.pa-chip-remove {
  margin-inline-start: 0.25rem;
  padding: 0 0.25rem;
  color: var(--cc-text);
  text-decoration: none;
}

.pa-clear-all {
  text-decoration: underline;
}

.pa-table mark.pa-proof {
  padding: 0 2px;
  color: var(--cc-gold-bright);
  background: rgb(226 183 85 / 22%);
  border-radius: 3px;
}

.pa-table mark.pa-proof a {
  color: inherit;
}

/* (a status keeps its own colour - its word and its dot say the group: the mark is a gold outline around it) */
.pa-table mark.pa-proof-status {
  display: inline-block;
  color: inherit;
  background: transparent;
  outline: 1px solid var(--cc-gold);
  outline-offset: 1px;
}

.pa-proof-tag {
  display: block;
  margin-top: 0.125rem;
  color: var(--cc-gold);
  font-size: 0.6875rem;
  font-weight: var(--tblr-font-weight-normal);
}

.pa-table .pa-why {
  min-width: 16rem;
  max-width: 24rem;
  white-space: normal;
}

.pa-why-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
}

.pa-why-list li + li {
  margin-top: 0.125rem;
}

/* (on a phone the line of why stands under its row instead, held at the left of the box: see the @media below) */
.pa-table .pa-why-row {
  display: none;
}

.pa-why-held {
  position: sticky;
  left: 0;
  max-width: calc(100vw - 3rem);
  white-space: normal;
}

.pa-why-title {
  display: block;
  color: var(--cc-dim);
  font-size: 0.6875rem;
  font-weight: var(--tblr-font-weight-semibold);
  text-transform: uppercase;
}

/* The owner's partner (affiliate) link beside a package (propatlas-dash-3 T3): a green pill with its word - shown
   only, never weighed (app/propatlas/partners.py). The link is underlined on hover like every link of the page. */
.pa-partner {
  margin-inline-start: 0.375rem;
  color: var(--cc-ok);
  background: rgb(127 201 138 / 12%);
  border-color: rgb(127 201 138 / 35%);
}

.pa-partner:hover,
.pa-partner:focus-visible {
  color: var(--cc-ok);
  text-decoration: underline;
}

.pa-partner-list td,
.pa-wrap {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
  .pa-scroll {
    --pa-pin-1: 6.5rem;
    max-height: 70vh;
  }

  .pa-table .pa-why {
    display: none;
  }

  .pa-table .pa-why-row {
    display: table-row;
  }

  .pa-table tr:has(+ .pa-why-row) > * {
    border-bottom-width: 0;
  }

  .pa-scroll .pa-table .pa-pin {
    padding-inline: 0.5rem;
    overflow-wrap: anywhere;
  }

  .pa-table .pa-pin-2 {
    min-width: 6.5rem;
    max-width: 8rem;
  }

  .pa-values th.pa-place {
    width: auto;
  }

  .pa-act {
    white-space: normal;
  }
}

/* ---- client portal ---- */
/* The client portal (templates/portal/): the same kit and colours, in Tabler's horizontal layout - a navbar on top
   (the logo, the menu, the client's email and Sign out) instead of the side menu. Everything else is the kit's own
   classes; only what they cannot say is here. */

/* The navbar in the colours of the side menu (section 3): the menu's words grey, the page one is on gold. */
.navbar.cc-portal-bar {
  --tblr-navbar-bg: var(--cc-bg-2);
  --tblr-navbar-border-color: var(--cc-line);
  --tblr-navbar-color: var(--cc-muted);
  --tblr-navbar-hover-color: var(--cc-text);
  --tblr-navbar-active-color: var(--cc-gold-bright);
  --tblr-navbar-active-bg: var(--cc-panel-2);
  --tblr-navbar-active-border-color: var(--cc-gold);
}

/* The bar and the page's title start where the page starts (section 3: from the left, at most 1400 px wide, the
   same side room as the page - 16 px below 992 px). */
.cc-portal-bar > .container-xl,
.cc-portal-head > .container-xl {
  max-width: 87.5rem;
  padding-inline: 2rem;
  margin-inline: 0;
}

/* The client's email and Sign out: at the end of the bar; on a phone, under the menu when it is open. */
.cc-portal-me {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
}

.cc-portal-email {
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--cc-dim);
  overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
  .cc-portal-bar > .container-xl,
  .cc-portal-head > .container-xl {
    padding-inline: 1rem;
  }
}

/* The facts of one payment: the name of a fact in a column of its own width, its value beside it (on a phone the
   name stands above the value: section 4b, `.cc-wraps`). */
@media (min-width: 576px) {
  .cc-portal-facts th {
    width: 18rem;
  }
}

@media (max-width: 767.98px) {
  /* The open menu: the email and Sign out under the links, as far in as the links' words. */
  .cc-portal-me {
    padding: 0.75rem;
    border-top: 1px solid var(--cc-line);
  }

  /* A form under a line of a table (Replace an account) reads from the left, the full width, and is not drawn
     as a line of a card (section 5: the name left, the fact right). */
  .cc-cards > tbody > tr.cc-portal-form > td {
    display: block;
    text-align: start;
  }
}

/* ---------------------------------------------------------------- the client file (crm-manual-2) */
/* the owner's notes about a client keep the lines he typed */
.cc-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
/* the proof files under a payment */
.cc-proofs { padding-left: 1.25rem; overflow-wrap: anywhere; }
