:root {
  --ink: #0E1330; --ink-2: #474C68; --ink-3: #8086A3;
  --paper: #fff; --mist: #F4F5FA; --line: #E2E5F0;
  --cobalt: #2447F9; --jade: #00A878; --flame: #FF5A36; --sun: #FFC83D;
  --accent: var(--ink);
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Figtree', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font: 16px/1.5 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, select, textarea { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }

.shell { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 34vw, 460px); height: 100dvh; }

/* ---------- conversation ---------- */
.talk { display: flex; flex-direction: column; min-width: 0; height: 100dvh; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(16px, 4vw, 44px); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.top-right { display: flex; align-items: center; gap: 6px; }
.demo { white-space: nowrap; font-size: 12px; font-weight: 600; color: #7A5200; background: #FFF1C9; padding: 4px 9px; border-radius: 99px; }
.lang select { appearance: none; border: 1px solid var(--line); background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23474C68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center / 12px; border-radius: 99px; padding: 8px 30px 8px 14px; font-size: 14px; font-weight: 500; cursor: pointer; min-height: 38px; }
[dir=rtl] .lang select { background-position: left 10px center; padding: 8px 14px 8px 30px; }
.ghost { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; border: 0; background: none; padding: 8px 12px; border-radius: 99px; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; min-height: 38px; }
.ghost:hover { background: var(--mist); color: var(--ink); }

.stream { flex: 1; overflow-y: auto; padding: 8px clamp(16px, 4vw, 44px) 24px; overscroll-behavior: contain; }
.stream > * { max-width: 680px; margin-inline: auto; }
.msg { margin-top: 18px; }
.msg.agent { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; }
.msg.agent::before { content: ''; width: 26px; height: 26px; margin-top: 1px; border-radius: 8px; background: linear-gradient(90deg, var(--cobalt) 0 33.3%, var(--jade) 33.3% 66.6%, var(--flame) 66.6%); }
.msg.agent.has-product::before { background: var(--accent); }
.body p { margin: 0 0 .7em; overflow-wrap: anywhere; }
.body p:last-child { margin-bottom: 0; }
.body a { color: var(--cobalt); font-weight: 500; }
.body strong { font-weight: 650; }
/* The greeting is the page's headline: the agent's first words, in the visitor's language. */
.msg.agent.first { display: block; margin-top: clamp(12px, 6vh, 64px); }
.msg.agent.first::before { display: none; }
.msg.agent.first .body p:first-child { font: 400 clamp(30px, 4.4vw, 46px)/1.08 var(--serif); letter-spacing: -.012em; margin-bottom: .5em; text-wrap: balance; }
.msg.agent.first .body p:not(:first-child) { font-size: 18px; color: var(--ink-2); }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .body { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 20px 20px 6px 20px; max-width: min(84%, 520px); }
[dir=rtl] .msg.user .body { border-radius: 20px 20px 20px 6px; }
.typing { display: inline-flex; gap: 5px; padding: 8px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: bob 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; background: var(--jade); } .typing i:nth-child(3) { animation-delay: .3s; background: var(--flame); } .typing i:first-child { background: var(--cobalt); }
@keyframes bob { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
.notice { margin-top: 14px; font-size: 14px; color: #A3261A; }

/* ---------- cards ---------- */
.card { --c: var(--ink); margin: 14px 0 4px; border-radius: 18px; overflow: hidden; max-width: 460px; }
.card-estimate { background: var(--c); color: #fff; padding: 20px 22px 18px; }
.card-estimate .lab { font-size: 13px; font-weight: 600; opacity: .85; }
.card-estimate .big { font: 400 clamp(40px, 7vw, 58px)/1 var(--serif); margin: 6px 0 4px; letter-spacing: -.01em; }
.card-estimate .big small { font: 500 15px var(--sans); opacity: .9; margin-inline-start: 6px; }
.card-estimate .sub { font-size: 14px; opacity: .9; margin: 0; }
.card-plan { border: 1.5px solid var(--c); }
.card-plan .head { background: var(--c); color: #fff; padding: 12px 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-plan .head b { font: 400 26px/1.1 var(--serif); }
.card-plan .head span { font-size: 13px; font-weight: 600; }
.card-plan .in { padding: 14px 18px 16px; }
.card-plan .price { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.card-plan .price small { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.card-plan p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.card-plan .trial { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); padding: 5px 11px; border-radius: 99px; }
.card-account { background: color-mix(in srgb, var(--c) 9%, #fff); border: 1.5px solid var(--c); padding: 18px 20px; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.card-account .tick { width: 40px; height: 40px; border-radius: 50%; background: var(--c); display: grid; place-items: center; animation: pop .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.card-account b { font: 400 24px/1.15 var(--serif); display: block; }
.card-account p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.card-account p em { font-style: normal; font-weight: 600; color: var(--ink); }
.card-video { background: var(--ink); color: #fff; }
.card-video .frame { position: relative; aspect-ratio: 16/9; background: #1A2046 center/cover; display: grid; place-items: center; border: 0; width: 100%; cursor: pointer; padding: 0; }
.card-video .frame span { width: 62px; height: 62px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.card-video iframe, .card-video video { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
.card-video .cap { padding: 10px 16px 12px; font-size: 14px; font-weight: 500; }
.card-handoff { border: 1.5px solid var(--line); padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.card-handoff b { font-weight: 600; }
.btn { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 99px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; }

/* ---------- composer ---------- */
.composer { padding: 0 clamp(16px, 4vw, 44px) calc(12px + env(safe-area-inset-bottom)); }
.composer > * { max-width: 680px; margin-inline: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chips button { border: 1.5px solid var(--ink); background: var(--paper); border-radius: 99px; padding: 8px 15px; font-size: 14.5px; font-weight: 500; cursor: pointer; min-height: 40px; transition: background .12s, color .12s; }
.chips button:hover { background: var(--ink); color: #fff; }
.field { display: flex; align-items: flex-end; gap: 8px; background: var(--mist); border: 1.5px solid transparent; border-radius: 26px; padding: 6px 6px 6px 20px; transition: border-color .15s, background .15s; }
.field:focus-within { border-color: var(--ink); background: var(--paper); }
.field textarea { flex: 1; border: 0; background: none; resize: none; outline: 0; padding: 9px 0; max-height: 140px; line-height: 1.4; font-size: 16px; }
.field textarea::placeholder { color: var(--ink-3); }
.field button { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .12s, opacity .12s; }
.field button:disabled { opacity: .3; cursor: default; }
.field button:not(:disabled):active { transform: scale(.92); }
[dir=rtl] .field button svg { transform: scaleX(-1); }
.fine { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 8px; margin-bottom: 0; }

/* ---------- the brief ---------- */
.brief { --sheet: var(--ink); position: relative; background: var(--sheet); color: #fff; overflow: hidden; transition: background .7s ease; display: flex; flex-direction: column; }
.brief-in { position: relative; z-index: 1; padding: 22px clamp(22px, 2.6vw, 36px) 0; overflow-y: auto; flex: 1; }
.brief-close { display: none; }
.brief-title { margin: 0; font-size: 13px; font-weight: 600; opacity: .8; }
.brief-who { font: 400 clamp(34px, 3.4vw, 48px)/1.04 var(--serif); margin: 10px 0 0; letter-spacing: -.012em; text-wrap: balance; overflow-wrap: anywhere; }
.brief-who.empty { opacity: .55; }
.facts { margin: 18px 0 0; display: grid; gap: 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid rgb(255 255 255 / .22); font-size: 14.5px; animation: rise .4s ease both; }
.facts dt { opacity: .78; flex: none; }
.facts dd { margin: 0; font-weight: 600; text-align: end; overflow-wrap: anywhere; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.fit { margin-top: 22px; }
.fit-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14.5px; }
.fit-row b { font: 400 34px/1 var(--serif); }
.meter { height: 8px; border-radius: 99px; background: rgb(255 255 255 / .22); margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: #fff; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.match, .risk { margin-top: 22px; }
.match span, .risk span { font-size: 13px; font-weight: 600; opacity: .8; display: block; }
.match strong { font: 400 38px/1.05 var(--serif); display: block; margin-top: 4px; }
.match p { margin: 6px 0 0; font-size: 14.5px; opacity: .92; }
.risk strong { font: 400 38px/1.05 var(--serif); display: block; margin-top: 4px; }
.risk strong small { font: 500 14px var(--sans); opacity: .9; margin-inline-start: 6px; }

/* Three bars, one per product. The matched one rises and floods the sheet with its colour. */
.bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; height: 34%; min-height: 150px; padding: 0 clamp(22px, 2.6vw, 36px); flex: none; }
.bar { border-radius: 14px 14px 0 0; position: relative; height: var(--h, 50%); background: var(--c); transition: height .8s cubic-bezier(.2, .8, .2, 1), background .7s, opacity .6s; min-height: 44px; }
.bar span { position: absolute; top: 10px; inset-inline: 0; text-align: center; font-size: 12.5px; font-weight: 600; color: #fff; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brief.matched .bar { background: rgb(255 255 255 / .2); }
.brief.matched .bar.on { background: #fff; }
.brief.matched .bar.on span { color: var(--sheet); }

.strip { display: none; }

@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .top { padding-block: 10px; }
  .ghost { padding: 0; width: 40px; justify-content: center; }
  .ghost span { display: none; }
  .lang select { max-width: 132px; text-overflow: ellipsis; }
  .brand span { font-size: 16px; }
  .strip { display: flex; align-items: center; gap: 10px; margin: 0 16px 4px; padding: 0 14px; min-height: 44px; border: 0; border-radius: 14px; background: var(--sheet, var(--ink)); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .7s; }
  .strip-fit { margin-inline-start: auto; font-weight: 500; opacity: .95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brief { position: fixed; inset: 0; z-index: 20; transform: translateY(102%); transition: transform .32s cubic-bezier(.2, .8, .2, 1), background .7s; }
  .brief.open { transform: none; }
  .brief-close { display: grid; place-items: center; position: absolute; top: 14px; inset-inline-end: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .18); color: #fff; cursor: pointer; }
  .brief-in { padding-top: 26px; }
  .msg.agent.first { margin-top: 14px; }
  .card { max-width: none; }
}
@media (max-width: 400px) { .brand span { display: none; } .top { padding-inline: 12px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
