/* main stylesheet, part 5 of 6: panel calendar and its modals, image cropper, calendar shortcuts.
   Loaded in this order by templates/base.html; the parts are one cascade, order matters. */
/* ── Panel calendar (therapy session scheduling) ─────────────────────────── */

.calendar-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.calendar-toolbar .form-field {
  max-width: 320px;
  width: 100%;
}

.calendar-shell {
  min-height: 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.calendar-placeholder {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 380px;
  border-radius: 0.9rem;
  background:
    repeating-linear-gradient(135deg, var(--teal-05) 0 2px, transparent 2px 14px),
    linear-gradient(180deg, #fbfaf7 0%, #f6f4ef 100%);
  color: var(--muted);
  font-size: var(--fs-92);
  text-align: center;
  filter: saturate(0.6);
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.calendar-nav-months {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Teal (--accent-strong) outline button, filling solid on hover — same family
   as .calendar-nav-btn's color tokens and the site's .button hover lift, so it
   reads as part of both the calendar toolbar and the wider design system. */
.calendar-add-exception-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--accent-strong);
  background: var(--teal-08);
  color: var(--accent-strong);
  font-size: var(--fs-82);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.calendar-add-exception-btn:hover {
  background: var(--accent-strong);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37, 145, 147, 0.25);
}

.calendar-add-exception-btn:active {
  transform: scale(0.97);
  box-shadow: none;
}

.calendar-nav-title {
  min-width: 8.5rem;
  text-align: center;
  font-weight: 700;
  font-size: var(--fs-105);
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.calendar-nav-btn {
  position: relative;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.65rem;
  background: var(--teal-08);
  color: var(--accent-strong);
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition-property: background, scale;
  transition-duration: 0.15s;
  transition-timing-function: ease-out;
}

/* expand the hit area to ~40px without growing the visible button */
.calendar-nav-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 2.5rem;
  height: 2.5rem;
}

.calendar-nav-btn:hover { background: var(--teal-18); }
.calendar-nav-btn:active { scale: 0.96; }

.calendar-scroll {
  overflow-x: visible;
  min-width: 0;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(var(--cal-cols, 7), 1fr);
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.calendar-weekdays span {
  text-align: center;
  font-size: var(--fs-78);
  font-weight: 600;
  color: var(--muted);
  padding: 0.2rem 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(var(--cal-cols, 7), 1fr);
  gap: 0.4rem;
}

/* each cell is a freshly-created node on every month switch, so this keyframe
   naturally replays on navigation, kept fast and unstaggered since reception
   clicks through months repeatedly all day; a per-cell stagger would drag. */
@keyframes cal-day-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.calendar-day {
  position: relative;
  /* sized for the busiest a cell ever gets (6 rows: pills, or pills + the
     "N more" row) so every cell in the grid shares one height instead of the
     row growing per-day. */
  min-height: 212px;
  min-width: 0;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  cursor: pointer;
  /* shadow-as-border: adapts to any background, unlike a flat border */
  box-shadow: 0 0 0 1px var(--teal-10);
  transition-property: box-shadow;
  transition-duration: 0.15s;
  transition-timing-function: ease-out;
  animation: cal-day-in 0.15s ease-out;
}

.calendar-day:hover {
  box-shadow: 0 0 0 1px rgba(37, 145, 147, 0.35), 0 6px 16px rgba(33, 50, 58, 0.07);
}

.calendar-day.is-blank {
  background: transparent;
  box-shadow: none;
  cursor: default;
}

/* Shown in place of the real grid while a month's sessions are being
   fetched (initial load and every month/therapist switch) — sized and
   spaced exactly like .calendar-day so the real grid drops in with no
   layout jump. */
.calendar-day.calendar-day-skeleton {
  background: linear-gradient(90deg, rgba(30, 30, 30, 0.05) 25%, rgba(30, 30, 30, 0.1) 37%, rgba(30, 30, 30, 0.05) 63%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  box-shadow: none;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .calendar-day.calendar-day-skeleton {
    animation: none;
    background-position: 0 0;
  }
}

.calendar-day.is-today {
  box-shadow: 0 0 0 1.5px var(--accent-strong);
}

.calendar-day-num {
  font-size: var(--fs-82);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.calendar-day.is-today .calendar-day-num {
  color: var(--accent-strong);
}

.calendar-day-sessions {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.calendar-day-more {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 0.26rem 0.4rem;
  border-radius: var(--radius-2xs);
  border: none;
  background: var(--teal-06);
  color: var(--accent-strong);
  cursor: pointer;
  text-align: center;
  transition: background-color 0.12s, filter 0.12s;
}

.calendar-day-more:hover {
  background: var(--teal-14);
  filter: brightness(0.96);
}

.calendar-pill {
  font-size: var(--fs-72);
  line-height: 1.4;
  padding: 0.26rem 0.4rem;
  border-radius: var(--radius-2xs);
  background: var(--teal-12);
  color: var(--accent-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition-property: filter, scale;
  transition-duration: 0.12s;
}

.calendar-pill:hover {
  filter: brightness(0.94);
}

.calendar-pill:active {
  scale: 0.96;
}

.calendar-pill.is-awaiting_summary {
  background: rgba(234, 179, 8, 0.16);
  color: #7a5f00;
}

.calendar-pill.is-done {
  background: rgba(76, 175, 100, 0.14);
  color: #2e7d43;
}

.calendar-pill.is-missed {
  background: rgba(222, 63, 63, 0.12);
  color: #b23a3a;
}

.calendar-pill.is-cancelled {
  background: rgba(120, 120, 120, 0.1);
  color: var(--muted);
  text-decoration: line-through;
}

.calendar-day-add {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--teal-10);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-85);
  opacity: 0;
  transition: opacity 0.12s;
}

.calendar-day:hover .calendar-day-add {
  opacity: 1;
}

/* days the therapist doesn't normally work: new bookings are blocked, but an
   existing session on one (a legacy record, a one-off exception) stays visible
   and editable via its pill. */
.calendar-day.is-unavailable {
  background:
    repeating-linear-gradient(135deg, rgba(120, 120, 120, 0.06) 0 2px, transparent 2px 10px),
    #fff;
  cursor: not-allowed;
}

.calendar-day.is-unavailable .calendar-day-num {
  color: var(--muted);
}

.calendar-day.is-unavailable:hover {
  box-shadow: 0 0 0 1px var(--teal-10);
}

.calendar-day-lock {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  font-size: var(--fs-72);
  opacity: 0.5;
  border: none;
  background: none;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.12s;
}

.calendar-day-lock:hover {
  opacity: 0.95;
}

/* a one-off exception (reception opening/closing a single date) overriding
   the therapist's normal weekly schedule for that date only */
.calendar-day-exception-tag {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-2xs);
  white-space: nowrap;
}

.calendar-day-exception-tag.is-open {
  background: var(--teal-14);
  color: var(--accent-strong);
}

.calendar-day-exception-tag.is-closed {
  background: rgba(222, 63, 63, 0.12);
  color: #b23a3a;
}

.calendar-day-exception-undo {
  border: none;
  background: none;
  padding: 0;
  font-size: var(--fs-80);
  line-height: 1;
  cursor: pointer;
  color: inherit;
}

/* official Iranian holidays: a visual mark only, bookings are never blocked
   on one (a doctor may still choose to work a holiday), unlike is-unavailable. */
.calendar-day.is-holiday {
  background:
    repeating-linear-gradient(135deg, rgba(222, 63, 63, 0.07) 0 2px, transparent 2px 10px),
    #fff;
}

.calendar-day.is-holiday .calendar-day-num {
  color: #b23a3a;
}

.calendar-day-holiday-tag {
  position: absolute;
  top: 50%;
  left: 0.45rem;
  right: 0.45rem;
  transform: translateY(-50%);
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-2xs);
  background: rgba(222, 63, 63, 0.12);
  color: #b23a3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* ── Panel calendar modal ─────────────────────────────────────────────────── */

.cal-modal-backdrop {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(30, 30, 30, 0.5);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  /* visibility (not display:none) is what actually makes the exit fade play:
     display:none would hide the element in the same paint as the opacity
     change starts, so the fade-out would never be visible. */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.cal-modal-backdrop.open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s ease, visibility 0s linear 0s;
}

.cal-modal-box {
  width: min(420px, 100%);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: linear-gradient(180deg, #fff 0%, #fbfaf7 100%);
  border-radius: 1.1rem;
  /* shadow-as-border ring + ambient depth, matching .res-box's own pattern */
  box-shadow: 0 0 0 1px var(--teal-12), 0 32px 80px rgba(33, 50, 58, 0.2);
  padding: 1.35rem;
  transform: translateY(16px);
  transition: transform 0.22s ease, opacity 0.14s ease;
  will-change: transform, opacity;
}

/* Crossfade for swapping content on an already-open modal (e.g. day list →
   a session's details, then back) instead of an instant, jarring innerHTML
   replacement. */
.cal-modal-box.cal-modal-swapping {
  opacity: 0;
  transform: translateY(6px);
}

.cal-modal-box-wide {
  width: min(640px, 100%);
}

/* Session edit popup: wide enough that the four status buttons each fit their
   label on one line (the longest, "در انتظار خلاصه‌نویسی", plus the check). */
.cal-modal-box-edit {
  width: min(800px, 100%);
}

.cal-modal-box-lg {
  width: min(560px, 100%);
  min-height: 420px;
}

/* Day-list popup: a fixed size that never changes shape between "just the
   list" and "list + add-form" — same height always, only the width grows
   when the form opens (so its inputs stop being squeezed), and both columns
   scroll internally instead of the box stretching taller. */
.cal-modal-box-daylist {
  width: min(780px, 100%);
  height: min(760px, calc(100vh - 3rem));
  display: flex;
  flex-direction: column;
}

.cal-modal-box-daylist.cal-modal-box-split {
  width: min(1040px, 100%);
}

.cal-modal-box-daylist .cal-modal-header {
  flex-shrink: 0;
}

.cal-day-list-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0.85rem;
  flex: 1;
  min-height: 0;
}

.cal-day-list-body.cal-day-list-split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 640px) {
  .cal-modal-box-daylist,
  .cal-modal-box-daylist.cal-modal-box-split {
    width: min(680px, 100%);
    height: auto;
    max-height: calc(100vh - 3rem);
  }
  .cal-day-list-body {
    flex: none;
  }
  .cal-day-list-body.cal-day-list-split {
    grid-template-columns: minmax(0, 1fr);
  }
  /* stacked on a narrow screen: the add-form goes above the day's list */
  .cal-day-list-body.cal-day-list-split .cal-day-list-add-panel {
    order: -1;
    /* the form is what reception is here for (the split view opens with it),
       so it takes its natural height and the whole popup scrolls (the popup
       box already does), instead of hiding "ثبت جلسه" behind an inner scroll */
    max-height: none;
    overflow: visible;
  }
  .cal-day-list-body.cal-day-list-split .cal-day-list,
  .cal-day-list-body.cal-day-list-split .cal-day-list-empty {
    max-height: min(22vh, 190px);
  }
  .cal-day-list,
  .cal-day-list-add-panel,
  .cal-day-list-empty {
    height: auto;
    max-height: min(45vh, 320px);
  }
}

.cal-modal-backdrop.open .cal-modal-box {
  transform: translateY(0);
}

.cal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cal-modal-header h3 {
  margin: 0;
  font-size: var(--fs-100);
  color: var(--accent-strong);
}

/* Session-detail modals: the client's name as a clickable chip (profile
   icon + name) instead of a plain heading, so opening their profile reads
   as an obvious, generously-sized action rather than a hidden icon button. */
.cal-client-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--teal-09);
  color: var(--accent-strong);
  font-size: var(--fs-95);
  font-weight: 700;
  transition: background 0.15s ease, transform 0.15s ease;
}

.cal-client-chip:hover {
  background: var(--teal-18);
  transform: translateY(-1px);
}

.cal-client-chip:active {
  transform: scale(0.97);
}

.cal-modal-close {
  position: relative;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--teal-08);
  color: var(--text);
  border: none;
  cursor: pointer;
  font-size: var(--fs-100);
  display: flex;
  align-items: center;
  justify-content: center;
  transition-property: background, scale;
  transition-duration: 0.15s;
  transition-timing-function: ease-out;
}

