/* --- A client's file (modules/clients/views/client.php), built like the Calendar: a white box with the client's name
   on the anthracite band, the grey bar (Back and the tabs on the left, Book on the right) and the grey footer, all from
   pages/calendar.css. Inside: the journey or the list of reports, and the tab's page. The box is the screen's height
   (never shorter than --client-min-h; a shorter screen scrolls the page) and its parts scroll inside it. From 992px the
   journey or the list is a sidebar on the left; below that it is a row above the page that scrolls sideways. --- */

.admin__page:has(> .client) {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--admin-top-h));
  height: calc(100dvh - var(--admin-top-h)); /* 100vh first for browsers without dvh */
  min-height: var(--client-min-h);
}

.client {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-2);
}

/* The band: the name cut short with "…" when long; email and phone on the right from 576px. */
.client__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client__contact {
  display: none;
  gap: var(--sp-4);
}

/* The bar: Back and the tabs on the left (one drop-down below 768px), Book on the right. */
.client__tools {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.client__square {
  width: var(--button-h-sm);
  padding-inline: 0;
}

.client__book {
  gap: var(--sp-2);
}

.client__book:disabled {
  cursor: default;
}

.client__tabs {
  display: none;
}

.client__tab {
  margin-left: calc(-1 * var(--border-1)); /* neighbours share one line */
  border-radius: 0;
}

.client__tab:first-child {
  margin-left: 0;
  border-radius: var(--radius-1) 0 0 var(--radius-1);
}

.client__tab:last-child {
  border-radius: 0 var(--radius-1) var(--radius-1) 0;
}

.client__tab--off {
  color: var(--c-text-muted);
  cursor: default;
}

.client__tab-drop {
  position: relative;
}

.client__tab-drop > summary {
  gap: var(--sp-2);
}

.client__tab-drop > summary i {
  font-size: var(--fs-xxs);
}

/* The tabs' drop-down menu: a white panel under its button. */
.client__menu {
  position: absolute;
  top: calc(100% + var(--sp-1));
  left: 0;
  z-index: 2;
  display: grid;
  min-width: 100%;
  padding: var(--sp-2);
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-1);
  box-shadow: var(--shadow-1);
}

.client__menu-item {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-small);
  color: var(--c-text);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-1);
}

.client__menu-item[aria-current="page"] {
  font-weight: 600;
  color: var(--c-accent-text);
  background-color: var(--c-chip);
}

.client__menu-item--off {
  color: var(--c-text-muted);
}

/* The tab's page: below 992px one column, the journey or the list on top and the page under it, scrolling. */
.client__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.client__main,
.client__doc {
  flex: 1;
  min-height: 0;
  padding: var(--sp-4);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.client__h {
  margin-bottom: var(--sp-3);
  font-family: var(--font-heading);
  font-size: var(--fs-lead);
  font-weight: 400;
  line-height: var(--lh-heading);
  color: var(--c-heading);
}

.client__cols {
  display: grid;
  align-items: start;
  gap: var(--sp-4);
}

/* A section's heading: small capitals in a light grey box with a line all round; its rows under it. */
.client__band {
  margin-bottom: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  font-family: inherit;
  font-size: var(--fs-xxs);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-anthracite);
  background-color: var(--c-surface);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-1);
}

.client__row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--sp-3);
  padding: var(--sp-3);
  font-size: var(--fs-small);
  border-bottom: var(--border-1) solid var(--c-line);
}

.client__row dt {
  color: var(--c-text-muted);
}

.client__row dd {
  overflow-wrap: anywhere; /* a long email address wraps instead of running out of the box */
}

/* The journey or the list: off-white; below 992px a row above the page with a line under it. */
.client__side {
  flex: none;
  padding: var(--sp-4);
  background-color: var(--c-off-white);
  border-bottom: var(--border-1) solid var(--c-line);
}

/* The journey: its heading with the client's tag beside it, then a thin line with a dot for each step (the booking still
   to come has a blue ring). Below 992px the steps run left to right, newest first, and the row scrolls sideways. */
