/* Metrecx dev3: the conversation layout. Sits on top of dev2's base.css and
   chat.css (form boxes, agreement, counters, SSN, address list) and changes
   the frame: soft gradient page, serif questions with no bubble, one answer
   card pinned to the bottom, segmented progress, numbered options. */

:root {
  --sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --wash-top: #E7F5F1;
  --wash-bottom: #E6EEF8;
  --ink: #1F2A37;
  --radius-card: 22px;
}

html, body { height: 100%; }
body.dev3 {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--wash-top) 0%, var(--wash-bottom) 100%) fixed;
}

/* ------------------------------------------------------------- top */
.dev3 .chat-top { background: transparent; border-bottom: 0; }
.dev3 .chat-top .progress { visibility: visible; max-width: 360px; }
.segs { display: flex; gap: 6px; }
.seg { flex: 1; height: 4px; border-radius: 99px; background: rgba(31, 42, 55, .12); transition: background .4s ease; }
.seg.done { background: var(--navy); }
.seg.now { background: linear-gradient(90deg, var(--navy) 0 50%, rgba(31, 42, 55, .12) 50% 100%); }
.dev3 .progress-label { font-family: var(--sans); }
.dev3 .chat-restart { font-family: var(--sans); }

/* ------------------------------------------------------------- thread */
.dev3 .chat-main { min-height: 0; }
.intro { max-width: 736px; margin: 0 auto; padding: 2.2rem 16px .4rem; }
.intro h1 { font-family: var(--sans); font-weight: 700; font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); letter-spacing: -.01em; margin: 0 0 .3rem; }
.intro p { margin: 0; color: var(--muted); font-size: .98rem; }
.dev3 .thread { max-width: 736px; padding: 1.4rem 16px 1.6rem; gap: 1.3rem; }

.dev3 .msg.bot { display: block; }
.dev3 .msg.bot .avatar { display: none; }
.dev3 .msg.bot .lines { padding-top: 0; gap: .7rem; }
.dev3 .msg.bot p {
  font-family: var(--serif); font-weight: 400; color: var(--ink);
  font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); line-height: 1.45;
}
.dev3 .msg.bot .aside { font-family: var(--sans); font-size: .92rem; }
.dev3 .typing { background: rgba(255, 255, 255, .7); border-color: transparent; }

.dev3 .msg.me { justify-content: flex-end; }
.dev3 .bubble {
  background: rgba(255, 255, 255, .85); color: var(--ink); border: 1px solid rgba(31, 42, 55, .08);
  border-radius: 999px; padding: .45rem .95rem; font: 500 .95rem/1.4 var(--sans); box-shadow: none;
  max-width: min(80%, 520px);
}
.dev3 .bubble .txt { white-space: normal; }
.dev3 div.bubble { border-radius: 18px; }

/* ------------------------------------------------------------- answer card */
.dock { padding: 0 16px max(.6rem, env(safe-area-inset-bottom)); }
.dev3 .composer {
  max-width: 736px; margin: 0 auto; padding: 1rem;
  background: #fff; border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(15, 34, 55, .05), 0 18px 44px -20px rgba(15, 34, 55, .35);
  max-height: 62dvh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: .8rem;
}
.dev3 .composer:empty { display: none; }
.dock-note { max-width: 736px; margin: .5rem auto 0; font-size: .72rem; line-height: 1.4; color: var(--muted); text-align: center; }

.options { display: flex; flex-direction: column; gap: 2px; }
.option {
  display: flex; align-items: center; gap: .85rem; width: 100%;
  min-height: 52px; padding: .55rem .7rem; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); text-align: left;
  font: 500 1.02rem/1.3 var(--sans); cursor: pointer;
}
.option:hover, .option:focus-visible { background: #F3F5F7; }
.option.is-on { background: var(--gold-soft); }
.option .num {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  background: #EEF1F4; color: var(--muted); font: 600 .85rem var(--sans);
}
.option.is-on .num { background: var(--gold); color: var(--ink); }

.freebox { display: flex; align-items: center; gap: .4rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.freebox input {
  flex: 1; min-width: 0; min-height: 46px; padding: 0 .9rem; border: 1.5px solid var(--line); border-radius: 999px;
  font: 400 1rem var(--sans); color: var(--ink); background: #fff;
}
.freebox input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(13, 136, 176, .12); }
.freebox .send {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ink); color: #fff; display: grid; place-items: center;
}
.freebox .send:hover { background: var(--navy); }
.askq { display: flex; justify-content: flex-start; }
.askq .freebox { flex: 1; }
.askq-open { background: none; border: 0; padding: .2rem 0; color: var(--teal-dark); font: 600 .9rem var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.dev3 .cnav .next, .dev3 .btn-wide { background: var(--ink); color: #fff; box-shadow: none; }
.dev3 .cnav .next:hover, .dev3 .btn-wide:hover { background: var(--navy); color: #fff; }
.dev3 .cnav { margin-top: .2rem; }
.dev3 .btn { font-family: var(--sans); }
.dev3 .agreement { max-height: 30dvh; }

/* Address suggestions open upward: the box is near the bottom of the screen. */
.dev3 .ac-list { top: auto; bottom: calc(100% + 4px); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.dev3 .chat-foot { background: transparent; }

@media (max-width: 560px) {
  .intro { padding-top: 1.2rem; }
  .dock { padding-left: 8px; padding-right: 8px; }
  .dev3 .composer { padding: .8rem; max-height: 66dvh; }
  .dock-note { font-size: .68rem; }
}
@media (prefers-reduced-motion: reduce) {
  .seg { transition: none; }
}
.dev3 button.bubble:hover { background: #fff; border-color: var(--navy); }
/* dev3 has no section list; the segmented bar is the progress. */
.dev3 .steps { display: none !important; }
