/* The admin dashboard: today's work for a program manager. Colour only where
   action is needed; everything settled is grey or plain text. */
.dashboard {
  --dashboard-border: #e6e0d6;
  --dashboard-hairline: #efeae1;
  --dashboard-ink: #15302e;
  --dashboard-text: #3d4a49;
  --dashboard-muted: #8a938f;
  --dashboard-link: #2f7d4f;
  --dashboard-link-quiet: #5b8a6c;
  --dashboard-red: #b91c1c;
  --dashboard-red-dot: #dc2626;
  --dashboard-red-wash: #fee2e2;
  --dashboard-amber: #b45309;
  --dashboard-amber-dot: #f59e0b;
  --dashboard-amber-wash: #fef3c7;
  --dashboard-grey-dot: #b8b2a7;
  --dashboard-grey-wash: #f1f3f2;
  --dashboard-raised: #f6f3ee;

  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: var(--dashboard-ink);
}

/* The quiet centred line under the last card: "Customize dashboard" here,
   "View PHI access logs" on the client and DSP pages. */
.page-footer {
  padding: 0.5rem 0 0.25rem;
  text-align: center;
  font-size: 0.9375rem;
}
.page-footer__link {
  color: #8a938f;
  cursor: pointer;

  &:hover { text-decoration: underline; }
}

/* Sections on your dashboard: the checklist, over the dimmed page. */
.dashboard-sections {
  width: min(100% - 2rem, 30rem);
  margin: auto;
  padding: 2rem;
  border: 0;
  border-radius: 1rem;
  background: #fff;
  color: var(--dashboard-ink);
  box-shadow: 0 1.5rem 3rem rgb(20 40 38 / 0.2);

  &::backdrop { background: rgb(20 40 38 / 0.4); }
}
.dashboard-sections__title {
  font-size: 1.25rem;
  font-weight: 600;
}
.dashboard-sections__hint {
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  color: var(--dashboard-muted);
}
/* With a mouse the rows are dragged by their handles; on a touch screen
   each row has up and down arrows instead. */
.dashboard-sections__hint--arrows { display: none; }
@media (pointer: coarse) {
  .dashboard-sections__hint--drag { display: none; }
  .dashboard-sections__hint--arrows { display: inline; }
}
.dashboard-sections__list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 1.5rem 0 1.75rem;
}
/* One section to tick and move. Needs your attention is pinned first. */
.dashboard-sections__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--dashboard-hairline);
  border-radius: 0.625rem;
  background: #fff;
  cursor: grab;

  &.is-dragging {
    border-color: var(--dashboard-link);
    box-shadow: 0 0.5rem 1.25rem rgb(20 40 38 / 0.18);
    opacity: 0.95;
  }
  /* The green line where the dragged row will land. */
  &[data-drop]::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 2px;
    background: var(--dashboard-link);
  }
  &[data-drop=before]::before { top: -0.3125rem; }
  &[data-drop=after]::before { bottom: -0.3125rem; }
}
.dashboard-sections__row--pinned {
  border-color: transparent;
  background: var(--dashboard-raised);
  cursor: default;
}
.dashboard-sections__grip,
.dashboard-sections__pin {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--dashboard-muted);
}
.dashboard-sections__pin { color: var(--dashboard-grey-dot); }
.dashboard-sections__move {
  display: none;
  place-items: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--dashboard-border);
  border-radius: 0.5rem;
  color: var(--dashboard-text);
  cursor: pointer;

  & svg { width: 1.125rem; height: 1.125rem; }
  &:focus-visible { outline: 2px solid var(--dashboard-link); outline-offset: 2px; }
}
/* Nowhere to go: the first row cannot go up, the last cannot go down. */
.dashboard-sections__row--pinned + .dashboard-sections__row .dashboard-sections__move--up,
.dashboard-sections__row:last-child .dashboard-sections__move--down {
  opacity: 0.35;
  pointer-events: none;
}
@media (pointer: coarse) {
  .dashboard-sections__row { cursor: default; }
  .dashboard-sections__grip { display: none; }
  .dashboard-sections__move { display: grid; }
}
.dashboard-sections__choice {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.0625rem;
  color: var(--dashboard-text);
  cursor: pointer;

  &:has(:disabled) { cursor: default; }
}
.dashboard-sections__box {
  appearance: none;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  border: 1.5px solid var(--dashboard-border);
  border-radius: 0.375rem;
  background: #fff;
  cursor: inherit;

  &:checked {
    border-color: var(--dashboard-link);
    background: var(--dashboard-link);
  }
  &:checked::after {
    content: "";
    width: 0.375rem;
    height: 0.6875rem;
    margin-top: -0.1875rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  &:disabled {
    border-color: var(--dashboard-hairline);
    background: var(--dashboard-hairline);
  }
  &:focus-visible { outline: 2px solid var(--dashboard-link); outline-offset: 2px; }
}
.dashboard-sections__always {
  margin-left: 0.25rem;
  font-size: 0.9375rem;
  color: var(--dashboard-muted);
}
.dashboard-sections__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.dashboard-sections__done { min-width: 5.25rem; }
.dashboard-sections__reset {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dashboard-link);
  cursor: pointer;

  &:hover { text-decoration: underline; }
}
.dashboard-sections__reset-icon {
  width: 1rem;
  height: 1rem;
}
.dashboard-sections__reset-hint {
  margin-top: 1rem;
  text-align: right;
  font-size: 0.8125rem;
  color: var(--dashboard-muted);
}