.client__journey {
  order: -1; /* after Details in the page, but shown first */
}

.client__journey-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.client__journey-head .client__h {
  margin-bottom: 0;
}

.client__steps {
  position: relative;
  isolation: isolate; /* the lines sit behind the dots */
  display: grid;
  grid-auto-columns: var(--client-step-w);
  grid-auto-flow: column;
  gap: var(--sp-4);
  padding-top: var(--sp-5);
  padding-bottom: var(--sp-2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
}

.client__step {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: var(--sp-1);
  font-size: var(--fs-small);
  scroll-snap-align: start;
}

.client__step::before {
  content: "";
  position: absolute;
  top: calc(-1 * var(--sp-5));
  left: 0;
  width: var(--sp-2);
  height: var(--sp-2);
  background-color: var(--c-line);
  border-radius: var(--radius-pill);
}

.client__step::after { /* the line to the next step, so it ends at the last one */
  content: "";
  position: absolute;
  top: calc(-1 * var(--sp-5) + var(--sp-1));
  left: 0;
  right: calc(-1 * var(--sp-4));
  z-index: -1;
  height: var(--border-1);
  background-color: var(--c-line);
}

.client__step:last-child::after {
  display: none;
}

.client__step--coming::before {
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-menu-button);
}

.client__when {
  font-size: var(--fs-xxs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.client__step--coming .client__when {
  color: var(--c-accent-text);
}

.client__step strong {
  font-weight: 600;
}

.client__note,
.client__none {
  font-size: var(--fs-small);
  color: var(--c-text-muted);
}

/* Reports: from 992px the list in groups (Questionnaires, Blood tests, Lab tests) under their names. Below that, tabs
   across the full width pick the group (radio buttons, so no JavaScript), and its reports sit in one row that scrolls
   sideways. The open report has a pale blue fill. */
.client__group,
.client__set {
  display: none;
}

.client__group-box--questionnaires:checked ~ .client__set--questionnaires,
.client__group-box--blood:checked ~ .client__set--blood,
.client__group-box--lab:checked ~ .client__set--lab {
  display: block;
}

.client__picker {
  display: grid;
  grid-template-columns: repeat(3, auto); /* the full width, its spare room shared equally, so long names still fit */
  margin-bottom: var(--sp-3);
  border-bottom: var(--border-1) solid var(--c-line);
}

.client__pick {
  margin-bottom: calc(-1 * var(--border-1)); /* the chosen tab's line sits on the line under them */
  padding-block: var(--sp-2);
  font-size: var(--fs-small);
  text-align: center;
  white-space: nowrap;
  color: var(--c-text-muted);
  border-bottom: calc(2 * var(--border-1)) solid transparent;
  cursor: pointer;
}

.client__group-box--questionnaires:checked ~ .client__picker .client__pick--questionnaires,
.client__group-box--blood:checked ~ .client__picker .client__pick--blood,
.client__group-box--lab:checked ~ .client__picker .client__pick--lab {
  font-weight: 600;
  color: var(--c-text);
  border-bottom-color: var(--c-anthracite);
}

.client__group-box--questionnaires:focus-visible ~ .client__picker .client__pick--questionnaires,
.client__group-box--blood:focus-visible ~ .client__picker .client__pick--blood,
.client__group-box--lab:focus-visible ~ .client__picker .client__pick--lab {
  outline: var(--border-1) solid var(--c-action);
  outline-offset: calc(-1 * var(--border-1));
}

.client__reports {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.client__reports li {
  flex: none;
}

.client__group {
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
  font-family: inherit;
  font-size: var(--fs-xxs);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-anthracite);
}

.client__group:first-of-type {
  padding-top: var(--sp-2);
}

.client__group + .client__set .client__none {
  padding-inline: var(--sp-3);
}

.client__reports form {
  display: block;
}

.client__report {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  font: inherit;
  font-size: var(--fs-small);
  text-align: start;
  white-space: nowrap;
  color: var(--c-text);
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-1);
  cursor: pointer;
}

.client__report > span {
  display: grid;
}

.client__report strong {
  font-weight: 600;
}

.client__report span span {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.client__report i {
  font-size: var(--fs-body);
  color: var(--c-text-muted);
}

.client__report[aria-current] {
  background-color: var(--c-chip);
  border-color: var(--c-chip);
}

.client__report[aria-current] strong {
  color: var(--c-accent-text);
}

.client__report[aria-current] i {
  color: var(--c-menu-button);
}

/* Consultations: the list as on Reports, upcoming dates in blue and cancelled ones crossed out. Below 992px both groups
   share one row that scrolls sideways. */
.client__report--coming strong {
  color: var(--c-accent-text);
}

.client__report--off strong {
  color: var(--c-text-muted);
  text-decoration: line-through;
}

.client__sets {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.client__sets .client__reports {
  overflow-x: visible;
}

/* The open consultation: its type and tag, then three full-width rows: Booking, the summary and the private notes. */
.client__title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.client__title .client__h {
  margin-bottom: 0;
}

.dashboard__tag.client__tag--planned { /* beats .dashboard__tag, which loads after this file */
  color: var(--c-accent-text);
  background-color: var(--c-chip);
}

.dashboard__tag.client__tag--completed {
  color: var(--c-success-text);
  background-color: var(--c-success-bg);
}

.dashboard__tag.client__tag--cancelled {
  color: var(--c-error);
  background-color: var(--c-error-bg);
}

.client__block {
  margin-top: var(--sp-5);
}

/* Summary and private notes: folded shut until their heading is clicked; the chevron turns when open. */
.client__fold-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: 0;
  list-style: none;
  cursor: pointer;
}

.client__fold-head::-webkit-details-marker { /* Safari: hide its own triangle */
  display: none;
}

.client__fold[open] > .client__fold-head {
  margin-bottom: var(--sp-1);
}

.client__fold-title {
  font: inherit;
}

/* Private notes: View on the right while folded, Hide while open (a link's look; the whole band opens it). */
.client__fold-view,
.client__fold-hide {
  margin-left: auto;
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1; /* no taller than the heading, so both bands match */
  letter-spacing: normal;
  text-transform: none;
  color: var(--c-action);
  text-decoration: underline;
}

.client__fold-hide,
.client__fold[open] .client__fold-view {
  display: none;
}

.client__fold[open] .client__fold-hide {
  display: inline;
}

.client__fold-icon {
  margin-left: auto;
  transition: transform var(--duration-base);
}

.client__fold-hide + .client__fold-icon {
  margin-left: 0;
  color: var(--c-action);
}

.client__fold[open] .client__fold-icon {
  transform: rotate(180deg);
}

.client__doc-head--consultation { /* phones: the time under the type; from 576px beside it, on the right */
  flex-direction: column;
  gap: var(--sp-2);
  padding-bottom: var(--sp-4);
  border-bottom: var(--border-1) solid var(--c-line);
}

.client__headline {
  display: grid;
  gap: var(--sp-1);
  min-width: 0;
}

.client__kind {
  font-size: var(--fs-small);
}

.client__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.client__doc-head .client__meta span { /* not the header's muted date style */
  font-size: inherit;
}

.client__meta i {
  margin-right: var(--sp-1);
}

.client__slot {
  display: grid;
  gap: var(--sp-1);
  flex: none;
  font-size: var(--fs-small);
}

/* An order in review: its chip and the ⋯ menu (Edit order, Delete order) side by side on the right. */
.client__slot--chip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.client__more {
  position: relative;
}

.client__menu--end { /* opens leftwards from a button at the right edge */
  left: auto;
  right: 0;
}

button.client__menu-item {
  font-family: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.client__menu form {
  display: grid;
}

.client__menu-item--danger {
  color: var(--c-error);
}

.client__time {
  color: var(--c-text-muted);
}

.client__actions {
  display: flex;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
}

.client__action { /* Change time and Cancel: shown, but off until the cancellation policy is decided */
  padding: 0;
  font: inherit;
  color: var(--c-action);
  text-decoration: underline;
  background: none;
  border: 0;
}

.client__action--danger {
  color: var(--c-error);
}

.client__action:disabled {
  cursor: default;
}

.client__pad {
  padding: var(--sp-3);
}

/* The summary and a new note: the editor (TinyMCE) in place of the text box, its status and buttons under it. */
.client__editor {
  margin-top: var(--sp-2);
}

.client__editor .field:has(.tox-tinymce) .field__label {
  display: none; /* the band above names it; the editor's frame carries the name for screen readers */
}

.client__editor .tox-tinymce {
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-1);
}

.client__editor .field:has([aria-invalid="true"]) .tox-tinymce {
  border-color: var(--c-error);
}

.client__editor-foot {
  display: flex;
  margin-top: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.client__editor-buttons {
  display: flex;
  gap: var(--sp-2);
  margin-left: auto;
}

.client__sent {
  color: var(--c-success-text);
}

/* Orders: New order full width at the top of the list (dark, like the client's name band). */
.client__new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: var(--button-h-sm);
  margin-bottom: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-page);
  background-color: var(--c-anthracite);
  border: var(--border-1) solid var(--c-anthracite);
  border-radius: var(--radius-1);
  cursor: pointer;
}

.client__new i {
  font-size: var(--fs-body);
}

.dashboard__tag.client__tag--review {
  color: var(--c-warning-text);
  background-color: var(--c-warning-bg);
}

/* A draft's header keeps Delete draft on the right, in the middle of the row, also on phones (two classes: it beats
   .client__doc-head--consultation, later in this file). */
.client__doc-head.client__doc-head--row {
  flex-direction: row;
  align-items: center;
}

.client__doc-head--row .client__slot {
  margin-left: auto;
}

/* Adding a product: the product, then Quantity and the grey + (as tall as the fields), on one row where there is room. */
.client__add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--field-h);
  align-items: start; /* an error under a field never stretches the + */
  gap: var(--sp-2);
  padding-top: var(--sp-3);
}

