/* The welcome screen of a new account: a dark stage that draws the story beside the questions. */

/* One dark frame holds the stage; the questions sit on a sheet that runs from top to bottom and scrolls on its own. */
.welcome {
  --wl-top: var(--banner-h, 0px);
  --wl-pad: clamp(20px, 5vw, 72px);
  position: relative; isolation: isolate; overflow: hidden; flex: 1; min-width: 0;
  display: grid; grid-template-columns: 44fr 56fr; grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - var(--wl-top)); height: calc(100dvh - var(--wl-top));
  background: var(--stage-bg); color: var(--stage-ink); transition: grid-template-columns .7s var(--ease);
}
.welcome::before {
  content: ""; position: absolute; inset: 0 56% 0 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--stage-ink) 9%, transparent) 1px, transparent 1.4px); background-size: 24px 24px;
  mask-image: var(--stage-mask); transition: inset 1.2s cubic-bezier(.65, 0, .35, 1);
}
.welcome::after {
  content: ""; position: absolute; inset: -30%; z-index: -2; pointer-events: none; opacity: .8;
  background:
    radial-gradient(12% 26% at 24% 34%, color-mix(in srgb, var(--stage-glow-1) 70%, transparent), transparent 70%),
    radial-gradient(15% 32% at 38% 66%, color-mix(in srgb, var(--stage-glow-2) 80%, transparent), transparent 70%);
  animation: wl-drift 26s ease-in-out infinite alternate;
}
@keyframes wl-drift { to { transform: translate3d(3%, -3%, 0) scale(1.06); } }

/* ---- the stage ---- */
.wl-stage {
  --line-ink: color-mix(in srgb, var(--stage-ink) 30%, transparent);
  --rt-contact: var(--stage-rt-contact); --rt-opportunity: var(--stage-rt-opportunity); --rt-deal: var(--stage-rt-deal); --rt-estimate: var(--stage-rt-estimate);
  --rt-job: var(--stage-rt-job); --rt-appointment: var(--stage-rt-appointment); --rt-invoice: var(--stage-rt-invoice);
  position: relative; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr);
}
.wl-canvas { position: relative; min-height: 0; }
.wl-dia { position: absolute; left: 50%; top: 50%; width: 600px; height: 600px; margin: -300px 0 0 -300px; transform: scale(var(--k, 1)); transform-origin: 50% 50%; }
.wl-layer { position: absolute; inset: 0; }

/* The best known systems turn on one ring around the hub; every logo stays upright. */
.wl-orbit { position: absolute; inset: 0; transition: opacity .6s ease; }
.wl-orbit.off { opacity: 0; }
.wl-ring {
  --r: 240px; --spin: 120s;
  position: absolute; left: 50%; top: 50%; width: calc(var(--r) * 2); height: calc(var(--r) * 2); margin: calc(var(--r) * -1);
  border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--stage-ink) 16%, transparent); animation: wl-spin var(--spin) linear infinite;
}
.wl-ochip { position: absolute; left: 50%; top: 50%; transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) rotate(calc(-1 * var(--a))); }
.wl-ochip .brandmark { position: relative; left: -52px; top: -16px; width: 104px; height: 32px; animation: wl-spin var(--spin) linear infinite reverse; box-shadow: 0 12px 24px -14px var(--stage-shade); }
@keyframes wl-spin { to { transform: rotate(360deg); } }

.wl-hub { position: absolute; left: 252px; top: 252px; width: 96px; height: 96px; z-index: 3; transition: opacity .5s ease, transform .6s cubic-bezier(.34, 1.32, .5, 1); }
.wl-hub img { display: block; width: 100%; height: 100%; border-radius: 26px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--stage-ink) 20%, transparent), 0 24px 50px -18px var(--stage-glow-1); }
.wl-hub.off { opacity: 0; transform: scale(.6); }
.wl-halo { position: absolute; left: 300px; top: 300px; width: 200px; height: 200px; margin: -100px; border-radius: 50%; z-index: 1; pointer-events: none; background: radial-gradient(circle, color-mix(in srgb, var(--stage-flow) 34%, transparent), transparent 64%); animation: wl-breathe 4.5s ease-in-out infinite; transition: opacity .5s; }
.wl-halo.off { opacity: 0; }
@keyframes wl-breathe { 50% { opacity: .55; transform: scale(.92); } }
.wl-burst { position: absolute; left: 300px; top: 300px; width: 120px; height: 120px; margin: -60px; border-radius: 50%; pointer-events: none; opacity: 0; z-index: 2; background: radial-gradient(circle, var(--stage-ink), color-mix(in srgb, var(--stage-flow) 60%, transparent) 35%, transparent 70%); }

