/* main stylesheet, part 3 of 6: family dashboard, profile edit, admin panel, insight cards, summaries.
   Loaded in this order by templates/base.html; the parts are one cascade, order matters. */
/* ── Dashboard ────────────────────────────────────────────── */

.dashboard-page {
  padding-bottom: 1rem;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
  margin-top: 1.25rem;
}

.dashboard-layout > aside {
  display: flex;
  align-self: start;
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  width: 100%;
  padding: 1.5rem;
  border-radius: 1.15rem;
  background:
    radial-gradient(circle at top right, rgba(222, 63, 130, 0.08), transparent 28%),
    linear-gradient(180deg, #fff 0%, #fbfaf7 100%);
  border: 1px solid var(--teal-09);
  box-shadow: var(--shadow-card);
}

.profile-avatar {
  width: 3.6rem;
  height: 3.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.2rem;
  background: linear-gradient(135deg, #fef2f6 0%, #fce4ee 55%, #f7cfe0 100%);
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
}

.profile-name,
.profile-email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* was a mask that faded every name, short ones too */
}
.profile-card > div:first-child > div:last-child { min-width: 0; }

.profile-name {
  margin: 0;
  font-size: var(--fs-92);
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 1.4;
}

.profile-email {
  margin: 0;
  font-size: var(--fs-86);
  color: var(--muted);
  direction: ltr;
  text-align: right;
}

.profile-meta {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.profile-meta-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--fs-88);
}

.profile-meta-label {
  flex: 0 0 auto;
  color: var(--muted);
}

.profile-meta-value {
  color: var(--text);
  font-weight: 500;
}

.profile-meta-empty {
  margin: 0;
  font-size: var(--fs-86);
  color: var(--muted);
}

.profile-card-actions {
  display: grid;
  gap: 0.5rem;
  margin-top: auto;
}

.profile-edit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.85rem;
  border-radius: 0.65rem;
  font-size: var(--fs-88);
  font-weight: 600;
  color: var(--accent-strong);
  border: 1px solid var(--teal-14);
  transition: background 0.2s ease;
}

.profile-edit-link:hover {
  background: var(--teal-05);
}

.profile-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.42rem 0.85rem;
  border-radius: 0.65rem;
  font-size: var(--fs-88);
  font-weight: 500;
  color: rgba(180, 40, 40, 0.82);
  border: 1px solid rgba(180, 40, 40, 0.14);
  transition: background 0.2s ease, color 0.2s ease;
}

.profile-logout-btn:hover {
  background: rgba(180, 40, 40, 0.06);
  color: var(--danger);
}

.dashboard-main {
  display: grid;
  gap: 1.25rem;
  align-content: start;
}

.dashboard-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  padding: 1.5rem;
  min-width: 0;
  border-radius: 1.15rem;
  background: linear-gradient(180deg, #fff 0%, #fbfaf7 100%);
  border: 1px solid var(--teal-09);
  box-shadow: var(--shadow-card);
}

.dashboard-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-section-header h2 {
  margin: 0;
  font-size: var(--fs-105);
  font-weight: 700;
  color: var(--accent-strong);
  padding-top: 0.2rem;
}

.dashboard-section-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Match the sort chips' height to the adjacent add (+) button's fixed
   2.1rem .button-icon square, so the row reads as one aligned control
   cluster instead of two different heights. */
.panel-sort-row .panel-filter-chip {
  display: inline-flex;
  align-items: center;
  height: 2.1rem;
  padding: 0 0.85rem;
}

.therapy-plan-card {
  gap: 0;
}

.therapy-plan-toggle {
  width: 100%;
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
}

.therapy-plan-toggle h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* nested plan card inside a bigger section (e.g. the panel user-detail page),
   as opposed to .therapy-plan-card which is a full top-level section itself */
.therapy-plan-subcard {
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  background: var(--teal-03);
  border: 1px solid var(--teal-07);
}

.therapy-plan-subcard-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--fs-95);
  font-weight: 600;
  color: var(--text);
}

.therapy-plan-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.therapy-plan-menu {
  position: relative;
}

/* .cal-modal-icon-btn (single class, declared later in this file) would
   otherwise win the specificity tie-break and keep its own idle background
   and color, so these combine both classes to guarantee they win instead. */
.cal-modal-icon-btn.therapy-plan-menu-btn {
  background: none;
  color: var(--muted);
}

.cal-modal-icon-btn.therapy-plan-menu-btn:hover {
  background: var(--teal-10);
  color: var(--accent-strong);
}

.cal-modal-icon-btn.therapy-plan-menu-btn[aria-expanded="true"] {
  background: var(--teal-16);
  color: var(--accent-strong);
}