.client__add-product {
  grid-column: 1 / -1;
}

.client__plus {
  display: grid;
  place-items: center;
  height: var(--field-h);
  padding: 0;
  font-size: var(--fs-lead);
  color: var(--c-text);
  background-color: var(--c-surface);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-1);
  cursor: pointer;
}

/* An order's products: name, size and group (or the shop's line) and the dose; Prescription or Shop in their own column,
   so the tags line up; how many on the right (− and + while it can be changed). Phones: one under the other. */
.client__lines {
  display: grid;
  border-bottom: var(--border-1) solid var(--c-line);
}

.client__line {
  display: grid;
  gap: var(--sp-2) var(--sp-3);
  align-items: center;
  padding: var(--sp-3);
  font-size: var(--fs-small);
  border-top: var(--border-1) solid var(--c-line);
}

.client__line:first-child {
  border-top: 0;
}

.client__line-name {
  display: grid;
  gap: var(--sp-1);
}

.client__line-name strong {
  font-weight: 600;
}

.client__line-sub {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.client__line-tag {
  justify-self: start;
}

.client__dose {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs);
}

.client__dose i {
  margin-right: var(--sp-1);
  color: var(--c-text-muted);
}

/* Change dose: a drop-down like the calendar's (a <details data-drop>, so it opens without JavaScript and closes on a
   click outside or Escape; Cancel reloads the page, which closes it too). A white panel under the dose line with the
   anthracite bar on top (the product, then Dose), the product's default dose, and the form two by two.
   Phones, and beside the list at 992–1199px: as wide as the line; elsewhere a fixed width. */
