/* The case and display each keep their physical proportions, independent of app content. */
.phone {
  position: relative;
  width: 100%;
  max-width: min(78vw, 320px);
  aspect-ratio: 71.5 / 149.6;
  align-self: start;
  justify-self: center;
  margin-inline: auto;
  border-radius: 14.6% / 7%;
  box-shadow: inset 0 0 0 2px var(--color-device-trim, var(--color-ink));
  background: var(--color-device-case, var(--color-ink));
  font-family: var(--font-device, system-ui);
  color: var(--color-ink);
}
.phone::before, .phone::after {
  content: "";
  position: absolute;
  top: 19%;
  left: -2px;
  width: 2px;
  height: 6.5%;
  border-radius: 2px 0 0 2px;
  background: var(--color-device-trim, var(--color-ink));
}
.phone::after { left: auto; right: -2px; top: 23.5%; height: 8%; border-radius: 0 2px 2px 0; }
.screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 94.5%;
  aspect-ratio: 393 / 852;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 13% / 6%;
  background: var(--color-device-screen, var(--color-ground));
}
.status-bar {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 37px;
  padding: 4px 7% 0 8%;
  font-size: var(--type-small);
  line-height: 1;
  font-weight: 700;
}
.status-bar svg { width: 17%; height: auto; margin-inline-start: auto; }
.island {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 22%;
  aspect-ratio: 63 / 17;
  border-radius: 20px;
  background: var(--color-device-case, var(--color-ink));
}
.contact {
  position: relative;
  flex: none;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 4px 0 9px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-ink) 17%, var(--color-ground));
  font-size: var(--type-small);
  font-weight: 600;
  line-height: 1.2;
}
.back { position: absolute; left: 13px; top: 18px; width: 20px; height: 20px; color: var(--color-brand); }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; color: var(--color-ink); background: var(--color-tint); }
.avatar svg { width: 27px; height: 27px; }

/* The body scrolls within the glass. The optional bottom slot stays above the home indicator. */
.screen > :is(.phone-content, .thread, .pick) {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  padding-bottom: 16px;
  mask-image: linear-gradient(to bottom, black calc(100% - 14px), transparent);
}
.phone-content:focus-visible { outline-offset: -4px; }
.phone-bottom, .home-bar { flex: none; }
.home-bar {
  width: 31%;
  height: 4px;
  margin: 5px auto 8px;
  border-radius: 20px;
  background: var(--color-device-case, var(--color-ink));
}
.thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  font-size: var(--type-body);
  font-weight: 400;
  line-height: 1.32;
  letter-spacing: -.016em;
}
.message { display: flex; position: relative; }
.incoming { margin-right: 15px; }
.outgoing { align-self: flex-end; }
.sender { display: none; }
.bubble {
  position: relative;
  width: fit-content;
  padding: 12px 13px;
  border-radius: 18px;
  color: var(--color-ink);
  background: var(--color-ground);
}
.bubble::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  bottom: 0;
  left: -3px;
  background: inherit;
  clip-path: polygon(35% 0, 100% 75%, 75% 94%, 0 100%, 24% 74%);
}
.incoming .bubble { background: var(--color-paper); }
.outgoing .bubble { background: var(--color-brand); color: var(--color-on-brand); }
.outgoing .bubble::after { left: auto; right: -3px; transform: scaleX(-1); }
.bubble b { font-weight: 650; }
.yes {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-width: 4rem;
  min-height: 44px;
  padding: 2px 10px;
  margin-top: 6px;
  border: 1px solid var(--color-brand);
  border-radius: 100px;
  cursor: pointer;
  background: var(--color-ground);
  color: var(--color-brand);
  font: 650 var(--type-body)/1.2 var(--font-device, system-ui);
}
@media (hover: hover) { .yes:hover { background: var(--color-paper); } }
.yes svg { display: none; width: .88rem; height: .88rem; }
.yes[aria-pressed="true"] { color: var(--color-on-brand); background: var(--color-brand); }
.yes[aria-pressed="true"] svg { display: block; }