/* The count is one link, number and word both link green, the number semibold. */
.dashboard-count {
  color: var(--dashboard-link);
  font-weight: 500;

  & b { margin-right: 0.125rem; font-weight: 600; }
}
.dashboard-link {
  color: var(--dashboard-link);
  font-weight: 600;
  white-space: nowrap;

  &:hover { text-decoration: underline; }
}

/* One white card per section; the header holds its one verb. */
.dashboard-card {
  padding: 1.75rem 2rem;
  border: 1px solid var(--dashboard-border);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 3px rgb(20 40 38 / 0.06), 0 1px 2px rgb(20 40 38 / 0.04);
}
.dashboard-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}
.dashboard-card__title {
  font-size: 1.375rem;
  font-weight: 600;
}
/* A header's link stays smaller and softer than the title beside it. */
.dashboard-card__head > .dashboard-link,
.quiet-dsps__all {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--dashboard-link-quiet);
}
.dashboard-card__note {
  margin-left: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--dashboard-muted);
}
.dashboard-card__empty {
  padding: 0.5rem 0;
  font-size: 1rem;
  color: var(--dashboard-muted);
}
.dashboard-card__more {
  padding-top: 0.875rem;
  text-align: center;
  font-size: 1rem;
}
.dashboard-card__rest {
  padding-top: 0.875rem;
  font-size: 1rem;
}

/* A row is the link to whatever it names; rows never show arrows. */
.dashboard-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  color: inherit;

  & + & { border-top: 1px solid var(--dashboard-hairline); }
  &:hover { background: color-mix(in oklab, var(--dashboard-grey-wash) 60%, #fff); }
}
.dashboard-row--sentence {
  font-size: 1.0625rem;
  color: var(--dashboard-text);
}

/* Needs your attention: a plain list. A dot for how urgent, the count and
   what it is as the link, and one grey sentence beside it. */
.attention-list { padding-top: 0.25rem; }
/* Past the first six lines, the rest open from "Show N more". */
.attention-more__toggle {
  display: inline-block;
  padding-top: 0.5rem;
  color: var(--dashboard-link);
  font-weight: 600;
  cursor: pointer;
  list-style: none;

  &::-webkit-details-marker { display: none; }
}
.attention-more__hide,
.attention-more[open] .attention-more__show { display: none; }
.attention-more[open] .attention-more__hide { display: inline; }
.attention-more[open] { display: flex; flex-direction: column-reverse; }
.attention-more .attention-list { padding-top: 0; }
.attention-row {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  padding: 0.5rem 0;
  font-size: 1.0625rem;
}
.attention-row__dot {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  transform: translateY(-0.0625rem);
}
.attention-row__dot--red { background: var(--dashboard-red-dot); }
.attention-row__dot--amber { background: var(--dashboard-amber-dot); }
.attention-row__title {
  flex-shrink: 0;
  font-weight: 700;
  white-space: nowrap;
  color: var(--dashboard-link);

  &:hover { text-decoration: underline; }
}
/* The pop-up window a planned shift opens in, over the dashboard. */
.shift-dialog {
  width: min(100% - 2rem, 40rem);
  margin: auto;
  padding: 1.75rem 2rem 2rem;
  border: 0;
  border-radius: 1rem;
  background: #fff;
  color: var(--dashboard-ink);
  box-shadow: 0 1.5rem 3rem rgb(20 40 38 / 0.2);

  &::backdrop { background: rgb(20 40 38 / 0.4); }
  @media (max-width: 640px) { padding: 1.25rem; }
}
.shift-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.shift-dialog__title { font-size: 1.375rem; font-weight: 600; }
.shift-dialog__close {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  color: var(--dashboard-muted);
  cursor: pointer;

  & svg { width: 1.25rem; height: 1.25rem; }
  &:hover { background: var(--dashboard-raised); color: var(--dashboard-ink); }
}

/* Each row stays on one line: a detail too long for it ends in "…", and the
   whole sentence shows on hover. */
.attention-row__detail {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--dashboard-text);
}