/* expand the hit area to ~40px without growing the visible circle */
.cal-modal-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 2.5rem;
  height: 2.5rem;
}

.cal-modal-close:hover { background: var(--teal-16); }
.cal-modal-close:active { scale: 0.96; }

.cal-client-results {
  position: relative;
}

.cal-client-results-list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.25rem);
  right: 0;
  left: 0;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--teal-18), 0 20px 50px rgba(33, 50, 58, 0.16);
  max-height: 220px;
  overflow-y: auto;
}

.cal-client-result {
  display: block;
  width: 100%;
  text-align: right;
  padding: 0.55rem 0.75rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: var(--fs-85);
  color: var(--text);
  transition: background 0.12s ease-out;
}

.cal-client-result:hover { background: var(--teal-08); }

.cal-day-list-add-panel {
  height: 100%;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: var(--teal-05);
  border: 1px solid var(--teal-12);
  overflow-y: auto;
  animation: cal-pop-in 0.18s ease-out;
}

.cal-day-list-add-title {
  display: block;
  margin-bottom: 0.5rem;
  font-size: var(--fs-88);
  font-weight: 600;
  color: var(--accent-strong);
}

.cal-day-list-add-panel .form-actions {
  display: flex;
  gap: 0.6rem;
}

.cal-day-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  height: 100%;
  overflow-y: auto;
}

