/* AI Workflow Survey: visual identity based on ALL-INKL.COM
   (red #E4003A, black, white, light grey panels, heavy uppercase headings). */

:root {
    --brand: #E4003A;
    --brand-dark: #B8002F;
    --brand-tint: #FDECF1;
    --ink: #000;
    --text: #444;
    --muted: #707070;
    --soft: #F5F5F5;
    --line: #E2E2E2;
    --white: #FFF;
    --ok: #1B7F4B;
    --radius: 5px;
    --shadow: 0 2px 14px rgba(0, 0, 0, .07);
    --font: "ProximaNova", "Proxima Nova", "Montserrat", "Segoe UI", Arial, Helvetica, sans-serif;
    --wrap: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--white);
    color: var(--text);
    font: 400 18px/1.45 var(--font);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

h1, h2, h3 { color: var(--ink); margin: 0 0 .5em; line-height: 1.1; }
h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: clamp(22px, 3vw, 31px); font-weight: 900; text-transform: uppercase; }
h3 { font-size: 20px; font-weight: 700; text-transform: uppercase; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }

/* ---- Header & footer -------------------------------------------------- */

.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand svg { width: 44px; height: 36px; flex: none; }
.brand-name { font-size: 22px; font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: -.01em; line-height: 1; }
.brand-name b { color: var(--brand); font-weight: 900; }

.header-meta { font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--ink); display: flex; gap: 18px; align-items: center; }
.header-meta a { color: var(--ink); text-decoration: none; }
.header-meta a:hover { color: var(--brand); }

.site-footer { background: var(--soft); color: var(--muted); font-size: 14px; margin-top: 64px; }
.site-footer .wrap { padding-top: 24px; padding-bottom: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---- Hero band (grey gradient like the brand site) -------------------- */

.hero {
    background: linear-gradient(180deg, #EFEFEF 0%, var(--soft) 55%, var(--white) 100%);
    padding: 48px 0 32px;
}
.hero p.lead { font-size: 22px; color: var(--ink); max-width: 760px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin-bottom: 12px; }

/* ---- Buttons ----------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 48px; padding: 0 24px;
    border: 2px solid var(--brand); border-radius: var(--radius);
    background: var(--brand); color: var(--white);
    font: 700 15px/1 var(--font); text-transform: uppercase; letter-spacing: .02em;
    text-decoration: none; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn:hover, .btn:focus-visible { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--white); }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-dark:hover, .btn-dark:focus-visible { background: #333; border-color: #333; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
.btn svg { width: 18px; height: 18px; }

:focus-visible { outline: 3px solid rgba(228, 0, 58, .35); outline-offset: 2px; }

/* ---- Cards & panels ---------------------------------------------------- */

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.panel { background: var(--soft); border-radius: var(--radius); padding: 24px; }

.notice { border-left: 4px solid var(--brand); background: var(--brand-tint); color: var(--ink); padding: 14px 18px; border-radius: var(--radius); margin-bottom: 24px; font-size: 16px; }
.notice.info { border-color: var(--ink); background: var(--soft); }
.notice.ok { border-color: var(--ok); background: #EAF6EF; }

/* ---- Start screen: one card per language ------------------------------- */

.intro-hero { padding-bottom: 8px; }
.intro-hero .lead { font-size: 18px; color: var(--muted); }

.lang-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 28px 0 8px; }
.lang-card {
    position: relative; display: flex; flex-direction: column;
    background: var(--white); border: 2px solid transparent; border-radius: 22px; padding: 30px 30px 28px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 10px 30px rgba(0, 0, 0, .07);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .25s;
}
.lang-card:hover, .lang-card:focus-within { transform: translateY(-4px); border-color: var(--brand); box-shadow: 0 18px 40px rgba(228, 0, 58, .14); }
.lang-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.lang-card-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--ink); }
.lang-card h2 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 900; text-transform: none; line-height: 1.15; margin-bottom: 14px; }
.lang-card p { font-size: 17px; line-height: 1.55; color: #333; }
.lang-card .lang-card-lead { font-size: 18px; font-weight: 600; color: var(--ink); background: var(--brand-tint); border-radius: 14px; padding: 12px 16px; }
.lang-card-btn { margin-top: auto; align-self: stretch; min-height: 56px; border-radius: 14px; font-size: 16px; }

.flag { display: block; flex: none; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .12); overflow: hidden; }
.flag-lg { width: 54px; height: 36px; border-radius: 6px; }
.lang-card:hover .flag-lg { animation: wave .9s ease-in-out; }
.flag-sm { width: 21px; height: 14px; border-radius: 3px; }
.lang-badge { display: inline-flex; align-items: center; gap: 7px; }
@keyframes wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg) scale(1.05); } 60% { transform: rotate(5deg) scale(1.05); } }

