/* Load after styles.css and any page-specific stylesheet.
   Mobile styles are isolated here so desktop layouts stay familiar. */
html { -webkit-text-size-adjust: 100%; }
.booking-action { min-width: 0; }
@media screen and (max-width: 800px) {
  body { font-size: 16px; }
  button, a, summary { touch-action: manipulation; }
  input:not([type="checkbox"]):not([type="hidden"]), select, textarea {
    font-size: 16px; min-height: 50px; border-color: #bac2b5;
    border-radius: 8px; padding: 12px; min-width: 0;
  }
  input::placeholder { font-size: 14px; }
  label { font-size: 14px; }
  .button, .category { min-height: 48px; border-radius: 8px; font-size: 14px; }
  .text-link, .edit-link, .site-footer a { min-height: 44px; display: inline-flex; align-items: center; }
  .site-header { padding: 14px 20px 0; gap: 10px; }
  .site-header .brand { min-width: 0; background: transparent; }
  .site-header .brand strong { font-size: 15px; letter-spacing: 1px; }
  .site-header .brand span { font-size: 12px; letter-spacing: 1.5px; }
  .site-header > .button { min-height: 44px; padding: 10px 12px; font-size: 12px; }
  .site-header nav, .home-page .site-header nav {
    flex-wrap: nowrap; flex-basis: 100%; overflow-x: auto; justify-content: flex-start;
    gap: 18px; padding-block: 0; border-top: 1px solid #d9ded1;
    scrollbar-width: thin; overscroll-behavior-x: contain;
  }
  .site-header nav a, .home-page .site-header nav a {
    display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 46px;
    font-size: 12px; letter-spacing: 0; text-transform: none;
  }
  .site-footer { padding: 24px 20px; gap: 8px 22px; font-size: 13px; }
  .site-footer > span { flex-basis: 100%; }
  .booking-shell { width: calc(100% - 32px); margin-top: 16px; padding: 24px; border-radius: 16px; min-height: 0; }
  .booking-shell h1 { font-size: 30px; line-height: 1.2; margin-bottom: 16px; }
  .booking-steps { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-bottom: 26px; font-size: 11px; line-height: 1.5; }
  .booking-steps li { border-top: 3px solid #e1e5da; padding-top: 10px; color: #686f63; }
  .booking-steps li[aria-current="step"] { border-color: #405642; color: #354b37; }
  .page-subtitle { font-size: 15px; margin-bottom: 28px; }
  .section-heading { gap: 8px; }
  .section-heading > span { font-size: 12px; overflow-wrap: anywhere; }
  .therapist-field { max-width: none; }
  .schedule-layout { gap: 24px; }
  .date-time-grid { grid-template-columns: 1fr; gap: 28px; }
  .calendar { max-width: none; border: 1px solid #d9ded1; border-radius: 12px; padding: 12px; }
  .calendar-heading > span { font-size: 16px; font-weight: 600; }
  .icon-button { width: 44px; height: 44px; border-radius: 50%; background: #f4f5ee; }
  .calendar-grid { gap: 3px; }
  .calendar-day { min-width: 0; height: 44px; border-radius: 7px; font-size: 14px; padding: 0; }
  .weekday { font-size: 12px; }
  .times-panel h3 { font-size: 16px; min-height: 0; }
  .notice, .error-message { font-size: 14px; border-radius: 8px; overflow-wrap: anywhere; }
  .time-buttons { grid-template-columns: repeat(3,minmax(0,1fr)); max-height: 288px; padding: 5px; gap: 8px; overscroll-behavior-y: auto; border-radius: 10px; }
  .time-button { min-height: 48px; font-size: 14px; border-radius: 8px; }
  .time-button.selected { border-color: #405642; background: #405642; box-shadow: 0 0 0 2px #dce4d4; }
  .booking-summary { background: #f7f8f1; padding: 20px; margin-top: 0; border: 1px solid #dfe3d7; border-radius: 12px; }
  .booking-summary p, .booking-summary h3 { font-size: 15px; overflow-wrap: anywhere; }
  .booking-summary summary { min-height: 44px; align-items: center; font-size: 14px; }
  .booking-summary h2 { margin-bottom: 14px; }
  .booking-summary details { margin-block: 12px; padding-bottom: 8px; }
  .details-layout { gap: 26px; }
  .name-email { grid-template-columns: 1fr; gap: 20px; }
  .client-fields { gap: 20px; }
  .client-fields small { display: block; margin-top: 6px; font-size: 12px; color: #626e5c; }
  .details-page textarea { min-height: 120px; }
  .total-row { font-size: 18px; }
  .confirmation-card { padding: 24px; border-radius: 12px; }
  .confirmation-card p { font-size: 15px; }
  .confirmation-actions { flex-wrap: wrap; gap: 12px; }
  .login-page .booking-shell { max-width: 480px; margin-block: 30px; }
  /* Long catalogs use compact cards and horizontally swipeable filters. */
  .services-page .reservation-hero { min-height: 310px; padding: 24px 20px; }
  .services-page .reservation-panel { padding: 24px; background: #34483ae8; border-radius: 14px; max-width: 460px; }
  .services-page .reservation-panel h1 { font-size: 34px; text-transform: none; margin-bottom: 12px; }
  .services-page .reservation-panel h1 br { display: none; }
  .services-page .reservation-panel p { font-size: 14px; margin-bottom: 14px; line-height: 1.6; }
  .services-page .reservation-panel .eyebrow { font-size: 10px; }
  .services-page .category-buttons { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 8px; padding: 8px 2px 16px; margin-bottom: 12px; scrollbar-width: thin; }
  .services-page .category { flex: 0 0 auto; white-space: nowrap; padding: 10px 16px; border-color: #c5ceba; border-radius: 24px; }
  .services-page .category.active { background: #405642; color: white; border-color: #405642; }
  .services-page .catalog-heading { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  .services-page .service-row { grid-template-columns: 150px minmax(0,1fr); min-height: 0; border: 1px solid #e1e5db; border-radius: 14px; overflow: hidden; }
  .services-page .service-image { min-height: 0; }
  .services-page .service-copy { padding: 22px; }
  .services-page .service-copy h3 { font-size: 21px; }
  .services-page .service-copy .eyebrow { font-size: 10px; margin-bottom: 8px; }
  .services-page .service-description { margin-bottom: 10px; }
  .services-page .service-description summary { display: flex; align-items: center; min-height: 44px; font-size: 14px; }
  .services-page .service-description p { font-size: 14px; }
  .services-page .service-duration { margin-bottom: 0; font-size: 14px; }
  .services-page .service-price { font-size: 21px; font-weight: 600; margin-bottom: 16px; }
  .services-page .service-copy > .button { width: 100%; font-size: 14px; }
  .home-page .home-header { padding: 14px 20px 0; }
  .home-page .home-header .home-button { min-height: 44px; }
  .home-page .home-text-link { min-height: 44px; align-items: center; }
  .home-page .home-footer a { min-height: 44px; display: inline-flex; align-items: center; }
}
@media screen and (max-width: 550px) {
  .site-header { padding-inline: 16px; }
  .site-header .brand strong { font-size: 14px; }
  .site-header > .button { font-size: 11px; padding-inline: 9px; }
  .content-width { width: calc(100% - 32px); }
  .booking-shell { padding: 22px 16px; }
  .booking-steps { gap: 6px; font-size: 10px; }
  .calendar { padding: 8px; margin-inline: -4px; }
  .time-buttons { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .booking-summary { padding: 18px; }
  .schedule-page, .details-page { padding-bottom: calc(136px + env(safe-area-inset-bottom,0px)); }
  .booking-action {
    position: fixed; z-index: 10; bottom: 0; left: 0; right: 0;
    padding: 12px max(16px,env(safe-area-inset-right,0px)) calc(12px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));
    border-top: 1px solid #d7dfcf; background: #fffef8; box-shadow: 0 -4px 20px #2e452610;
  }
  .booking-action .full-width { margin-top: 0; min-height: 50px; background: #405642; border-color: #405642; }
  .booking-action .selected-summary { margin: 0 0 8px; padding: 0; background: none; font-size: 13px; line-height: 1.5; }
  .details-page:has(input:focus, textarea:focus, select:focus) .booking-action { position: static; padding: 0; box-shadow: none; border: 0; background: none; }
  .confirmation-actions { flex-direction: column; }
  .confirmation-actions > * { width: 100%; justify-content: center; }
  .services-page .reservation-hero { min-height: 0; padding: 20px 16px; }
  .services-page .reservation-panel { max-width: none; padding: 22px; }
  .services-page .service-row { grid-template-columns: 1fr; }
  .services-page .service-image { height: 140px; min-height: 0; }
  .services-page .service-copy { padding: 20px; }
  .services-page .service-copy h3 { margin-bottom: 4px; }
  .services-page .service-list { gap: 18px; }
  .home-page .welcome { padding-top: 0; }
  .home-page .welcome-copy { padding-block: 22px 12px; }
  .home-page .welcome h1 { font-size: clamp(45px,12.8vw,66px); line-height: 1.04; letter-spacing: -2px; margin-bottom: 20px; }
  .home-page .welcome-description { line-height: 1.7; margin-bottom: 20px; }
  .home-page .welcome-note { font-size: 12px; margin-top: 12px; }
  .home-page .welcome-actions { gap: 8px 16px; }
  .home-page .hero-photo { height: 285px; border-top-left-radius: 90px; }
  .home-page .photo-label { padding: 14px 18px; }
  .home-page .home-section { padding-block: 44px; }
  .home-page .home-footer > div { gap: 8px 24px; }
}
/* Admin tables become labelled cards; their original headers remain accessible. */
@media screen and (max-width: 650px) {
  .admin-page .site-header { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 12px; }
  .admin-page .site-header nav { grid-column: 1; grid-row: 2; border: 0; }
  .admin-page #admin-name { grid-column: 2; grid-row: 2; text-align: right; overflow-wrap: anywhere; }
  .admin-page #logout { grid-column: 2; grid-row: 1; }
  .admin-shell { padding: 24px 16px 44px; }
  .admin-title h1 { font-size: 28px; }
  .admin-title #zone { font-size: 12px; overflow-wrap: anywhere; }
  .admin-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
  .admin-tabs button { min-height: 48px; padding: 10px 4px; border-radius: 8px; font-size: 13px; }
  .admin-panel { padding: 20px 14px; border-radius: 12px; }
  .admin-panel h2 { font-size: 23px; }
  .admin-panel p, .admin-panel legend { font-size: 14px; overflow-wrap: anywhere; }
  .admin-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 10px; }
  .admin-filters label { min-width: 0; }
  .admin-filters > .button { grid-column: 1 / -1; }
  .admin-grid, .staff-list { grid-template-columns: minmax(0,1fr); }
  .mobile-card-table, .mobile-card-table tbody { display: block; }
  .mobile-card-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mobile-card-table tbody tr { display: grid; grid-template-columns: minmax(0,1fr); padding: 16px; border: 1px solid #dce3d4; border-radius: 12px; margin-bottom: 14px; background: #fcfdf8; }
  .mobile-card-table td { display: block; min-width: 0; padding: 10px 0; border-bottom: 1px solid #e7eadf; overflow-wrap: anywhere; font-size: 15px; }
  .mobile-card-table td::before { content: attr(data-label); display: block; font-size: 12px; color: #66745a; margin-bottom: 5px; }
  .mobile-card-table td:last-child { border: 0; padding-bottom: 0; }
  .mobile-card-table td:empty { display: none; }
  .mobile-card-table td details { max-width: none; }
  .mobile-card-table td summary { min-height: 44px; padding-block: 10px; }
  .mobile-card-table td .button { min-height: 44px; padding: 10px 12px; font-size: 13px; }
  .pager { gap: 8px; justify-content: space-between; flex-wrap: wrap; }
  .pager .button { padding-inline: 12px; }
  .pager span { font-size: 12px; }
  .staff-card { border-radius: 10px; padding: 18px; }
  .check { min-height: 48px; align-items: center; }
  .check input { width: 22px; height: 22px; min-height: 22px; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
  #add-booking-form > .button, #period-form > .button, #save-roster { width: 100%; margin: 0 0 10px; }
  #period-title { margin-top: 24px; }
  dialog { padding: 24px 20px; border-radius: 16px; max-height: calc(100dvh - 32px); overflow-y: auto; }
}
@media screen and (max-width: 360px) {
  .admin-filters { grid-template-columns: 1fr; }
  .site-header > .button { max-width: 115px; white-space: normal; text-align: center; }
}
@media screen and (max-height: 500px) {
  .booking-action { position: static; padding: 0; border: 0; box-shadow: none; }
  .schedule-page, .details-page { padding-bottom: 0; }
}
@media screen and (max-width: 800px) {
  .home-page .site-header .brand strong { font-size: 23px; letter-spacing: -.9px; }
  .home-page .site-header .brand span { font-size: 9px; letter-spacing: 2.2px; }
}
@media screen and (max-width: 550px) {
  .home-page .site-header .brand strong { font-size: 21px; }
  .home-page .site-header .brand span { font-size: 7px; }
}