.cal-day-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 100%;
  padding: 1.5rem 1rem;
  text-align: center;
}

.cal-day-list-empty-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--teal-10);
  color: var(--accent-strong);
}

.cal-day-list-empty-title {
  font-size: var(--fs-105);
  font-weight: 700;
  color: var(--text);
}

.cal-day-list-empty-sub {
  font-size: var(--fs-86);
  color: var(--muted);
}

.cal-day-list-empty-add {
  margin-top: 0.7rem;
  padding: 0.65rem 1.6rem;
  font-size: var(--fs-95);
  border-radius: 0.85rem;
}

/* A day-list row: the time + name button (opens the session popup) on the
   right, the status dropdown on the left (#45), and an extra line under them
   for the cancel confirm or an error. */
.cal-day-list-row {
  flex-shrink: 0;
  border-radius: 0.65rem;
  background: var(--teal-08);
  color: var(--text);
  font-size: 0.83rem;
}

/* the counselor calendar's rows are still one plain button (no dropdown) */
button.cal-day-list-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: right;
  transition: filter 0.12s ease-out;
}

button.cal-day-list-row:hover { filter: brightness(0.96); }

.cal-day-list-row-main {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-inline-end: 0.45rem;
}

.cal-day-list-open {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 0.65rem;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: right;
  transition: background-color 0.12s ease-out;
}

.cal-day-list-open:hover { background: rgba(0, 0, 0, 0.04); }

.cal-day-list-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Status colours, shared by the row's pill and its menu — the same pairs the
   session popup's status buttons use (.cal-status-option.is-*). */