/* ---- Forms ------------------------------------------------------------- */

label.field { display: block; font-weight: 700; color: var(--ink); margin-bottom: 8px; font-size: 16px; }

input[type=email], input[type=text], input[type=password], textarea, select {
    width: 100%; font: 400 17px/1.4 var(--font); color: var(--ink);
    border: 1px solid #CFCFCF; border-radius: var(--radius); background: var(--white);
    padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(228, 0, 58, .15); }
textarea { resize: vertical; min-height: 84px; field-sizing: content; }
.field-error { color: var(--brand); font-size: 15px; font-weight: 700; margin-top: 8px; }

.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }

/* ---- Shared animation keyframes ---------------------------------------- */

@keyframes rise   { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes drop   { from { opacity: 0; transform: translateY(-26px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(10px) scale(.96); transform-origin: left top; } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pop    { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes dot    { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes bob    { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes shake  { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes glow   { from { transform: translate(0, 0) scale(1); } to { transform: translate(-40px, 30px) scale(1.25); } }
@keyframes numIn  { from { opacity: 0; transform: translateX(40px) skewX(-8deg); } to { opacity: 1; transform: none; } }
@keyframes pulse  { 0% { box-shadow: 0 0 0 0 rgba(228, 0, 58, .45); } 70% { box-shadow: 0 0 0 14px rgba(228, 0, 58, 0); } 100% { box-shadow: 0 0 0 0 rgba(228, 0, 58, 0); } }
@keyframes fall   { 0% { transform: translate3d(0, -10vh, 0) rotate(0); opacity: 1; } 100% { transform: translate3d(var(--drift, 0), 105vh, 0) rotate(var(--spin, 540deg)); opacity: .9; } }

.rise { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); }

/* Line icons (shield, arrows, ticks) */
.icon-line, .btn svg, .btn-back svg, .chip svg, .bubble.reassure svg, .promise svg, .opt-tick svg {
    fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Conversation page ------------------------------------------------- */

.chat-page main {
    background:
        radial-gradient(900px 420px at 85% -120px, rgba(228, 0, 58, .07), transparent 70%),
        linear-gradient(180deg, #F3F3F3 0%, #FAFAFA 360px, var(--white) 100%);
}
.chat-page .site-footer { margin-top: 0; }

.chat-top {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.chat-top-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0 10px; }
.chat-count { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--brand-tint); color: var(--brand-dark);
    font-size: 12px; font-weight: 700; padding: 5px 11px 5px 8px; border-radius: 999px; white-space: nowrap;
}
.chip svg { width: 16px; height: 16px; }
.chat-progress { height: 4px; background: #E8E8E8; border-radius: 2px; overflow: hidden; margin-bottom: -1px; }
.chat-progress span {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--brand-dark), var(--brand));
    border-radius: 2px; transition: width .7s cubic-bezier(.2, .8, .2, 1);
}

.chat-body { padding-top: 36px; padding-bottom: 72px; min-height: 72vh; }

/* Steps: one visible at a time once JavaScript is running */
.js .chat .step:not(.active) { display: none; }
.step.active.from-below { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
.step.active.from-above { animation: drop .45s cubic-bezier(.2, .8, .2, 1) both; }

/* ---- Answer history (thread) ------------------------------------------- */

.thread { margin-bottom: 28px; display: grid; gap: 4px; }
.thread-list { display: grid; gap: 6px; }
.exchange {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center;
    width: 100%; padding: 8px 10px; margin: 0; border: 0; border-radius: 12px;
    background: transparent; text-align: left; font: inherit; cursor: pointer;
    opacity: .72; transition: opacity .2s, background .2s;
}
.exchange:hover, .exchange:focus-visible { opacity: 1; background: rgba(0, 0, 0, .035); }
.exchange.fresh { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.ex-q { grid-column: 1 / -1; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-edit { grid-row: 2; grid-column: 1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); opacity: 0; transition: opacity .2s; }
.exchange:hover .ex-edit, .exchange:focus-visible .ex-edit { opacity: 1; }
.ex-a {
    grid-row: 2; grid-column: 2; justify-self: end; max-width: min(520px, 78vw);
    background: var(--brand); color: var(--white); font-size: 14px; font-weight: 700; line-height: 1.35;
    padding: 7px 13px; border-radius: 16px 16px 4px 16px;
}
.ex-a.is-skipped { background: #D9D9D9; color: var(--text); font-weight: 400; }
.ex-a small { font-weight: 400; opacity: .85; }
.thread-toggle { justify-self: start; background: none; border: 0; padding: 4px 10px; font: 700 13px var(--font); color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Host (the "survey team" speaking) --------------------------------- */

.host { display: flex; gap: 14px; align-items: flex-start; }
.avatar {
    flex: none; width: 44px; height: 44px; border-radius: 50%;
    background: var(--white); box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
    display: grid; place-items: center;
}
.avatar svg { width: 26px; height: 22px; }
.step.typing .avatar { animation: bob .9s ease-in-out infinite; }

.bubbles { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.bubble {
    max-width: 100%; background: var(--white); color: var(--ink);
    border-radius: 4px 20px 20px 20px; padding: 16px 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .06);
}
.bubble.reaction { background: var(--ink); color: var(--white); font-size: 15px; font-weight: 700; padding: 8px 15px; animation: bubbleIn .35s both; }
.bubble.typing { display: none; gap: 5px; padding: 15px 18px; }
.bubble.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: dot 1s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; }
.bubble.typing i:nth-child(3) { animation-delay: .3s; }

.q-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }
.q-meta .q-count:empty { display: none; }
.q-pick { color: var(--muted); }
.bubble .q-text { font-size: clamp(22px, 3.2vw, 30px); font-weight: 800; text-transform: none; line-height: 1.22; margin: 6px 0 0; outline: none; }
.q-hint { font-size: 15px; color: var(--muted); margin: 8px 0 0; }
/* The no-judgement note: larger, darker and medium weight so it reads easily */
.bubble.reassure {
    display: flex; gap: 12px; align-items: flex-start;
    background: #FFF1F5; color: #1A1A1A;
    font-size: 17px; font-weight: 500; line-height: 1.55; letter-spacing: .005em;
    box-shadow: none; border: 1px solid #F5C6D3; border-left: 4px solid var(--brand);
    border-radius: 4px 18px 18px 18px; padding: 14px 18px;
}
.bubble.reassure svg { flex: none; width: 22px; height: 22px; color: var(--brand); margin-top: 2px; stroke-width: 2.6; }

/* Typing → typed: bubbles and cards arrive one after another */
.js .step.typing .bubble.typing { display: inline-flex; }
.js .step.typing .bubble.main, .js .step.typing .bubble.reassure, .js .step.typing .answer, .js .step.typing .final-actions { display: none; }
.step.typed .bubble.main { animation: bubbleIn .4s cubic-bezier(.2, .8, .2, 1) both; }
.step.typed .bubble.reassure { animation: bubbleIn .4s .14s cubic-bezier(.2, .8, .2, 1) both; }
.step.typed .answer, .step.typed .final-actions { animation: fadeIn .3s .2s both; }
.step.typed .opt { animation: cardIn .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.26s + var(--i, 0) * 55ms); }

/* ---- Answer cards ------------------------------------------------------ */

.answer { margin: 24px 0 0 58px; }
.step.shake .answer { animation: shake .4s; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cards.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.opt {
    position: relative; display: flex; align-items: center; gap: 12px;
    min-height: 66px; padding: 16px 50px 16px 16px;
    background: var(--white); color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.3;
    border: 2px solid transparent; border-radius: 16px; cursor: pointer; user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 18px rgba(0, 0, 0, .05);
    transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, border-color .2s, background .2s, opacity .2s;
}
.opt:hover { transform: translateY(-3px); border-color: #DADADA; box-shadow: 0 12px 28px rgba(0, 0, 0, .1); }
.opt:active { transform: translateY(0) scale(.98); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt:has(input:focus-visible) { outline: 3px solid rgba(228, 0, 58, .35); outline-offset: 2px; }
.opt.pop { animation: pop .35s cubic-bezier(.2, .8, .2, 1); }

.opt-key {
    flex: none; width: 26px; height: 26px; border-radius: 8px;
    border: 1.5px solid #D2D2D2; color: var(--muted);
    display: grid; place-items: center; font-size: 13px; font-weight: 700;
    transition: background .2s, border-color .2s, color .2s;
}
.opt-label { flex: 1; }
.opt-tick {
    position: absolute; right: 16px; top: 50%; width: 24px; height: 24px; margin-top: -12px;
    border-radius: 50%; border: 2px solid #D6D6D6; display: grid; place-items: center;
    transition: background .2s, border-color .2s, transform .2s;
}
.cards[role=group] .opt-tick { border-radius: 7px; }
.opt-tick svg { width: 14px; height: 14px; stroke: var(--white); stroke-width: 3.2; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s .05s; }

.opt:has(input:checked) {
    border-color: var(--brand);
    background: linear-gradient(135deg, var(--white) 0%, var(--brand-tint) 100%);
    box-shadow: 0 10px 26px rgba(228, 0, 58, .18);
}
.opt:has(input:checked) .opt-key { background: var(--brand); border-color: var(--brand); color: var(--white); }
.opt:has(input:checked) .opt-tick { background: var(--brand); border-color: var(--brand); transform: scale(1.08); }
.opt:has(input:checked) .opt-tick svg { stroke-dashoffset: 0; }
.cards[role=radiogroup]:has(input:checked) .opt:not(:has(input:checked)) { opacity: .62; }
.cards[role=radiogroup]:has(input:checked) .opt:not(:has(input:checked)):hover { opacity: 1; }

/* Scale cards with a little level meter */
.cards.scale { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cards.scale.with-na { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, .85fr); }
.scale .opt { flex-direction: column; justify-content: flex-end; text-align: center; gap: 12px; min-height: 128px; padding: 34px 8px 16px; font-size: 15px; }
.scale .opt-key { position: absolute; top: 9px; left: 9px; width: 22px; height: 22px; font-size: 11px; border-radius: 6px; }
.scale .opt-tick { display: none; }
.scale .opt-na { background: var(--soft); box-shadow: none; color: var(--muted); font-weight: 400; justify-content: center; }
.level { display: flex; align-items: flex-end; gap: 4px; height: 30px; }
.level i { width: 7px; border-radius: 4px; background: #E4E4E4; transition: background .25s, transform .25s; }
.level i:nth-child(1) { height: 7px; }  .level i:nth-child(2) { height: 13px; } .level i:nth-child(3) { height: 19px; }
.level i:nth-child(4) { height: 25px; } .level i:nth-child(5) { height: 30px; }
.level[data-level="1"] i:nth-child(-n+1), .level[data-level="2"] i:nth-child(-n+2), .level[data-level="3"] i:nth-child(-n+3),
.level[data-level="4"] i:nth-child(-n+4), .level[data-level="5"] i:nth-child(-n+5) { background: #F2A3B7; }
.opt:hover .level i { transform: scaleY(1.08); transform-origin: bottom; }
.opt:has(input:checked) .level[data-level] i:nth-child(-n+5) { background: #EDEDED; }
.opt:has(input:checked) .level[data-level="1"] i:nth-child(-n+1), .opt:has(input:checked) .level[data-level="2"] i:nth-child(-n+2),
.opt:has(input:checked) .level[data-level="3"] i:nth-child(-n+3), .opt:has(input:checked) .level[data-level="4"] i:nth-child(-n+4),
.opt:has(input:checked) .level[data-level="5"] i:nth-child(-n+5) { background: var(--brand); }

/* Free text */
.text-answer textarea, .explain textarea {
    border: 2px solid #E2E2E2; border-radius: 16px; background: var(--white);
    padding: 16px 18px; font-size: 18px; line-height: 1.5; min-height: 150px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .04);
}
.text-answer textarea:focus, .explain textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(228, 0, 58, .12); }

/* "Tell us more" slides open after an answer is picked */
.explain { margin-top: 18px; }
.explain label { display: block; font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 8px 4px; }
.explain label .muted { font-weight: 400; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.explain textarea { min-height: 84px; font-size: 16px; }
.js .explain { max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; transition: max-height .5s cubic-bezier(.2, .8, .2, 1), opacity .35s, margin-top .35s; }
.js .explain.show { max-height: 360px; opacity: 1; margin-top: 18px; }

.step-error { color: var(--brand); font-size: 15px; font-weight: 700; margin-top: 12px; }
.step-error:empty { display: none; }

.step-nav { display: flex; align-items: center; gap: 14px; margin-top: 24px; }
.keys-hint { flex: 1; font-size: 13px; color: var(--muted); }
.btn-back, .btn-skip {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 2px;
    background: none; border: 0; cursor: pointer;
    font: 700 14px var(--font); text-transform: uppercase; letter-spacing: .03em; color: var(--ink);
    transition: color .15s;
}
.btn-back:hover, .btn-skip:hover { color: var(--brand); }
.btn-back svg { width: 16px; height: 16px; }
.btn-back[hidden] { display: none; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.step-nav .js-next { transition: opacity .25s, transform .25s, background .15s, border-color .15s; }
.js .step.question:not(.needs-continue) .js-next { opacity: 0; transform: translateY(6px); pointer-events: none; }

/* ---- Chapter cards ----------------------------------------------------- */

.chapter-card {
    position: relative; overflow: hidden; isolation: isolate;
    background: #0F0F0F; color: var(--white);
    border-radius: 22px; padding: 46px 42px 42px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
}
.chapter-card::before {
    content: ""; position: absolute; z-index: -1; right: -90px; top: -110px; width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(228, 0, 58, .6), transparent 68%);
    animation: glow 7s ease-in-out infinite alternate;
}
.chapter-num {
    position: absolute; z-index: -1; right: 26px; bottom: -36px;
    font-size: 190px; font-weight: 900; font-style: italic; line-height: 1;
    color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, .13);
    animation: numIn .9s .1s cubic-bezier(.2, .8, .2, 1) both;
}
.chapter-part { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #FF5C85; }
.chapter-card h2 { color: var(--white); font-size: clamp(30px, 5vw, 50px); font-weight: 900; text-transform: uppercase; margin: 10px 0 12px; outline: none; }
.chapter-intro { font-size: 19px; color: #DADADA; max-width: 580px; }
.chapter-welcome { display: inline-block; background: rgba(255, 255, 255, .1); color: var(--white); padding: 10px 14px; border-radius: 12px; font-size: 15px; }
.promise {
    display: flex; gap: 12px; align-items: flex-start; max-width: 640px; margin: 22px 0 28px;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 16px; padding: 14px 16px;
}
.promise svg { flex: none; width: 22px; height: 22px; color: #FF5C85; }
.promise p { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.55; color: var(--white); }
.step.chapter.active .chapter-card > :not(.chapter-num) { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
.step.chapter.active .chapter-card > :nth-child(3) { animation-delay: .08s; }
.step.chapter.active .chapter-card > :nth-child(4) { animation-delay: .16s; }
.step.chapter.active .chapter-card > :nth-child(5) { animation-delay: .24s; }
.step.chapter.active .chapter-card > :nth-child(6) { animation-delay: .32s; }
.step.chapter.active .chapter-card > :nth-child(7) { animation-delay: .4s; }

/* ---- Final step -------------------------------------------------------- */

.final-text { font-size: 18px; color: var(--text); margin: 8px 0 0; }
.final-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 26px 0 0 58px; }
.final-actions .btn-back { margin-right: auto; }
.btn-send { min-height: 58px; padding: 0 30px; font-size: 16px; animation: pulse 2.2s 1s infinite; }
.btn-send.is-sending { opacity: .6; pointer-events: none; animation: none; }
.final .notice { margin: 20px 0 0 58px; }

/* ---- No-JavaScript fallback: one long form ----------------------------- */

html:not(.js) .chat .step { margin-bottom: 44px; }
html:not(.js) .step-nav, html:not(.js) .bubble.typing, html:not(.js) .bubble.reaction,
html:not(.js) .thread, html:not(.js) .js-review, html:not(.js) .final .js-back, html:not(.js) .chat-count { display: none; }

/* ---- Email step (conversational) --------------------------------------- */

.convo { padding: 48px 0 64px; }
.convo .bubble:nth-child(1) { animation: bubbleIn .4s .1s both; }
.convo .bubble:nth-child(2) { animation: bubbleIn .4s .5s both; }
.convo .bubble:nth-child(3) { animation: bubbleIn .4s .9s both; }
.convo .answer { animation: rise .5s 1.2s cubic-bezier(.2, .8, .2, 1) both; }
.email-card { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.email-card input { flex: 1 1 260px; min-height: 58px; border: 2px solid #E2E2E2; border-radius: 16px; font-size: 18px; padding: 14px 18px; box-shadow: 0 6px 18px rgba(0, 0, 0, .04); }
.email-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(228, 0, 58, .12); }
.email-card .btn { min-height: 58px; border-radius: 16px; }

/* ---- Thank-you --------------------------------------------------------- */

.done-wrap { position: relative; overflow: hidden; }
.done-mark {
    width: 84px; height: 84px; border-radius: 50%; background: var(--brand); color: var(--white);
    display: grid; place-items: center; margin-bottom: 24px;
    animation: pop .6s .2s cubic-bezier(.2, .8, .2, 1) both, pulse 2.4s 1s infinite;
}
.done-mark svg { width: 40px; height: 40px; }
.done-mark path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .55s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
    position: absolute; top: 0; left: var(--x); width: 9px; height: 15px; border-radius: 2px;
    background: var(--c); opacity: 0;
    animation: fall var(--t, 3s) var(--delay, 0s) cubic-bezier(.25, .6, .4, 1) forwards;
}

/* ---- Admin ------------------------------------------------------------- */

.admin-nav { background: var(--ink); }
.admin-nav .wrap { display: flex; gap: 4px; overflow-x: auto; }
.admin-nav a { color: #CCC; text-decoration: none; font-size: 14px; font-weight: 700; text-transform: uppercase; padding: 14px 16px; white-space: nowrap; border-bottom: 3px solid transparent; }
.admin-nav a:hover { color: var(--white); }
.admin-nav a.active { color: var(--white); border-color: var(--brand); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 36px 0 24px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); margin: 0; }

.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters select, .filters input { width: auto; min-width: 180px; padding: 9px 12px; font-size: 15px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 32px; }
.kpi { display: flex; flex-direction: column; background: var(--soft); border-radius: var(--radius); padding: 20px; border-top: 4px solid var(--brand); }
.kpi .kpi-label { font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.kpi .kpi-value { margin-top: auto; padding-top: 6px; font-size: 40px; font-weight: 900; color: var(--ink); line-height: 1.1; }
.kpi .kpi-sub { font-size: 14px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.stat-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; background: var(--white); }
.stat-card h3 { text-transform: none; font-size: 18px; line-height: 1.35; margin-bottom: 4px; }
.stat-meta { font-size: 13px; color: var(--muted); margin-bottom: 16px; display: flex; gap: 14px; flex-wrap: wrap; }
.stat-meta .tag { background: var(--soft); padding: 2px 8px; border-radius: var(--radius); font-weight: 700; text-transform: uppercase; color: var(--ink); }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(140px, 38%) 1fr 92px; gap: 12px; align-items: center; font-size: 15px; color: var(--ink); }
.bar { height: 14px; background: #EDEDED; border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.bar-row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.bar-row .num b { color: var(--ink); }

.stack { display: flex; height: 30px; border-radius: var(--radius); overflow: hidden; margin: 6px 0 10px; background: #EDEDED; }
.stack span { display: grid; place-items: center; color: var(--white); font-size: 13px; font-weight: 700; min-width: 0; overflow: hidden; }
.stack .s1, .legend i.s1 { background: #F7B3C4; color: var(--ink); }
.stack .s2, .legend i.s2 { background: #EF7393; }
.stack .s3, .legend i.s3 { background: #E4003A; }
.stack .s4, .legend i.s4 { background: #A3002A; }
.stack .s5, .legend i.s5 { background: #5C0018; }
.stack .sna, .legend i.sna { background: #BDBDBD; color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.mean { font-size: 14px; color: var(--ink); margin-top: 8px; }

details.notes { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }
details.notes summary { cursor: pointer; font-weight: 700; color: var(--brand); font-size: 15px; }
.note-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.note-list li { background: var(--soft); border-radius: var(--radius); padding: 12px 14px; font-size: 15px; color: var(--ink); white-space: pre-line; }
.note-list .who { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; white-space: normal; }
.note-list .who a { color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th { background: var(--ink); color: var(--white); text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; white-space: nowrap; }
table.data td { padding: 12px 14px; border-top: 1px solid var(--line); color: var(--ink); vertical-align: top; }
table.data tr:nth-child(even) td { background: #FAFAFA; }
table.data .actions { white-space: nowrap; text-align: right; }
table.data .actions form { display: inline; }

.answer-list { display: grid; gap: 14px; }
.answer-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.answer-item .q { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.answer-item .a { font-size: 17px; font-weight: 700; color: var(--ink); white-space: pre-line; }
.answer-item .n { margin-top: 10px; padding: 10px 12px; background: var(--soft); border-radius: var(--radius); font-size: 15px; color: var(--ink); white-space: pre-line; }
.answer-item .n::before { content: "\201C"; color: var(--brand); font-weight: 900; margin-right: 4px; }
.muted { color: var(--muted); }

.login-box { max-width: 420px; margin: 72px auto; }
.login-box .btn { width: 100%; margin-top: 20px; }
.login-box .field-wrap + .field-wrap { margin-top: 16px; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 760px) {
    body { font-size: 17px; }
    .lang-cards, .grid-2 { grid-template-columns: 1fr; }
    .lang-card { padding: 24px 20px 22px; }
    .card { padding: 20px; }
    .brand-name { font-size: 17px; }
    .header-meta .hide-sm { display: none; }
    .bar-row { grid-template-columns: 1fr 72px; }
    .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
    .form-actions .btn { flex: 1; }

    /* Conversation */
    .chat-body { padding-top: 24px; }
    .avatar { width: 36px; height: 36px; }
    .avatar svg { width: 21px; height: 18px; }
    .host { gap: 10px; }
    .bubble { padding: 14px 16px; }
    .bubble.reassure { font-size: 16px; padding: 12px 14px; }
    .answer, .final-actions, .final .notice { margin-left: 0; }
    .cards, .cards.cards-2 { grid-template-columns: 1fr; gap: 10px; }
    .opt { min-height: 58px; }
    .cards.scale, .cards.scale.with-na { grid-template-columns: 1fr; gap: 8px; }
    .scale .opt { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 56px; padding: 12px 16px 12px 50px; }
    .scale .opt-key { top: 50%; left: 14px; margin-top: -11px; }
    .scale .opt-na { justify-content: flex-start; }
    .level { order: 2; margin-left: auto; height: 22px; }
    .level i { width: 5px; }
    .chapter-card { padding: 34px 22px 30px; border-radius: 18px; }
    .chapter-num { font-size: 120px; bottom: -22px; right: 14px; }
    .step-nav .js-next { flex: 1; }
    .final-actions .btn { flex: 1 1 100%; }
    .chip { font-size: 11px; }
}

/* Touch devices have no number keys to hint at */
@media (hover: none) {
    .keys-hint { visibility: hidden; }
    .opt:hover { transform: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 18px rgba(0, 0, 0, .05); border-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .confetti { display: none; }
}

@media print {
    .site-header, .admin-nav, .site-footer, .filters, .btn { display: none !important; }
    details.notes { display: block; }
    .stat-card { break-inside: avoid; }
}

.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; }
a.btn-back { text-decoration: none; }

/* Personal greeting on the first chapter card ("Hey Ammar!") */
.chapter-hello { margin: 0 0 14px; font-size: clamp(22px, 3vw, 28px); font-weight: 800; color: var(--white); }
.wave-hand { display: inline-block; transform-origin: 70% 80%; animation: hand 1.6s .6s ease-in-out 2; }
@keyframes hand { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-8deg); } 50% { transform: rotate(12deg); } }