/* Optional event listing. Each skin supplies its own tag colours and borders. */
.listing { width: min(100%, 22rem); justify-self: center; container: listing / inline-size; }
.listing .screen { container: listing / inline-size; }
.listing :is(.goal, .tags) {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--space-2);
}
.listing .goal { width: fit-content; max-width: 100%; }
.listing .goal svg { flex: none; width: 1rem; height: 1rem; }
.listing .goal .goal-chevron { width: .75rem; }
.listing .tags .tag { min-width: min-content; text-align: center; }
.listing .event-actions { display: flex; align-items: center; gap: var(--space-2); }
.listing .event-details { display: grid; place-items: center; flex: none; width: 3rem; min-height: 3rem; }
.listing .event-details svg { width: 1.25rem; height: 1.25rem; }
.listing .tags .score { flex: none; margin-inline-start: auto; }
@media (max-width: 46.99rem) {
  .listing { width: min(100vw, max(100%, 10em), 22rem); }
}
@container listing (max-width: 18em) {
  .listing .product-card { padding-inline: var(--space-3); }
  .listing .tags { gap: .2rem; }
  .listing .tags > * { padding-inline: .2rem; }
}
@container listing (max-width: 12em) {
  .listing .pick, .listing .product-card { padding-inline: .125rem; }
  .listing .tags > * { padding-inline: .1rem; }
  .listing .goal { gap: 2px; padding-inline: 3px; letter-spacing: -.025em; }
  .listing .goal svg { width: 14px; }
  .listing .goal .goal-chevron { width: 10px; }
}

.ticket {
  --ticket-padding: clamp(1.12rem, 3.2vw, 2.75rem);
  padding: var(--ticket-padding);
  background: var(--color-paper);
  color: var(--color-ink);
  border-top: .65rem solid var(--color-panel);
}
.seats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8em), 1fr));
  align-items: baseline;
  gap: clamp(.35rem, 1vw, .9rem);
  font: 650 var(--type-body)/1.3 var(--font-mono);
}
.seat-pair { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: clamp(.35rem, 1vw, .9rem); }
.assignment strong { font-size: var(--type-figure); letter-spacing: -.015em; }
.assignment svg { width: 100%; max-width: 8rem; height: auto; margin-top: .45rem; color: var(--color-brand); }
.cost {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .45rem 1rem;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 2px dashed var(--color-ink);
}
.cost::before, .cost::after {
  content: "";
  position: absolute;
  top: -9px;
  left: calc(0px - var(--ticket-padding));
  width: 8px;
  height: 16px;
  background: var(--color-ink);
  border-radius: 0 8px 8px 0;
}
.cost::after { left: auto; right: calc(0px - var(--ticket-padding)); transform: rotate(180deg); }
.cost s { font: 600 var(--type-body)/1.4 var(--font-mono); }
.cost strong { font-size: var(--type-h2); font-weight: 1000; line-height: 1; letter-spacing: normal; }