.cal-row-status,
.cal-row-status-option {
  --status-color: var(--accent-strong);
  --status-tint: rgba(37, 145, 147, 0.12);
}
.cal-row-status.is-awaiting_summary,
.cal-row-status-option.is-awaiting_summary { --status-color: #7a5f00; --status-tint: rgba(234, 179, 8, 0.18); }
.cal-row-status.is-done,
.cal-row-status-option.is-done { --status-color: #2e7d43; --status-tint: rgba(76, 175, 100, 0.16); }
.cal-row-status.is-missed,
.cal-row-status-option.is-missed { --status-color: #b23a3a; --status-tint: rgba(222, 63, 63, 0.13); }
.cal-row-status.is-cancelled,
.cal-row-status-option.is-cancelled { --status-color: #5c5c5c; --status-tint: rgba(120, 120, 120, 0.14); }

/* the row's status button: white chip (same corner radius family as the
   rows and inputs), status-coloured text, chevron */
.cal-row-status {
  flex-shrink: 0;
  max-width: 12rem;
  min-height: 2.1rem;
  padding: 0.3rem 0.65rem 0.3rem 0.5rem;
  border: 0;
  border-radius: 0.55rem;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--teal-16);
  color: var(--status-color);
  font: inherit;
  font-size: var(--fs-78);
  font-weight: 600;
  gap: 0.4rem;
  transition: box-shadow 0.12s ease-out, background-color 0.12s ease-out;
}

.cal-row-status:hover,
.cal-row-status[aria-expanded="true"] {
  background: var(--status-tint);
  box-shadow: inset 0 0 0 1.5px var(--status-color);
}

.cal-row-status:active {
  scale: 0.97;
}

.cal-row-status:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cal-row-status:disabled {
  opacity: 0.6;
  cursor: progress;
}

.cal-row-status .custom-select-chevron {
  color: currentColor;
  opacity: 0.75;
}

/* the menu: the site's custom-select list, lifted to <body> above the modal
   (1300) and the date picker (1400), like the combobox's portal list */
.cal-row-status-list {
  z-index: var(--z-modal);
  right: auto;
  left: auto;
  top: auto;
  padding: 0.35rem;
}

.cal-row-status-list li {
  list-style: none;
}

.custom-select-option.cal-row-status-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  font-size: var(--fs-85);
  white-space: nowrap;
}

.cal-row-status-option-label {
  flex: 1;
}

.custom-select-option.cal-row-status-option[aria-selected="true"] {
  background: var(--status-tint);
  color: var(--status-color);
}

/* the check that marks the current status — same mask as the popup's buttons */
.cal-row-status-option[aria-selected="true"]::after {
  content: "";
  flex-shrink: 0;
  width: 0.9rem;
  height: 0.9rem;
  background-color: var(--status-color);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill-rule='evenodd' d='M16.7 5.3a1 1 0 010 1.4l-8 8a1 1 0 01-1.4 0l-4-4a1 1 0 011.4-1.4L8 12.6l7.3-7.3a1 1 0 011.4 0z' clip-rule='evenodd'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill-rule='evenodd' d='M16.7 5.3a1 1 0 010 1.4l-8 8a1 1 0 01-1.4 0l-4-4a1 1 0 011.4-1.4L8 12.6l7.3-7.3a1 1 0 011.4 0z' clip-rule='evenodd'/></svg>") center / contain no-repeat;
}

@media (max-width: 640px) {
  /* leave the client's name room on a phone */
  .cal-row-status {
    max-width: 8.5rem;
  }
  .custom-select-option.cal-row-status-option {
    min-height: 2.6rem;
  }
}

/* #47: a row with a reception note shows this icon; hovering the row's
   open button shows the note in .cal-note-tooltip */
.cal-row-note-icon {
  flex-shrink: 0;
  display: inline-flex;
  color: var(--accent-strong);
  opacity: 0.7;
}

.cal-note-tooltip {
  z-index: var(--z-modal); /* above the modal backdrop (1300) and the date picker (1400) */
  display: grid;
  gap: 0.2rem;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: 0.55rem 0.75rem;
  border-radius: 0.65rem;
  background: linear-gradient(180deg, #fff 0%, #fbfaf7 100%);
  box-shadow: 0 0 0 1px var(--teal-12), 0 12px 32px rgba(33, 50, 58, 0.16);
  font-size: var(--fs-82);
  line-height: 1.7;
  color: var(--text);
  pointer-events: none;
  animation: cal-pop-in 0.15s ease-out;
}

.cal-note-tooltip-label {
  font-size: var(--fs-72);
  font-weight: 600;
  color: var(--accent-strong);
}

.cal-note-tooltip-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cal-day-list-row-extra {
  padding: 0 0.6rem 0.6rem;
}

.cal-day-list-row-extra .cal-error-box {
  margin: 0;
}

.cal-day-list-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.55rem;
  background: rgba(222, 63, 63, 0.08);
  font-size: var(--fs-80);
  animation: cal-pop-in 0.18s ease-out;
}

.cal-day-list-confirm-actions {
  display: flex;
  gap: 0.4rem;
}

.cal-day-list-confirm .button {
  padding: 0.35rem 0.85rem;
  font-size: var(--fs-80);
}

/* modal_guard.js: "unsaved work, close anyway?" bar under a modal's header */
.modal-guard-confirm {
  margin: 0 0 0.75rem;
}

.cal-day-list-time {
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-strong);
}

.cal-day-list-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-day-list-status {
  flex-shrink: 0;
  font-size: var(--fs-74);
  color: var(--muted);
}

.cal-day-list-row.is-awaiting_summary { background: rgba(234, 179, 8, 0.16); }
.cal-day-list-row.is-awaiting_summary .cal-day-list-time { color: #7a5f00; }

.cal-day-list-row.is-done { background: rgba(76, 175, 100, 0.14); }
.cal-day-list-row.is-done .cal-day-list-time { color: #2e7d43; }

.cal-day-list-row.is-missed { background: rgba(222, 63, 63, 0.12); }
.cal-day-list-row.is-missed .cal-day-list-time { color: #b23a3a; }

.cal-day-list-row.is-cancelled {
  background: rgba(120, 120, 120, 0.1);
  color: var(--muted);
}
.cal-day-list-row.is-cancelled .cal-day-list-name { text-decoration: line-through; }

/* one-shot pop-in for feedback that appears via innerHTML swap; a keyframe
   is correct here (not a transition) since these nodes are freshly inserted,
   not toggled, each time they show up. */
@keyframes cal-pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.cal-selected-client {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 0.65rem;
  background: var(--teal-08);
  font-size: var(--fs-85);
  margin-top: 0.4rem;
  animation: cal-pop-in 0.18s ease-out;
}

.cal-selected-client button {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--fs-80);
  transition: color 0.12s ease-out;
}

.cal-selected-client button:hover {
  color: var(--accent-strong);
}

.cal-open-plan-note {
  font-size: var(--fs-82);
  color: var(--accent-strong);
  background: var(--teal-08);
  border-radius: 0.65rem;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  animation: cal-pop-in 0.18s ease-out;
}

/* "ثبت همه‌ی جلسات پلن" in the add-session form: the switch, then weekday
   chips (only the doctor's working days) and a one-line summary. */
/* The edit popup's date box is a click-to-open picker, not a typed field —
   a calendar icon and pointer cursor say so (it used to read as plain text). */
.form-input.cal-date-trigger {
  cursor: pointer;
  padding-left: 2.75rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23259193'><path fill-rule='evenodd' d='M6 2a1 1 0 011 1v1h6V3a1 1 0 112 0v1h1a2 2 0 012 2v11a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2h1V3a1 1 0 011-1zm-2 7v8h12V9H4z' clip-rule='evenodd'/></svg>");
  background-repeat: no-repeat;
  background-position: left 0.9rem center;
  background-size: 1.1rem;
}

/* Session status in the edit popup: one-tap buttons instead of a dropdown.
   The chosen one is filled in its own colour (the same hues as the calendar
   pills) with a ring and a check, so it reads as "this is the status". */
.cal-status-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.5rem;
}

.cal-status-option-label {
  white-space: nowrap;
}

/* phone: two columns, and the long label may wrap inside its button */
@media (max-width: 640px) {
  .cal-status-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cal-status-option-label {
    white-space: normal;
  }
}

.cal-status-option {
  --status-color: var(--accent-strong);
  --status-tint: rgba(37, 145, 147, 0.12);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 3rem;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--teal-16);
  font-family: inherit;
  font-size: var(--fs-84);
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  transition-property: background-color, color, box-shadow, scale;
  transition-duration: 0.15s;
  transition-timing-function: ease-out;
}

.cal-status-option.is-awaiting_summary { --status-color: #7a5f00; --status-tint: rgba(234, 179, 8, 0.18); }
.cal-status-option.is-done { --status-color: #2e7d43; --status-tint: rgba(76, 175, 100, 0.16); }
.cal-status-option.is-missed { --status-color: #b23a3a; --status-tint: rgba(222, 63, 63, 0.13); }
.cal-status-option.is-cancelled { --status-color: #5c5c5c; --status-tint: rgba(120, 120, 120, 0.14); }

/* hover is a hint, not a selection: a light wash and the status colour on the
   text only — the chosen one alone gets the full tint, ring and check */
.cal-status-option:hover {
  background: var(--teal-06);
  color: var(--status-color);
}

.cal-status-option:active {
  scale: 0.97;
}

.cal-status-option.is-selected,
.cal-status-option.is-selected:hover {
  background: var(--status-tint);
  color: var(--status-color);
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px var(--status-color);
}

/* the check that marks the chosen one */
.cal-status-option.is-selected::before {
  content: "";
  flex-shrink: 0;
  width: 0.95rem;
  height: 0.95rem;
  background-color: var(--status-color);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill-rule='evenodd' d='M16.7 5.3a1 1 0 010 1.4l-8 8a1 1 0 01-1.4 0l-4-4a1 1 0 011.4-1.4L8 12.6l7.3-7.3a1 1 0 011.4 0z' clip-rule='evenodd'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill-rule='evenodd' d='M16.7 5.3a1 1 0 010 1.4l-8 8a1 1 0 01-1.4 0l-4-4a1 1 0 011.4-1.4L8 12.6l7.3-7.3a1 1 0 011.4 0z' clip-rule='evenodd'/></svg>") center / contain no-repeat;
}

.cal-status-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* "تعداد کل جلسات" and "ساعت جلسه" share a row so the form needs less
   scrolling; when the count is hidden (single-session service, or continuing
   an open plan) the time simply takes the whole row. Wraps on a very narrow
   popup instead of squeezing the inputs. */
.cal-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.cal-field-row > .form-field {
  flex: 1 1 8rem;
  min-width: 0;
}

/* edit popup: the date (with its icon) needs more room than "16:00" */
.cal-field-row > .form-field.cal-field-date {
  flex: 3 1 9.5rem;
}

.cal-field-row > .form-field.cal-field-time {
  flex: 2 1 6.5rem;
}

/* "تعداد کل جلسات" / "ساعت جلسه" / "مدت" in one row of the add form;
   the short values need little width each. */
.cal-field-row-3 > .form-field {
  flex: 1 1 5.5rem;
}

/* The day popup's add form (#46): tighter than the site's standard form so
   the whole thing — repeat section included — fits without scrolling.
   Scoped to this form only; other forms keep the normal sizes. */
.cal-add-form {
  gap: 0.5rem;
}

.cal-add-form .form-field {
  gap: 0.2rem;
}

.cal-add-form .form-label {
  font-size: var(--fs-80);
}

.cal-add-form .form-input {
  min-height: 2.35rem;
  padding: 0.4rem 0.75rem;
  font-size: var(--fs-88);
}

.cal-add-form .cal-field-row {
  gap: 0.6rem;
}

.cal-add-form .cal-selected-client {
  margin-top: 0;
  min-height: 2.35rem;
}

.cal-add-form .cal-open-plan-note {
  margin-top: 0;
}

.cal-add-form .cal-repeat,
.cal-add-form .cal-repeat-body {
  gap: 0.5rem;
}

.cal-add-form .form-switch-row {
  padding: 0.4rem 0.75rem;
}

.cal-add-form .cal-weekday-chips {
  gap: 0.3rem;
}

.cal-add-form .cal-weekday-chip {
  min-height: 1.9rem;
  padding: 0.25rem 0.65rem;
  font-size: var(--fs-80);
}

.cal-add-form .form-actions {
  margin-top: 0.15rem;
}

/* phones: keep finger-sized targets */
@media (max-width: 640px) {
  .cal-add-form .form-input,
  .cal-add-form .cal-selected-client {
    min-height: 2.6rem;
  }
  .cal-add-form .cal-weekday-chip {
    min-height: 2.25rem;
  }
}

.cal-repeat {
  display: grid;
  gap: 0.75rem;
}

.cal-repeat-body {
  display: grid;
  gap: 0.75rem;
  animation: cal-pop-in 0.18s ease-out;
}

.form-switch-row-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.cal-weekday-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* .panel-filter-chip is styled for <a>; as a <button> it needs its own reset,
   and a phone-sized touch target. */
.cal-weekday-chip {
  font-family: inherit;
  cursor: pointer;
  min-height: 2.25rem;
  padding: 0.4rem 0.9rem;
  font-size: var(--fs-86);
}

.cal-weekday-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cal-repeat-summary {
  display: grid;
  gap: 0.15rem;
  margin-top: 0;
  font-variant-numeric: tabular-nums;
}

.cal-repeat-summary strong {
  font-weight: 600;
}

/* After a whole course is registered: a notice floating over the top of the
   add form (never pushing it down), closed by a timer or its × */
.cal-day-list-add-panel {
  position: relative;
}

.cal-bulk-result {
  position: absolute;
  z-index: 5;
  top: 0.6rem;
  inset-inline: 0.6rem;
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem;
  padding-inline-end: 2.4rem; /* room for the × on the left (RTL end) */
  border-radius: 0.85rem;
  background: linear-gradient(180deg, #fff 0%, #fbfaf7 100%);
  box-shadow: 0 0 0 1px var(--teal-12), 0 16px 40px rgba(33, 50, 58, 0.18);
  animation: cal-pop-in 0.18s ease-out;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

/* one card, not a box in a box: the success line sits on the card itself */
.cal-bulk-result > .cal-open-plan-note {
  margin: 0;
  padding: 0.15rem 0.35rem;
  background: none;
  animation: none;
}

.cal-bulk-result.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
}

.cal-bulk-result-close {
  position: absolute;
  top: 0.45rem;
  inset-inline-end: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--teal-08);
  color: var(--accent-strong);
  font-size: var(--fs-100);
  line-height: 1;
  cursor: pointer;
}

.cal-bulk-result-close:hover {
  background: var(--teal-16);
}

.cal-bulk-result-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cal-bulk-result > * {
  margin-top: 0;
}

.cal-warning-box + .cal-open-plan-note,
.cal-open-plan-note + .cal-warning-box {
  margin-top: 0.5rem;
}

.cal-warning-box {
  font-size: var(--fs-82);
  color: #a15a1f;
  background: rgba(255, 176, 32, 0.14);
  border-radius: 0.65rem;
  padding: 0.6rem 0.75rem;
  margin-top: 0.6rem;
  animation: cal-pop-in 0.18s ease-out;
}

.cal-error-box {
  font-size: var(--fs-82);
  color: #b23a3a;
  background: rgba(222, 63, 63, 0.1);
  border-radius: 0.65rem;
  padding: 0.6rem 0.75rem;
  margin-top: 0.6rem;
  animation: cal-pop-in 0.18s ease-out;
}

/* ── Image cropper (image_cropper.js) ────────────────────────────────────── */
.cropper-stage {
  position: relative;
  width: 100%;
  max-width: 340px;
  /* Matches .counselor-card-avatar's real aspect ratio — cropping to a
     square here would look right in the modal but then get its top/bottom
     silently trimmed by object-fit: cover on the actual card. */
  aspect-ratio: 1 / 0.8;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--text);
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 1px rgba(37, 145, 147, 0.15);
}

.cropper-stage:active {
  cursor: grabbing;
}

.cropper-stage img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.cropper-zoom-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 320px;
  margin: 0.9rem auto 0;
}

.cropper-zoom-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent-strong);
}

.cropper-zoom-icon {
  color: var(--muted);
  font-size: var(--fs-100);
  line-height: 1;
  width: 1rem;
  text-align: center;
  user-select: none;
}

.image-crop-preview img {
  max-height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
}

.cal-no-results {
  font-size: var(--fs-82);
  color: var(--muted);
  padding: 0.65rem 0.75rem;
  text-align: center;
}

@media (max-width: 640px) {
  /* Keep the same side-by-side grid as desktop (avatar+title on one side,
     badges/kebab on the other, vertically centered) instead of stacking
     into rows — stacking pushed the kebab menu to an orphaned row below
     the content. The info column truncates instead. */
  .reservation-item,
  .test-item {
    gap: 0.3rem 0.6rem;
  }

  .reservation-item-info {
    align-items: flex-start;
  }

  .reservation-item-title,
  .test-item-title {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 28px, black 100%);
    mask-image: linear-gradient(to right, transparent 0, black 28px, black 100%);
  }

  /* A title that carries the "جلسه N" tag wraps instead of truncating (the
     tag would otherwise be clipped away), and the tag drops its
     " با این درمانگر" tail — the full phrase stays in its tooltip. */
  .reservation-item-title:has(.session-ordinal) {
    white-space: normal;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .session-ordinal-suffix {
    display: none;
  }

  /* the title column is narrow beside the status pill — a long ordinal
     ("چهل و هشتم") wraps inside its pill instead of spilling over it */
  .session-ordinal-num {
    white-space: nowrap;
  }

  .session-ordinal {
    white-space: normal;
    max-width: 100%;
    margin-inline-start: 0;
    border-radius: 0.9rem;
  }

  .reservation-item-date,
  .test-item-date {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .reservation-item-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  /* the toggle button (title) fights the chips + "سابقه کامل" link (or,
     inside a user-detail page, the chips + kebab menu) for space on one
     row and gets squeezed to a sliver — give it its own row */
  .therapy-plan-card .dashboard-section-header,
  .therapy-plan-subcard .dashboard-section-header {
    flex-wrap: wrap;
  }

  .therapy-plan-card .therapy-plan-toggle,
  .therapy-plan-subcard .therapy-plan-toggle {
    flex-basis: 100%;
  }

  /* status-filter chip rows (reservations, test results, …) fight the
     section heading for space on one line and end up tangled together —
     give the heading its own row and let the chips wrap below it */
  .dashboard-section-header:has(.panel-filter-row) {
    flex-wrap: wrap;
  }

  .panel-filter-row {
    flex-basis: 100%;
  }

  .dashboard-section-header:has(.panel-select) {
    flex-wrap: wrap;
  }

  .panel-select {
    flex-basis: 100%;
  }

  .panel-select-trigger {
    width: 100%;
  }

  .calendar-day {
    min-height: 196px;
    padding: 0.3rem;
  }

  .calendar-scroll {
    overflow-x: auto;
    margin: 0 -0.25rem;
    padding: 0 0.25rem 0.4rem;
    -webkit-overflow-scrolling: touch;
  }

  /* The sessions-trend chart's axis/value text is set in plain CSS px
     inside the SVG's own coordinate space, so it scales down with the
     SVG's rendered width — at native width:100% on a phone (~300-340px
     against a 600px viewBox) 9-10px text shrinks to under 5px, unreadable.
     37.5rem (600px) matches the chart's native viewBox width exactly —
     a true 1:1 render, same text size as desktop — and
     .panel-line-chart-scroll handles the overflow, so labels stay legible
     and the chart scrolls horizontally instead of illegibly compressing.
     Same idiom as .calendar-scroll above. */
  .panel-line-chart-svg {
    width: 37.5rem;
  }

  .calendar-weekdays,
  .calendar-grid {
    /* scales down with fewer columns so a 1- or 2-day therapist doesn't force
       the same horizontal scroll a full 7-day week needs. */
    min-width: calc(34rem * var(--cal-cols, 7) / 7);
  }
}

.button.danger {
  color: var(--danger);
  border: 1px solid rgba(180, 40, 40, 0.18);
  background: rgba(180, 40, 40, 0.04);
}

.button.danger:hover {
  background: rgba(180, 40, 40, 0.09);
}

.cal-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cal-modal-icon-btn {
  position: relative;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-08);
  color: var(--text);
  transition-property: background, scale;
  transition-duration: 0.15s;
  transition-timing-function: ease-out;
}

/* expand the hit area to ~40px without growing the visible circle */
.cal-modal-icon-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 2.5rem;
  height: 2.5rem;
}