.client__line-name {
  position: relative; /* the panel opens from here */
}

.client__dose-open > summary {
  list-style: none;
  cursor: pointer;
}

.client__dose-open > summary::-webkit-details-marker { /* Safari: hide its own triangle */
  display: none;
}

.client__dose-panel {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: 0;
  right: 0;
  z-index: 2;
  display: none;
  gap: var(--sp-4);
  padding: var(--sp-4);
  font-size: var(--fs-body);
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
}

[open] > .client__dose-panel {
  display: grid;
}

.client__dose-default {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  background-color: var(--c-surface);
  border-radius: var(--radius-1);
}

.client__dose-default i {
  margin-right: var(--sp-1);
}

.client__dose-default .client__action {
  margin-left: auto;
  cursor: pointer;
}

.client__dose-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--sp-2);
}

.client__dose-wide,
.client__dose-buttons {
  grid-column: 1 / -1;
}

.client__dose-buttons {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
}

.client__kind-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding-inline: var(--sp-2);
  font-size: var(--fs-xxs);
  font-weight: 600;
  line-height: var(--sp-5);
  color: var(--c-text-muted);
  background-color: var(--c-surface);
  border-radius: var(--radius-pill);
}

.client__kind-tag--rx {
  color: var(--c-warning-text);
  background-color: var(--c-warning-bg);
}