/* The absolute/right:0 here is only the pre-JS baseline. Opening a menu hands
   it to SitePopover (static/js/popover_position.js), which switches it to
   position: fixed and places it against the real viewport — flipping upward,
   clamping horizontally — so it can't clip off-screen or under an ancestor's
   overflow. That's why there are no per-breakpoint direction patches. */
.therapy-plan-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 20;
  min-width: 180px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  padding: 0.35rem;
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.95) translateY(-4px);
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

/* Flipped above its button: slide in from below instead of from above. */
.therapy-plan-menu-dropdown[data-placement="top"] {
  transform: scale(0.95) translateY(4px);
}

.therapy-plan-menu-dropdown.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  visibility: visible;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0s;
}

.therapy-plan-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: right;
  padding: 0.55rem 0.75rem;
  border: none;
  background: none;
  border-radius: 0.55rem;
  font-family: inherit;
  font-size: var(--fs-85);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.therapy-plan-menu-item svg {
  flex-shrink: 0;
}

.therapy-plan-menu-item:hover:not(:disabled) {
  background: var(--teal-08);
}

.therapy-plan-menu-item-danger {
  color: var(--danger);
}

.therapy-plan-menu-item-danger:hover:not(:disabled) {
  background: rgba(180, 40, 40, 0.08);
}

.therapy-plan-menu-item:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.65;
}

.therapy-plan-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1);
}

.therapy-plan-toggle[aria-expanded="true"] .therapy-plan-chevron {
  transform: rotate(180deg);
}

.therapy-plan-sessions {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.therapy-plan-sessions-inner {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.75rem;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 0.85rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-92);
  border-radius: var(--radius-md);
  background: var(--teal-03);
}

.reservation-item,
.test-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--teal-03);
  border: 1px solid var(--teal-07);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* the flex wrappers nested inside a reservation-item row (drag handle +
   avatar + title/date) default to min-width:auto like any flex/grid item;
   without this, a text child refuses to wrap and instead overflows into
   the next grid column once the row is narrower than its content. Fixed
   widths set inline (avatar/icon dimensions) are unaffected since min-width
   only lowers the shrink floor, it never overrides an explicit width. */
.reservation-item *,
.test-item * {
  min-width: 0;
}

/* ...but the kebab dropdown is absolutely positioned (out of flow), so the
   reset above has no layout benefit for it — only the side effect of
   collapsing its own min-width back to 0 on rows that use it (e.g. the
   users list), since both rules share the same specificity and this one
   comes later. Restore it explicitly wherever the dropdown sits inside one
   of these rows. */
.reservation-item .therapy-plan-menu-dropdown,
.test-item .therapy-plan-menu-dropdown {
  min-width: 180px;
}

a.reservation-item:hover,
.reservation-item[data-res-detail]:hover,
a.test-item:hover {
  cursor: pointer;
  background: var(--teal-08);
  border-color: rgba(37, 145, 147, 0.2);
}

.reservation-item-title,
.test-item-title {
  font-size: var(--fs-95);
  font-weight: 600;
  color: var(--accent-strong);
}

.reservation-item-date,
.test-item-date {
  font-size: var(--fs-82);
  color: var(--muted);
  grid-column: 1;
}

.reservation-status {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-78);
  font-weight: 600;
  white-space: nowrap;
}

.reservation-status-pending {
  background: rgba(234, 179, 8, 0.15);
  color: #7a5f00;
}

.reservation-status-contacted {
  background: var(--teal-10);
  color: var(--accent-strong);
}

.reservation-status-confirmed {
  background: rgba(34, 120, 70, 0.1);
  color: #227846;
}

.reservation-status-cancelled {
  background: rgba(180, 40, 40, 0.08);
  color: var(--danger);
}

/* ── Profile edit page ────────────────────────────────────── */

.profile-edit-page {
  padding-bottom: 1rem;
}

.profile-edit-card {
  max-width: 640px;
  padding: 2rem;
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at top right, rgba(222, 63, 130, 0.06), transparent 30%),
    linear-gradient(180deg, #fff 0%, #fbfaf7 100%);
  border: 1px solid var(--teal-09);
  box-shadow: var(--shadow-card-strong);
}

.profile-edit-card form {
  display: grid;
  gap: 1.25rem;
}

