/* =====================================================================
 * HOMECARE — Home Services (M10 PART 02)
 * Token-driven browse + in-page service detail for the active unit.
 * 44px targets, 320/359px stacking, no horizontal overflow.
 * Booking CTA is a disabled placeholder until PART 03.
 * =================================================================== */

.hc-hs-page {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-4);
  padding-bottom: var(--hc-space-6);
  min-width: 0;
}

.hc-hs-heading h2 {
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-2xl);
  font-weight: var(--hc-font-weight-bold);
  letter-spacing: var(--hc-letter-tight);
}

.hc-hs-heading p {
  margin-top: var(--hc-space-1);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
}

/* ---- Active-unit hero ---- */
.hc-hs-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hc-space-3);
  padding: var(--hc-space-4);
  background: var(--hc-bg-surface);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius-lg);
  box-shadow: var(--hc-shadow-sm);
}

.hc-hs-hero__main {
  min-width: 0;
}

.hc-hs-hero__eyebrow {
  color: var(--hc-text-faint);
  font-size: var(--hc-font-size-xs);
  font-weight: var(--hc-font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hc-hs-hero__property {
  margin-top: var(--hc-space-1);
  color: var(--hc-text-strong);
  font-weight: var(--hc-font-weight-semibold);
  overflow-wrap: anywhere;
}

.hc-hs-hero__location {
  margin-top: var(--hc-space-1);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
  overflow-wrap: anywhere;
}

.hc-hs-hero__main > .hc-badge {
  margin-top: var(--hc-space-2);
}

.hc-hs-authority-note {
  margin-top: calc(-1 * var(--hc-space-2));
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
}

.hc-hs-hero__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--hc-radius-xl);
  background: var(--hc-color-accent-weak);
  color: var(--hc-color-primary);
}

.hc-hs-hero__note {
  display: flex;
  align-items: flex-start;
  gap: var(--hc-space-2);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
}

.hc-hs-hero__note-icon {
  flex: none;
  margin-top: 2px;
}

/* ---- Browse region ---- */
.hc-hs-view,
.hc-hs-browse {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: var(--hc-space-3);
}

.hc-hs-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: var(--hc-space-2);
  margin: 0;
  padding: var(--hc-space-3);
  background: var(--hc-bg-subtle);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius-md);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-xs);
}

.hc-hs-disclaimer__icon {
  flex: none;
  margin-top: 1px;
  color: var(--hc-color-primary);
}

/* Category filter chips */
.hc-hs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hc-space-2);
}

.hc-hs-chip {
  min-height: var(--hc-touch-target, 44px);
  padding: 0 var(--hc-space-4);
  border: 1px solid var(--hc-border-strong);
  border-radius: var(--hc-radius-pill);
  background: var(--hc-bg-surface);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
  font-weight: var(--hc-font-weight-medium);
  cursor: pointer;
}

.hc-hs-chip:hover {
  border-color: var(--hc-color-primary);
  color: var(--hc-color-primary);
}

.hc-hs-chip:focus-visible {
  outline: 2px solid var(--hc-border-focus);
  outline-offset: 2px;
  box-shadow: var(--hc-focus-ring);
}

.hc-hs-chip.is-active {
  background: var(--hc-color-primary-strong);
  border-color: var(--hc-color-primary-strong);
  color: var(--hc-text-inverse);
}

.hc-hs-result-count {
  margin: 0;
}

/* Service list + cards */
.hc-hs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--hc-space-3);
  min-width: 0;
}

.hc-hs-card {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-2);
  min-width: 0;
}

.hc-hs-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hc-space-2);
  flex-wrap: wrap;
}

.hc-hs-card__category {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hc-hs-card__title {
  margin: 0;
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-md);
  font-weight: var(--hc-font-weight-semibold);
  overflow-wrap: anywhere;
}

.hc-hs-card__summary {
  margin: 0;
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
  overflow-wrap: anywhere;
}

.hc-hs-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--hc-space-2);
  margin: 0;
  font-size: var(--hc-font-size-sm);
}

.hc-hs-card__meta > div {
  min-width: 0;
}

.hc-hs-card__meta dt {
  color: var(--hc-text-faint);
  font-size: var(--hc-font-size-xs);
}

.hc-hs-card__meta dd {
  margin: 2px 0 0;
  color: var(--hc-text-base);
  overflow-wrap: anywhere;
}

.hc-hs-card__price {
  color: var(--hc-text-strong);
  font-weight: var(--hc-font-weight-semibold);
}

.hc-hs-card__action {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--hc-space-1);
}

.hc-hs-card__unavailable-note {
  color: var(--hc-text-faint);
  font-size: var(--hc-font-size-xs);
  font-style: italic;
}

.hc-hs-card--unavailable {
  opacity: 0.72;
}