.client__line-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.client__qty {
  display: flex;
  align-items: center;
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-1);
}

.client__qty button,
.client__remove {
  display: grid;
  place-items: center;
  width: var(--sp-8);
  height: var(--sp-8);
  padding: 0;
  color: var(--c-text-muted);
  background: none;
  border: 0;
  border-radius: var(--radius-1);
  cursor: pointer;
}

.client__qty button:disabled {
  opacity: 0.5;
  cursor: default;
}

.client__qty output {
  min-width: var(--sp-6);
  font-weight: 600;
  text-align: center;
}

.client__line-count {
  font-weight: 600;
  justify-self: end;
}

.client__hint {
  padding: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

/* Show older notes: centred above the notes shown. */
.client__older {
  display: flex;
  justify-content: center;
  padding-top: var(--sp-3);
  font-size: var(--fs-xs);
}

/* Private notes: a conversation, oldest first; each note with who wrote it, their role and when. */
.client__notes {
  display: grid;
  gap: var(--sp-3);
  padding-top: var(--sp-3);
}

.client__note {
  display: flex;
  align-items: start;
  gap: var(--sp-3);
}

.client__note .clients__avatar {
  display: none;
  flex: none;
}

.client__note-box {
  flex: 1;
  min-width: 0;
  padding: var(--sp-2) var(--sp-3);
  background-color: var(--c-off-white);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-1);
}

.client__note-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--sp-2);
  margin-bottom: var(--sp-1);
  font-size: var(--fs-xs);
}

.client__note-top strong {
  font-size: var(--fs-small);
  font-weight: 600;
}

.client__note-role {
  color: var(--c-accent-text);
}

.client__note-when {
  margin-left: auto;
  color: var(--c-text-muted);
}

.client__note-text {
  display: grid;
  gap: var(--sp-2);
  font-size: var(--fs-small);
  overflow-wrap: anywhere;
}

.client__note-text :is(ul, ol) {
  padding-left: var(--sp-5);
}

.client__note-text ul {
  list-style: disc;
}

.client__note-text ol {
  list-style: decimal;
}

.client__note-text :is(h2, h3) {
  font-family: var(--font-heading);
  font-size: var(--fs-body);
  font-weight: 400;
  color: var(--c-heading);
}

.client__note-text a {
  color: var(--c-action);
}

/* The open report: its name and date, then its parts in one column (two from 768px), questions in grey over answers. */
.client__doc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-3);
}

.client__doc-head span {
  font-size: var(--fs-small);
  color: var(--c-text-muted);
}

.client__parts {
  column-gap: var(--sp-6);
}

.client__parts .client__section {
  break-inside: avoid;
  padding-top: var(--sp-3);
}

.client__qa {
  padding: var(--sp-3);
  font-size: var(--fs-small);
  border-bottom: var(--border-1) solid var(--c-line);
}

.client__q {
  margin-bottom: var(--sp-1);
  color: var(--c-text-muted);
}

.client__a {
  white-space: pre-line; /* the patient's own line breaks */
}

.client__a :is(ul, ol) {
  padding-left: var(--sp-5);
  white-space: normal;
}

