/* =========================================================
   03 YOUR BUILDING: THE CONVERSATION (ask.js) and the place search (place.js)
   On Ivory, so the colours show. Questions on the left in sage,
   answers on the right in slate. One question at a time.
   ========================================================= */

.cv { max-width: 760px; margin: 0 auto; }
.cv-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* progress: a thin sage line, "Question 4 of 11" */
.cv-progress { height: 3px; background: var(--sage-bg); border-radius: 2px; overflow: hidden; }
.cv-fill { display: block; height: 100%; width: 0; background: var(--sage); transition: width 0.4s ease; }
.cv-count { margin: 0.5rem 0 1.4rem; font-size: 0.72rem; letter-spacing: 0.12rem; text-transform: uppercase; color: var(--sage-ink); }

/* turns: 24 px between turns, 12 px between the bubbles of one turn */
.cv-thread { display: flex; flex-direction: column; }
.cv-turn + .cv-turn, .cv-turn + .cv-ctl, .cv-ctl + .cv-turn { margin-top: 24px; }
.cv-turn { display: flex; align-items: flex-end; gap: 0.6rem; }
.cv-bubs { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cv-bot .cv-bubs { align-items: flex-start; max-width: min(36rem, calc(100% - 40px)); }
.cv-you { justify-content: flex-end; }
.cv-you .cv-bubs { align-items: flex-end; max-width: min(30rem, 88%); }

.cv-av { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--clay-ink); color: var(--paper); font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.04rem; align-self: flex-start; margin-top: 2px; }

