/* A viewport-sized home. Only a long people list needs its own scrolling area. */
html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.topbar {
  flex: 0 0 auto;
  width: 100%;
  height: calc(clamp(52px, 8dvh, 90px) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
}
.top-right {
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
  margin-left: 12px;
}
.wordmark,
#profile-initial {
  flex-shrink: 0;
}
.profile-button {
  min-width: 0;
}
.profile-button #profile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  margin: 0 auto;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.home {
  display: grid;
  grid-template-areas: "composer" "friends" "footer";
  grid-template-rows: minmax(0, 1fr) minmax(128px, 0.5fr) auto;
  gap: clamp(10px, 2dvh, 18px);
  padding-top: 0;
}
.home .composer-section {
  min-width: 0;
  grid-area: composer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}
.home .home-companion {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  max-height: min(27dvh, 230px);
  margin-bottom: 8px;
}
.home .home-companion img {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.home .companion-halo {
  height: 100%;
  max-height: 215px;
  max-width: 100%;
}
.home .companion-note {
  top: 40%;
}
.home #home-heading {
  flex: 0 0 auto;
}
.home #home-heading h1 {
  font-size: clamp(25px, 3.8dvh, 36px);
}
.home #home-heading .eyebrow {
  font-size: 8px;
  margin-bottom: 6px;
}
.home #home-heading p {
  margin-top: 6px;
  font-size: 13px;
}
.composer {
  flex: 0 0 auto;
  margin-top: clamp(10px, 2dvh, 20px);
}
.composer textarea {
  min-height: 42px;
  max-height: 72px;
  padding: 13px 18px 4px;
  font-size: 16px;
  overflow-y: auto;
}
.composer.settled textarea {
  min-height: 55px;
  max-height: 55px;
  padding-top: 13px;
  padding-left: 18px;
  line-height: 21px;
  overflow: hidden;
}
.start-button {
  min-height: 48px;
  padding: 8px 18px 14px;
  font-size: 20px;
}
.composer.settled .start-button {
  padding-bottom: 14px;
}
.edit-status {
  top: 10px;
  right: 14px;
}
.prejoin {
  flex: 0 0 auto;
  margin: 10px 0 0;
}
.small-control {
  min-height: 34px;
  padding: 7px 10px;
}
.privacy-note {
  flex: 0 0 auto;
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.4;
}
.resume-button {
  flex: 0 0 auto;
  min-height: 38px;
  margin-top: 8px;
  padding: 10px 12px;
  font-size: 12px;
}
.home .friends-section {
  grid-area: friends;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.home .section-heading {
  flex: 0 0 auto;
  padding-bottom: 8px;
}
.home .friends {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 4px;
  margin: 0 -4px;
  scrollbar-width: thin;
}
.home .friend-row {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 7px 8px;
}
.home .friend-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
}
.home .empty-note {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  align-content: center;
  padding: 12px 0;
  font-size: 12px;
  line-height: 1.5;
}
.home .friends:empty {
  display: none;
}
.home .home-footer {
  grid-area: footer;
  margin: 0;
  font-size: 10px;
}
.home .tiny-flower {
  font-size: 16px;
}
.home.has-invite {
  --people-min: 128px;
  grid-template-areas: "invitation" "composer" "friends" "footer";
  grid-template-rows: auto minmax(0, 1fr) minmax(
      var(--people-min),
      0.45fr
    ) auto;
}
.home.has-invite .invitation {
  grid-area: invitation;
  padding-top: 0;
}
.home.has-invite .invitation .eyebrow {
  font-size: 8px;
  margin-bottom: 6px;
}
.home.has-invite .invitation h1 {
  font-size: clamp(20px, 2.9dvh, 28px);
  line-height: 1.2;
}
.home.has-invite .invitation p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
}
.home.has-invite .invitation .primary {
  min-height: 44px;
  margin-top: 10px;
  padding: 11px 16px;
}
.home.has-invite .home-companion {
  height: auto;
  max-height: min(15dvh, 125px);
}
.home.has-invite .home-companion img {
  height: 100%;
}
.home.has-invite #home-heading h1 {
  font-size: 18px;
  line-height: 1.3;
}
.home.has-invite #home-heading p {
  display: none;
}
.home.has-invite .composer {
  margin-top: 10px;
}
.home.has-invite:has(.invitation.available) {
  --people-min: 84px;
}
@media (max-width: 760px) {
  .topbar {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }
  .wordmark {
    font-size: 30px;
  }
  .home {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
  .home .companion-note {
    display: none;
  }
  .home.editing-status .home-companion {
    display: none;
  }
  .home.editing-status .composer-section {
    justify-content: flex-start;
  }
}
@media (max-height: 620px) {
  .home:has(#resume-button:not([hidden])) .home-companion {
    display: none;
  }
  .home #home-heading :is(.eyebrow, p) {
    display: none;
  }
  .home .companion-note {
    display: none;
  }
}
@media (max-width: 599px) and (max-height: 760px) {
  .home.has-invite {
    grid-template-areas: "invitation" "composer" "friends";
    grid-template-rows: auto minmax(0, 1fr) minmax(104px, 0.45fr);
    gap: 10px;
  }
  .home.has-invite :is(.home-companion, .home-footer, .invitation .eyebrow) {
    display: none;
  }
  .home.has-invite .invitation p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
@media (max-height: 540px) {
  .home {
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "composer" "friends";
    gap: 8px;
  }
  .home :is(.home-companion, .home-footer) {
    display: none;
  }
  .home.editing-status #home-heading {
    display: none;
  }
}
@media (max-width: 599px) and (max-height: 540px) {
  .home.has-invite {
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  .home.has-invite.editing-status .invitation {
    display: none;
  }
}
@media (min-width: 600px) and (max-height: 540px) {
  .home {
    max-width: 1000px;
    grid-template-columns: minmax(0, 1.15fr) minmax(240px, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "composer friends";
    column-gap: 30px;
  }
}

@media (min-width: 600px) and (max-height: 540px) {
  .home.has-invite {
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "invitation friends" "composer friends";
  }
  .home.has-invite #home-heading,
  .home.has-invite .invitation .eyebrow {
    display: none;
  }
  .home.has-invite .invitation p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Keep the action distinct while preserving the single friendly composer. */
.composer.settled {
  cursor: default;
}
.composer.settled textarea {
  pointer-events: auto;
  cursor: text;
}
.composer .start-button {
  margin: 4px 8px 8px;
  width: calc(100% - 16px);
  min-height: 59px;
  padding: 9px 12px;
  border-radius: 15px;
  gap: 12px;
  background: linear-gradient(120deg, #ffe5a0, #f1d580);
  box-shadow:
    inset 0 1px 0 #fff4d1,
    0 2px 14px #e4bd5140;
  color: #48512a;
}
.composer .start-button:not(:disabled) {
  animation: invitation-glow 3.8s ease-in-out infinite;
}
.composer .start-button:disabled {
  animation: none;
}
.start-copy {
  display: block;
  min-width: 0;
  flex: 1;
}
.start-copy > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 19px;
  line-height: 1.2;
}
.start-copy > small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 450;
  letter-spacing: 0;
  color: #827248;
}
@keyframes invitation-glow {
  50% {
    box-shadow:
      inset 0 1px 0 #fff6dc,
      0 2px 18px #e0b54275;
  }
}
@media (max-height: 600px) {
  .composer .start-button {
    min-height: 50px;
    padding: 7px 11px;
    margin-top: 2px;
    margin-bottom: 6px;
  }
  .start-copy > span {
    font-size: 17px;
  }
  .start-copy > small {
    font-size: 10px;
    margin-top: 2px;
  }
}

/* 07 · Brushstroke: the selected tilted wordmark and yellow swipe. */
.home #home-heading h1 {
  position: relative;
  isolation: isolate;
  display: inline-block;
  margin: 0 0 10px;
  color: #414b31;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(36px, 6dvh, 51px);
  line-height: 1.04;
  letter-spacing: -3px;
  font-weight: 900;
  font-style: italic;
  transform: rotate(-5deg);
}
.home #home-heading h1::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -12px;
  right: -9px;
  top: 51%;
  height: 0.51em;
  background: #e7cc78;
  clip-path: polygon(2% 12%, 100% 0, 97% 81%, 0 100%);
  transform: rotate(-1deg);
}
.home #home-heading p {
  max-width: 360px;
  margin: 5px auto 0;
  font-size: 13px;
  line-height: 1.55;
}
.home:not(.has-invite) .companion-halo {
  width: min(196px, 70%);
  height: 75%;
  max-height: 153px;
  bottom: 12%;
  background: #e1e4c6;
  transform: rotate(-6deg);
  border-radius: 48% 52% 38% 58%;
}
.home.unregistered
  :is(#composer, .prejoin, #prejoin-note, #resume-button, .friends-section) {
  display: none;
}
.home.unregistered.has-invite .composer-section {
  display: none;
}
.home.unregistered.has-invite {
  grid-template-areas: "invitation" "footer";
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
}
.home.unregistered.has-invite .invitation {
  align-self: center;
}
.home.welcome {
  max-width: 580px;
  grid-template-areas: "composer" "footer";
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
}
.home.welcome .home-companion {
  flex: 0 1 230px;
  min-height: 80px;
}
.welcome-gate {
  flex: 0 0 auto;
  max-width: 390px;
  width: 100%;
  margin: clamp(20px, 4dvh, 36px) auto 0;
  padding: 23px 18px 15px;
  border: 1px solid #d9d6be;
  border-radius: 15px 21px 16px 20px;
  background: #f7f2df;
  box-shadow: 2px 3px 0 #d9cd9f;
}
.welcome-gate h2 {
  font-size: 19px;
  letter-spacing: -0.4px;
}
.welcome-gate > p {
  margin: 8px auto 10px;
  max-width: 260px;
  font-size: 14px;
  line-height: 1.55;
}
.welcome-return {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 13px;
}
#home-signin {
  min-height: 44px;
  padding: 10px 6px;
  font-weight: 650;
}
#account-invitation-step > p {
  margin: 12px 0 18px;
}
#account-invitation-step button {
  min-height: 44px;
}
@media (max-height: 620px) {
  .home #home-heading h1 {
    font-size: 34px;
    margin-bottom: 6px;
  }
  .home.welcome #home-heading p {
    display: block;
  }
  .home.welcome .home-companion {
    flex-basis: 130px;
  }
  .welcome-gate {
    margin-top: 18px;
    padding-top: 16px;
    padding-bottom: 8px;
  }
}
@media (max-height: 440px) {
  .home.welcome .home-companion {
    display: none;
  }
  .home.welcome .composer-section {
    justify-content: center;
  }
  .home.welcome #home-heading p {
    display: none;
  }
  .welcome-gate {
    margin-top: 12px;
  }
}