.client__a ul {
  list-style: disc;
}

.client__a ol {
  list-style: decimal;
}

.client__a--none {
  font-style: italic;
  color: var(--c-text-muted);
}

.client .calendar__foot i {
  margin-right: var(--sp-1);
}

@media (hover: hover) {
  .client__report:not([aria-current]):hover,
  .client__menu-item:not(.client__menu-item--off):not([aria-current]):hover {
    background-color: var(--c-surface);
  }
}

@media (min-width: 576px) {
  .client__contact {
    display: flex;
  }

  .client__doc-head--consultation {
    flex-direction: row;
    align-items: flex-start;
  }

  .client__doc-head.client__doc-head--row {
    align-items: center;
  }

  .client__slot { /* on the right, also when a narrow column wraps it under the type */
    margin-left: auto;
    justify-items: end;
    text-align: right;
    white-space: nowrap;
  }

  .client__note .clients__avatar {
    display: grid;
  }
  .client__add {
    grid-template-columns: minmax(0, 1fr) var(--client-qty-w) var(--field-h);
  }

  .client__add-product {
    grid-column: auto;
  }

  .client__line {
    grid-template-columns: minmax(0, 1fr) var(--client-tag-w) auto;
  }

  .client__dose-panel {
    right: auto;
    width: var(--client-dose-panel-w);
  }
}

@media (min-width: 768px) {
  .client__tabs {
    display: flex;
  }

  .client__tab-drop {
    display: none;
  }

  .client__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client__parts {
    columns: 2;
  }
}

/* From 992px: the journey or the list as a sidebar on the left, the same width on both tabs, scrolling inside the box.
   Up to 1199px Details and the report keep to one column beside it. */
@media (min-width: 992px) {
  .admin__page:has(> .client) {
    height: 100vh;
    height: 100dvh; /* no top bar beside the sidebar */
  }

  .client__body {
    flex-direction: row;
  }

  .client__main,
  .client__doc {
    padding: var(--sp-6);
  }

  .client__side {
    width: var(--client-side-w);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: var(--border-1) solid var(--c-line);
    border-bottom: 0;
  }

  .client__journey {
    display: flex;
    flex-direction: column;
    padding: var(--sp-6) var(--sp-5);
  }

  .client__journey .client__steps {
    flex: 1;
    grid-auto-columns: auto;
    grid-auto-flow: row;
    align-content: start; /* a short journey keeps its spacing instead of spreading down the sidebar */
    min-height: 0;
    padding: 0 0 0 var(--sp-6);
    overflow-x: visible;
    overflow-y: auto;
    scroll-snap-type: none;
  }

  .client__step::before {
    top: var(--sp-1);
    left: calc(-1 * var(--sp-6) + var(--border-1));
  }

  .client__step::after { /* the line down to the next step */
    top: var(--sp-1);
    bottom: calc(-1 * var(--sp-4) - var(--sp-1));
    left: calc(-1 * var(--sp-6) + var(--sp-1));
    right: auto;
    width: var(--border-1);
    height: auto;
  }

  .client__picker {
    display: none;
  }

  .client__group,
  .client__list .client__set {
    display: block;
  }

  .client__reports {
    display: block;
    overflow-x: visible;
  }

  .client__sets {
    display: block;
    overflow-x: visible;
  }

  .client__report {
    width: 100%;
    white-space: normal;
    background-color: transparent;
    border-color: transparent;
  }

  .client__report[aria-current] {
    background-color: var(--c-chip);
    border-color: var(--c-chip);
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .client__add { /* the page beside the list is narrow here: the product on its own line, as on phones */
    grid-template-columns: minmax(0, 1fr) var(--field-h);
  }

  .client__add-product {
    grid-column: 1 / -1;
  }

  .client__line { /* and an order's lines one under the other */
    grid-template-columns: minmax(0, 1fr);
  }

  .client__dose-panel {
    right: 0;
    width: auto;
  }

  .client__cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .client__parts {
    columns: 1;
  }
}
