/* /advisor (views/brain/advisor.ejs) on the Site Plan design. Tokens only.
   The page sits on drawing paper: the copy and the conversation on the left, the block plan on the right. Each
   answer is a notice (an amber band over a white sheet) that writes itself in. Motion runs only in .pw-motion
   (views/partials/site/motion-gate.ejs); static mode and reduced motion get end states. */

.page-advisor { background: var(--paper-2); }

/* ---------- Layout ---------- */
.adv { position: relative; isolation: isolate; padding: calc(var(--nav-clear) + clamp(20px, 3.4vw, 52px)) 0 clamp(80px, 10vw, 140px); }
.adv::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--scrim) 1px, transparent 1px), linear-gradient(90deg, var(--scrim) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(#000, #000 35%, transparent 90%); mask-image: linear-gradient(#000, #000 35%, transparent 90%);
}
.adv-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: clamp(40px, 5.5vw, 88px); align-items: start; }
.advisor-wrap { min-width: 0; }
.adv-side { position: sticky; top: calc(var(--nav-clear) + 18px); min-width: 0; }

/* ---------- Copy ---------- */
.adv-copy { display: grid; gap: 22px; justify-items: start; padding-top: clamp(4px, 1.6vw, 24px); }
.adv-copy .h1 { font-size: clamp(44px, 5.3vw, 78px); }
.h1-break { display: none; }
@media (min-width: 640px) { .h1-break { display: inline; } }
.adv-copy .lead { max-width: 33em; }
.adv-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.quota-pill {
  display: inline-flex; align-items: center; gap: 11px; min-height: 36px; padding: 0 14px 0 13px; border-radius: 10px;
  background: var(--sheet); box-shadow: var(--sh-1); font-size: 14px; font-weight: 500; color: var(--ink-2); letter-spacing: -0.005em;
}
#quota-count { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.quota-pill svg { width: 20px; height: 20px; color: var(--amber-deep); flex: none; }
.q-dots { display: inline-flex; gap: 5px; }
.q-dots i { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--rule-2); transition: background-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out); }
.q-dots i.on { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.q-dots i.spent { animation: q-spend 640ms var(--ease-out); }
@keyframes q-spend { 0% { transform: scale(1.7); background: var(--amber); box-shadow: 0 0 0 6px var(--amber-soft); } 100% { transform: none; } }
.adv-offline {
  display: flex; gap: 10px; align-items: flex-start; max-width: 36em; padding: 11px 14px; border-radius: 12px;
  background: var(--amber-wash); box-shadow: inset 0 0 0 1px var(--amber-soft); color: var(--amber-ink); font-size: 14px; line-height: 1.5;
}
.adv-offline svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
noscript .adv-offline { margin-top: 18px; }

/* ---------- Ask box ---------- */
.ask-bar { display: grid; gap: 14px; margin-top: clamp(28px, 3.2vw, 44px); }
.ask-inner {
  display: flex; align-items: flex-end; gap: 8px; padding: 7px 7px 7px 20px; border-radius: 18px;
  background: var(--sheet); box-shadow: 0 0 0 1px var(--rule-2), 0 18px 44px -24px rgba(17, 18, 20, .34);
  transition: box-shadow var(--dur-instant) var(--ease-out);
}
.ask-inner:focus-within { box-shadow: 0 0 0 1.5px var(--amber-deep), 0 0 0 5px var(--amber-wash), 0 18px 44px -24px rgba(17, 18, 20, .34); }
/* min-width:0 lets the textarea shrink inside the flex row; 16px stops iOS Safari zooming on focus. */
.ask-inner textarea {
  flex: 1 1 auto; min-width: 0; min-height: 50px; max-height: 140px; padding: 13px 0; border: 0; background: transparent; resize: none;
  font-size: 16px; line-height: 1.45; color: var(--ink); outline: none;
}
@media (min-width: 640px) { .ask-inner textarea { font-size: 17px; } }
.ask-inner textarea::placeholder { color: var(--ink-3); }
.ask-inner textarea:focus-visible { box-shadow: none; }
.ask-btn { flex: none; --h: 50px; padding: 0 20px; border-radius: 13px; }
.ask-btn:disabled { opacity: .5; cursor: progress; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.example-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 13px 0 10px; border-radius: 10px;
  background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule-2); font-size: 14px; color: var(--ink-2); text-align: left;
  transition: color var(--dur-instant), box-shadow var(--dur-instant), background-color var(--dur-instant);
}
.example-chip svg { width: 15px; height: 15px; flex: none; color: var(--amber-deep); }
.example-chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--amber-deep); background: var(--amber-wash); }
/* Chips carry a short label for narrow screens and the full question above it. */
.chip-short { display: inline; }
.chip-long { display: none; }
@media (min-width: 640px) { .chip-short { display: none; } .chip-long { display: inline; } }
.ask-note { font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }

/* In a conversation the ask bar floats at the bottom of the view, frosted like the header pill. */
.has-chat .ask-bar {
  position: sticky; bottom: 12px; z-index: 6; gap: 10px; padding: 10px; border-radius: 24px;
  background: color-mix(in srgb, var(--paper-2) 80%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px);
  box-shadow: 0 0 0 1px var(--rule), 0 22px 54px -26px rgba(17, 18, 20, .5);
}
.has-chat .examples { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 1px; margin: -1px; }
.has-chat .examples::-webkit-scrollbar { display: none; }
.has-chat .example-chip { flex: none; }
.has-chat .chip-long { display: none; }
.has-chat .chip-short { display: inline; }
.has-chat .ask-note { padding: 0 6px 2px; font-size: 12px; }

/* ---------- The conversation ---------- */
.chat-log { display: grid; gap: 22px; margin-top: clamp(28px, 3vw, 40px); }
.chat-log:empty { display: none; }
.msg { scroll-margin-top: calc(var(--nav-clear) + 16px); min-width: 0; }
.msg-user {
  justify-self: end; max-width: min(88%, 560px); padding: 11px 18px 13px; border-radius: 18px 18px 6px 18px;
  background: var(--ink); color: var(--paper); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere;
}
.msg-k { display: block; margin-bottom: 3px; font: 500 10.5px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; opacity: .62; }