.form-section-title {
  margin: 0.25rem 0 0.1rem;
  font-size: var(--fs-82);
  font-weight: 600;
  color: rgba(37, 145, 147, 0.55);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.profile-edit-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* ── Admin Panel ──────────────────────────────────────────────────────────── */

.panel-nav-toggle {
  display: none;
}

.panel-nav-collapse {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.panel-nav {
  display: grid;
  gap: 0.2rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.panel-nav-section {
  margin: 0.6rem 0 0.2rem;
  font-size: var(--fs-72);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0 0.5rem;
}

.panel-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.55rem;
  font-size: var(--fs-88);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.panel-nav-link:hover {
  background: var(--teal-07);
  color: var(--accent-strong);
}

.panel-nav-link.active {
  background: rgba(37, 145, 147, 0.11);
  color: var(--accent-strong);
  font-weight: 600;
}

.role-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.42rem 0.85rem;
  border-radius: 0.65rem;
  font-size: var(--fs-88);
  font-weight: 500;
  color: var(--accent-strong);
  border: 1px solid var(--teal-14);
  transition: background 0.2s ease, transform 0.15s cubic-bezier(0.2, 0, 0, 1);
}

.role-switch-btn:hover {
  background: var(--teal-05);
}

.role-switch-btn:active {
  transform: scale(0.96);
}

.panel-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.panel-stat-card {
  position: relative;
  background: linear-gradient(180deg, #fff 0%, #fbfaf7 100%);
  border: 1px solid var(--teal-09);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.15rem 1.25rem;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.45rem;
  box-shadow: 0 10px 24px rgba(33, 50, 58, 0.05);
  text-decoration: none;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.panel-stat-card:hover {
  border-color: rgba(37, 145, 147, 0.25);
  box-shadow: 0 16px 32px rgba(33, 50, 58, 0.09);
}

.panel-stat-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.7rem;
  background: var(--teal-10);
  color: var(--accent-strong);
}

.panel-stat-card-attention .panel-stat-icon {
  background: rgba(234, 179, 8, 0.18);
  color: #a17f00;
}

.panel-stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.panel-stat-label {
  font-size: var(--fs-80);
  color: var(--muted);
  font-weight: 500;
}

.panel-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: var(--fs-76);
  font-weight: 600;
}

.panel-trend-up { color: #227846; }
.panel-trend-down { color: var(--danger); }
.panel-trend-flat { color: var(--muted); }

/* Content-management counts (services/counselors/challenges/etc.) — these
   barely change day to day and don't inform any decision, so they're quick
   nav shortcuts to their list pages rather than full stat cards competing
   for attention with the time-aware KPIs above. */
.panel-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.panel-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--teal-05);
  border: 1px solid var(--teal-10);
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.panel-quick-link:hover {
  background: rgba(37, 145, 147, 0.11);
  border-color: rgba(37, 145, 147, 0.25);
}

.panel-quick-link svg {
  color: var(--accent-strong);
  flex-shrink: 0;
}

.panel-quick-link-count {
  font-weight: 700;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

/* ── Dashboard insight cards (bar lists + the one line chart) ────────────── */

.panel-dashboard-grid {
  display: grid;
  /* min(420px, 100%) instead of a bare 420px — a fixed minimum forces a
     grid track wider than the viewport on any phone, causing the whole
     dashboard to scroll horizontally. Capping it at 100% lets the track
     shrink to a real single column below ~420px instead of overflowing. */
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* Grid rows default to stretching every card to match the tallest sibling
   (e.g. a 5-row status breakdown next to a 1-row counselor-load card) —
   .dashboard-section is itself a nested grid with no explicit row sizing,
   so that extra height cascades into its content instead of just leaving
   blank space, visibly distorting a short card's one row. Each card sizes
   to its own content instead. */
.panel-dashboard-grid > .dashboard-section {
  align-self: start;
}

.panel-bar-list {
  display: grid;
  gap: 1rem;
}

.panel-bar-row {
  display: grid;
  gap: 0.4rem;
}

.panel-bar-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: var(--fs-90);
}

.panel-bar-row-label {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-bar-row-count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-strong);
}

.panel-bar-row-pct {
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.panel-bar-row-risk {
  font-size: var(--fs-74);
  font-weight: 600;
  color: var(--danger);
  background: rgba(180, 40, 40, 0.08);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
}

.panel-bar-track {
  height: 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--teal-08);
  overflow: hidden;
}

.panel-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent-strong);
}

.panel-bar-fill-pending { background: rgb(234, 179, 8); }
.panel-bar-fill-contacted { background: var(--accent-strong); }
.panel-bar-fill-confirmed { background: #227846; }
.panel-bar-fill-cancelled { background: var(--danger); }

/* Shown the instant a range chip is clicked, in place of the chart's own
   .panel-line-chart-scroll, while the new range's data is still in flight —
   same 600x210 aspect ratio as the real <svg> so nothing jumps when the
   real chart replaces it. */
.panel-chart-skeleton {
  width: 100%;
  aspect-ratio: 600 / 210;
}

/* Range-chip swap (panel_dashboard.js): fades the chart card's content out,
   swaps the markup while invisible, then fades it back in — instead of a
   full page reload (which also used to jump-scroll the page). */
.panel-sessions-chart-inner {
  transition: opacity 0.16s ease;
}

.panel-sessions-chart-inner.panel-sessions-chart-fading {
  opacity: 0;
}

.panel-line-chart-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.panel-line-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  /* text-anchor start/end is direction-relative — force ltr so the axis
     labels (positioned with plain numeric x/y math) anchor predictably
     regardless of the page's own rtl direction. */
  direction: ltr;
}