/* Dashed links between the hub and each system: idle, or red where time is lost. */
.wl-link { position: absolute; top: 299px; height: 2px; opacity: 0; background: repeating-linear-gradient(90deg, var(--line-ink) 0 6px, transparent 6px 13px); transition: opacity .4s ease; }
.wl-link.a { left: 196px; width: 52px; }
.wl-link.b { left: 352px; width: 52px; }
.wl-link.on { opacity: 1; }
.wl-link.pain { height: 3px; background: repeating-linear-gradient(90deg, var(--stage-bad) 0 3px, transparent 3px 10px); animation: wl-crawl 6s linear infinite; }
@keyframes wl-crawl { to { background-position: 40px 0; } }

.wl-node { position: absolute; left: 0; top: 0; width: 132px; height: 48px; margin: -24px 0 0 -66px; z-index: 4; perspective: 520px; opacity: 0; transition: transform .7s cubic-bezier(.34, 1.25, .5, 1), opacity .4s ease; }
.wl-node.in { opacity: 1; }
.wl-node.in.dim { opacity: .4; }
.wl-flip, .wl-face { position: relative; width: 100%; height: 100%; }
.wl-node .brandmark { width: 100%; height: 100%; border-radius: 14px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--stage-ink) 40%, transparent), 0 18px 34px -16px var(--stage-shade); }
.wl-slot { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 14px; border: 2px dashed color-mix(in srgb, var(--stage-ink) 36%, transparent); color: var(--stage-muted); font-size: 24px; line-height: 1; }
.wl-check { position: absolute; right: -9px; top: -9px; width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: var(--stage-ok); color: var(--stage-on-ok); box-shadow: 0 0 0 3px var(--stage-bg); transform: scale(0); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.wl-check svg { width: 13px; height: 13px; }
.wl-node.ok .wl-check { transform: scale(1); transition-delay: .2s; }
.wl-label { position: absolute; left: 50%; top: calc(100% + 12px); transform: translateX(-50%); white-space: nowrap; font-size: var(--fs-s); font-weight: 500; color: var(--stage-ink); opacity: .85; }
.wl-label.ok { color: var(--stage-ok); }

/* What costs time sits in a tidy stack above the system it belongs to. */
.wl-tag { position: absolute; z-index: 5; transform: translate(-50%, -50%); white-space: nowrap; padding: 6px 9px; border-radius: 8px; font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--stage-ink); background: var(--stage-bad-fill); box-shadow: 0 10px 22px -10px var(--stage-shade); transition: left .4s var(--ease), top .4s var(--ease); }

.wl-flow { position: absolute; inset: 0; width: 600px; height: 600px; overflow: visible; pointer-events: none; z-index: 2; }
.wl-path { fill: none; stroke-width: 3; stroke-linecap: round; opacity: 0; transition: opacity .5s ease; }
.wl-path.show { opacity: 1; }
.wl-path.flowing { stroke: var(--stage-flow); stroke-dasharray: 7 10; }
.wl-path.red { stroke: var(--stage-bad); stroke-dasharray: 3 8; animation: wl-dash-red 3.2s linear infinite; }
.wl-path.back { stroke: color-mix(in srgb, var(--stage-flow) 55%, transparent); stroke-width: 2.5; }
.wl-flow.run .wl-path.flowing { animation: wl-dash 1.1s linear infinite; }
.wl-flow.idle .wl-path.flowing { opacity: .45; }
@keyframes wl-dash { to { stroke-dashoffset: -34; } }
@keyframes wl-dash-red { to { stroke-dashoffset: -44; } }
.wl-head-flow { fill: var(--stage-flow); }
.wl-head-red { fill: var(--stage-bad); }
.wl-pulse { fill: var(--stage-ink); filter: drop-shadow(0 0 6px var(--stage-flow)); }
.wl-hand { position: absolute; left: 300px; top: 176px; z-index: 5; transform: translate(-50%, -50%); opacity: 0; transition: opacity .4s ease; white-space: nowrap; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--stage-bad); }
.wl-hand.on { opacity: 1; }

