/* Functionality interiors. The marble, scene geometry and transitions belong
   to the host. All cqw/cqh values refer to its size container. */
.fd-sheet,
.fd-device,
[data-story-screen] > .demo-chatgpt {
  --fd-ink: #020817;
  --fd-muted: #64748B;
  --fd-rule: #E2E8F0;
  --fd-gold: #A38240;
  --fd-blue: #003366;
  --fd-green: #16A34A;
  color: var(--fd-ink);
  text-align: start;
  font-family: var(--sans, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}
.fd-sheet {
  --fd-pad: clamp(12px, min(4cqw, 3.9cqh), 31px);
  --fd-gap: clamp(9px, min(3.5cqw, 2.8cqh), 22px);
  width: min(90cqw, 680px);
  min-width: 0;
  display: grid;
  gap: var(--fd-gap);
  padding: var(--fd-pad);
  border: 1px solid #E2E8F0;
  border-radius: clamp(13px, 3.2cqw, 24px);
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(2, 8, 23, .04), 0 10px 24px -14px rgba(0, 51, 102, .16);
  font-size: clamp(12px, 2.35cqw, 15px);
  line-height: 1.35;
}
.fd-sheet :where(h4, p, dl, dd, figure),
.fd-device :where(h4, p) { margin: 0; }
.fd-sheet :where(svg path, svg circle) { vector-effect: non-scaling-stroke; }

/* Front-on handset. The limiting dimension is generally the panel's height;
   only the frame scales geometrically. Type has its own legibility floor. */
.fd-device {
  --fd-unit: min(1cqh, 1.6cqw);
  --fd-frame: clamp(3.5px, calc(.88 * var(--fd-unit)), 6.5px);
  --fd-radius: clamp(25px, calc(6.9 * var(--fd-unit)), 48px);
  --fd-inset: clamp(8px, calc(2.75 * var(--fd-unit)), 22px);
  --fd-air: clamp(6px, calc(1.9 * var(--fd-unit)), 16px);
  position: relative;
  width: min(312px, 46cqh, 74cqw);
  aspect-ratio: .5;
  padding: var(--fd-frame);
  border: 1px solid #626a70;
  border-radius: var(--fd-radius);
  background: linear-gradient(125deg, #a0a7ab 0%, #373d42 18%, #161b1e 54%, #343b40 82%, #80888d);
  box-shadow: inset 0 0 0 1px #ffffff28, 0 1px 2px #1527353d, 0 12px 30px -14px #20334273;
  font-size: clamp(11.5px, calc(2.42 * var(--fd-unit)), 16px);
  line-height: 1.3;
}
.fd-device::before,
.fd-device::after {
  position: absolute;
  width: clamp(1px, .44cqh, 2.5px);
  border-radius: 2px;
  background: #4c5359;
  content: "";
}
.fd-device::before { left: -2.5px; top: 24%; height: 9%; }
.fd-device::after { right: -2.5px; top: 32%; height: 13%; }
.fd-glass {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: calc(var(--fd-radius) - var(--fd-frame) - 1px);
  background: #F8FAFC;
  box-shadow: 0 0 0 1px #151a1c;
}
.fd-status {
  position: relative;
  min-height: clamp(19px, calc(5.8 * var(--fd-unit)), 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12%;
  color: #020817;
  font: 700 clamp(9px, calc(1.66 * var(--fd-unit)), 12px)/1 system-ui, sans-serif;
}
.fd-status i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28%;
  height: 38%;
  transform: translate(-50%, -50%);
  border-radius: 99px;
  background: #101113;
}
.fd-status span {
  position: relative;
  width: 1.2em;
  height: .62em;
  border: 1px solid #32414a;
  border-radius: 2px;
  background: #32414a;
  box-shadow: inset 0 0 0 1px #eef3f2;
}
.fd-status span::after { content: ""; position: absolute; top: 25%; right: -2.5px; width: 1px; height: 50%; background: #32414a; }
.fd-phone-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--fd-air);
  padding: var(--fd-air) var(--fd-inset);
}
.fd-home { flex: none; width: 29%; height: clamp(2px, .65cqh, 4px); margin: 0 auto clamp(4px, 1.25cqh, 9px); border-radius: 99px; background: #546066; }
/* Keep the approved ChatGPT DOM, message animation and sequence untouched.
   Its flexible transcript has no hidden overflow or fixed-height message area. */
[data-story-screen] > .demo-chatgpt {
  width: min(92cqw, 50rem);
  height: auto;
  display: block;
  border: 1px solid #E2E8F0;
  border-radius: clamp(12px, 2.6cqw, 20px);
  background: #FFFFFF;
  color: #020817;
  box-shadow: 0 2px 4px rgba(2, 8, 23, .04), 0 1.4cqh 3.8cqh -2cqh rgba(0, 51, 102, .2);
  font: 400 clamp(12px, min(2.45cqw, 2.4cqh), 18px)/1.35 system-ui, sans-serif;
}
[data-story-screen] .demo-chatgpt > aside { display: none; }
[data-story-screen] .demo-chatgpt-main { height: auto; }
[data-story-screen] .demo-chatgpt-main > header { flex: none; height: auto; min-height: 0; gap: 4px; padding: .75em 1em; font-size: 1em; line-height: 1.15; }
[data-story-screen] .demo-chatgpt-main > header span {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  padding: .25em .55em;
  border-radius: .4em;
  background: #E6F5F0;
  color: #166534;
  font-size: .85em;
}
[data-story-screen] .demo-chatgpt-main > header span::before {
  content: "";
  width: 1em;
  height: 1em;
  flex: none;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23166534' stroke-width='1.45'%3E%3Crect x='3' y='7' width='10' height='7.5' rx='1.7'/%3E%3Cpath d='M5 7V4.7a3 3 0 1 1 6 0V7m-3 3v1.8'/%3E%3C/svg%3E");
}
[data-story-screen] .demo-chatgpt-thread { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6em; padding: .8em 1em; max-width: none; overflow: visible; }
[data-story-screen] .demo-gpt-message.user { max-width: 89%; padding: .55em .8em; background: #F1F5F9; color: #020817; font-size: 1em; line-height: 1.35; }
[data-story-screen] .demo-gpt-message.assistant { grid-template-columns: 1.55em 1fr; gap: .55em; margin: 0; color: #020817; font-size: 1em; line-height: 1.35; }
[data-story-screen] .demo-gpt-message.assistant > i { width: 1.55em; height: 1.55em; }
[data-story-screen] .demo-gpt-message.followup { margin-top: 0; }
[data-story-screen] .demo-gpt-tool { grid-template-columns: 1.8em 1fr auto; gap: .55em; margin: 0; padding: .55em .7em; font-size: .94em; }
[data-story-screen] .demo-gpt-tool > i { width: 1.8em; height: 1.8em; background: #FFFFFF url("welta-mark.svg") center / 90% no-repeat; color: transparent; }
[data-story-screen] .demo-gpt-tool span,
[data-story-screen] .demo-gpt-tool > b { margin: 0; color: #64748B; font-size: .92em; }
[data-story-screen] .demo-gpt-composer { height: auto; min-height: 2.3em; margin: 0; padding: .27em .4em .27em .8em; color: #64748B; font-size: .94em; }
[data-story-screen] .demo-chatgpt > aside { background: #F8FAFC; border-color: #E2E8F0; }
[data-story-screen] .demo-chatgpt > aside > span,
[data-story-screen] .demo-chatgpt > aside > small { color: #64748B; }
[data-story-screen] .demo-chatgpt > aside > span.active { background: #FFFFFF; color: #020817; }
[data-story-screen] .demo-chatgpt-main > header { border-bottom-color: #E2E8F0; }
[data-story-screen] .demo-gpt-tool { border-color: #E2E8F0; }
[data-story-screen] .demo-gpt-composer b { width: 1.6em; height: 1.6em; }

@container (min-width: 660px) and (min-height: 510px) {
  [data-story-screen] > .demo-chatgpt { display: grid; grid-template-columns: minmax(110px, 22%) minmax(0, 1fr); }
  [data-story-screen] .demo-chatgpt > aside { display: flex; padding: 1em .6em; border-radius: 18px 0 0 18px; }
  [data-story-screen] .demo-chatgpt-brand { font-size: .95em; }
  [data-story-screen] .demo-chatgpt > aside > span { font-size: .83em; }
  [data-story-screen] .demo-chatgpt > aside > small { font-size: .73em; }
}
@container (max-width: 439px) {
  [data-story-screen] > .demo-chatgpt { width: 95cqw; }
}
@container (max-height: 390px) or ((max-width: 360px) and (max-height: 465px)) {
  [data-story-screen] > .demo-chatgpt { width: 96cqw; font-size: 11.75px; }
  [data-story-screen] .demo-chatgpt-main > header { padding: .45em .65em; }
  [data-story-screen] .demo-chatgpt-thread { gap: .28em; padding: .45em .6em; }
  [data-story-screen] .demo-gpt-message.user { max-width: 96%; padding: .22em .48em; line-height: 1.23; }
  [data-story-screen] .demo-gpt-message.assistant { display: block; line-height: 1.23; }
  [data-story-screen] .demo-gpt-message.assistant > i,
  [data-story-screen] .demo-gpt-tool > i { display: none; }
  [data-story-screen] .demo-gpt-tool { grid-template-columns: 1fr auto; padding: .2em .48em; line-height: 1.17; }
  [data-story-screen] .demo-gpt-composer { min-height: 1.7em; padding-block: .1em; }
  [data-story-screen] .demo-gpt-composer b { width: 1.35em; height: 1.35em; }
}
@container (max-width: 375px) and (max-height: 320px) {
  [data-story-screen] > .demo-chatgpt { width: 97cqw; font-size: 11.5px; }
  [data-story-screen] .demo-chatgpt-main > header { padding-block: 3px; }
  [data-story-screen] .demo-chatgpt-thread { gap: 2px; padding: 3px 5px; }
  [data-story-screen] .demo-gpt-message.user { max-width: 100%; padding: 2px 5px; line-height: 1.15; }
  [data-story-screen] .demo-gpt-message.assistant { line-height: 1.15; }
  [data-story-screen] .demo-gpt-tool { padding-block: 1px; line-height: 1.12; }
  [data-story-screen] .demo-gpt-composer { min-height: 16px; padding-block: 0; }
}
