/* Layout corrections for small screens. Component colors and routes are unchanged. */
.service-detail-page,
.therapist-profile-page,
.contact-page,
.questionnaire-page {
  min-width: 0;
  overflow-wrap: anywhere;
}
.service-detail-page .grid > *,
.therapist-profile-page .grid > *,
.contact-page .grid > *,
.questionnaire-page .grid > * {
  min-width: 0;
}
.service-detail-page nav,
.therapist-profile-breadcrumb {
  flex-wrap: wrap;
}
.service-detail-page nav svg,
.therapist-profile-breadcrumb svg { flex-shrink: 0; }
.service-detail-step > div,
.service-detail-list li > span { min-width: 0; }
.service-detail-step > div { flex: 1; }
.service-detail-therapist > svg { flex-shrink: 0; }
.therapist-filters { top: 0; }
.therapist-profile-info { min-width: 0; }
.therapist-profile-heading { flex-wrap: wrap; gap: 12px; }
.therapist-profile-heading > div { min-width: 0; flex: 1 1 200px; }
.therapist-profile-heading > span { flex-shrink: 0; }
.therapist-profile-stats { flex-wrap: wrap; gap: 12px 20px; }
.therapist-profile-stats > div { flex: 1 1 120px; min-width: 0; font-size: 14px; }
.therapist-profile-stats svg { flex-shrink: 0; }
/* Keep the session title above the description/price, even in a narrow sidebar. */
.therapist-profile-page .session-type > div {
  padding: 16px;
  transition-property: background-color, border-color, box-shadow;
}
.therapist-profile-price-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 6px 12px;
  align-items: start;
}
.therapist-profile-price-row > div,
.therapist-profile-price-row > div > div:last-child { display: contents; }
.therapist-profile-price-row > div > div:first-child {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
}
.therapist-profile-price-row p:first-child {
  grid-column: 2 / -1;
  grid-row: 1;
  white-space: nowrap;
}
.therapist-profile-price-row p:last-child {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}
.therapist-profile-price-row > span {
  grid-column: 2;
  grid-row: 3;
  justify-self: end;
  white-space: nowrap;
}
.contact-page :is(input, select, textarea),
.questionnaire-page :is(input, select, textarea) { min-width: 0; max-width: 100%; }
.questionnaire-entry-options .flex { flex-wrap: wrap; }
.questionnaire-entry-options :is(.btn-primary, .btn-secondary) { min-height: 44px; }
.contact-page .btn,
.therapist-profile-page .btn-primary,
#therapist-booking-dialog .booking-dialog-submit { max-width: 100%; white-space: normal; }
#therapist-booking-dialog .booking-dialog-header > div { min-width: 0; }
#therapist-booking-dialog .booking-dialog-header > form { flex-shrink: 0; }
.theme-mindthera #therapist-booking-dialog .booking-dialog-close { width: 44px; height: 44px; }
#therapist-booking-dialog .booking-dialog-submit { min-height: 48px; }

@media (max-width: 767px) {
  .therapist-filters { position: static; }
  .theme-mindthera :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { font-size: 16px; }
  .contact-page h2 { font-size: clamp(1.5rem, 5vw, 1.875rem); }
}
@media (max-height: 500px) {
  .therapist-filters { position: static; }
}
@media (max-width: 480px) {
  .therapist-profile-info,
  .therapist-profile-page > div > .therapist-profile-layout > div > .p-6 { padding: 20px; }
  .therapist-profile-heading > span { font-size: 12px; }
  .therapist-profile-page .session-type > div { padding: 12px; }
  .therapist-profile-page .btn-primary { padding-inline: 14px; min-height: 48px; }
  .contact-page .container { padding-inline: 16px; }
  .contact-page > .container > .grid > .p-6,
  .contact-page .space-y-4 > .p-6 { padding: 20px; }
  .contact-page .btn { padding-inline: 16px; }
  .questionnaire-entry-panel,
  #questionnaire-form { padding: 16px; }
  .theme-mindthera #therapist-booking-dialog .booking-dialog-header,
  .theme-mindthera #therapist-booking-dialog .booking-dialog-content { padding: 16px; }
  #therapist-booking-dialog .booking-dialog-submit { padding-inline: 14px; }
}