/* DSP Updates: four stat columns, no dividers, then the quiet DSPs block. */
/* 32px between the title row and the counts. */
.dsp-updates .dashboard-card__head,
.billing .dashboard-card__head { margin-bottom: 2rem; }
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.dashboard-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
}
.dashboard-stat__link { font-size: 1.0625rem; }
.dashboard-stat__number {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
}
.dashboard-stat__figure {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.dashboard-stat__badge {
  padding: 0.1875rem 0.625rem;
  border-radius: 9999px;
  background: var(--dashboard-grey-wash);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}
.dashboard-stat--red .dashboard-stat__number { color: var(--dashboard-red); }
.dashboard-stat--red .dashboard-stat__badge { background: var(--dashboard-red-wash); color: var(--dashboard-red); }
.dashboard-stat--amber .dashboard-stat__number { color: var(--dashboard-amber); }
.dashboard-stat--amber .dashboard-stat__badge { background: var(--dashboard-amber-wash); color: var(--dashboard-amber); }

.quiet-dsps {
  margin-top: 2rem;
  padding: 0.875rem 1rem;
  border-radius: 0.625rem;
  background: var(--dashboard-raised);
  font-size: 1.0625rem;
}
.quiet-dsps__head {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}
.quiet-dsps__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dashboard-muted);
}
.quiet-dsps__count { flex: 1; color: var(--dashboard-text); }
.quiet-row {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  padding-top: 0.625rem;
}
.quiet-row__name {
  font-weight: 700;
  color: var(--dashboard-ink);

  &:hover { text-decoration: underline; }
}
.quiet-row__fact { color: var(--dashboard-text); }

/* Billing: one line per step with sessions in it. Grey dots: nothing here is
   wrong, it is work in its queue. */
/* Billing: three steps, read the same way as DSP Updates. */
.billing .dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.billing-step__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.billing-step__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
}
.billing-step--to-do .billing-step__icon { color: var(--dashboard-amber-dot); }
.billing-step--ready .billing-step__icon { color: var(--dashboard-link); }
.billing-step--waiting .billing-step__icon { color: var(--dashboard-muted); }
.billing-step--caught-up .billing-step__icon { color: var(--dashboard-link); }

/* Schedule: the week as a strip of days, then today's shifts beside what is
   clocked in. Colour only on the two rows the office is looking for: a shift
   with no DSP (red) and a clock-in nobody planned (amber). */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-top: 1.5rem;
  padding: 0;
  list-style: none;
}
.week-day { display: flex; justify-content: center; }
/* Each day is a link that lists its shifts below the strip. */
.week-day__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.75rem;

  &:hover .week-day__number { background: var(--dashboard-raised); }
  &:focus-visible { outline: 2px solid var(--dashboard-link); outline-offset: 2px; }
}
.week-day__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dashboard-muted);
}
.week-day__number {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  font-size: 1.25rem;
  font-weight: 700;
}
.week-day--today .week-day__name,
.week-day--today .week-day__number { color: var(--dashboard-link); }
.week-day--shown .week-day__number,
.week-day--shown .week-day__link:hover .week-day__number { background: var(--dashboard-link); color: #fff; }
.week-day__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
}
.week-day__dot--red { background: var(--dashboard-red-dot); }
.week-day__dot--amber { background: var(--dashboard-amber-dot); }