/* The notice: an amber band (the brand, like the site notice on the lamp post) over a white sheet */
.notice { position: relative; overflow: hidden; border-radius: 8px 8px 22px 22px; background: var(--sheet); box-shadow: 0 0 0 1px var(--rule), 0 26px 64px -34px rgba(17, 18, 20, .38); }
.notice-head { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px 0 14px; background: var(--amber-field); color: #111214; }
.notice-mark { display: grid; place-items: center; width: 24px; height: 24px; }
.notice-mark svg { width: 22px; height: 22px; color: #111214; }
.notice-mark svg [stroke="#f59e0b"] { stroke: #111214; }
.notice-head b { font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.notice-meta { margin-left: auto; font: 500 11px/1.2 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: rgba(17, 18, 20, .66); white-space: nowrap; }
.notice-body { padding: 20px 22px 22px; font-size: 16.5px; line-height: 1.66; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 640px) { .notice-body { padding: 18px 16px 18px; font-size: 16px; } .notice-head { padding: 0 14px 0 12px; } }
.answer p { margin: 0 0 14px; }
.answer p:last-child { margin-bottom: 0; }
.answer strong { font-weight: 600; }
.answer-head { display: block; margin: 20px 0 2px; font-family: var(--font-display); font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; }
.answer p:first-child > .answer-head:first-child { margin-top: 0; }
.cite {
  display: inline-block; vertical-align: .12em; min-width: 26px; height: 19px; margin: 0 2px; padding: 0 6px; border-radius: 6px;
  background: var(--amber-soft); color: var(--amber-ink); font: 600 11px/19px var(--font-mono); text-align: center; text-decoration: none; letter-spacing: 0;
  transition: background-color var(--dur-instant), color var(--dur-instant);
}
a.cite:hover { background: var(--amber-field); color: #111214; }
.datacard { display: grid; gap: 4px; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.datacard strong { color: var(--ink); font-weight: 600; }
.datacard-k { font: 500 10.5px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
/* A postcode in the question: a link to PlanWatch's search for it */
.nearby { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 11px 14px 11px 11px; border-radius: 12px; background: var(--amber-wash); box-shadow: inset 0 0 0 1px var(--amber-soft); font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.nearby-pin { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--sheet); box-shadow: inset 0 0 0 1px var(--amber-soft); color: var(--amber-deep); }
.nearby-pin svg { width: 18px; height: 18px; }
.nearby a { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.nearby a:hover { text-decoration-color: var(--amber-deep); }
.sources-box { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--rule-2); }
.sources-box h4 { margin: 0 0 8px; font: 500 11px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.src-item { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0 6px; padding: 6px 0; font-size: 14.5px; line-height: 1.45; }
.src-item + .src-item { border-top: 1px solid var(--rule-soft); }
.src-item a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color var(--dur-instant); }
.src-item a:hover { text-decoration-color: var(--amber-deep); }
.src-ref { font: 600 11px/21px var(--font-mono); color: var(--amber-ink); }
.src-main { min-width: 0; }
.src-conf { margin-left: 4px; font: 500 11px/1.4 var(--font-mono); color: var(--ink-3); white-space: nowrap; }
.src-subs { margin-top: 3px; font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.src-subs a { color: var(--ink-2); }
.src-dot { color: var(--ink-4); }
.notice-body:focus, .notice-body:focus-visible { outline: none; box-shadow: none; }
.free-note { margin-top: 16px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.disclaimer { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--paper-2); font-size: 13px; line-height: 1.55; color: var(--ink-3); }

/* Waiting: three ruled lines drawn over and over, like notes being taken */
.typing { color: var(--ink-3); font-size: 15px; }
.pens { display: block; width: min(420px, 100%); height: auto; margin-top: 14px; }
.pens path { fill: none; stroke: var(--rule-2); stroke-width: 7; stroke-linecap: round; }
.pw-motion .pens path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pen 2.4s var(--ease-draw) infinite; }
.pw-motion .pens path:nth-child(2) { animation-delay: .18s; }
.pw-motion .pens path:nth-child(3) { animation-delay: .36s; }
@keyframes pen { 0% { stroke-dashoffset: 1; opacity: 1; } 55% { stroke-dashoffset: 0; opacity: 1; } 85%, 100% { stroke-dashoffset: 0; opacity: 0; } }

/* The email gate: the rest of the answer shown redacted, then the unlock */
.locked { display: grid; gap: 9px; margin: 14px 0 18px; }
.locked span { display: block; height: 11px; border-radius: 3px; background: var(--paper-3); transform-origin: left center; }
.locked span:nth-child(1) { width: 97%; } .locked span:nth-child(2) { width: 91%; } .locked span:nth-child(3) { width: 99%; }
.locked span:nth-child(4) { width: 84%; } .locked span:nth-child(5) { width: 62%; }
.unlock { display: grid; gap: 10px; padding: 18px; border-radius: 16px; background: var(--amber-wash); box-shadow: inset 0 0 0 1px var(--amber-soft); }
.unlock strong { font-family: var(--font-display); font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.unlock-sub { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.unlock-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.unlock-form input { flex: 1 1 220px; min-width: 0; height: 48px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--rule-2); background: var(--sheet); font-size: 16px; color: var(--ink); transition: border-color var(--dur-instant), box-shadow var(--dur-instant); }
.unlock-form input:focus { outline: none; border-color: var(--amber-deep); box-shadow: var(--focus); }
.unlock-form .btn { flex: none; }
.unlock-form .btn:disabled { opacity: .55; cursor: progress; }
.unlock-err { font-size: 14px; font-weight: 500; color: var(--amber-ink); }
.unlock-alt { font-size: 13.5px; color: var(--ink-3); }
.unlock-alt a { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
/* "Email me this answer", under the latest answer */
.email-me { margin-top: 18px; }
.email-me strong { font-size: 17px; }
.email-me.is-sent strong { font-family: inherit; font-size: 15px; letter-spacing: 0; }
.consent { flex: 1 1 100%; display: flex; align-items: flex-start; gap: 10px; margin-top: 4px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
.consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--amber-deep); }
.gate { display: grid; gap: 14px; justify-items: start; }
.gate strong { font-family: var(--font-display); font-size: 19px; line-height: 1.35; font-weight: 600; letter-spacing: -0.02em; }

/* ---------- Motion: arrivals and the writing-in ---------- */
.pw-motion .msg-user { animation: msg-in 340ms var(--ease-out) both; }
.pw-motion .notice { animation: notice-in 460ms var(--ease-out) 120ms both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); filter: blur(2px); } }
@keyframes notice-in { from { opacity: 0; transform: translateY(16px); } }
.notice.is-writing .w { animation: w-in 380ms var(--ease-out) both; animation-delay: calc(var(--w) * var(--wstep, 16ms)); }
@keyframes w-in { from { opacity: 0; filter: blur(3px); } }
.notice.is-writing .cite { animation: cite-pop 460ms var(--ease-spring) both; animation-delay: calc(var(--w, 0) * var(--wstep, 16ms)); }
@keyframes cite-pop { from { opacity: 0; transform: scale(.4); } }
.notice.is-writing :is(.datacard, .nearby, .sources-box h4, .src-item, .disclaimer, .unlock, .gate) { animation: blk-in 440ms var(--ease-out) both; animation-delay: calc(var(--wend, 0ms) + 120ms + var(--k, 0) * 45ms); }
@keyframes blk-in { from { opacity: 0; transform: translateY(8px); filter: blur(2px); } }
.notice.is-writing .locked span { animation: redact 560ms var(--ease-draw) both; animation-delay: calc(var(--wend, 0ms) + var(--k, 0) * 70ms); }
@keyframes redact { from { transform: scaleX(0); } }
.notice.is-writing .notice-meta::after { content: ""; display: inline-block; width: 6px; height: 11px; margin-left: 6px; vertical-align: -1px; background: currentColor; animation: caret 900ms steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.notice[data-state="pending"] .notice-meta::after { content: "…"; }

/* ---------- Answers grounded in ---------- */
.grounded { margin-top: clamp(44px, 4.6vw, 64px); }
.grounded h3 { margin-bottom: 14px; font: 500 12px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.grounded-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grounded-item { position: relative; display: grid; gap: 3px; align-content: start; min-width: 0; padding: 16px 16px 18px; border-radius: 6px 6px 16px 16px; background: var(--sheet); box-shadow: var(--sh-1); }
.g-ico { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 10px; border-radius: 11px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); }
.g-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.g-ico .am { stroke: var(--amber-deep); fill: var(--amber-soft); }
.g-ico path { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 900ms var(--ease-draw); transition-delay: calc(200ms + var(--i, 0) * 90ms); }
.grounded-item b { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.g-sub { font-size: 13px; line-height: 1.4; color: var(--ink-3); }
/* the icons draw themselves as each sheet comes in (only sheets that waited below the fold animate) */
.pw-motion .grounded-item.rv-wait:not(.in) .g-ico path { stroke-dashoffset: 1; }

/* ---------- The block plan ---------- */
.adv-plan {
  position: relative; margin: 0; overflow: clip; padding: clamp(14px, 1.7vw, 22px) clamp(14px, 1.7vw, 22px) 18px; border-radius: var(--r-xl);
  background-color: var(--sheet); box-shadow: var(--sh-2);
  background-image: linear-gradient(var(--scrim) 1px, transparent 1px), linear-gradient(90deg, var(--scrim) 1px, transparent 1px); background-size: 20px 20px;
}
.bplan-box { position: relative; }
.adv-plan figcaption { display: grid; gap: 3px; margin-top: 12px; padding: 14px 4px 0; border-top: 1px solid var(--rule); }
.adv-plan figcaption b { font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: -0.015em; }
.adv-plan figcaption span { font-size: 13.5px; color: var(--ink-3); }

.bplan .bp-road { fill: var(--paper-3); }
.bplan .bp-lane { fill: none; stroke: var(--sheet); stroke-width: 3; stroke-dasharray: 22 18; opacity: .95; }
.bplan .bp-tree { fill: var(--green-wash); stroke: var(--green); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; }
.bplan .bp-tree.faint { stroke: color-mix(in srgb, var(--green) 45%, transparent); fill: color-mix(in srgb, var(--green-wash) 60%, transparent); }
.bplan .ln.ink.heavy.bp-fence { stroke-width: 2.6; }
.bplan .bp-kerb { stroke-width: 1.6; }
.bplan text { font-size: 9px; }
.bplan .bp-anno { fill: var(--ink-3); transition: fill 300ms var(--ease-out), opacity 300ms var(--ease-out); }
.bplan .bp-hide { opacity: 0; transition: opacity 300ms var(--ease-out); }
.bplan .bp-t.is-on .bp-hide { opacity: 1; }
.bplan .fill-hatch { opacity: calc(var(--p) * .38); transition: opacity 360ms var(--ease-out); }
.bplan .bp-hatch-on { opacity: 0; }
.bplan .bp-t { transition: opacity 360ms var(--ease-out); }
.adv-plan.has-topic .bp-t:not(.is-on) { opacity: .26; }
.bplan .bp-t.is-on .fill-hatch { opacity: calc(var(--p) * .95); }
.bplan .bp-t.is-on .ln.red:not(.bp-lead) { stroke-width: 2.6; }
.bplan .bp-t.is-on .ln.ink { stroke: var(--amber-deep); }
.bplan .bp-t.is-on .bp-anno { fill: var(--amber-ink); font-weight: 600; }
.bplan .bp-t.is-on .bp-tree { fill: color-mix(in srgb, var(--green) 26%, var(--sheet)); stroke-width: 2; }

/* The plan draws itself as it comes into view (on load on a desktop, where it is in the first screen): the street,
   the neighbours, the house, the red line round the site, then the works, then the notes. About two seconds.
   Below the fold the reveal gate marks it .rv-wait and story.js adds .in when it arrives, which starts the drawing. */
@keyframes bp-draw { from { --p: 0; } to { --p: 1; } }
@keyframes bp-pop { from { opacity: 0; transform: scale(.4); } }
.pw-motion .adv-plan:not(.rv-wait) .bplan .lyr, .pw-motion .adv-plan.in .bplan .lyr { animation: bp-draw var(--bp-dur, 760ms) var(--ease-draw) both; animation-delay: var(--bp-at, 0ms); }
.pw-motion .adv-plan:not(.rv-wait) .bplan .bp-tree, .pw-motion .adv-plan.in .bplan .bp-tree { animation: bp-pop 560ms var(--ease-spring) both; animation-delay: calc(760ms + var(--k, 0) * 90ms); }
.pw-motion .bplan .bp-l2 { --bp-at: 120ms; }
.pw-motion .bplan .bp-l3 { --bp-at: 260ms; --bp-dur: 860ms; }
.pw-motion .bplan .bp-l3b { --bp-at: 380ms; }
.pw-motion .bplan .bp-l4 { --bp-at: 520ms; }
.pw-motion .bplan .bp-site { --bp-at: 640ms; --bp-dur: 1150ms; }
.pw-motion .bplan .bp-w { --bp-at: calc(1050ms + var(--k, 0) * 110ms); --bp-dur: 680ms; }
.pw-motion .bplan .bp-l5 { --bp-at: 1300ms; }

/* The example questions, pinned to the plan (built by /site/js/advisor.js from the chips) */
.qpins { position: absolute; inset: 0; pointer-events: none; }
/* (--x, --y) is the point; the tag opens centred, to the left or to the right of it (data-a) */
.qpin { --ax: 50%; --tx: -50%; position: absolute; left: var(--x); top: var(--y); z-index: 2; padding-bottom: 15px; pointer-events: auto; cursor: pointer;
  opacity: 0; transform: translate(var(--tx), calc(-100% + 12px)) scale(.9); transform-origin: var(--ax) 100%;
  transition: opacity 360ms var(--ease-out), transform 600ms var(--ease-spring); }
.qpin[data-a="l"] { --ax: calc(100% - 17px); --tx: calc(-100% + 17px); }
.qpin[data-a="r"] { --ax: 17px; --tx: -17px; }
.qpin.on { opacity: 1; transform: translate(var(--tx), -100%); }
.qpin::before { content: ""; position: absolute; left: var(--ax); bottom: 4px; width: 1.5px; height: 12px; margin-left: -.75px; background: var(--ink-2); }
.qpin::after { content: ""; position: absolute; left: var(--ax); bottom: 0; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2.5px var(--sheet); }
.qpin-in { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 12px; background: var(--sheet); white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(17, 18, 20, .07), 0 10px 26px -10px rgba(17, 18, 20, .32); transition: box-shadow var(--dur-quick) var(--ease-out), transform var(--dur-quick) var(--ease-out); }
.qpin i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--amber-soft); color: var(--amber-ink); font: 600 12px/1 var(--font-mono); font-style: normal; }
.qpin b { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.qpin:hover .qpin-in, .adv-plan .qpin.is-on .qpin-in { box-shadow: 0 0 0 1.5px var(--amber-deep), 0 12px 28px -10px rgba(17, 18, 20, .34); transform: translateY(-2px); }
.adv-plan.has-topic .qpin:not(.is-on) { opacity: .5; }
.adv-plan .qpin.is-on i { background: var(--amber-field); color: #111214; }

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .adv-grid { grid-template-columns: minmax(0, 1fr); }
  .adv-side { position: static; max-width: 560px; }
}
@media (max-width: 760px) {
  .grounded-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .adv-copy { gap: 18px; }
  .adv-copy .h1 { font-size: clamp(40px, 11.4vw, 52px); }
  .ask-inner { padding-left: 16px; }
  .ask-btn { padding: 0 16px; }
  .msg-user { max-width: 94%; }
  .has-chat .ask-bar { bottom: 8px; padding: 8px; border-radius: 22px; }
  /* phones: the pins are just their markers (the questions are the chips just above) */
  .qpin-in { padding: 4px; }
  .qpin b { display: none; }
}

/* ---------- Static mode and reduced motion: everything in its end state ---------- */
.pw-static .qpin { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .qpin, .q-dots i { transition: none; }
  .q-dots i.spent { animation: none; }
}