.panel-line-chart-area {
  fill: var(--teal-12);
}

.panel-line-chart-line {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel-line-chart-dot {
  fill: var(--accent-strong);
  stroke: #fff;
  stroke-width: 2;
}

.panel-line-chart-value {
  font-size: 10px;
  font-weight: 700;
  fill: var(--accent-strong);
  text-anchor: middle;
}

.panel-line-chart-baseline {
  stroke: var(--border);
  stroke-width: 1;
}

.panel-line-chart-axis-label {
  font-size: 9px;
  fill: var(--muted);
}

.panel-line-chart-x-label {
  text-anchor: middle;
}

.panel-line-chart-y-label {
  text-anchor: start;
  font-variant-numeric: tabular-nums;
}


.panel-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Custom filter dropdown for a long/growing option list (e.g. test types) —
   a chip row like .panel-filter-row doesn't scale past a handful of short
   labels and starts crowding the section heading once there are many, and a
   plain <select> looks like a stray system control next to everything else
   here. Visually matches .therapy-plan-menu-dropdown (the kebab menu).

   Built on native <details>/<summary> rather than a button + JS-toggled
   class: the closed state is what the browser paints on the very first
   frame, with no JS timing involved, so there's no flash of the panel being
   open before a script has a chance to hide it. panel_select_dropdown.js
   only adds click-outside/Escape-to-close on top — the open/close mechanism
   itself needs no JS at all. */
.panel-select {
  position: relative;
}

.panel-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 340px;
  padding: 0.6rem 0.9rem;
  border-radius: 0.7rem;
  border: 1px solid var(--teal-16);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-88);
  cursor: pointer;
  list-style: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.panel-select-trigger::-webkit-details-marker {
  display: none;
}

.panel-select-trigger:hover {
  border-color: rgba(37, 145, 147, 0.32);
}

.panel-select[open] > .panel-select-trigger {
  border-color: rgba(37, 145, 147, 0.36);
  box-shadow: 0 0 0 4px var(--teal-08);
}

.panel-select-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-select-chevron {
  flex-shrink: 0;
  color: var(--accent-strong);
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1);
}

.panel-select[open] .panel-select-chevron {
  transform: rotate(180deg);
}

.panel-select-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  left: 0;
  z-index: 20;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  padding: 0.35rem;
  max-height: 320px;
  overflow-y: auto;
  display: grid;
  gap: 0.1rem;
}

.panel-select-option {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  font-size: var(--fs-85);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.12s ease;
}

.panel-select-option:hover {
  background: var(--teal-08);
}

.panel-select-option.active {
  background: var(--teal-12);
  color: var(--accent-strong);
  font-weight: 600;
}

.panel-search-form {
  margin: 0.85rem 0 1.1rem;
}

.panel-search-form .search-field {
  width: 100%;
  max-width: 26rem;
}

/* AJAX-swapped list results (panel users, counselor «مراجعین من») sit one
   level deeper than the .dashboard-section grid that normally spaces
   .reservation-item rows via its own `gap` — without this they'd render
   flush against each other. */
[data-list-url] {
  display: grid;
  gap: 0.75rem;
}

/* …and the desktop rows inside the phone/desktop split (#52) one level
   deeper still. */
.list-rows {
  display: grid;
  gap: 0.75rem;
}

/* Tags beside a name each keep their own number: without isolation the
   digits of «پرونده ۱۰۰۳» and «۳ فرزند» run together across the tags. */
.row-case,
.cl-case {
  unicode-bidi: isolate;
}

.panel-filter-chip {
  padding: 0.25rem 0.7rem;
  border-radius: 2rem;
  font-size: var(--fs-80);
  font-weight: 500;
  color: var(--muted);
  background: var(--teal-05);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.panel-filter-chip:hover {
  background: var(--teal-10);
  color: var(--accent-strong);
}

.panel-filter-chip.active {
  background: var(--teal-12);
  border-color: var(--teal-30);
  color: var(--accent-strong);
  font-weight: 600;
}

.reservation-detail-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel-detail-list {
  display: flex;
  flex-direction: column;
}

.panel-detail-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--teal-07);
  font-size: var(--fs-90);
}

.panel-detail-row:last-child {
  border-bottom: none;
}

.panel-detail-label {
  flex: 0 0 150px;
  color: var(--muted);
  font-weight: 500;
}

.panel-detail-value {
  color: var(--text);
  font-weight: 600;
}

/* Questionnaire Q&A — one column, clearly separated cards */
.panel-qa-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.panel-qa-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--teal-04);
  border: 1px solid var(--teal-09);
}