.cal-modal-icon-btn:active { scale: 0.96; }

/* A solid, filled circle (vs. the neutral ghost-circle close button next to
   it) so "add a session" reads as a distinct primary action, not just
   another close-style icon button. */
.cal-modal-icon-btn-add {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 6px 16px var(--teal-30);
}

.cal-modal-icon-btn-add:hover {
  background: #1f7d7f;
}

.cal-modal-icon-danger {
  background: rgba(180, 40, 40, 0.09);
  color: var(--danger);
}

.cal-modal-icon-danger:hover {
  background: rgba(180, 40, 40, 0.16);
}

.cal-confirm-text {
  font-size: var(--fs-88);
  color: var(--text);
  line-height: 1.7;
  margin: 0 0 0.4rem;
}

.calendar-day.is-view-only {
  cursor: default;
}

.calendar-day.is-view-only:hover {
  box-shadow: 0 0 0 1px var(--teal-10);
}

/* Client-document upload progress (client_documents.js) */
.doc-upload-progress {
  margin-top: 0.75rem;
}

.doc-upload-progress-track {
  height: 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
}

.doc-upload-progress-fill {
  width: 0;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent-strong);
  transition: width 0.15s linear;
}

.doc-upload-progress-label {
  font-size: var(--fs-82);
  font-weight: 600;
  color: rgba(37, 145, 147, 0.8);
  margin-top: 0.4rem;
  text-align: center;
}

