/*
  Demo shell: chrome, picker, and the live layout grid.
  Thread bubbles and booking controls live in demo-thread.css and demo-booking.css.
*/

html:has(.demo-app),
body:has(.demo-app) {
  height: 100%;
  overflow: hidden;
}

.demo-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--gsu-ice);
  color: var(--gsu-navy);
  /* Keyboard inset is set from visualViewport. Safe area clears the home indicator. */
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--gsu-keyboard, 0px));
}

.demo-skip {
  position: absolute;
  left: var(--gsu-s-4);
  top: var(--gsu-s-4);
  z-index: 3;
  padding: 8px 12px;
  border-radius: var(--gsu-r-pill);
  background: var(--gsu-lime);
  color: var(--gsu-navy);
  font-weight: 600;
  transform: translateY(-150%);
}

.demo-skip:focus {
  transform: none;
  color: var(--gsu-navy);
  text-decoration: none;
}

.demo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gsu-s-5);
  flex: 0 0 auto;
  box-sizing: border-box;
  min-height: calc(73px + env(safe-area-inset-top, 0px));
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(32px, env(safe-area-inset-right, 0px)) 14px max(32px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--gsu-navy);
  background: var(--gsu-white);
}

/* Reserve the lockup before JS paints it, so the bar does not grow. */
#demo-lockup {
  min-height: 44px;
}

.demo-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.demo-brand-rule {
  flex: 0 0 auto;
  width: 1px;
  height: 22px;
  background: var(--gsu-rule-soft);
}

.demo-switch {
  height: 44px;
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
}

.demo-stage {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.demo-app[data-phase="pick"] #live,
.demo-app[data-phase="live"] #picker {
  display: none;
}

#picker,
#live {
  flex: 1 1 auto;
  min-height: 0;
}

#picker {
  display: flex;
  flex-direction: column;
  gap: 32px;
  overflow: auto;
  padding: 48px 48px 40px;
}

#live {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
}

.gsu-in {
  animation: gsu-in 0.4s ease both;
}

/* ---- Picker ---- */

.demo-picker-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.demo-picker-kicker {
  margin: 0 0 12px;
  color: var(--gsu-cobalt);
}

.demo-picker-title {
  margin: 0;
  font-family: var(--gsu-font-sans);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: pretty;
}

.demo-picker-lead {
  margin: 0;
  max-width: 44ch;
  color: var(--gsu-body);
  font-size: 16px;
  line-height: 1.6;
}

.demo-error-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.demo-error {
  margin: 0;
  color: var(--gsu-navy);
  font-size: 14px;
  font-weight: 600;
}

.demo-scripted {
  width: fit-content;
}

.demo-scripted[hidden] {
  display: none;
}

.demo-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.stylist-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid var(--gsu-navy);
  border-radius: var(--gsu-r-panel);
  background: var(--gsu-white);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stylist-card:hover {
  transform: translateY(-4px);
  box-shadow: 6px 6px 0 var(--gsu-navy);
}

.stylist-card:active {
  transform: scale(0.98);
  box-shadow: none;
}

.stylist-card:focus-visible {
  outline: 2px solid var(--gsu-cobalt);
  outline-offset: 3px;
}

.stylist-card-photo {
  height: 300px;
  border-bottom: 1px solid var(--gsu-navy);
  background: var(--gsu-ice);
}

.stylist-card-photo img,
.demo-profile-photo img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  padding-top: 14px;
  object-fit: contain;
  object-position: center bottom;
  background: var(--gsu-ice);
}

.stylist-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  padding: 20px 20px 22px;
}