.panel-qa-question {
  font-size: var(--fs-82);
  font-weight: 600;
  color: var(--accent-strong);
}

.panel-qa-answer {
  font-size: var(--fs-92);
  font-weight: 500;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-line;
}

/* ── Session/reservation summaries ───────────────────────────────────────── */
/* Expand/collapse cards for written summaries. Built as a <button> +
   sibling panel (not native <details>/<summary>) specifically so the reveal
   can be animated — <details> snaps display:none<->block instantly with no
   way to transition it. JS (expandable_summary.js) drives the max-height
   transition and toggles the .open class. */
.expandable-toggle {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
}

.session-summary-box {
  margin-top: 0.6rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--teal-04);
  border: 1px solid var(--teal-09);
}

.session-summary-box > .expandable-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: var(--fs-78);
  font-weight: 600;
  color: var(--accent-strong);
}

.session-summary-meta {
  font-size: var(--fs-75);
  color: var(--muted);
}

.session-summary-text {
  font-size: var(--fs-88);
  color: var(--text);
  line-height: 1.8;
  white-space: pre-line;
  text-wrap: pretty;
  margin: 0.5rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--teal-10);
}

.session-summary-edit {
  position: relative;
  margin-top: 0.6rem;
}

/* Extend the edit button's hit area to ~40px tall without growing its
   visible pill — it's easy to under-size a small text button like this. */
.session-summary-edit::after {
  content: "";
  position: absolute;
  inset: -0.5rem;
}

/* A reservation/session row that has a written summary: the whole row is
   the expand trigger, so the row and its summary render as one card instead
   of two separately-bordered boxes stacked on top of each other.

   Grid (not an extra wrapper <div>) so an optional side action button
   (.reservation-item-expandable-action, e.g. panel/user_detail.html's
   delete-session button) can sit beside the toggle while both stay *direct*
   children — the toggle's own grid layout and expandable_summary.js's wiring
   both specifically target ":scope > .expandable-toggle", so nesting it one
   level deeper inside a flex wrapper silently breaks both. */
.reservation-item-expandable {
  display: grid;
  grid-template-columns: 1fr auto;
  border-radius: var(--radius-md);
  background: var(--teal-03);
  border: 1px solid var(--teal-07);
  transition-property: background-color, border-color;
  transition-duration: 0.15s;
  transition-timing-function: ease-out;
}

.reservation-item-expandable > .expandable-toggle {
  grid-column: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
}

.reservation-item-expandable > .reservation-item-expandable-action {
  grid-column: 2;
  align-self: center;
  margin-inline-end: 1rem;
}

.reservation-item-expandable > .session-summary-inner {
  grid-column: 1 / -1;
}

.reservation-item-expandable:hover {
  background: var(--teal-06);
  border-color: rgba(37, 145, 147, 0.15);
}

.session-summary-chevron {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--muted);
  transition-property: transform;
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.open > .expandable-toggle .session-summary-chevron {
  transform: rotate(180deg);
}

.session-summary-inner {
  max-height: 0;
  overflow: hidden;
  transition-property: max-height;
  transition-duration: 0.22s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.reservation-item-expandable .session-summary-inner {
  padding: 0 1rem;
}

.reservation-item-expandable.open .session-summary-inner {
  padding: 0 1rem 0.85rem;
}

/* Compact history rows inside the calendar's session-view popup — the modal
   is a fixed ~420px wide regardless of screen size, too narrow for the wide
   pages' title/status side-by-side grid without cramming, so this stacks
   title above a date+status footer instead. */
.cal-history-item {
  padding: 0.7rem 0.85rem;
  border-radius: 0.7rem;
  background: var(--teal-03);
  border: 1px solid var(--teal-07);
  margin-bottom: 0.5rem;
}

.cal-history-item:last-child {
  margin-bottom: 0;
}

.cal-history-item-title {
  font-size: var(--fs-86);
  font-weight: 600;
  color: var(--accent-strong);
  line-height: 1.6;
  text-wrap: pretty;
}

.cal-history-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.cal-history-item-date {
  font-size: var(--fs-78);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cal-history-item .session-summary-inner {
  padding-top: 0;
}

.cal-history-item.open .session-summary-inner {
  padding-top: 0.55rem;
}

/* The top-level "سابقه قبلی" toggle inside the calendar popup — same card
   shell as .session-summary-box, but its panel holds a dynamically-fetched
   list rather than static text. */
.cal-history-panel {
  max-height: 0;
  overflow: hidden;
  transition-property: max-height;
  transition-duration: 0.22s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.session-summary-box.open .cal-history-panel {
  padding-top: 0.5rem;
}

.panel-checkbox-list {
  display: grid;
  gap: 0.5rem;
  padding: 0.6rem 0;
}

.panel-checkbox-list--inline {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.panel-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-88);
  cursor: pointer;
}

.panel-checkbox-item input[type="checkbox"],
.profile-edit-card input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(37, 145, 147, 0.35);
  border-radius: 0.3rem;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  vertical-align: middle;
}

.panel-checkbox-item input[type="checkbox"]:hover,
.profile-edit-card input[type="checkbox"]:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--teal-10);
}