/* #47: reception's note on a session, as counselors see it — one muted line
   under a history entry, and a detail row that keeps the note's line breaks */
.reception-note-line {
  margin-top: 0.3rem;
  font-size: var(--fs-80);
  line-height: 1.7;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: right;
}

.reception-note-label {
  font-weight: 600;
  color: var(--accent-strong);
}

.reception-note-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ── Calendar keyboard shortcuts (#48) ─────────────────────────────────── */

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

/* the keyboard-highlighted day: a ring in the accent colour, stronger than
   today's thin ring so the two never read as the same thing */
.calendar-day.is-kbd-cursor {
  box-shadow: 0 0 0 2.5px var(--accent), 0 6px 18px var(--teal-18);
  z-index: 1;
}

.calendar-day.is-kbd-cursor.is-unavailable {
  box-shadow: 0 0 0 2.5px rgba(120, 120, 120, 0.45);
}

.cal-client-result.is-active {
  background: var(--teal-12);
}

/* #58: one row per family in the client pickers, a pill per child */
.cal-family-row {
  display: grid;
  gap: 0.3rem;
  padding: 0.45rem 0.75rem 0.55rem;
  border-bottom: 1px solid var(--border);
}

.cal-family-row:last-child {
  border-bottom: 0;
}

.cal-family-head {
  color: var(--muted);
  font-size: var(--fs-74);
  direction: rtl;
}

.cal-family-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cal-client-result.cal-family-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  width: auto;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: #fff;
}

