/* Homepage CSS, loaded last. The kit owns layout, type and components; this file only sets
   panel heights per card group, what sits inside a visual, and the two-pane app frame. */

.card { --c-text: var(--ink); }
#steps .panel { --p-h: 336px; }
#packages .panel { --p-h: 440px; }

@media (max-width: 639px) {
  :is(#steps, #packages) .panel { --p-h: 300px; }
  #questions .faq__item:nth-child(n+4) { display: none; }
  .hero__media .stage { --fade-h: 24px; }
  .hero__media .ui-doc__text:nth-of-type(n+5) { display: none; }
}

/* a phone: the hero holds the two assistant chips and still ends at the fold, so the picture under
   them starts a little closer and gives up a few pixels of its least height */
@media (max-width: 639px) {
  .hero__text > .ic-chip-row { margin-top: var(--s-4); }
  .hero--split .hero__media { min-height: 220px; margin-top: var(--s-5); }
}

/* 1024 to 1279: three cards stay three across */
@media (min-width: 1024px) and (max-width: 1279px) {
  :is(#steps, #packages) .grid > .card { grid-column: auto / span 4; }
  #steps .panel { --p-h: 280px; }
  #packages .panel { --p-h: 280px; }
}

/* the tablet: two screens each; the card rows share what the screens leave, so the panels grow to fill them */
@media (min-width: 640px) and (max-width: 1023px) {
  :is(#steps, #packages) { --h: 2; }
  :is(#steps, #packages) .panel { --p-h: 420px; }
  :is(#steps, #packages) > .wrap > .grid { flex: 1 0 auto; }
}
/* a phone: the same, so no card row ends short of its second screen */
@media (max-width: 639px) { :is(#steps, #packages) > .wrap > .grid { flex: 1 0 auto; } }

/* the questions' heading, intro and link stay together at the top of their column, beside the list */
#questions .section-head { align-content: start; }

/* the tablet: the questions run down to the screen's foot, each row taking an equal share of what is left */
@media (min-width: 640px) and (max-width: 1023px) {
  #questions .grid { flex: 1 0 auto; grid-template-rows: auto 1fr; }
  #questions .faq { display: flex; flex-direction: column; }
  #questions .faq__item { flex: 1 0 auto; align-content: center; }
}

/* the file's picture keeps its 5:4 shape beside the words on a desktop; stacked under them on a tablet
   or a phone it takes what the screen leaves (the kit's .grid.fill and .frame--fill), and the section
   grows instead when the words leave less than the frame's least height */
@media (min-width: 1024px) { :is(#file, #assistants) .grid.fill { flex: none; } }
@media (max-width: 1023px) { :is(#file, #assistants) .grid.fill { flex: 1 0 auto; } }
/* a phone leaves the file's picture too short for its side note, which would sit on the person's name */
@media (max-width: 639px) { #file .ui-doc__note { display: none; } }

/* the pause button belongs to the conversation's loop, so it leaves the frame with that tab */
#assistants .frame:has(> #assistants-screen-order[hidden]) > .loop-pause { display: none; }
/* the assistant's mark on its small round message tile */
#assistants .ui-msg__av img { width: 14px; height: 14px; }
/* a phone: the frame under the tabs is short, so the section's opening line makes room for it, and
   the conversation ends on the order's answer instead of cutting the later message in half */
@media (max-width: 639px) {
  #assistants .t-lead { display: none; }
  #assistants .ui-chat__body > :nth-child(n+4) { display: none; }
}

/* below the desktop the teal section's wipe keeps a clear 20px frame, never a sliver at the seam */
@media (max-width: 1023px) { #report { --mo-gap: 20px; } }

/* a phone: the footer fits one screen without its brand block; the header above it carries the name */
@media (max-width: 639px) { .closing__links > .grid > .span-4 { display: none; } }

@media (min-width: 640px) { .app .ui-doc { width: 100%; padding-right: 232px; } }

/* app frame: one window across the wrap, the order list beside the open finding */
.app.ui { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: var(--s-7); background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); box-shadow: var(--u-shadow); }
.app > .app__pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.app > .app__pane + .app__pane { border-left: 1px solid var(--u-line); }
.app > .app__pane > .ui-panel { width: 100%; border: 0; border-radius: 0; box-shadow: none; }
.app > .app__pane::after { content: ""; position: absolute; inset: auto 0 0 0; height: 64px; background: linear-gradient(transparent, var(--u-bg)); pointer-events: none; }

@media (min-width: 1024px) and (max-width: 1279px) { .app.ui { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }

@media (max-width: 1023px) {
  .app.ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app > .app__pane--list { max-height: 252px; }
  .app > .app__pane--list::after { display: none; }
  .app .ui-win__side { display: none; }
  .app .ui-win__body { grid-template-columns: minmax(0, 1fr); }
  .app > .app__pane + .app__pane { border-left: 0; border-top: 1px solid var(--u-line); }
}

@media (max-width: 639px) {
  .app.ui { grid-template-rows: minmax(0, 1fr); }
  .app > .app__pane--list { display: none; }
  .app > .app__pane + .app__pane { border-top: 0; }
}