/* A command or price stays inside its own frame with its action. */
.installer {
  min-width: 0; padding: 20px; border-radius: 0 var(--radius-corner) 0 0;
  color: var(--color-ink); background: var(--color-ground); box-shadow: 5px 5px 0 var(--color-panel);
}
.install-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.install-heading h2 { font-size: var(--type-h3); line-height: 1.1; }
.install-heading p { font-weight: 750; }
.tabs { display: flex; flex-wrap: wrap; align-items: stretch; gap: 4px; border-bottom: 1px solid; }
.tabs button { flex: 1 1 auto; min-width: min-content; max-width: 100%; overflow-wrap: break-word; padding: 6px; border: 0; border-radius: 14px 14px 0 0; color: var(--color-ink); background: transparent; font-weight: 850; line-height: 1.25; }
.tabs button:focus-visible { outline-color: var(--color-ink); }
.tabs button[aria-selected="true"] { color: var(--color-on-dark); background: var(--color-ink); }
.installer [role="tabpanel"] { padding-top: 14px; }
.hint, .speaker, .term-bar, .prices small { font: 700 var(--type-body)/1.45 var(--font-mono); }
.installer code {
  display: block; min-height: 44px; margin: 0 0 10px; padding-block: 8px;
  font: 600 var(--type-body)/1.5 var(--font-mono); white-space: pre; overflow-x: auto;
}
.check-receipt {
  width: fit-content; max-width: 100%; padding: 16px 20px; border: 1px solid;
  background: var(--color-ground); box-shadow: 3px 3px 0 var(--color-ink);
  font: 600 var(--type-body)/1.5 var(--font-mono); overflow-wrap: anywhere;
}
.checks { display: grid; gap: 6px; list-style: none; padding: 0; }
.checks li { position: relative; padding-inline-start: 1.5em; }
.checks li::before { content: ""; position: absolute; left: .25em; top: .22em; width: .45em; height: .85em; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check-receipt del { display: block; margin-top: 12px; padding-top: 10px; border-top: 1px dashed; }
.terminal { min-width: 0; border: 2px solid; border-radius: 0 var(--radius-corner) 0 0; overflow: hidden; color: var(--color-ink); background: var(--color-ground); }
.term-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 18px; background: var(--color-ink); color: var(--color-on-dark); }
.turn { padding: 13px 18px 0; }
.speaker { display: block; margin-bottom: 2px; }
.result { margin-top: 17px; padding: 15px 18px; border-top: 1px dashed; color: var(--color-on-accent); background: var(--color-accent); }
.result > strong { display: block; font: 1000 var(--type-figure)/1 var(--font-display); letter-spacing: -.04em; overflow-wrap: anywhere; }
.prices { display: flex; flex-wrap: wrap; gap: clamp(24px,5vw,76px); margin-block: 15px 8px; }
.prices small { display: block; }
.prices b { font-size: var(--type-h3); letter-spacing: -.05em; }
.prices b small { display: inline; font: 700 var(--type-small)/1.5 var(--font-body); letter-spacing: 0; }

/* A receipt, responsive results table and product card also stand alone. */
.price-card, .product-card, .table-frame { min-width: 0; padding: clamp(1.25rem,3vw,2.75rem); color: var(--color-ink); background: var(--color-ground); border: 1px solid; border-radius: var(--radius-corner); }
.price-card { position: relative; border-top: 6px solid; }
.price-card header, .price-card .price-total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.price-card header { padding-bottom: var(--space-4); border-bottom: 1px dashed; }
.price-lines { padding-block: var(--space-4); }
.price-lines > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.price-lines dd, .price-total strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-total { border-top: 1px dashed; padding-block: var(--space-4); }
.price-total strong { font: 800 var(--type-figure)/1 var(--font-display); letter-spacing: -.04em; }
.price-card > details, .product-card > details, .table-frame > details { border-top: 1px solid; padding-top: .5rem; }
.price-card summary, .product-card summary, .table-frame summary { align-content: center; }
.price-card details p, .product-card details p, .table-frame details p { padding-bottom: .5rem; }
.results { width: 100%; border-collapse: collapse; text-align: left; }
.results caption { padding-bottom: var(--space-4); font: 900 var(--type-h3)/1.1 var(--font-display); text-align: left; }
.results :is(td, th) { padding: .7rem .35rem .7rem 0; border-top: 1px solid; }
.results th { font-weight: 800; }
.results .cell-label { display: none; }
.product-card { display: flex; flex-direction: column; gap: var(--space-3); }
.product-card .product-art { display: grid; place-content: center; min-height: 8rem; border-radius: var(--radius-corner); background: var(--color-tint); }
.product-art svg { width: 5.5rem; height: 5.5rem; }
.product-card > details { margin-top: auto; }

@media (min-width: 47.5rem) {
  .hero-poster .installer { padding: clamp(20px,3vw,44px); }
  .term-bar, .turn, .result { padding-inline: 26px; }
}
@media (max-width: 37rem) {
  .results { display: block; }
  .results caption, .results tbody, .results tr { display: block; }
  .results thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .results tbody tr { padding-block: .65rem; border-top: 1px solid; }
  .results tbody th { display: block; }
  .results tbody :is(th, td) { border: 0; padding: .15rem 0; }
  .results td { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; }
  .results .cell-label { display: inline; font-weight: 650; }
}