/* A record type riding the arrow, in its own colour and icon; one that travels both ways rides back as well. */
.wl-pill {
  position: absolute; left: 0; top: 0; z-index: 4; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 4px 12px 4px 4px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; line-height: 1; color: var(--stage-ink);
  background: var(--stage-card); border: 1px solid color-mix(in srgb, var(--rtc, var(--stage-flow)) 50%, transparent); backdrop-filter: blur(6px);
  box-shadow: 0 10px 24px -12px var(--stage-shade), 0 0 18px -8px color-mix(in srgb, var(--rtc, var(--stage-flow)) 70%, transparent); opacity: 0;
  transform: translate(196px, var(--y)) translate(-50%, -50%); animation: wl-ride 4.4s cubic-bezier(.45, 0, .55, 1) infinite backwards;
}
.wl-rti { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 999px; color: var(--rtc); background: color-mix(in srgb, var(--rtc) 24%, transparent); }
.wl-rti svg { width: 13px; height: 13px; }
.wl-way { display: inline-grid; color: var(--rtc); }
.wl-way svg { width: 13px; height: 13px; }
.wl-pill.both { animation-direction: alternate; }
@keyframes wl-ride {
  0% { transform: translate(196px, var(--y)) translate(-50%, -50%) scale(.85); opacity: 0; }
  14% { transform: translate(226px, var(--y)) translate(-50%, -50%) scale(1); opacity: 1; }
  86% { transform: translate(374px, var(--y)) translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(404px, var(--y)) translate(-50%, -50%) scale(.85); opacity: 0; }
}

/* The records of one system in a panel under its logo, the way the system itself would list them. */
.wl-panel {
  position: absolute; left: 0; top: 0; width: 210px; margin-left: -105px; z-index: 3; opacity: 0; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--stage-ink) 13%, transparent); background: color-mix(in srgb, var(--stage-card) 55%, transparent);
  box-shadow: 0 24px 50px -30px var(--stage-shade); backdrop-filter: blur(4px); transition: opacity .35s ease, height .4s var(--ease);
}
.wl-panel.in { opacity: 1; }
.wl-panel-head {
  display: block; padding: 11px 14px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--stage-muted);
}
.wl-sync {
  position: absolute; left: 300px; top: 428px; z-index: 5; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 7px 12px 7px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; line-height: 1;
  color: var(--tone, var(--stage-ink)); background: color-mix(in srgb, var(--tone, var(--stage-ink)) 14%, var(--stage-bg));
  border: 1px solid color-mix(in srgb, var(--tone, var(--stage-ink)) 40%, transparent);
  opacity: 0; transform: translate(-50%, -50%) scale(.85); transition: opacity .3s ease, transform .4s cubic-bezier(.34, 1.4, .5, 1);
}
.wl-sync.in { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.wl-sync.ok { --tone: var(--stage-ok); }
.wl-sync.bad { --tone: var(--stage-bad); }
.wl-sync i { width: 7px; height: 7px; border-radius: 99px; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: wl-ping 2s ease-out infinite; }
@keyframes wl-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

.wl-card { position: absolute; left: 0; top: 0; width: 194px; margin: -20px 0 0 -97px; z-index: 4; transition: transform .5s var(--ease), opacity .3s ease; }
.wl-card-in {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 12px;
  background: var(--stage-card); border: 1px solid color-mix(in srgb, var(--stage-ink) 16%, transparent); color: var(--stage-ink);
  font-size: var(--fs-xs); line-height: 1.2; backdrop-filter: blur(6px); box-shadow: 0 14px 30px -18px var(--stage-shade);
}
.wl-card.bad .wl-card-in { border-color: color-mix(in srgb, var(--stage-bad) 45%, transparent); }
.wl-card.ok .wl-card-in { border-color: color-mix(in srgb, var(--stage-ok) 40%, transparent); }
.wl-av { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; font-size: 10px; font-weight: 600; color: var(--stage-ink); background: color-mix(in srgb, var(--rtc, var(--stage-pill-dot)) 42%, transparent); }
.wl-av.doc { border-radius: 8px; color: var(--rtc); background: color-mix(in srgb, var(--rtc) 22%, transparent); }
.wl-av svg { width: 14px; height: 14px; }
.wl-av.miss { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--stage-ink) 40%, transparent); color: var(--stage-muted); }
.wl-ct { min-height: 1.2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-ct.typo { text-decoration: underline wavy var(--stage-bad); text-underline-offset: 3px; }
.wl-ct.typing::after { content: ""; display: inline-block; width: 1.5px; height: 12px; margin-left: 1px; vertical-align: -1px; background: var(--stage-ink); animation: wl-blink 1s steps(1) infinite; }
@keyframes wl-blink { 50% { opacity: 0; } }
.wl-ctag { padding: 4px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.wl-ctag.ok { color: var(--stage-ok); background: color-mix(in srgb, var(--stage-ok) 16%, transparent); }
.wl-ctag.bad { color: var(--stage-bad); background: color-mix(in srgb, var(--stage-bad) 16%, transparent); }
.wl-ctag.mute { color: var(--stage-muted); background: color-mix(in srgb, var(--stage-ink) 12%, transparent); }

.wl-phases { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 520px; margin: 0; padding: 0; list-style: none; }
.wl-phases li { display: grid; gap: 8px; min-width: 0; font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); transition: color .3s; }
.wl-phases li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-phases li.past { color: var(--ink-2); }
.wl-phases li.cur { color: var(--brand-text); }
.wl-phases b { display: block; height: 3px; border-radius: 99px; background: var(--line); overflow: hidden; }
.wl-phases b i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--brand); transition: width .5s var(--ease); }
.wl-tools { margin-left: auto; display: flex; gap: 6px; }
.wl-tool {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-m); cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  font-size: 15px; line-height: 1; text-decoration: none; transition: border-color .2s, color .2s;
}
.wl-tool:hover { border-color: var(--brand-line); color: var(--brand-text); }
.wl-tool svg { width: 16px; height: 16px; }