.schedule-today__empty { margin-top: 2rem; }
.schedule-today__heading {
  margin-top: 2.25rem;
  font-size: 1.125rem;
  font-weight: 600;
}

/* Today's rows, one shift each, in start order. */
.schedule-today {
  width: 100%;
  margin-top: 0.5rem;
  border-collapse: collapse;
}
.schedule-today th,
.schedule-today td {
  vertical-align: middle;
  text-align: left;
}
.schedule-today thead th {
  padding: 0.875rem 0.75rem 0.75rem 0;
  border-bottom: 1px solid var(--dashboard-hairline);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dashboard-muted);
}
.schedule-today th:last-child,
.schedule-today td:last-child { padding-right: 0; }
.schedule-today th.schedule-today__planned,
.schedule-today th.schedule-today__status { text-align: right; }
.schedule-today-row > td {
  padding: 0.75rem 0.75rem 0.75rem 0;
  border-bottom: 1px solid var(--dashboard-hairline);
  font-size: 1.0625rem;
}
/* A row opens the session behind it: the whole row is the client's link,
   and it lights up under the pointer. The DSP picker and Assign button of an
   open shift stay clickable on top of it. */
.schedule-today th:first-child,
.schedule-today-row > td:first-child { padding-left: 0.5rem; }
.schedule-today-row {
  position: relative;
  cursor: pointer;

  &:hover > td { background: var(--dashboard-raised); }
}
.schedule-today-row__open {
  color: inherit;

  &::after { content: ""; position: absolute; inset: 0; }
  &:focus-visible { outline: none; }
  &:focus-visible::after { outline: 2px solid var(--dashboard-link); outline-offset: -2px; border-radius: 0.375rem; }
}
.schedule-today-row__picker,
.schedule-today-row .ts-wrapper,
.schedule-today-row__assign { position: relative; z-index: 1; }
.schedule-today-row__time { width: 18%; color: var(--dashboard-muted); white-space: nowrap; }
.schedule-today-row__client { width: 16%; font-weight: 700; white-space: nowrap; }
.schedule-today-row__dsp { width: 20%; color: var(--dashboard-text); white-space: nowrap; }
.schedule-today-row__type { width: 16%; }
.schedule-today-row__planned {
  width: 6%;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.schedule-today-row__planned--none { font-weight: 400; color: var(--dashboard-muted); }
.schedule-today-row__status {
  text-align: right;
  font-size: 0.9375rem;
  white-space: nowrap;
}
/* An open shift takes its DSP here: the picker stands in for the words on a
   computer, and sits under them on a phone. */
.schedule-today-row__no-dsp { display: none; font-weight: 700; color: var(--dashboard-red); }
.schedule-today-row__picker { min-width: 12rem; }
.schedule-today-row__assign { display: inline; }
.schedule-today-row__assign .btn { min-width: 0; }

/* An open shift is washed red with a red dot before the client; a clock-in
   nobody planned is washed amber with an amber dot. The columns stay put. */
.schedule-today-row--open > td { background: var(--dashboard-red-wash); border-bottom-color: transparent; }
.schedule-today-row--not-planned > td { background: var(--dashboard-amber-wash); border-bottom-color: transparent; }
.schedule-today-row--open .schedule-today-row__client::before,
.schedule-today-row--not-planned .schedule-today-row__client::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.625rem;
  border-radius: 9999px;
  vertical-align: middle;
  background: var(--dashboard-red-dot);
}
.schedule-today-row--not-planned .schedule-today-row__client::before { background: var(--dashboard-amber-dot); }

/* Authorized hours and ISP renewals sit side by side, both as tall as the
   taller one, rows at the top. */