.panel-checkbox-item input[type="checkbox"]:checked,
.profile-edit-card input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.panel-checkbox-item input[type="checkbox"]:checked::after,
.profile-edit-card input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 8px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.panel-checkbox-item input[type="checkbox"]:focus-visible,
.profile-edit-card input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


.panel-count-badge {
  font-size: var(--fs-82);
  font-weight: 600;
  color: var(--muted);
  background: var(--teal-07);
  padding: 0.2rem 0.65rem;
  border-radius: 2rem;
  font-variant-numeric: tabular-nums;
}

/* "جلسه ۴۶" — a client's lifetime session number with one doctor. Same
   pill family as .panel-count-badge, but teal text on a ring so it reads as a
   label on the row's title, not as one more status. */
.session-ordinal {
  display: inline-block;
  margin-inline-start: 0.5rem;
  padding: 0.1rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--teal-08);
  box-shadow: inset 0 0 0 1px var(--teal-14);
  color: var(--accent-strong);
  font-size: var(--fs-80);
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  vertical-align: 0.05em;
}

/* Per-doctor numbering summary above a client's plans (panel user page):
   "12 جلسه در سیستم + 34 جلسه پیش از سیستم" with the edit control. */
.session-numbering {
  margin-bottom: 0.85rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-md);
  background: var(--teal-03);
  border: 1px solid var(--teal-07);
}

.session-numbering-title {
  margin: 0.4rem 0 0.15rem;
  font-size: var(--fs-78);
  font-weight: 600;
  color: var(--muted);
}

.session-numbering-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
}

.session-numbering-row + .session-numbering-row {
  border-top: 1px solid var(--teal-08);
}

/* controls stay on one line; the detail text is what wraps on a phone */
.session-numbering-row .therapy-plan-chips {
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.session-numbering-info {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.session-numbering-name {
  font-size: var(--fs-95);
  font-weight: 600;
  color: var(--text);
}

.session-numbering-detail {
  font-size: var(--fs-82);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.session-prior-preview {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

/* Reusable rows inside a .reservation-item: the avatar+title/date row on one
   side, and the badges+kebab-menu row on the other. Pulled out of inline
   styles so the mobile breakpoint below can target them directly instead of
   guessing at wrapping behaviour. */
.reservation-item-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.reservation-item-info > *:last-child {
  min-width: 0;
  flex: 1;
}

.reservation-item-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.reservation-item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.button-icon {
  position: relative;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 0.55rem;
  flex-shrink: 0;
}

.button-icon::before {
  content: "";
  position: absolute;
  inset: -0.35rem;
}

/* ── Panel identity header + section tabs ─────────────────────────────────
   Used on the admin user-detail and counselor client-history pages to
   replace one long scroll with a persistent identity summary + switchable
   section tabs. panel_tabs.js progressively enhances this: the server
   renders every .panel-tab-panel fully visible with no [hidden], so with
   JS disabled the page degrades to the old single-scroll layout exactly. */

.panel-identity-header {
  display: grid;
  gap: 0.75rem;
  padding: 1.35rem 1.5rem;
  border-radius: 1.15rem;
  background: linear-gradient(180deg, #fff 0%, #fbfaf7 100%);
  border: 1px solid var(--teal-09);
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
}

.panel-identity-header-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.panel-identity-header-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.panel-identity-header-case {
  font-size: var(--fs-85);
  color: var(--muted);
}

.panel-identity-header .panel-detail-list {
  border-top: 1px solid var(--teal-07);
  padding-top: 0.5rem;
}

.panel-identity-header .panel-detail-row {
  padding: 0.35rem 0;
  font-size: var(--fs-85);
}

.panel-identity-header .panel-detail-label {
  flex: 0 0 110px;
}

.panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0;
}

.panel-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  border-radius: 2rem;
  font-family: inherit;
  font-size: var(--fs-88);
  font-weight: 500;
  color: var(--muted);
  background: var(--teal-05);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.panel-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.panel-tab:hover {
  background: var(--teal-10);
  color: var(--accent-strong);
}

.panel-tab[aria-selected="true"] {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(37, 145, 147, 0.25);
}

.panel-tab[aria-selected="true"] svg {
  opacity: 1;
}

.panel-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.panel-tab-panel {
  display: grid;
  gap: 1.25rem;
}

.panel-tab-panel[hidden] {
  display: none;
}

/* Field grouping helpers inside .profile-edit-card */

.form-subsection-title {
  margin: 0.15rem 0 -0.25rem;
  font-size: var(--fs-78);
  font-weight: 600;
  color: var(--accent-strong);
  opacity: 0.75;
}

.form-notes-box {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: var(--teal-03);
  border: 1px dashed var(--teal-16);
}

/* Case number: pulled out of the field groups and shown first so staff can
   confirm they're on the right record at a glance, before reading anything
   else. Styled like any other field, not called out with heavy color. */
/* File number | mobile, above the first section title (which carries its
   own underline — no second divider here). */
.form-top-row {
  margin-bottom: 1rem;
  align-items: start; /* the family suggestion under the mobile mustn't stretch the file number */
}

/* Father's name | mother's name | landline on one line. */
.form-fields-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* De-emphasized read-only account metadata (join date, last login) — kept
   low-priority and placed near the bottom of the form since staff rarely
   need it, unlike the fields above. Same .form-fields-row grid every other
   paired row in this form already uses. */
.form-meta-block {
  padding-top: 0.75rem;
  border-top: 1px solid var(--teal-08);
}

.form-meta-block .panel-detail-value {
  color: var(--muted);
  font-weight: 500;
}

/* Account-active toggle, styled as a switch instead of a checkbox. */
.form-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--teal-03);
  border: 1px solid var(--teal-08);
  cursor: pointer;
}

.form-switch-row-label {
  font-size: var(--fs-88);
  font-weight: 600;
  color: var(--text);
}

.form-switch {
  position: relative;
  flex-shrink: 0;
  width: 2.6rem;
  height: 1.45rem;
}

.form-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.form-switch-track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: rgba(30, 30, 30, 0.2);
  transition: background-color 0.15s ease;
}

/* The site is RTL: "off" rests on the right (the start side) and the thumb
   slides left to switch on — the mirror of a left-to-right switch. */
.form-switch-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1);
}