/* ---- the questions, on their own sheet: the progress and the tools sit at its top ---- */
.wl-head {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 16px;
  padding: 20px 16px 14px var(--wl-pad); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
}
.wl-script {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  border-top-left-radius: 22px; background: var(--bg); color: var(--ink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--stage-ink) 10%, transparent), -30px 0 70px -40px var(--stage-shade);
}

.wl-main { flex: 1 0 auto; display: flex; align-items: center; padding: clamp(20px, 4vh, 48px) var(--wl-pad) 36px; }
.wl-step { width: 100%; max-width: 560px; display: grid; gap: 18px; align-content: start; }
.wl-step.wide { max-width: 760px; }
.wl-eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--brand-text); }
.wl-step h1, .wl-step h2 { margin: 0; color: var(--ink); font-weight: 600; letter-spacing: var(--tr-tight); text-wrap: balance; }
.wl-step h1 { font-size: clamp(32px, 3.4vw, 46px); line-height: 1.06; }
.wl-step h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; }
.wl-lead { margin: 0; font-size: 16.5px; line-height: 1.55; color: var(--ink-3); text-wrap: pretty; }
.wl-points { display: grid; gap: 12px; margin: 4px 0 0; padding: 0; list-style: none; counter-reset: wl; }
.wl-points li { display: flex; align-items: center; gap: 12px; font-size: var(--fs-l); color: var(--ink-2); counter-increment: wl; }
.wl-points b { font-weight: 600; color: var(--ink); }
.wl-points li::before { content: counter(wl); display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font: 600 12px/1 var(--mono); }
.wl-connected { justify-self: start; display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: var(--fs-m); font-weight: 600; }
.wl-connected.plain { gap: 8px; padding: 6px 14px 6px 12px; }
.wl-connected.plain svg { width: 16px; height: 16px; }