/* ---- Detail view ---- */
.hc-hs-detail {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-3);
  min-width: 0;
}

.hc-hs-detail__back {
  align-self: flex-start;
  min-height: var(--hc-touch-target, 44px);
}

.hc-hs-detail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hc-space-2);
  flex-wrap: wrap;
}

.hc-hs-detail__title {
  margin: var(--hc-space-2) 0 0;
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-xl);
  font-weight: var(--hc-font-weight-bold);
  letter-spacing: var(--hc-letter-tight);
  overflow-wrap: anywhere;
}

.hc-hs-detail__summary {
  margin: var(--hc-space-2) 0 0;
  color: var(--hc-text-base);
  font-size: var(--hc-font-size-sm);
  overflow-wrap: anywhere;
}

.hc-hs-detail__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--hc-space-2);
  margin: var(--hc-space-4) 0 0;
  padding: 0;
}

.hc-hs-detail__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: var(--hc-space-2) 0;
  border-bottom: 1px solid var(--hc-border);
}

.hc-hs-detail__row:last-child {
  border-bottom: 0;
}

.hc-hs-detail__row dt {
  color: var(--hc-text-faint);
  font-size: var(--hc-font-size-xs);
}

.hc-hs-detail__row dd {
  margin: 0;
  color: var(--hc-text-base);
  overflow-wrap: anywhere;
}

.hc-hs-detail__price {
  color: var(--hc-text-strong);
  font-weight: var(--hc-font-weight-semibold);
}

.hc-hs-detail__disclaimer {
  display: flex;
  align-items: flex-start;
  gap: var(--hc-space-2);
  margin: var(--hc-space-3) 0 0;
  padding: var(--hc-space-3);
  background: var(--hc-bg-subtle);
  border-radius: var(--hc-radius-md);
}

.hc-hs-detail__disclaimer .hc-icon {
  flex: none;
  margin-top: 1px;
  color: var(--hc-color-primary);
}

.hc-hs-detail__section {
  margin-top: var(--hc-space-4);
}

.hc-hs-detail__section-title {
  margin: 0 0 var(--hc-space-2);
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-sm);
  font-weight: var(--hc-font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hc-hs-detail__includes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-2);
}

.hc-hs-detail__includes li {
  display: flex;
  align-items: flex-start;
  gap: var(--hc-space-2);
  color: var(--hc-text-base);
  font-size: var(--hc-font-size-sm);
  overflow-wrap: anywhere;
}

.hc-hs-detail__includes .hc-icon {
  flex: none;
  margin-top: 2px;
  color: var(--hc-success, #1f8a52);
}

.hc-hs-detail__cta {
  margin-top: var(--hc-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-2);
}

.hc-hs-detail__soon {
  margin: 0;
  text-align: center;
}

/* ---- Back link ---- */
.hc-hs-back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--hc-space-2);
  min-height: var(--hc-touch-target, 44px);
  padding: 0 var(--hc-space-2);
  color: var(--hc-color-accent);
  font-size: var(--hc-font-size-sm);
  font-weight: var(--hc-font-weight-semibold);
  text-decoration: none;
  border-radius: var(--hc-radius-sm);
}

.hc-hs-back__icon {
  width: 18px;
  height: 18px;
  transform: rotate(180deg);
}

.hc-hs-back:focus-visible,
.hc-hs-detail__back:focus-visible,
.hc-hs-heading__bookings:focus-visible {
  outline: 2px solid var(--hc-border-focus);
  outline-offset: 2px;
  box-shadow: var(--hc-focus-ring);
}

.hc-hs-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--hc-space-3);
}

.hc-hs-heading__bookings {
  flex: none;
  min-height: var(--hc-touch-target, 44px);
}

/* ---- Booking list / status (PART 04) ---- */
.hc-hs-bookings,
.hc-hs-bookings-head,
.hc-hs-booking-detail {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-3);
  min-width: 0;
}

.hc-hs-booking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.hc-hs-booking-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--hc-space-2);
  width: 100%;
  min-height: var(--hc-touch-target, 44px);
  padding: var(--hc-space-3);
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hc-border);
  cursor: pointer;
}

.hc-hs-booking-row:last-child {
  border-bottom: 0;
}

.hc-hs-booking-row:focus-visible {
  outline: 2px solid var(--hc-border-focus);
  outline-offset: -2px;
}

.hc-hs-booking-row__main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.hc-hs-booking-row__ref {
  color: var(--hc-text-strong);
  font-weight: var(--hc-font-weight-semibold);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.hc-hs-booking-row__service {
  color: var(--hc-text-base);
  font-size: var(--hc-font-size-sm);
  overflow-wrap: anywhere;
}

.hc-hs-booking-row__time {
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-xs);
  overflow-wrap: anywhere;
}

.hc-hs-booking-row__side {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--hc-space-1);
}