/* Admin layout uses the same form sizing and an accessible drawer on mobile. */
.mindthera-admin { overflow-wrap: anywhere; }
.mindthera-admin-main,
.mindthera-admin-content,
.mindthera-admin-content .grid > * { min-width: 0; }
.mindthera-admin-sidebar { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; z-index: 80; }
.mindthera-admin-sidebar > div { flex-shrink: 0; }
.mindthera-admin-sidebar > nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.mindthera-admin-menu-toggle,
.mindthera-admin-menu-close,
.mindthera-admin-backdrop { display: none; }
.mindthera-admin-backdrop[hidden] { display: none !important; }
.mindthera-admin-table-scroll,
.mindthera-admin-content .overflow-x-auto { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.mindthera-admin-content table { min-width: 620px; }
.mindthera-admin-content :is(input,select,textarea) { min-width: 0; max-width: 100%; }
.mindthera-admin :is(button,a):focus-visible { outline: 2px solid #0d9488; outline-offset: 3px; }
@media (max-width: 1023px) {
  .mindthera-admin-sidebar {
    width: min(280px,calc(100vw - 40px));
    transform: translateX(-100%);
    visibility: hidden;
  }
  .mindthera-admin-sidebar.is-open { transform: translateX(0); visibility: visible; }
  .mindthera-admin-main { margin-left: 0; width: 100%; }
  .mindthera-admin-topbar { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .mindthera-admin-topbar h1 { flex: 1; min-width: 0; font-size: 18px; }
  .mindthera-admin-account { width: 100%; justify-content: space-between; gap: 8px; }
  .mindthera-admin-account > span:first-child,
  .mindthera-admin-account > form { flex-shrink: 0; }
  .mindthera-admin-account > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
  .mindthera-admin-account button { width: 44px; height: 44px; }
  .mindthera-admin-content { padding: 20px; }
  .mindthera-admin-menu-toggle,
  .mindthera-admin-menu-close {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 44px; height: 44px; border: 1px solid #d1e7e4; border-radius: 12px;
    background: #ffffff; color: #0f766e; cursor: pointer;
  }
  .mindthera-admin-menu-close { position: absolute; top: 12px; right: 12px; }
  .mindthera-admin-backdrop { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(15,23,42,0.45); border: 0; }
  .mindthera-admin.is-admin-nav-open { overflow: hidden; }
}
@media (max-width: 640px) {
  .mindthera-admin-content { padding: 16px; }
  .mindthera-admin-content > .flex { flex-wrap: wrap; gap: 12px; }
  .mindthera-admin-content > .flex > h2 { min-width: 0; }
  .mindthera-admin :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea),
  .admin-login-page :is(input,select,textarea) { font-size: 16px; }
  .mindthera-admin-content :is(input:not([type="checkbox"]):not([type="radio"]),select) { min-height: 44px; }
  .admin-login-page .login-container { padding: 16px; }
  .admin-login-page .login-card { padding: 24px; }
}

/* Shared booking form inside the profile, alongside the existing card popup. */
[data-booking-widget] [hidden] { display: none !important; }
[data-booking-widget] .booking-calendar-title { margin-top: 20px; font-size: 20px; font-weight: 700; }
[data-booking-widget] [data-booking-history] { margin-top: 20px; }
.booking-inline-panel { min-width: 0; padding: 24px; scroll-margin-top: 24px; }
.booking-inline-panel .booking-dialog-note { color: var(--mt-muted); font-size: 14px; line-height: 1.7; }
.booking-inline-panel .booking-date-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 24px 0; }
.booking-inline-panel .booking-date-fields > div { min-width: 0; }
.booking-inline-panel label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.booking-inline-panel input:not([type="checkbox"]) { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; color: var(--mt-ink); background: var(--mt-soft); border: 1px solid var(--mt-border); border-radius: 12px; font: inherit; }
.booking-inline-panel .booking-dialog-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 20px; }
.booking-inline-panel .booking-dialog-contact { color: #0f766e; font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.booking-inline-panel .booking-dialog-consent { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0 0; font-size: 13px; font-weight: 400; line-height: 1.7; }
.booking-inline-panel input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; accent-color: #4d9b5f; }
.booking-inline-panel .booking-dialog-optional { font-weight: 400; color: var(--mt-muted); }
.booking-inline-panel .booking-dialog-error { margin-top: 12px; color: #b91c1c; }
.booking-inline-panel .booking-dialog-success { color: #265f37; font-weight: 700; line-height: 1.7; }
.booking-inline-panel .booking-dialog-submit { max-width: 100%; min-height: 48px; white-space: normal; }
.booking-inline-panel .booking-dialog-submit:disabled { opacity: .65; cursor: wait; }
.booking-inline-panel iframe { width: 100%; height: 720px; border: 1px solid var(--mt-border); border-radius: 12px; margin-top: 16px; background: #fff; }
.booking-inline-panel :focus-visible { outline: 2px solid #0f766e; outline-offset: 3px; }
.client-dashboard-shell .grid > *, .client-dashboard-shell form { min-width: 0; }
.client-booking-history { scroll-margin-top: 24px; }
.client-booking-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 13px; }
.client-history-restore form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 16px; }
.client-history-restore input { width: 160px; max-width: 100%; border: 1px solid var(--mt-border); border-radius: 12px; padding: 12px; font-size: 16px; }
.client-history-restore button { max-width: 100%; white-space: normal; min-height: 44px; }
@media (max-width: 640px) {
  .booking-inline-panel { padding: 20px; }
  .booking-inline-panel .booking-date-fields { grid-template-columns: 1fr; }
  .booking-inline-panel input:not([type="checkbox"]) { font-size: 16px; }
  .booking-inline-panel .booking-dialog-submit, .booking-inline-panel [data-booking-history] a { width: 100%; }
  .booking-inline-panel iframe { height: 640px; }
  .client-dashboard-shell .client-dashboard-card { overflow-wrap: anywhere; }
}

/* Keep the requested session mode visible in the card popup and profile form. */
.theme-mindthera [data-booking-widget] .booking-session-select {
  display: block; width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px;
  color: var(--mt-ink); background: var(--mt-soft); border: 1px solid var(--mt-border);
  border-radius: 12px; font: inherit;
}
.therapist-profile-page .session-type[hidden] { display: none !important; }
@media (max-width: 767px) { .theme-mindthera [data-booking-widget] .booking-session-select { font-size: 16px; } }

/* Only paired public CTAs: equal columns on phones, desktop layout preserved. */
@media (max-width: 767px) {
  .theme-mindthera .mobile-cta-pair,
  .theme-mindthera #therapists .mobile-cta-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: none;
  }
  .theme-mindthera .mobile-cta-pair > a,
  .theme-mindthera #therapists .mobile-cta-pair > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 50px;
    height: 100%;
    margin: 0;
    padding: 12px 8px;
    gap: 6px;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .theme-mindthera .mobile-cta-pair > a > svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
  }
}