/* The two chosen systems: the slot filled next is outlined, a filled one clears on a click. */
.wl-picks { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; }
.wl-pick {
  display: grid; align-content: center; gap: 8px; justify-items: start; min-height: 76px; padding: 12px 14px; border-radius: var(--r-l);
  border: 1.5px dashed var(--line-strong); background: var(--panel-2); color: var(--ink-4); text-align: left; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s;
}
.wl-pick small { font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); }
.wl-pick-face { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: var(--fs-m); font-weight: 600; }
.wl-pick-face .brandmark { flex: none; }
.wl-pick.next { border-color: var(--brand); box-shadow: var(--focus-ring); }
.wl-pick.filled { border-style: solid; border-color: var(--brand-line); background: var(--panel); color: var(--ink); }
.wl-pick.filled:hover:not(:disabled) { border-color: var(--bad-line); }
.wl-pick:disabled { cursor: default; }
.wl-pick-join { display: grid; place-items: center; color: var(--ink-4); }
.wl-pick-join svg { width: 18px; height: 18px; }
/* Every system is a card of one size: its logo on a white plate across the top, its name and kind below. */
.wl-search { max-width: 360px; }
.wl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.wl-sys {
  position: relative; display: grid; grid-template-rows: auto 1fr; gap: 10px; min-width: 0; padding: 6px 6px 11px; border-radius: var(--r-l);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .15s;
}
.wl-sys:hover { border-color: var(--brand-line); transform: translateY(-1px); box-shadow: var(--sh-card); }
.wl-sys:active { transform: scale(.98); }
.wl-sys[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: var(--focus-ring); }
.wl-sys-logo { display: grid; place-items: center; height: 54px; border-radius: calc(var(--r-l) - 4px); border: 1px solid var(--paper-line); background: var(--paper); }
.wl-sys .brandmark { width: 100%; height: 34px; border: 0; background: transparent; }
.wl-sys-text { display: grid; gap: 3px; align-content: start; min-width: 0; }
.wl-sys-text b { font-size: var(--fs-s); font-weight: 600; line-height: 1.25; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-sys-text small { font-size: var(--fs-2xs); line-height: 1.2; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-sys[data-role]::after {
  content: attr(data-role); position: absolute; top: -8px; right: 10px; padding: 4px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 600; line-height: 1; color: var(--on-brand); background: var(--brand); box-shadow: 0 0 0 2px var(--bg);
}
.wl-sys:disabled { cursor: not-allowed; opacity: .38; transform: none; box-shadow: none; }
.wl-sys:disabled:hover { border-color: var(--line); }
.wl-none { margin: 0; font-size: var(--fs-s); color: var(--ink-3); }
.wl-request {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: var(--r-l);
  border: 2px dashed color-mix(in srgb, var(--brand-text) 65%, transparent); background: color-mix(in srgb, var(--brand) 7%, var(--panel)); font-size: var(--fs-m); color: var(--ink);
}
.wl-request b { font-weight: 600; }
.wl-request .btn { margin-left: auto; }
.wl-request-ic { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); }
.wl-request-ic svg { width: 17px; height: 17px; }

.wl-pains { display: grid; gap: 8px; }
.wl-pain {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); text-align: left; font-size: var(--fs-l); font-weight: 500; cursor: pointer; transition: border-color .2s, background .2s, transform .15s;
}
.wl-pain:hover { border-color: var(--brand-line); }
.wl-pain:active { transform: scale(.99); }
.wl-pain[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.wl-pain .wl-ic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--panel-2); color: var(--brand-text); }
.wl-pain .wl-ic svg { width: 18px; height: 18px; }
.wl-box { display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-left: auto; border-radius: 7px; border: 1.5px solid var(--line-strong); color: transparent; transition: all .2s; }
.wl-box svg { width: 12px; height: 12px; }
.wl-pain[aria-pressed="true"] .wl-box { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* What goes wrong today and what changes: one row each, in the tone of the step. */
.wl-facts { --tone: var(--brand-text); display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wl-facts.bad { --tone: var(--bad); }
.wl-facts.ok { --tone: var(--ok); }
.wl-facts li {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; border-radius: var(--r-l);
  border: 1px solid var(--line); border-left: 3px solid var(--tone); background: var(--panel);
  font-size: var(--fs-l); font-weight: 500; line-height: 1.4; color: var(--ink); opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s;
}
.wl-facts li.in { opacity: 1; transform: none; }
.wl-facts .wl-dot { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent); }
.wl-facts .wl-dot svg { width: 18px; height: 18px; }
.wl-replay { justify-self: start; }

/* Use AI on the choices: a short exchange inside the card, and what the chat set up so far once it has spoken. */
.wl-way-demo { display: grid; gap: 6px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-l); background: var(--panel-2); font-size: var(--fs-xs); line-height: 1.4; color: var(--ink-2); }
.wl-way-demo:has(.me:empty) { display: none; }
.wl-way-demo .me { justify-self: end; max-width: 88%; padding: 5px 10px; border-radius: 12px; background: color-mix(in srgb, var(--brand-text) 11%, var(--panel)); color: var(--ink); }
.wl-way-demo .ai { display: flex; align-items: flex-start; gap: 7px; }
.wl-way-demo .ai img { flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 5px; }
.wl-sofar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--panel); }
.wl-sofar-text { display: grid; gap: 8px; min-width: 0; }
.wl-sofar-text b { font-size: var(--fs-s); font-weight: 600; color: var(--ink); }
.wl-sofar-types { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-sofar-types:empty { display: none; }
.wl-sofar-types svg { width: 12px; height: 12px; }
.wl-sofar .btn { margin-left: auto; }

/* The chat takes the whole screen: one column in the middle, the composer at the bottom, like the chat apps people know. */
.wl-chatview {
  --wl-column: 760px;
  position: fixed; inset: var(--wl-top) 0 0; z-index: 20; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: radial-gradient(70% 42% at 50% 0%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 72%), var(--panel);
  color: var(--ink); outline: 0;
}
.wl-chatview[hidden] { display: none; }
html.wl-chat-open, html.wl-chat-open body { overflow: hidden; }
.wl-cv-head {
  display: flex; align-items: center; gap: 14px; min-width: 0; padding: 12px clamp(14px, 3vw, 24px);
  border-bottom: 1px solid var(--line-soft); background: color-mix(in srgb, var(--panel) 86%, transparent); backdrop-filter: blur(10px);
}
.wl-cv-pair { display: flex; align-items: center; gap: 8px; flex: none; color: var(--ink-3); }
.wl-cv-pair .brandmark { width: 96px; height: 28px; }
.wl-cv-pair svg { width: 16px; height: 16px; }
.wl-cv-title { margin: 0; min-width: 0; font-size: var(--fs-m); font-weight: 600; letter-spacing: 0; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-cv-actions { display: flex; gap: 8px; flex: none; margin-left: auto; }
.wl-cv-short { display: none; }
.wl-thread {
  display: grid; align-content: start; gap: 22px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth;
  padding: 30px max(20px, calc((100% - var(--wl-column)) / 2)) 16px;
}
.wl-hello { display: grid; justify-items: center; gap: 12px; padding: clamp(16px, 7vh, 80px) 0 4px; text-align: center; animation: wl-in .4s var(--ease) both; }
.wl-hello img { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 0 0 1px var(--line), var(--sh-card); }
.wl-hello h3 { margin: 6px 0 0; max-width: 30ch; font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; line-height: 1.15; letter-spacing: var(--tr-tight); color: var(--ink); text-wrap: balance; }
.wl-hello p { margin: 0; max-width: 54ch; font-size: var(--fs-l); line-height: 1.5; color: var(--ink-3); text-wrap: pretty; }
.wl-prompts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px; width: 100%; margin-top: 14px; }
.wl-prompt {
  display: grid; align-content: start; justify-items: start; gap: 10px; padding: 14px; border-radius: var(--r-l); border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); text-align: left; font-size: var(--fs-s); line-height: 1.4; cursor: pointer; box-shadow: var(--sh-xs);
  transition: border-color .2s, background .2s, transform .15s, box-shadow .2s;
}
.wl-prompt:hover { border-color: color-mix(in srgb, var(--rtc, var(--brand)) 55%, var(--line)); background: var(--panel-2); transform: translateY(-1px); box-shadow: var(--sh-card); }
.wl-prompt:active { transform: scale(.98); }
.wl-prompt:focus-visible { outline: 0; border-color: var(--brand); box-shadow: var(--focus-ring); }
.wl-prompt .rtc.rtc-ic, .wl-prompt-ic { width: 30px; height: 30px; border-radius: 999px; }
.wl-prompt .rtc.rtc-ic svg, .wl-prompt-ic svg { width: 15px; height: 15px; }
.wl-prompt-ic { display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.wl-prompt.all { border-color: var(--brand-line); background: color-mix(in srgb, var(--brand) 5%, var(--panel)); }
.wl-prompt-text { font-weight: 500; }
.wl-prompt small { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-2xs); color: var(--ink-4); }
.wl-prompt small svg { width: 11px; height: 11px; }
.wl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-msg { display: grid; gap: 10px; min-width: 0; font-size: var(--fs-l); line-height: 1.6; animation: wl-in .28s var(--ease) both; }
.wl-msg p { margin: 0; }
.wl-msg.me { justify-self: end; max-width: min(80%, 560px); padding: 10px 16px; border-radius: 20px; background: color-mix(in srgb, var(--brand-text) 11%, var(--panel)); color: var(--ink); }
.wl-msg.ai { justify-self: stretch; color: var(--ink); }
.wl-msg.ai > :not(.wl-who) { margin-left: 34px; }
.wl-who { display: flex; align-items: center; gap: 10px; font-size: var(--fs-s); font-weight: 600; color: var(--ink-2); }
.wl-who img { width: 24px; height: 24px; border-radius: 7px; box-shadow: 0 0 0 1px var(--line); }
.wl-word { opacity: 0; transition: opacity .18s linear; }
.wl-word.in { opacity: 1; }
.wl-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.wl-list li { display: flex; gap: 9px; align-items: baseline; opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s var(--ease); }
.wl-list li.in { opacity: 1; transform: none; }
.wl-list li::before { content: "✓"; flex: none; font-weight: 700; color: var(--ok); }
.wl-list li.note::before { content: "i"; font-style: italic; color: var(--ink-4); }
.wl-list li.type { align-items: center; gap: 10px; }
.wl-list li.type::before { content: none; }
.wl-list .rtc.rtc-ic, .wl-option .rtc.rtc-ic { width: 24px; height: 24px; border-radius: 999px; }
.wl-after { display: grid; gap: 10px; justify-items: start; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s var(--ease); }
.wl-after.in { opacity: 1; transform: none; }
.wl-after a:not(.btn) { font-weight: 600; color: var(--brand-text); }
.wl-typing { display: inline-flex; gap: 4px; padding: 6px 2px; }
.wl-typing i { width: 6px; height: 6px; border-radius: 99px; background: var(--ink-5); animation: wl-bounce 1s infinite; }
.wl-typing i:nth-child(2) { animation-delay: .15s; }
.wl-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes wl-bounce { 40% { transform: translateY(-4px); opacity: 1; } 0%, 80%, 100% { opacity: .45; } }
@keyframes wl-in { from { opacity: 0; transform: translateY(8px); } }
.wl-options { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-option {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink-2); font-size: var(--fs-s); font-weight: 500; text-align: left; cursor: pointer; transition: border-color .2s, color .2s, background .2s, transform .15s;
}
.wl-option.ic { padding-left: 5px; }
.wl-option:hover { border-color: var(--rtc, var(--brand)); color: var(--ink); }
.wl-option:active { transform: scale(.97); }
.wl-option.all { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand-text); }
.wl-option small { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-2xs); color: var(--ink-4); }
.wl-option small svg { width: 11px; height: 11px; }

