/* How it works — interactive chat walkthrough (Figma 117:2192 · 117:2532 · 117:2616 · 117:2938 · 120:3217) */
.how__inner {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--head-gap);
  padding: var(--section-y) var(--gx);
}
.how__head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.how__title .t-h2--regular { font-weight: 400; }

.how__stage { position: relative; width: min(800px, 100%); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }

/* window ------------------------------------------------------- */
.app {
  width: 100%;
  padding: 4px;
  border-radius: 20px;                                      /* same radius on all four corners */
  background: rgba(249, 239, 228, .25);
  overflow: hidden;
  transition: height .5s cubic-bezier(.19, 1, .22, 1);     /* the window eases open as the reply streams in */
}
.app__panel {
  display: flex; flex-direction: column;
  min-height: 734px; max-height: var(--app-max, none); box-sizing: border-box;
  overflow: hidden;
  background: #fdfdfd; border: 1px solid #ecedef; border-radius: 16px;
  box-shadow: 0 0 16px rgba(0, 0, 0, .04);
}
.app img { display: block; max-width: none; }
.app__bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 17px 20px; background: #fdfdfd; }
.app__nav { display: flex; gap: 4px; }
.app__arrow { position: relative; display: block; width: 13px; height: 15px; }
.app__arrow img { position: absolute; left: 27.08%; top: 15.69%; width: 45.84%; height: 68.62%; max-width: none; }
.app__crumb { font: 500 15px/22.5px var(--font-ui); letter-spacing: -.02em; color: #a3a3a3; white-space: nowrap; }
.app__crumb b { font-weight: 500; color: #555; }
.app__more { margin-left: auto; display: grid; place-items: center; padding: 4px; border-radius: 8px; background: #fff; }

/* thread ------------------------------------------------------- */
.app__thread {
  position: relative; flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
  padding: 30px clamp(20px, 7.8%, 62px) 24px clamp(20px, 14.8%, 117px);
  scrollbar-width: thin;
}
.app__thread > * { flex: none; }
.app__sent { align-self: flex-end; }
.file {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 16px 10px 12px;
  border: 1px solid #ebebeb; border-radius: 16px; background: #ebebeb;
  max-width: 100%;
}
.app__attached .file { background: #fff; }
.file__icon { display: grid; place-items: center; padding: 8px; border-radius: 96px; background: #f7f7f7; }
.file__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.file__row { display: flex; align-items: center; gap: 12px; }
.file__name { font: 500 14px/20px var(--font-ui); letter-spacing: -.006em; color: #171717; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__x { display: grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%; background: #262626; }
.file__type { font: 500 12px/16px var(--font-ui); color: #5c5c5c; }

.app__typing { margin-left: -57px; }                 /* sits at x=60 in the design, left of the reply column */
.app__typing img { animation: dots 1.2s ease-in-out infinite; }
@keyframes dots { 50% { opacity: .45; } }

.app__reply { font: 400 15px/24px var(--font-ui); letter-spacing: -.01em; color: #171717; }
.app__reply p { margin: 0 0 24px; }
.app__reply p:last-child { margin-bottom: 0; }
.app__reply b { font-weight: 700; }
.app__reply strong { font-weight: 600; }
.app__reply .w { transition: opacity .3s ease-out; }

.app__next { display: flex; flex-direction: column; gap: 10px; }
.app__next-title { margin: 0; font: 700 15px/24px var(--font-ui); letter-spacing: -.01em; color: #171717; }
.app__chips { display: flex; flex-wrap: wrap; gap: 10px; }
.app__chip {
  padding: 6px 9px; border: 0; border-radius: 8px; cursor: pointer;
  background: rgba(104, 111, 125, .06);
  font: 400 15px/24px var(--font-ui); letter-spacing: -.01em; color: #171717;
  transition: background-color .2s ease, transform .3s cubic-bezier(.19, 1, .22, 1);
}
.app__chip:hover { background: rgba(35, 92, 251, .1); transform: translateY(-1px); }
.app__chip:active { transform: translateY(1px); }
.app__chip:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.app__log { display: flex; flex-direction: column; gap: 16px; }
.app__log:empty { display: none; }
.app__log .msg-user { align-self: flex-end; max-width: 80%; padding: 10px 14px; border-radius: 16px; background: #ebebeb; font: 500 14px/20px var(--font-ui); color: #171717; white-space: pre-wrap; overflow-wrap: anywhere; }
.app__log .msg-ai { font: 400 15px/24px var(--font-ui); letter-spacing: -.01em; color: #171717; }

/* entrance for each block — ease-out, no bounce */
.app [data-enter] { animation: app-in .45s cubic-bezier(.19, 1, .22, 1) both; }
@keyframes app-in { from { opacity: 0; transform: translateY(8px); } }

/* prompt — the same text box as the hero (.chat): one ring, same radius, padding, shadows and orbiting highlight ---- */
.app__prompt {
  flex: none; position: relative; align-self: center;
  width: min(666px, calc(100% - 40px)); margin: 0 0 20px;
  padding: 0; background: none; border: 0;
}
.app__prompt-in {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 113px;
  padding: 14px 14px 10px 14px;
  background: #fff; border: 1px solid rgba(35, 92, 251, 0.55); border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(35, 92, 251, 0.25),
    0 6px 16px rgba(35, 92, 251, 0.18),
    0 14px 32px rgba(35, 92, 251, 0.10);
  transition: box-shadow .5s ease;
}
/* thin #235CFB highlight travelling around the border + a soft glow (identical to the hero box) */
@property --app-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.app__prompt-in::before, .app__prompt-in::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--app-angle), transparent 0 72%, rgba(35,92,251,.15) 82%, #235CFB 96%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: app-orbit 5s linear infinite;
}
.app__prompt-in::after { filter: blur(4px); opacity: .7; padding: 2px; inset: -2px; }
@keyframes app-orbit { to { --app-angle: 360deg; } }
.app[data-state="thinking"] .app__prompt-in {            /* glow brightens slightly while the AI thinks */
  box-shadow:
    0 1px 2px rgba(35, 92, 251, 0.32),
    0 6px 18px rgba(35, 92, 251, 0.28),
    0 14px 36px rgba(35, 92, 251, 0.18);
}
.app__attached { margin-bottom: 8px; }
.app__attached .file { animation: app-in .45s cubic-bezier(.19, 1, .22, 1) both; }
.app__field { position: relative; flex: 1; }
.app__input { display: block; width: 100%; min-height: 48px; margin: 0; padding: 0; font: 400 16px/24px var(--font-ui); position: relative; resize: none; border: 0; outline: 0; background: transparent; color: var(--color-ink); caret-color: var(--color-primary); overflow: hidden; max-height: 168px; }
.app__input::placeholder { color: #a3a3a3; opacity: 1; }
.app__box.has-file .app__field { display: none; }
.app__actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.app__btn {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; cursor: pointer;
  background: #F5F5F5; transition: background-color .15s ease, transform .15s ease;
}
.app__btn:hover { background: #ECECEC; }
.app__btn:active { transform: scale(.94); }
.app__btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.app__btn--send:disabled { cursor: default; }
.app__btn--send:not(:disabled) { background: var(--color-primary); }
.app__btn--send:not(:disabled) img { filter: brightness(0) invert(1); }

.how__replay {
  padding: 8px 14px; border: 1px solid rgba(0,0,0,.1); border-radius: 999px; background: #fff; cursor: pointer;
  font: 500 13px/16px var(--font-ui); color: #5c5c5c; transition: color .2s ease, transform .3s cubic-bezier(.19, 1, .22, 1);
}
.how__replay:hover { color: var(--color-primary); transform: translateY(-1px); }
.how__replay:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }

@media (max-width: 1023px) {
  .app__panel { min-height: 600px; }
}
@media (max-width: 599px) {
  .app__panel { min-height: 520px; }
  .app__thread { padding-inline: 16px; }
  .app__typing { margin-left: 0; }
  .app__prompt { width: calc(100% - 24px); }
  .file__name { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .app__prompt-in::before, .app__prompt-in::after, .app__typing img, .app [data-enter] { animation: none; }
}