.stylist-card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.stylist-card-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stylist-card-with,
.stylist-card-cuts-line {
  color: var(--gsu-gray);
  font-family: var(--gsu-font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.stylist-card-cuts-line {
  display: none;
  margin: 0;
  color: var(--gsu-body);
  font-family: var(--gsu-font-sans);
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}

.stylist-card-blurb {
  margin: 0;
  color: var(--gsu-body);
  font-size: 14px;
  line-height: 1.55;
  text-wrap: pretty;
}

.stylist-card-pills,
.demo-profile-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stylist-card-pills {
  margin-top: auto;
}

.stylist-try {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: var(--gsu-r-pill);
  background: var(--gsu-cobalt);
  color: var(--gsu-white);
  font-size: 14px;
  font-weight: 600;
}

/* ---- Live shell ---- */

#live-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--gsu-navy);
  background: var(--gsu-white);
}

.demo-profile-photo {
  flex: 0 0 auto;
  height: 230px;
  border-bottom: 1px solid var(--gsu-navy);
  background: var(--gsu-ice);
}

.demo-profile-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 0;
}

.demo-profile-title,
.demo-mobile-name,
.demo-mobile-meta,
#thread-title,
.demo-thread-kicker {
  margin: 0;
}

.demo-profile-title {
  margin-bottom: 6px;
  color: var(--gsu-cobalt);
  font-family: var(--gsu-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.demo-profile-name {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.demo-sidebar-rest {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 22px 24px;
}

.demo-thread-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--gsu-ice);
}

#mobile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--gsu-rule-soft);
  background: var(--gsu-white);
}

.demo-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gsu-navy);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.demo-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--gsu-navy);
  border-radius: var(--gsu-r-pill);
  background: var(--gsu-ice);
}

.demo-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.demo-mobile-id {
  flex: 1 1 auto;
  min-width: 0;
}

.demo-mobile-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.demo-mobile-meta {
  color: var(--gsu-gray);
  font-family: var(--gsu-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

#booking-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--gsu-navy);
  background: var(--gsu-white);
}

#thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gsu-s-4);
  padding: 14px 28px;
  border-bottom: 1px solid var(--gsu-navy);
  background: var(--gsu-white);
}

.demo-thread-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#thread-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.demo-thread-kicker {
  color: var(--gsu-gray);
  font-family: var(--gsu-font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

#channel-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

#thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.demo-compose {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 12px;
  padding: 14px 28px;
  border-top: 1px solid var(--gsu-navy);
  background: var(--gsu-white);
}

#composer:empty,
#call-bar:empty,
#suggestions:empty,
#phone-row:empty,
#channel-pills:empty,
#booking-panel:empty,
#setup-chips:empty,
#mobile-call:empty {
  display: none;
}

@media (max-width: 1023px) {
  .demo-topbar {
    box-sizing: border-box;
    min-height: calc(65px + env(safe-area-inset-top, 0px));
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  }

  #topbar-actions {
    display: none;
  }

  #picker {
    gap: 16px;
    padding: 20px 16px 24px;
  }

  .demo-picker-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .demo-picker-kicker {
    margin-bottom: 8px;
    font-size: 10px;
  }

  .demo-picker-title {
    font-size: 28px;
    letter-spacing: -0.03em;
    line-height: 1.08;
  }

  .demo-picker-lead {
    display: none;
  }

  .demo-picker-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stylist-card-photo {
    height: 150px;
  }

  .stylist-card-body {
    gap: 6px;
    padding: 12px;
  }

  .stylist-card-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .stylist-card-title {
    font-size: 19px;
    letter-spacing: -0.02em;
  }

  .stylist-card-with {
    font-size: 10px;
  }

  .stylist-card-blurb,
  .stylist-card-pills {
    display: none;
  }

  .stylist-card-cuts-line {
    display: block;
  }

  .stylist-try {
    align-self: flex-start;
    height: 30px;
    margin-top: 4px;
    padding: 0 12px;
    font-size: 12px;
  }

  #live {
    display: flex;
    flex-direction: column;
  }

  #live-sidebar,
  #thread-header {
    display: none;
  }

  .demo-thread-col {
    flex: 1 1 auto;
  }

  .demo-compose {
    gap: 8px;
    padding: 10px 12px 20px;
  }
}

@media (min-width: 1024px) {
  #mobile-head,
  #booking-strip {
    display: none;
  }
}

@media (hover: none) {
  .stylist-card:hover {
    transform: none;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gsu-in,
  .stylist-card {
    animation: none !important;
    transition: none !important;
  }
}