.wl-compose { display: grid; gap: 8px; padding: 10px max(16px, calc((100% - var(--wl-column)) / 2)) calc(16px + env(safe-area-inset-bottom, 0px)); }
.wl-composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 7px 7px 7px 18px; border-radius: 26px; border: 1px solid var(--line-strong);
  background: var(--input); box-shadow: var(--sh-card); transition: border-color .2s, box-shadow .2s;
}
.wl-composer:focus-within { border-color: var(--brand); box-shadow: var(--focus-ring); }
.wl-composer textarea {
  flex: 1; min-width: 0; min-height: 38px; max-height: 160px; padding: 9px 0; border: 0; outline: 0; resize: none;
  background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-l); line-height: 1.4;
}
.wl-composer textarea::placeholder { color: var(--ink-4); }
.wl-send { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 999px; border: 0; background: var(--brand); color: var(--on-brand); cursor: pointer; transition: background .2s, transform .15s; }
.wl-send:hover { background: var(--brand-hover); }
.wl-send:active { transform: scale(.94); }
.wl-send svg { width: 18px; height: 18px; }
.wl-compose-note { margin: 0; text-align: center; font-size: var(--fs-2xs); line-height: 1.4; color: var(--ink-4); }
.wl-assistants { margin: 0; font-size: var(--fs-s); color: var(--ink-3); }
.wl-assistants a { font-weight: 600; color: var(--brand-text); }
.wl-manual { display: grid; gap: 12px; }