.cal-client-result.cal-family-pill small {
  color: var(--muted);
  font-size: var(--fs-72);
}

.cal-client-result.cal-family-pill.is-active {
  border-color: var(--accent-strong);
  background: var(--teal-12);
}

/* the number key next to a status (menu rows and the session popup) */
.cal-status-key {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 0.35rem;
  background: var(--teal-08);
  color: var(--muted);
  font-size: var(--fs-72);
  font-weight: 600;
}

.cal-status-option .cal-status-key {
  margin-inline-start: 0.15rem;
}

/* the «میانبرها» help card */
.cal-modal-box-help {
  width: min(620px, 100%);
}

.cal-shortcut-intro {
  margin: 0 0 0.9rem;
  font-size: var(--fs-82);
  color: var(--muted);
  line-height: 1.8;
}

.cal-shortcut-group {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 0.9rem;
}

.cal-shortcut-title {
  margin-bottom: 0.25rem;
  font-size: var(--fs-85);
  font-weight: 700;
  color: var(--accent-strong);
}

.cal-shortcut-row {
  display: grid;
  grid-template-columns: minmax(8.5rem, auto) 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid var(--teal-08);
  font-size: var(--fs-84);
}

.cal-shortcut-keys {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  direction: ltr;
  justify-content: flex-end;
}

.cal-shortcut-keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.4rem;
  border-radius: var(--radius-2xs);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(37, 145, 147, 0.2), 0 1px 0 rgba(37, 145, 147, 0.2);
  font-family: inherit;
  font-size: var(--fs-78);
  font-weight: 600;
  color: var(--text);
}

.cal-kbd-fa {
  font-size: var(--fs-75);
  color: var(--muted);
}

@media (max-width: 640px) {
  .cal-shortcut-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .cal-shortcut-keys {
    justify-content: flex-start;
    direction: rtl;
  }
}

/* phones have no keyboard: no shortcuts button there */
@media (max-width: 640px) {
  .calendar-shortcuts-btn {
    display: none;
  }
}