.dashboard-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.authorized-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(5rem, 7rem) 3rem;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.0625rem;
}
.authorized-row--yellow { --authorized-color: #d97706; }
.authorized-row--red { --authorized-color: #dc2626; }
.authorized-row__client { font-weight: 700; color: var(--dashboard-ink); }
.authorized-row__used { font-size: 0.875rem; color: var(--dashboard-muted); white-space: nowrap; }
.authorized-bar {
  display: block;
  height: 0.5rem;
  border-radius: 9999px;
  background: #e5e7eb;
  overflow: hidden;
}
.authorized-bar__fill {
  display: block;
  width: var(--share, 0%);
  height: 100%;
  border-radius: 9999px;
  background: var(--authorized-color);
}
.authorized-row__percent {
  text-align: right;
  font-weight: 700;
  color: var(--authorized-color);
}

/* Events this week: date, flyer, title and time, description, who is going. */
.event-row {
  display: grid;
  grid-template-columns: 5.625rem 2.75rem 16.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}
.event-row__date { font-size: 0.9375rem; font-weight: 600; }
.event-row__day { display: none; }
.event-row__flyer {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--dashboard-hairline);
  border-radius: 0.5rem;
  object-fit: cover;
}
.event-row__flyer--blank { display: block; background: #eff6ff; }
.event-row:nth-child(3n+2) .event-row__flyer--blank { background: #ecfdf5; }
.event-row:nth-child(3n) .event-row__flyer--blank { background: #fef9c3; }
.event-row__what { min-width: 0; }
.event-row__title { display: block; font-weight: 700; }
.event-row__time { display: block; margin-top: 0.125rem; font-size: 0.875rem; color: var(--dashboard-muted); }
.event-row__description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--dashboard-muted);
}
.event-row__going {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--dashboard-muted);
  white-space: nowrap;
}
.avatar-stack {
  display: flex;
  align-items: center;

  & > * + * { margin-left: -0.5rem; }
  & .avatar > div { border: 2px solid #fff; }
}
.avatar-stack__more {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #fff;
  border-radius: 9999px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 0.625rem;
  font-weight: 700;
}

/* Monthly reports: one calm line until the due date is close, then who owes one. */
.monthly-reports--calm {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding: 1rem 1.5rem;

  & .dashboard-card__note { flex: 1; margin-left: 0; }
}
.report-group + .report-group { margin-top: 1rem; }
.report-group__label {
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dashboard-muted);
}
.report-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.report-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  border-radius: 9999px;
  font-size: 0.9375rem;
  color: var(--dashboard-ink);
}
.report-chip--red { background: var(--dashboard-red-wash); }
.report-chip--red .report-chip__initials { background: var(--dashboard-red); }
.report-chip--amber { background: var(--dashboard-amber-wash); }
.report-chip--amber .report-chip__initials { background: var(--dashboard-amber); }
.report-chip--more { padding: 0.25rem 0.75rem; background: var(--dashboard-grey-wash); font-weight: 600; }
.report-chip__initials {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
}