.wl-foot {
  position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 12px;
  padding: 14px var(--wl-pad) calc(14px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.wl-hint { flex: 1; min-width: 0; font-size: var(--fs-s); line-height: 1.35; color: var(--ink-4); }
.wl-skip { padding: 8px 6px; border: 0; background: none; color: var(--ink-3); font-size: var(--fs-m); font-weight: 500; white-space: nowrap; }
.wl-skip:hover { color: var(--ink); }

/* ---- the intro: the hub fills the frame first, then steps aside for the questions; welcome.js plays it ---- */
.wl-intro { position: absolute; inset: 0; z-index: 6; display: none; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0 24px clamp(36px, 9vh, 104px); text-align: center; pointer-events: none; }
.wl-intro.is-leaving { display: flex; }
.wl-intro-text { display: grid; gap: 16px; justify-items: center; max-width: 920px; }
.wl-intro-title { margin: 0; font-size: clamp(30px, 4.2vw, 62px); font-weight: 600; line-height: 1.04; letter-spacing: -.035em; color: var(--stage-ink); text-wrap: balance; }
.wl-intro-title span { display: inline-block; }
.wl-intro-count { margin: 0; font-size: clamp(16px, 1.5vw, 20px); color: var(--stage-muted); }
.wl-intro-count b { font-weight: 600; color: var(--stage-flow); font-variant-numeric: tabular-nums; }
.wl-intro-skip {
  position: absolute; right: 22px; bottom: 22px; padding: 9px 13px; border-radius: 999px; pointer-events: auto; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--stage-ink) 18%, transparent); background: color-mix(in srgb, var(--stage-ink) 6%, transparent);
  color: var(--stage-muted); font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; transition: color .2s, border-color .2s;
}
.wl-intro-skip:hover { color: var(--stage-ink); border-color: color-mix(in srgb, var(--stage-ink) 42%, transparent); }
.wl-intro-glow {
  position: absolute; left: 300px; top: 300px; width: 1100px; height: 1100px; margin: -550px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity 1.2s ease;
  background: radial-gradient(circle, color-mix(in srgb, var(--stage-glow-1) 55%, transparent), color-mix(in srgb, var(--stage-glow-2) 22%, transparent) 38%, transparent 66%);
}
/* Without the script the page shows itself after a few seconds, so nothing stays hidden. */
@media (prefers-reduced-motion: no-preference) {
  html.js .welcome.is-intro::before { inset: 0; }
  html.js .welcome.is-intro .wl-intro { display: flex; animation: wl-intro-gone 0s 9s forwards; }
  html.js .welcome.is-intro .wl-intro:not(.is-playing) :is(.wl-intro-text, .wl-intro-skip) { opacity: 0; }
  html.js .welcome.is-intro .wl-intro-glow { opacity: 1; }
  html.js .welcome.is-intro .wl-dia { opacity: 0; animation: wl-intro-dia 0s 9s forwards; }
  html.js .welcome.is-intro .wl-script { transform: translateX(calc(100% + 64px)); animation: wl-intro-sheet 0s 9s forwards; }
  html.js .welcome.is-intro .wl-intro.is-playing,
  html.js .welcome.is-intro:has(.wl-intro.is-playing) :is(.wl-dia, .wl-script) { animation: none; }
}
@keyframes wl-intro-gone { to { visibility: hidden; } }
@keyframes wl-intro-dia { to { opacity: 1; } }
@keyframes wl-intro-sheet { to { transform: none; opacity: 1; } }