.hc-hs-booking-row__chevron {
  display: inline-flex;
  color: var(--hc-text-faint);
}

/* ---- Booking form ---- */
.hc-hs-form {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-3);
  min-width: 0;
}

.hc-hs-form__title {
  margin: 0;
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-lg);
  font-weight: var(--hc-font-weight-bold);
  overflow-wrap: anywhere;
}

.hc-hs-form__hint {
  display: flex;
  align-items: flex-start;
  gap: var(--hc-space-2);
  margin: 0;
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-xs);
}

.hc-hs-form__hint .hc-icon {
  flex: none;
  margin-top: 1px;
  color: var(--hc-color-primary);
}

.hc-hs-form__actions {
  display: flex;
  gap: var(--hc-space-2);
  margin-top: var(--hc-space-2);
}

.hc-hs-form__actions .hc-btn {
  flex: 1 1 auto;
  min-height: var(--hc-touch-target, 44px);
}

.hc-hs-form__alert {
  margin: 0;
  color: var(--hc-danger-600);
  font-size: var(--hc-font-size-sm);
}

/* ---- Summary ---- */
.hc-hs-summary,
.hc-hs-success {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-3);
  min-width: 0;
}

.hc-hs-summary__slot-note {
  display: flex;
  align-items: flex-start;
  gap: var(--hc-space-2);
  margin: var(--hc-space-3) 0 0;
  padding: var(--hc-space-3);
  background: var(--hc-bg-subtle);
  border-radius: var(--hc-radius-md);
}

.hc-hs-summary__slot-note .hc-icon {
  flex: none;
  margin-top: 1px;
  color: var(--hc-color-primary);
}

.hc-hs-summary__note {
  margin: 0;
  color: var(--hc-text-base);
  font-size: var(--hc-font-size-sm);
  overflow-wrap: anywhere;
}

/* ---- Success ---- */
.hc-hs-success__card {
  text-align: center;
}

.hc-hs-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: var(--hc-space-2);
  border-radius: var(--hc-radius-xl);
  background: var(--hc-color-accent-weak);
  color: var(--hc-success, #1f8a52);
}

.hc-hs-success__icon .hc-icon {
  width: 36px;
  height: 36px;
}

.hc-hs-success__title {
  margin: 0;
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-xl);
  font-weight: var(--hc-font-weight-bold);
  overflow-wrap: anywhere;
}

.hc-hs-success__message {
  margin: var(--hc-space-2) 0;
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
}

.hc-hs-success__status {
  align-self: center;
}

.hc-hs-success .hc-hs-detail__meta,
.hc-hs-success .hc-hs-form__actions {
  text-align: left;
}

.hc-hs-created__eyebrow,
.hc-hs-created__eyebrow {
  color: var(--hc-text-faint);
  font-size: var(--hc-font-size-xs);
  font-weight: var(--hc-font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- CR-HC-02 PART 03: resident service progress ---- */
.hc-hs-progress {
  display: grid;
  gap: var(--hc-space-3);
  margin-top: var(--hc-space-3);
}

.hc-hs-progress__steps {
  display: grid;
  gap: var(--hc-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hc-hs-progress__step {
  display: flex;
  align-items: center;
  gap: var(--hc-space-2);
  color: var(--hc-text-faint);
  font-size: var(--hc-font-size-sm);
}

.hc-hs-progress__label {
  overflow-wrap: anywhere;
}

.hc-hs-progress__step--upcoming {
  color: var(--hc-text-faint);
}

.hc-hs-progress__dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--hc-border);
  flex: 0 0 auto;
}

.hc-hs-progress__step--complete {
  color: var(--hc-text-muted);
}

.hc-hs-progress__step--complete .hc-hs-progress__dot {
  background: var(--hc-success-500);
}

.hc-hs-progress__step--current {
  color: var(--hc-text-strong, var(--hc-text-muted));
  font-weight: var(--hc-font-weight-semibold);
}

.hc-hs-progress__step--current .hc-hs-progress__dot {
  background: var(--hc-color-primary);
  box-shadow: 0 0 0 3px var(--hc-success-50);
}

.hc-hs-progress__actions {
  display: grid;
  gap: var(--hc-space-2);
}

.hc-hs-progress__form {
  display: grid;
  gap: var(--hc-space-2);
}

.hc-hs-progress__fm {
  margin-top: var(--hc-space-2);
}

/* ---- Narrow phones ---- */
@media (max-width: 359px) {
  .hc-hs-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hc-hs-card__meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .hc-hs-chip {
    flex: 1 1 auto;
  }

  .hc-hs-form__actions {
    flex-direction: column;
  }

  .hc-hs-booking-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .hc-hs-booking-row__side {
    justify-content: flex-start;
  }

  .hc-hs-booking-row__chevron {
    display: none;
  }
}