/* A phone stacks the same sections in the same order. */
@media (max-width: 767px) {
  .dashboard { gap: 1rem; }
  .dashboard-card { padding: 1.25rem; }
  .dashboard-card__head .dashboard-card__note { display: block; margin: 0.125rem 0 0; }

  .attention .dashboard-card__head { margin-bottom: 1rem; }
  /* Still one line each on a phone: the detail gives way first. */
  .attention-row { gap: 0.5rem; font-size: 1rem; }

  .dsp-updates .dashboard-card__head,
  .billing .dashboard-card__head { margin-bottom: 1.5rem; }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; column-gap: 1rem; }
  /* A long step name wraps inside its half instead of running off the card. */
  .dashboard-stat { min-width: 0; }
  .dashboard-stat__link { font-size: 0.9375rem; }
  /* Billing on a phone: one step per line, its name on the left and its
     number on the right, so the longer names never run into each other. */
  .billing .dashboard-stats { grid-template-columns: minmax(0, 1fr); row-gap: 1rem; }
  .billing .dashboard-stat {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .billing .dashboard-stat__number { font-size: 1.75rem; }
  .quiet-dsps { margin-top: 1.75rem; }
  .quiet-dsps__head { flex-wrap: wrap; }
  .quiet-dsps__count { flex-basis: 100%; order: 1; }
  .quiet-dsps__all { margin-left: auto; }
  /* The name stays whole; a long fact wraps on its own side of the box. */
  .quiet-row { justify-content: space-between; }
  .quiet-row__name { flex: none; white-space: nowrap; }
  .quiet-row__fact { min-width: 0; text-align: right; }
  .quiet-row__alert-date { display: none; }


  /* Schedule: smaller day circles with room around the strip, then three
     lines a shift: the client, the time, the DSP, and the type pill beside
     the status. Planned hours wait for a wider screen. */
  .schedule .dashboard-card__head .dashboard-card__note { display: inline; margin-left: 0.5rem; }
  .week-strip { margin: 1.5rem 0; }
  .week-day__link { gap: 0.375rem; padding: 0.25rem; }
  .week-day__number { width: 2rem; height: 2rem; font-size: 1rem; }
  .schedule-today__empty { margin-top: 0; }
  .schedule-today__heading { margin-top: 0; }
  .schedule-today__today { display: none; }
  .schedule-today { margin-top: 0.75rem; }
  .schedule-today thead { display: none; }
  .schedule-today tbody,
  .schedule-today tr,
  .schedule-today td { display: block; }
  .schedule-today .schedule-today-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "client client"
      "time time"
      "dsp dsp"
      "type status";
    row-gap: 0.375rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--dashboard-hairline);
  }
  .schedule-today-row > td {
    width: auto;
    padding: 0;
    border-bottom: 0;
    background: none;
  }
  .schedule-today-row__client { grid-area: client; font-size: 1.0625rem; }
  .schedule-today-row__time { grid-area: time; font-size: 0.9375rem; color: var(--dashboard-ink); }
  .schedule-today-row__dsp { grid-area: dsp; font-size: 0.9375rem; white-space: normal; }
  .schedule-today-row__type { grid-area: type; margin-top: 0.125rem; }
  .schedule-today-row__status { grid-area: status; margin-top: 0.125rem; }
  .schedule-today .schedule-today-row__planned { display: none; }
  .schedule-today .schedule-time--wide { display: none; }
  .schedule-today .schedule-time--narrow { display: inline; }
  .schedule-today .schedule-status__so-far { display: none; }
  .schedule-today-row--open,
  .schedule-today-row--not-planned {
    padding: 0.75rem;
    border-radius: 0.5rem;
    border-bottom: 0;
  }
  .schedule-today .schedule-today-row--open { background: var(--dashboard-red-wash); border-bottom: 0; }
  .schedule-today .schedule-today-row--not-planned { background: var(--dashboard-amber-wash); border-bottom: 0; }
  .schedule-today-row--open > td,
  .schedule-today-row--not-planned > td { background: none; }
  .schedule-today-row__no-dsp { display: block; }
  .schedule-today-row__picker { width: 100%; min-width: 0; margin-top: 0.375rem; }

  /* "Showing 1–9 of 23" centred above Prev, Page, Go and Next. */
  .schedule-pages > div { flex-direction: column; justify-content: center; gap: 0.5rem; }

  .dashboard-pair { grid-template-columns: minmax(0, 1fr); }
  .authorized-row { grid-template-columns: minmax(0, 1fr) minmax(5rem, 7rem) 3rem; }
  .authorized-row__used { display: none; }

  .event-row {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    align-items: start;
    gap: 0 0.75rem;
  }
  .event-row + .event-row { border-top: 0; }
  .event-row__date { display: none; }
  .event-row__day { display: inline; }
  .event-row__flyer { grid-row: 1 / span 3; width: 4.5rem; height: 4.5rem; border-radius: 0.625rem; }
  .event-row__title { font-size: 1.0625rem; font-weight: 600; }
  .event-row__time { font-size: 0.9375rem; font-weight: 500; color: var(--dashboard-ink); }
  .event-row__description,
  .event-row__going { grid-column: 2; }
  .event-row__description { margin-top: 0.25rem; padding-right: 4rem; }
  .event-row__going { margin-top: -1.125rem; }
  .avatar-stack { display: none; }

  .monthly-reports--calm .dashboard-card__note { flex-basis: 100%; order: 1; }

  .dashboard-sections { padding: 1.5rem; }
}