@media (max-width: 960px) {
  .welcome { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; height: auto; min-height: calc(100vh - var(--wl-top)); overflow: clip; }
  .welcome::before { inset: 0; }
  .wl-head { top: var(--wl-top); border-radius: 22px 22px 0 0; }
  .wl-stage { height: 38vh; height: 38svh; min-height: 240px; }
  .wl-script { overflow: visible; border-radius: 22px 22px 0 0; }
  .wl-main { align-items: flex-start; }
}
@media (max-width: 960px) and (prefers-reduced-motion: no-preference) {
  html.js .welcome.is-intro { height: calc(100vh - var(--wl-top)); height: calc(100svh - var(--wl-top)); overflow: hidden; }
  html.js .welcome.is-intro .wl-script { transform: translateY(56px); opacity: 0; }
}
@media (max-width: 560px) {
  .welcome { --wl-pad: 16px; }
  .wl-phases li span { display: none; }
  .wl-hint { visibility: hidden; height: 0; overflow: hidden; }
  .wl-step h1 { font-size: 30px; }
  .wl-step h2 { font-size: 25px; }
  .wl-cv-head { gap: 10px; }
  .wl-cv-title, .wl-cv-long { display: none; }
  .wl-cv-short { display: inline; }
  .wl-cv-pair .brandmark { width: 72px; height: 24px; }
  .wl-cv-pair svg { width: 14px; height: 14px; }
  .wl-cv-actions [data-chat-close] { width: var(--h-sm); padding: 0; justify-content: center; }
  .wl-thread { gap: 16px; padding: 18px 14px 10px; }
  .wl-compose { padding: 6px 10px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .wl-msg.me { max-width: 90%; }
}
@media (max-width: 480px) {
  .wl-picks { grid-template-columns: minmax(0, 1fr); }
  .wl-pick-join { transform: rotate(90deg); }
  .wl-pain { gap: 12px; padding: 12px 14px; font-size: var(--fs-m); }
  .wl-msg.ai > :not(.wl-who) { margin-left: 0; }
  .wl-foot { gap: 8px; }
  .wl-foot [data-back] span { display: none; }
  .wl-foot [data-back] { width: var(--h-md); padding: 0; justify-content: center; }
  .wl-skip { padding: 8px 2px; font-size: var(--fs-s); }
}
@media (prefers-reduced-motion: reduce) {
  .welcome::after, .wl-ring, .wl-ring .brandmark, .wl-halo, .wl-link.pain, .wl-path, .wl-pill, .wl-typing i, .wl-msg, .wl-hello, .wl-sync i { animation: none !important; }
  .wl-prompt { transition: none; }
  .wl-thread { scroll-behavior: auto; }
  .wl-pill { opacity: 1; transform: translate(300px, var(--y)) translate(-50%, -50%); }
  .wl-facts li, .wl-node, .wl-card, .wl-word, .wl-list li, .wl-after, .wl-tag, .wl-panel, .wl-sync { transition: none; }
}