.form-switch input:checked ~ .form-switch-track {
  background: var(--accent-strong);
}

.form-switch input:checked ~ .form-switch-track .form-switch-thumb {
  transform: translateX(-1.15rem);
}

.form-switch input:focus-visible ~ .form-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── End Admin Panel ──────────────────────────────────────────────────────── */

.form-actions {
  display: flex;
  gap: 0.75rem;
}

.form-actions-center {
  justify-content: center;
}

@media (max-width: 1100px) {
  .nav {
    position: relative;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
  }

  .brand-logo {
    height: 2.8rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-actions {
    min-width: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .nav-actions .user-account-link {
    min-width: 0;
    display: block;
  }

  .menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.6rem);
    right: auto;
    left: 0;
    width: min(24rem, 100%);
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px rgba(30, 30, 30, 0.18);
    padding: 0.6rem;
    z-index: 120;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    white-space: normal;
  }

  .site-header.menu-open .menu {
    display: flex;
  }

  .menu > a,
  .menu-item {
    width: 100%;
  }

  .menu > a,
  .menu-item > a {
    padding: 0.8rem 0.7rem;
    border-radius: var(--radius-sm2);
  }

  .menu-item > a {
    flex: 1;
  }

  .menu > a.nav-active,
  .menu-item > a.nav-active {
    background: var(--teal-07);
  }

  @media (hover: hover) {
    .menu > a:hover,
    .menu-item > a:hover {
      background: var(--teal-07);
    }
  }

  .menu > a:active,
  .menu-item > a:active {
    background: var(--teal-12);
  }

  .menu > a::after,
  .menu-item > a::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .brand {
    min-width: 0;
    gap: 0.3rem;
  }

  .brand-logo {
    height: 2.2rem;
  }

  .brand-text {
    font-size: var(--fs-100);
    margin-right: 0;
  }

  /* Admin/counselor panel sidebar — collapse the nav links + logout behind
     a toggle so the page content isn't pushed a full screen down by the
     sidebar on every panel page. */
  .panel-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--teal-14);
    background: var(--teal-05);
    color: var(--accent-strong);
    font-family: inherit;
    font-weight: 600;
    font-size: var(--fs-88);
    cursor: pointer;
  }

  .panel-nav-toggle-icon {
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  }

  .panel-nav-toggle[aria-expanded="true"] .panel-nav-toggle-icon {
    transform: rotate(180deg);
  }

  /* Positioning context for the open dropdown below — without this it
     anchors to the nearest positioned ancestor, which on a panel page is
     way up at .site-header, landing the menu in the wrong spot entirely. */
  .profile-card {
    position: relative;
  }

  .panel-nav-collapse {
    display: none;
  }

  /* display:none -> flex kept this out of the layout while closed, but
     opening it was still a normal-flow block, so it pushed the whole page
     (.dashboard-main and everything in it) down by the menu's height
     instead of floating over it. Absolute-positioned overlay instead,
     anchored right under the card exactly like a real dropdown. */
  .panel-nav-collapse.open {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: 0;
    z-index: 90;
    padding: 0.85rem;
    max-height: min(70vh, 26rem);
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--teal-14);
    border-radius: 1.25rem;
    box-shadow: 0 20px 45px rgba(33, 50, 58, 0.16);
    animation: panel-nav-collapse-in 0.18s cubic-bezier(0.2, 0, 0, 1);
  }

  @keyframes panel-nav-collapse-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* As a floating popover rather than a full-height sidebar, the desktop
     nav's left-flush icon+label rows read as oddly off-balance — center
     everything and give touch targets more room to breathe. */
  .panel-nav-collapse.open .panel-nav {
    width: 100%;
    gap: 0.3rem;
  }

  .panel-nav-collapse.open .panel-nav-section {
    text-align: center;
  }

  .panel-nav-collapse.open .panel-nav-link {
    justify-content: center;
    padding: 0.7rem 0.9rem;
    font-size: var(--fs-92);
  }

  .panel-nav-collapse.open .profile-card-actions {
    width: 100%;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
  }

  .panel-tab {
    padding: 0.5rem 0.9rem;
    font-size: var(--fs-84);
  }

  .panel-identity-header {
    padding: 1.1rem 1.15rem;
  }

  .panel-identity-header .panel-detail-label {
    flex: 0 0 96px;
  }


  .nav-actions .guest-reserve-link {
    display: none;
  }

  .nav-actions .button-login {
    background: var(--accent);
    color: white;
    border-color: transparent;
    padding: 0.42rem 0.9rem;
    border-radius: 0.55rem;
    font-weight: 600;
  }


  .card-grid {
    grid-template-columns: 1fr;
  }

  .section-action-heading {
    align-items: flex-start;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-tile {
    min-height: 16rem;
    aspect-ratio: 1.25;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .blogs-controls {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "search toggle"
      "category category"
      "sort sort";
    gap: 0.6rem;
  }

  .blogs-filter-toggle {
    display: inline-flex;
    grid-area: toggle;
  }

  .blogs-controls:not(.filters-open) .sort-field {
    display: none;
  }

  .blogs-controls.filters-open .sort-field {
    animation: blogs-filter-field-in 0.2s ease;
  }

  .page-summary {
    font-size: 0.94rem;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .page-summary.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  .page-summary-toggle {
    display: inline-flex;
    margin: 0.1rem 0 0.6rem;
    font-weight: 600;
    font-size: var(--fs-88);
    color: var(--accent-strong);
  }

  .blogs-grid {
    grid-template-columns: 1fr;
  }

  .services-page-grid {
    grid-template-columns: 1fr;
  }


  .counselors-grid {
    grid-template-columns: 1fr;
  }

  .about-page-card {
    padding: 1.15rem;
  }

  .article-tile,
  .article-tile-featured,
  .article-tile:nth-of-type(2),
  .article-tile:nth-of-type(3),
  .article-tile:nth-of-type(4),
  .article-tile:nth-of-type(5) {
    grid-area: auto;
    min-height: 16rem;
    aspect-ratio: 1.35;
  }

  .blog-card-image,
  .service-card-image {
    aspect-ratio: 1 / 0.65;
  }

  .blog-card-body,
  .service-card-body {
    gap: 0.3rem;
    padding: 0.85rem 1rem 0.9rem;
  }

  .blog-card-text,
  .service-card-text {
    gap: 0.2rem;
  }

  .blog-card-text p,
  .service-card-text p {
    -webkit-line-clamp: 1;
  }

  .blog-card-footer,
  .service-card-footer {
    margin-top: 0;
  }

  .blog-card-more,
  .service-card-more {
    padding: 0.55rem 1rem;
    font-size: var(--fs-90);
  }

  .counselor-card-avatar {
    aspect-ratio: 1 / 0.9;
  }

  .article-tile .article-excerpt {
    display: none;
  }

  .service-tile p {
    display: none;
  }

  .hero {
    width: 100%;
    margin-inline: 0;
  }

  .hero-inner {
    width: 100%;
  }

  .page-hero {
    padding-block: 2.75rem 1.5rem;
  }

  .footer-links {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .footer-brand {
    justify-items: center;
  }

  .footer-contact {
    justify-items: center;
  }

  .contact-item {
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .contact-icon {
    display: none;
  }

  .footer-phone-list {
    justify-content: center;
  }

  .footer-socials {
    justify-content: center;
  }

  .cta-card {
    padding: 2rem 1rem;
  }

  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-fields-row,
  .form-fields-row-3 {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .profile-edit-card {
    padding: 1.25rem;
  }

  .profile-edit-sections {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 980px) {
  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "article-feature article-feature"
      "article-right-top article-left-top"
      "article-right-bottom article-left-bottom";
  }

  .article-tile-featured {
    min-height: 22rem;
  }
}