.cv-b { margin: 0; padding: 0.7rem 1rem; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.cv-bot .cv-b { background: var(--sage-bg); color: var(--ink); border-radius: 18px 18px 18px 4px; }
.cv-bot .cv-b .q { font-size: 1.08rem; font-weight: 500; }
.cv-you .cv-b { background: var(--slate-bg); color: var(--slate-ink); border-radius: 18px 18px 4px 18px; }
.cv-you .cv-b.is-a { box-shadow: inset 0 0 0 1px var(--clay); }
.cv-why { padding-left: 0.4rem; font-size: 0.76rem; line-height: 1.45; color: var(--sage-ink); }
.sys main .cv-change { min-height: 28px; padding: 0 0.3rem; font-size: 0.78rem; color: var(--clay-ink); text-decoration: underline; text-underline-offset: 0.2rem; }
.sys main .cv-change:hover, .sys main .cv-change:focus-visible { color: var(--ink); }

/* typing: three sage dots, 500 ms */
.cv-typing .cv-b { display: inline-flex; gap: 5px; padding: 0.95rem 1rem; }
.cv-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); animation: cv-dot 1s ease-in-out infinite; }
.cv-typing i:nth-child(2) { animation-delay: 0.15s; }
.cv-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cv-dot { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.cv-wait { display: none !important; }
.cv-in { animation: cv-up 0.2s ease both; }
@keyframes cv-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* where you answer: picked, never typed */
.cv-ctl { margin-left: 38px; display: flex; flex-direction: column; gap: 12px; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sys main .cv-chip {
    min-height: 44px; padding: 0.55rem 1.05rem; border: 1px solid var(--slate); border-radius: 999px;
    background: transparent; color: var(--slate-ink); font-size: 0.92rem; line-height: 1.2; text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.sys main .cv-chip:hover { background: var(--slate-bg); }
.sys main .cv-chip.is, .sys main .cv-chip[aria-pressed="true"] { background: var(--slate-ink); border-color: var(--slate-ink); color: var(--paper); }
.sys main .cv-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sys main .cv-chip:disabled { opacity: 0.4; cursor: default; background: transparent; }
.sys main .cv-chip.cv-ns { border-style: dashed; border-color: var(--clay); color: var(--clay-ink); }
.sys main .cv-chip.cv-ns:hover { background: var(--clay-bg); }
.sys main .cv-chip.cv-done { border-color: var(--ink); color: var(--ink); }

/* Pick exactly: a slider with - and + */
.cv-exact { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem; background: var(--slate-bg); border-radius: 14px; }
.cv-exact[hidden] { display: none; }
.cv-exact input[type="range"] { flex: 1 1 10rem; min-width: 8rem; accent-color: var(--slate-ink); height: 44px; }
.sys main .cv-step { width: 44px; height: 44px; border: 1px solid var(--slate); border-radius: 50%; color: var(--slate-ink); font-size: 1.2rem; text-align: center; }
.sys main .cv-step:hover { background: var(--paper); }
.cv-out { min-width: 6rem; font-weight: 500; color: var(--slate-ink); font-variant-numeric: tabular-nums; }

/* the pick lists sit on Ivory too */
.cv-ctl .bsearch, .cv-ctl .psearch { max-width: 100%; color: var(--ink); }
.cv-ctl .bsearch .bs-input, .ps-input { width: 100%; min-height: 44px; padding: 0.7rem 1rem; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid var(--slate); border-radius: 22px; }
.cv-ctl .bsearch .bs-input:focus, .ps-input:focus { outline: 2px solid var(--slate-ink); outline-offset: 1px; border-color: var(--slate-ink); }
.cv-ctl .bs-list, .ps-list { margin-top: 0.4rem; list-style: none; background: #fff; border: 1px solid var(--slate); border-radius: 14px; overflow: hidden; }
.cv-ctl .bs-list li, .ps-list li { padding: 0.6rem 1rem; cursor: pointer; }
.cv-ctl .bs-list li + li, .ps-list li + li { border-top: 1px solid var(--slate-bg); }
.cv-ctl .bs-list li.on, .cv-ctl .bs-list li:hover, .ps-list li.on, .ps-list li:hover { background: var(--slate-bg); text-decoration: none; }
.ps-list[hidden] { display: none; }
.ps-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.ps-main { display: flex; flex-direction: column; min-width: 0; }
.ps-main b { font-weight: 500; }
.ps-main small { font-size: 0.78rem; color: var(--slate-ink); }
.ps-tag { flex: none; padding: 0.1rem 0.5rem; border: 1px solid var(--sage); border-radius: 999px; font-style: normal; font-size: 0.66rem; letter-spacing: 0.06rem; text-transform: uppercase; color: var(--sage-ink); }
.ps-note { margin: 0.5rem 0 0; font-size: 0.82rem; color: var(--clay-ink); }
.ps-note[hidden] { display: none; }
.psearch { position: relative; }

/* mixed use: the uses picked so far */
.cv-uses { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cv-use { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 36px; padding: 0.3rem 0.4rem 0.3rem 0.9rem; background: var(--slate-ink); color: var(--paper); border-radius: 999px; font-size: 0.9rem; }
.cv-use small { opacity: 0.8; }
.sys main .cv-x { width: 28px; height: 28px; border-radius: 50%; color: var(--paper); font-size: 1rem; text-align: center; }
.sys main .cv-x:hover { background: rgba(239, 236, 229, 0.2); }
.cv-hint { margin: 0; font-size: 0.88rem; color: var(--sage-ink); }

/* the closing bubble: the sentence and Draw your plot */
.cv-end { margin: 12px 0 0 38px; display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.cv-sentence { margin: 0; font-family: 'Fraunces', serif; font-style: italic; font-size: clamp(1.3rem, 2.6vw, 1.8rem); line-height: 1.3; }
.cv-go { display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.6rem; background: var(--ink); color: var(--paper); text-decoration: none; font-size: 0.8rem; letter-spacing: 0.14rem; text-transform: uppercase; transition: background 0.2s ease; }
.cv-go:hover, .cv-go:focus-visible { background: var(--pop-ink); }

@media (max-width: 600px) {
    .cv-ctl, .cv-end { margin-left: 0; }
    .cv-bot .cv-bubs { max-width: calc(100% - 36px); }
    .cv-b { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
    .cv-in, .cv-typing i { animation: none; }
    .cv-fill { transition: none; }
}


/* =========================================================
   UI ROUND 9: the chat lives in a soft box, the ONE inner scroll on the site.
   Scrolling inside it moves the chat; at its top or bottom the page goes on (no overscroll-behavior).
   Soft shadows at the top and bottom edges show there is more.
   ========================================================= */
.cv-box {
    position: relative; height: min(68vh, 620px); overflow-y: auto; padding: 20px;
    border: 1px solid rgba(42, 40, 36, 0.12); border-radius: 16px;
    background:
        linear-gradient(#F4F2EC 30%, rgba(244, 242, 236, 0)) top / 100% 28px no-repeat local,
        linear-gradient(rgba(244, 242, 236, 0), #F4F2EC 70%) bottom / 100% 28px no-repeat local,
        radial-gradient(farthest-side at 50% 0, rgba(42, 40, 36, 0.14), transparent) top / 100% 12px no-repeat scroll,
        radial-gradient(farthest-side at 50% 100%, rgba(42, 40, 36, 0.14), transparent) bottom / 100% 12px no-repeat scroll,
        #F4F2EC;
}
.cv-box:focus-visible { outline: 2px solid var(--slate); outline-offset: 2px; }
.cv-after { display: flex; justify-content: center; margin-top: 1.4rem; }
.cv-after[hidden] { display: none; }
.sys main .cv-down { display: inline-flex; flex-direction: column; align-items: center; gap: 0.4rem; font-size: 0.8rem; letter-spacing: 0.12rem; text-transform: uppercase; text-align: center; }
.cv-down i { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: var(--paper); font-style: normal; font-size: 1.2rem; }
.cv-after.bounce .cv-down i { animation: cv-bounce 1.2s ease 3; }
@keyframes cv-bounce { 0%, 100% { transform: none; } 40% { transform: translateY(8px); } 60% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .cv-after.bounce .cv-down i { animation: none; } }

/* round 12: a saved project waiting over the chat: Continue this project / Start a new project */
.proj-card { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; max-width: 720px; margin: 0 0 1.4rem; padding: 24px; border-radius: 12px; background: var(--paper); color: var(--ink); border-top: 3px solid var(--sage); box-shadow: 0 1px 2px rgba(42, 40, 36, 0.06), 0 6px 20px rgba(42, 40, 36, 0.08); }
.proj-card .eyebrow { margin: 0; }
.proj-sentence { margin: 0; font-family: 'Fraunces', serif; font-style: italic; font-size: clamp(1.2rem, 2.4vw, 1.6rem); line-height: 1.3; }
.proj-acts { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.sys main .proj-card .proj-go { display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.4rem; background: var(--ink); border: 1px solid var(--ink); color: var(--paper); text-decoration: none; font-size: 0.8rem; letter-spacing: 0.12rem; text-transform: uppercase; }
.sys main .proj-card .proj-go:hover { background: var(--pop-ink); border-color: var(--pop-ink); color: var(--paper); }
.sys main .proj-card .proj-new { min-height: 48px; padding: 0 1.4rem; background: transparent; border: 1px solid var(--ink); color: var(--ink); font-size: 0.8rem; letter-spacing: 0.12rem; text-transform: uppercase; }
