/* App additions on top of the demo stylesheet (app.css). */
.signin, .signin-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; box-sizing: border-box; }
.signin-body .signin { min-height: 0; }
.signin-card { width: min(460px, 100%); gap: 18px; padding: 32px; }
.signin-card h1 { font-size: 1.75rem; }
.signin-card .form { gap: 12px; }
.signin-card form .btn { width: 100%; }
.form input[type="url"], .form input[type="tel"] { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); padding: 12px 16px; font-size: 1rem; min-height: 50px; box-sizing: border-box; }
.form .field { display: grid; gap: 6px; }
.form .field label { font-weight: 700; font-size: .9375rem; }
.bottom-nav.three { grid-template-columns: repeat(3, 1fr); }
.bottom-nav.four { grid-template-columns: repeat(4, 1fr); }

/* Edit on the page: the site on the left, the field and Archie on the right. */
.view.view-edit { max-width: none; }
.edit-layout { display: grid; gap: 20px; }
@media (min-width: 1100px) { .edit-layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; } .edit-panel { position: sticky; top: 24px; } }
.edit-site { display: grid; gap: 12px; min-width: 0; }
.edit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.edit-bar .select-wrap select { min-width: 220px; }
#edit-frame { width: 100%; height: calc(100vh - 170px); min-height: 520px; border: 0; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow), 0 0 0 1px var(--card-line); }
@media (max-width: 1099px) {
  #edit-frame { height: 70vh; min-height: 420px; }
  /* On phones and tablets the field opens as a sheet over the menu, with the page still in view above it. */
  #edit-field.editing { position: fixed; left: 0; right: 0; bottom: 0; z-index: 48; max-height: 75vh; overflow: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-lg); animation: sheet-up .2s ease-out; }
  /* Unpublished edits: a small bar above the menu, so Publish is always in reach. */
  #edit-pending:not([hidden]) { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 32; padding: 14px 16px; gap: 10px; box-shadow: var(--shadow-lg); }
  #edit-pending .list { display: none; }
  #edit-field .row .btn, #edit-pending .row .btn { flex: 1 1 0; }
  #edit-field .row .grow, #edit-pending .row .grow { display: none; }
  .view-edit { padding-bottom: 150px; }
  body:has(.view-edit:not([hidden]) #edit-pending:not([hidden])) .toast { bottom: calc(200px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 960px) and (max-width: 1099px) { #edit-pending:not([hidden]) { bottom: 16px; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #edit-field.editing { animation: none; } }
.edit-panel { display: grid; gap: 16px; align-content: start; }
/* The edit form: every field type the site's schema has, its rules, and the list the field sits in. */
.form input[type="number"] { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); padding: 12px 16px; font-size: 1rem; min-height: 50px; box-sizing: border-box; }
.form .field > .note { font-size: .875rem; }
.form .field .select-wrap + input { margin-top: 2px; }
.req { margin-left: 6px; font: 500 .6875rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chars { justify-self: end; font: 500 .8125rem/1 var(--mono); color: var(--muted); }
.chars.over, .field-err { color: var(--brick); }
.field-err { font-size: .9375rem; font-weight: 700; }
.form .field.invalid input, .form .field.invalid textarea, .form .field.invalid select { border-color: var(--brick); }
.onoff { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 700; cursor: pointer; }
.onoff input { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 48px; height: 28px; margin: 0; border-radius: 14px; background: var(--line-strong); cursor: pointer; transition: background .15s; }
.onoff input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.onoff input:checked { background: var(--fern); }
.onoff input:checked::after { transform: translateX(20px); }
.onoff input:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }
.ef-head { display: grid; gap: 4px; }
.ef-head b { font: 700 1.125rem/1.3 var(--display); }
.list-bar { display: grid; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--sunken); }
.list-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } /* fixed places: a button that changes its label never moves the others */
.list-acts .btn { padding: 0 12px; }
.list-acts [data-armed] { border-color: var(--brick); color: var(--brick); }
/* Adding something new: an event, a speaker, a session, each with the page it shows on. */
.add-choices { display: grid; gap: 10px; }
.btn.add-choice { display: grid; justify-content: stretch; justify-items: start; gap: 2px; min-height: 60px; padding: 10px 18px; border-radius: var(--r-md); text-align: left; white-space: normal; }
.add-choice b { font-size: 1rem; }
.add-choice .note { font-weight: 400; font-size: .875rem; }
.kept { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--marigold-soft); color: var(--on-marigold-soft); font-size: .9375rem; line-height: 1.5; }
#edit-changes li.clash .d { color: var(--brick); }
@media (prefers-reduced-motion: reduce) { .onoff input, .onoff input::after { transition: none; } }
.edit-empty { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.edit-empty b { display: block; font: 700 1.125rem/1.3 var(--display); margin-bottom: 4px; }
.photo-pick { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: center; }
.photo-pick img { width: 120px; height: 90px; object-fit: cover; border-radius: 12px; background: var(--line); }
.photo-do { display: grid; gap: 6px; justify-items: start; }
.photo-pick:has(input:focus-visible) .btn { outline: 3px solid var(--marigold); outline-offset: 2px; }
/* The photo library: upload a new photo, or pick one the website has. */
.lib-top { display: grid; gap: 8px; justify-items: start; }
.lib-search input { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); padding: 12px 16px; font-size: 1rem; min-height: 48px; box-sizing: border-box; color: var(--ink); }
#lib-state:empty { display: none; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.lib-item { position: relative; display: block; padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--sunken); cursor: pointer; box-shadow: 0 0 0 1px var(--card-line); }
.lib-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lib-item:hover { box-shadow: 0 0 0 2px var(--dusk); }
.lib-item:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }
.lib-item[aria-current] { box-shadow: 0 0 0 3px var(--fern); }
.lib-tag { position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 8px; border-radius: 999px; background: rgba(28, 30, 63, .84); color: #fff; font: 700 .75rem/1.3 var(--sans); }
@media (max-width: 640px) { .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .lib-top .btn { width: 100%; } }
/* Cropping: the photo under a frame, on a dark stage that suits any photo. */
.crop-shapes { justify-self: start; }
.crop-stage { height: min(56vh, 460px); border-radius: var(--r-md); background: #15162B; overflow: hidden; }
.crop-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-stage canvas:focus-visible { outline: 3px solid var(--marigold); outline-offset: -3px; }
.crop-zoom { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--muted); }
.crop-zoom input { flex: 1; min-height: 44px; accent-color: var(--dusk); }
#crop-note:empty { display: none; }
@media (max-width: 640px) {
  .crop-sheet .sheet-body { gap: 14px; }
  .crop-stage { height: clamp(240px, calc(100dvh - 412px), 520px); }
  .crop-sheet .sheet-foot .btn { flex: 1 1 0; }
  .crop-sheet .sheet-foot .grow { display: none; }
  .crop-shapes button { padding: 8px 12px; }
}
/* A new photo asks for its description. */
.form .field.ask-alt { padding: 12px 14px; border-radius: var(--r-md); background: var(--marigold-soft); color: var(--on-marigold-soft); }
.field.ask-alt .note, .field.ask-alt .chars { color: inherit; }
.alt-ask { font-weight: 700; }
.list .t .thumb { display: inline-block; width: 44px; height: 33px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 10px; }
.composer-mini { padding: 18px; gap: 12px; }
.composer-mini textarea { min-height: 90px; font-size: 1rem; }
.composer-mini .btn-primary, .edit-panel .btn-primary { background: var(--marigold); border-color: var(--marigold); color: var(--on-marigold); }
.composer-mini .mic { background: var(--marigold); color: var(--on-marigold); }
a.status-line { text-decoration: none; }
a.status-line:hover span { text-decoration: underline; }
.practice-pick { display: grid; gap: 4px; }

.tasks-meter { display: flex; align-items: baseline; gap: 10px; }
.tasks-meter b { font: 700 2.5rem/1 var(--display); color: var(--dusk); }
.tasks-meter span { color: var(--muted); }

.rd-info, .rd-visual { display: grid; gap: 16px; min-width: 0; align-content: start; }
.thread { display: grid; gap: 10px; }
.msg.me { margin-left: auto; flex-direction: row-reverse; }
.msg.me p { background: var(--dusk-soft); color: var(--ink); border-radius: 18px 18px 6px 18px; }
.msg.sys { max-width: 100%; }
.msg.sys p { background: var(--sunken); color: var(--muted); font-size: .9375rem; border-radius: 12px; }
.msg .archie { flex: none; }
.plan { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.uses { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 14px 16px; border-radius: var(--r-md); background: var(--marigold-soft); color: var(--on-marigold-soft); }
.uses b { font-family: var(--display); font-size: 1.125rem; }
.fix-area { width: 100%; min-height: 96px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); padding: 12px 14px; font: inherit; font-size: 1rem; resize: vertical; box-sizing: border-box; }
.fix-area:focus { border-color: var(--dusk); outline: none; box-shadow: 0 0 0 3px var(--dusk-soft); }
.sheet-foot .grow { flex: 1; }
.preview-frame iframe { display: block; width: 100%; height: min(62vh, 620px); border: 0; background: #fff; }
.working { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 40px 20px; border-radius: var(--r-lg); background: var(--sunken); }
/* Archie's moods (see archie() in app.js). The demo's blink, and its happy eyes, still apply. */
.archie .a-bubble, .archie .a-ask, .archie .a-sparks { display: none; }
.archie .a-bubble circle:first-child, .archie .a-bubble rect { fill: var(--raised); stroke: var(--line-strong); stroke-width: 1.5; }
.archie .a-dot { fill: var(--dusk); }
.archie .a-ask circle { fill: var(--marigold); }
.archie .a-ask text { font: 700 12px/1 var(--display); fill: var(--on-marigold); }
.archie .a-sparks path { fill: var(--marigold); }
.archie.thinking, .archie.busy { transform-origin: 40% 90%; }
.archie.thinking .a-bubble, .archie.busy .a-bubble { display: inline; }
.archie.thinking { animation: sw-tilt 2.4s ease-in-out infinite; }
.archie.thinking .a-eyes { animation: sw-look-up 2.4s ease-in-out infinite; }
.archie.busy { animation: sw-bob 0.9s ease-in-out infinite; }
.archie.busy .a-eyes { animation: sw-scan 1.6s ease-in-out infinite; }
.archie .a-dot { animation: sw-dot 1.2s ease-in-out infinite; }
.archie .a-dot:nth-of-type(2) { animation-delay: .2s; } .archie .a-dot:nth-of-type(3) { animation-delay: .4s; }
.archie.asking { transform: rotate(-8deg); transform-origin: 40% 90%; }
.archie.asking .a-ask { display: inline; }
.archie.celebrate .a-happy { display: inline; } .archie.celebrate .a-eyes { display: none; }
.archie.happy, .archie.celebrate { animation: sw-hop .7s ease-out 1; }
.archie.celebrate .a-sparks { display: inline; }
.archie.celebrate .a-sparks path { transform-box: fill-box; transform-origin: center; animation: sw-spark 1.4s ease-out 2 both; }
.archie.celebrate .a-sparks path:nth-child(2n) { animation-delay: .25s; }
@keyframes sw-tilt { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }
@keyframes sw-look-up { 0%, 100% { transform: translate(0, 0); } 40%, 60% { transform: translate(2px, -2px); } }
@keyframes sw-scan { 0%, 100% { transform: translateX(-2px); } 50% { transform: translateX(2px); } }
@keyframes sw-bob { 50% { transform: translateY(-4px); } }
@keyframes sw-dot { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes sw-hop { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-10px); } 60% { transform: translateY(0); } 75% { transform: translateY(-3px); } }
@keyframes sw-spark { 0% { opacity: 0; transform: scale(.2); } 40% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(.6); } }
.working .archie { margin-top: 18px; } /* room for the thought bubble */
@media (prefers-reduced-motion: reduce) {
  .archie.thinking, .archie.busy, .archie.happy, .archie.celebrate, .archie .a-dot, .archie .a-eyes, .archie.celebrate .a-sparks path { animation: none; }
  .archie .a-dot { opacity: 1; }
}

/* Marigold accents. Buttons and the mic are marigold with dark text: white on marigold is only 2.17:1.
   In dark mode the request heading is marigold too (never on light backgrounds, where it's too faint). */
.composer .btn-primary, #quick .btn-primary { background: var(--marigold); border-color: var(--marigold); color: var(--on-marigold); }
.composer .btn-primary:hover, #quick .btn-primary:hover { background: var(--marigold); filter: brightness(.94); }
.composer .mic { background: var(--marigold); color: var(--on-marigold); }
.composer .mic.on { background: var(--dusk); color: var(--on-dusk); } /* recording: clearly different */
:root[data-theme="dark"] .composer-top b { color: var(--marigold); text-decoration: none; }
.error-note { color: var(--brick); font-size: .9375rem; }
.empty { color: var(--muted); }
/* Request view: a wider left column, and long words (links) wrap instead of running under the preview. */
@media (min-width: 900px) { .sheet-body.split { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); } }
.rd-info .msg p, .rd-info .plan, .rd-info .uses span { overflow-wrap: anywhere; }
.rd-info .req-head .note { min-width: 0; }

/* Request view: where it stands, what's changing, then the conversation folded away. */
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.track li { display: grid; gap: 6px; font-size: .8125rem; font-weight: 700; color: var(--muted); }
.track li i { height: 6px; border-radius: 3px; background: var(--sunken); }
.track li.done i { background: var(--fern); }
.track li.now i { background: var(--dusk); }
.track li.now.needs i { background: var(--marigold); }
.track li.now.bad i { background: var(--brick); }
.track li.now, .track li.done { color: var(--ink); }
.state { display: grid; gap: 4px; }
.state b { font: 700 1.375rem/1.25 var(--display); letter-spacing: -0.01em; }
.state span { color: var(--muted); font-size: 1rem; line-height: 1.5; }
.state .elapsed { font-family: var(--mono); font-size: .875rem; }
.chg-card { display: grid; gap: 12px; padding: 16px 18px; border-radius: var(--r-md); background: var(--raised); box-shadow: 0 0 0 1px var(--card-line); }
.chg-card > b { font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chg-item { display: grid; gap: 6px; }
.chg-item .where { font-weight: 700; font-size: .9375rem; }
.chg-item .was, .chg-item .will { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.chg-item .was { background: var(--sunken); color: var(--muted); }
.chg-item .will { background: var(--fern-soft); color: var(--ink); }
.chg-item small { font: 700 .6875rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: block; }
.convo summary { cursor: pointer; font-weight: 700; color: var(--dusk); padding: 6px 0; }
.convo[open] summary { margin-bottom: 10px; }
.working.done b, .working.staging b { font-size: 1.25rem; }
.working.staging .btn { min-width: 240px; }
/* Phones: the two main actions side by side, Withdraw as a quiet link underneath. */
@media (max-width: 640px) {
  .sheet-foot [data-act="withdraw"] { order: 9; flex: 1 1 100%; min-height: 36px; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
  .sheet-foot [data-act="open-fix"], .sheet-foot [data-act="approve"] { flex: 1 1 0; padding: 0 14px; }
}
/* Microphone: the demo's .mic button, also beside the "what to fix" box. */
.fix-mic { display: flex; align-items: center; gap: 12px; flex: 1 1 100%; }
.composer > .record { margin-top: -6px; }
@media (prefers-reduced-motion: reduce) { .mic.on { animation: none; } }
.state > div { display: grid; gap: 4px; }
.state.with-archie { grid-template-columns: auto 1fr; align-items: center; gap: 14px; }
/* Rich text: a toolbar with only what the site's field can show, and a box in the page's own colours. */
.rt-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--raised); color: var(--ink); font-size: .9375rem; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s; }
.rt-btn:hover { background: var(--dusk-hover); }
.rt-btn[aria-pressed="true"] { border-color: var(--dusk); background: var(--dusk-soft); color: var(--dusk); }
.rt-btn:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }
.rt-tones { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.rt-dot { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.rt-area { min-height: 130px; max-height: 50vh; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 12px 16px; font-size: 1rem; line-height: 1.55; overflow-wrap: anywhere; cursor: text; }
.rt-area:focus { border-color: var(--dusk); outline: none; box-shadow: 0 0 0 3px var(--dusk-soft); }
.rt-area p, .rt-area ul, .rt-area ol { margin: 0 0 .75em; }
.rt-area > :last-child { margin-bottom: 0; }
.rt-area ul, .rt-area ol { padding-left: 1.4em; }
.rt-area li + li { margin-top: .25em; }
.rt-area a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.rt-fixed { min-height: 0; max-height: 220px; cursor: default; white-space: normal; }
.rt-link { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--sunken); }
.rt-link[hidden] { display: none; }
.rt-link-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-link-acts .btn { padding: 0 14px; }
.form .field.invalid .rt-area { border-color: var(--brick); }
@media (max-width: 1099px) { .rt-area { max-height: 36vh; } }

/* Navigation with fewer tabs: the agreement only (until it's signed), or Home, the questionnaire and the agreement while onboarding. */
.bottom-nav.one { grid-template-columns: 1fr; }
.bottom-nav.two { grid-template-columns: repeat(2, 1fr); }

/* The demo spaced these cards with margins; the app's views space them with a gap. */
.card.ag-status, .card.onb { margin-bottom: 0; }

/* Home before launch day: what Archie will do from launch day. */
.card.soon { display: flex; align-items: center; gap: 16px; }
.card.soon p { color: var(--muted); font-size: .9375rem; }
.card.soon .archie { flex: none; }
.onb-head p a { color: var(--dusk); font-weight: 700; }
.onb-head > div { flex: 1 1 320px; min-width: 0; }
/* The access guide in the checklist: one block per account. */
.guide-sec { display: grid; gap: 6px; }
.guide-sec + .guide-sec { padding-top: 10px; border-top: 1px solid var(--line); }
.guide-sec ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; overflow-wrap: break-word; }
@media (max-width: 640px) { .onb-step .onb-more { grid-column: 1 / -1; } }
.guide-sec > span { color: var(--muted); }
.guide-sec a { color: var(--dusk); font-weight: 700; justify-self: start; }

/* Agreement: the text as signed (src/agreements/<version>.html), styled like hellosaywell.com/founding-agreement/ */
.ag-doc { gap: 0; }
.ag-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.ag-meta span { font-size: .8125rem; font-weight: 700; color: var(--dusk); background: var(--dusk-soft); border-radius: 999px; padding: 4px 10px; }
.ag-meta-note { font-size: .875rem; color: var(--muted); margin-top: 10px; }
.ag-doc .glance, .ag-doc .term { display: grid; gap: 12px; padding: 20px 0; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.ag-doc .glance { margin-top: 18px; }
.ag-doc .term:last-child { padding-bottom: 0; }
.ag-doc h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.ag-doc .num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--dusk); color: var(--on-dusk); font: 700 .8125rem/1 var(--sans); }
.ag-doc .glance > p { color: var(--muted); }
.ag-doc .gl { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 0; }
.ag-doc .gl div { background: var(--sunken); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; align-content: start; }
.ag-doc .gl dt { font: 700 .72rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--dusk); }
.ag-doc .gl dd { margin: 0; font-size: .9375rem; line-height: 1.5; }
.ag-doc .term ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: c; }
.ag-doc .term ol > li { counter-increment: c; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 4px; font-size: 1rem; }
.ag-doc .term ol > li::before { content: var(--t) "." counter(c); font: 700 .8125rem/1.95 var(--sans); color: var(--dusk); }
.ag-doc .tw { overflow-x: auto; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.ag-doc table { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.5; }
.ag-doc th, .ag-doc td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.ag-doc th { background: var(--sunken); color: var(--dusk); font-size: .8125rem; letter-spacing: .04em; }
.ag-doc tr:last-child td { border-bottom: 0; }
.ag-doc .cell-tw { grid-column: 2; margin-top: 4px; }
.ag-field .lbl { margin-bottom: 0; }
.ag-need { font-size: .9375rem; font-weight: 700; color: var(--ink); }
.ag-need:empty { display: none; }
.ag-opt { font: 700 .75rem/1 var(--sans); color: var(--muted); background: var(--sunken); border-radius: 999px; padding: 3px 8px; margin-left: 4px; }
.ag-accept a { color: var(--dusk); font-weight: 700; }
.ag-rec .kv b { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.ag-help a { color: var(--dusk); font-weight: 700; }
@media (max-width: 640px) { .ag-doc .term ol > li { grid-template-columns: 36px minmax(0, 1fr); font-size: .9688rem; } .ag-rec .kv b { text-align: left; } }
/* Print or save as PDF: the agreement and its signature record only. */
@media print {
  .topbar, .side, .bottom-nav, .toast, .modal, #ag-status, #ag-sign, #ag-wait, .ag-help, #ag-record-card .row, .page-head p { display: none !important; }
  body { background: #fff; }
  .app, .ag-grid { display: block; }
  main { padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0 0 16px; }
  .ag-doc .term, .ag-doc .glance { break-inside: avoid-page; }
}

/* Welcome questionnaire: one part per screen, big tap targets (from hellosaywell.com/welcome/) */
.wq-layout { display: grid; gap: 28px; }
@media (min-width: 1100px) { .wq-layout { grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: 40px; } .wq-layout.solo { grid-template-columns: minmax(0, 1fr); } }
.wq-steps { display: none; }
@media (min-width: 1100px) { .wq-steps { display: grid; gap: 4px; position: sticky; top: 24px; } .wq-steps[hidden] { display: none !important; } }
.wq-steps button { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 12px; cursor: pointer; color: var(--muted); font-size: .9375rem; line-height: 1.3; }
.wq-steps button:hover { background: var(--dusk-hover); color: var(--ink); }
.wq-steps button[aria-current="step"] { background: var(--raised); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm), 0 0 0 1px var(--card-line); }
.wq-steps .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); font-weight: 700; font-size: .8125rem; }
.wq-steps .n svg { width: 14px; height: 14px; }
.wq-steps button[aria-current="step"] .n { border-color: var(--dusk); color: var(--dusk); }
.wq-steps .done .n { border-color: transparent; background: var(--fern-soft); color: var(--fern); }
.wq-steps small { display: block; font-weight: 400; color: var(--muted); font-size: .8125rem; }
.wq-main { min-width: 0; max-width: 760px; display: grid; gap: 18px; align-content: start; }
.wq-main:focus { outline: none; }
.wq-layout.solo .wq-main { margin: 0 auto; width: 100%; }
.wq-progress { position: sticky; top: 0; z-index: 5; display: grid; gap: 6px; padding: 10px 0 12px; background: var(--surface); }
.wq-prog-row { display: flex; justify-content: space-between; gap: 10px; font-size: .875rem; color: var(--muted); }
.wq-prog-row b { color: var(--ink); }
.wq-prog-row > span:last-child { white-space: nowrap; }
.wq-saved:not(:empty)::after { content: " · "; }
.wq-progress .bar i { background: var(--fern); transition: width .35s ease; }
@media (max-width: 560px) { .wq-prog-title { display: none; } }
.wq-note { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 14px 16px; border-radius: var(--r-md); background: var(--marigold-soft); color: var(--on-marigold-soft); font-size: .9375rem; }
.wq-note svg { margin-top: 2px; }
.wq-q { background: var(--raised); border: 1px solid var(--card-line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 20px 22px; display: grid; gap: 12px; }
.wq-q.err { border-color: var(--brick); }
.wq-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font: 700 1.125rem/1.35 var(--display); letter-spacing: -0.01em; }
.wq-tag { font: 700 .75rem/1 var(--sans); letter-spacing: .04em; color: var(--muted); background: var(--sunken); border-radius: 999px; padding: 4px 8px; }
.wq-help { color: var(--muted); font-size: .9375rem; margin-top: -4px; }
.wq-indent { margin: 0 0 0 38px; }
.wq-err { color: var(--brick); font-size: .9375rem; font-weight: 700; }
.wq-inp { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); padding: 13px 15px; font-size: 1.0625rem; }
textarea.wq-inp { min-height: 120px; resize: vertical; line-height: 1.55; }
.wq-inp:focus { border-color: var(--dusk); outline: none; box-shadow: 0 0 0 3px var(--dusk-soft); }
.wq-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.wq-opt { position: relative; }
.wq-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wq-opt span { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 1rem; line-height: 1.3; }
.wq-opt span:hover { border-color: var(--dusk); }
.wq-opt input:checked + span { background: var(--dusk); border-color: var(--dusk); color: var(--on-dusk); font-weight: 700; }
.wq-opt input:focus-visible + span { outline: 2px solid var(--dusk); outline-offset: 2px; }
.wq-opt.multi input:checked + span::before { content: "✓"; font-weight: 700; }
.wq-follow { padding-left: 14px; border-left: 3px solid var(--dusk-soft); display: grid; gap: 8px; }
.wq-follow label { font-weight: 700; font-size: 1rem; }
.wq-check { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; align-items: start; cursor: pointer; font-size: 1rem; }
.wq-check input { width: 24px; height: 24px; margin: 0; accent-color: var(--dusk); }
.wq-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wq-chips:empty { display: none; }
.wq-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: var(--dusk); color: var(--on-dusk); font-weight: 700; font-size: .875rem; padding: 6px 6px 6px 12px; }
.wq-chip button { width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .2); color: inherit; cursor: pointer; line-height: 1; }
.wq-states { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; display: grid; gap: 2px; }
.wq-states label { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.wq-states label:hover { background: var(--dusk-hover); }
.wq-states input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--dusk); }
.wq-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-top: 6px; }
@media (max-width: 640px) { .wq-nav .btn-primary { flex: 1 1 100%; order: -1; } .wq-nav .btn { flex: 1 1 auto; } }
.wq-intro { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wq-intro li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.wq-intro .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--dusk-soft); color: var(--dusk); }
.wq-intro .ico svg { width: 18px; height: 18px; }
.wq-parts { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.wq-parts div { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--sunken); font-size: .9375rem; }
.wq-parts span { color: var(--muted); white-space: nowrap; }
.wq-rv { display: grid; gap: 12px; }
.wq-rv dl { margin: 0; display: grid; gap: 8px; }
.wq-rv dl div { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.wq-rv dl div:last-child { border-bottom: 0; padding-bottom: 0; }
.wq-rv dt { font-size: .875rem; color: var(--muted); }
.wq-rv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.wq-rv .missing { color: var(--brick); font-weight: 700; }
.wq-done { text-align: center; justify-items: center; padding: 34px 24px; }
.wq-done h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
.wq-done .badge { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--fern-soft); color: var(--fern); }
.wq-done .badge svg { width: 36px; height: 36px; }
.wq-next { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: n; }
.wq-next li { counter-increment: n; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.wq-next li::before { content: counter(n); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--dusk); color: var(--on-dusk); font-weight: 700; }

/* Photos and files: a drop area per kind, and what's been sent. */
.up-group { display: grid; gap: 6px; }
.up-group > b { font-size: 1rem; }
.up { display: grid; gap: 8px; margin-top: 4px; }
.up-drop { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 20px 16px; border: 2px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface); cursor: pointer; color: var(--ink); }
.up-drop:hover, .up-drop.over { border-color: var(--dusk); background: var(--dusk-hover); }
.up-drop:focus-within { outline: 2px solid var(--dusk); outline-offset: 2px; }
.up-drop svg { color: var(--dusk); }
.up-drop small { color: var(--muted); font-size: .875rem; }
.up-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.up-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 12px; border-radius: 10px; background: var(--sunken); font-size: .9375rem; }
.up-list a { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; min-width: 0; flex: 1 1 160px; }
.up-list .link-btn { color: var(--brick); min-height: 36px; }

/* Plan: billing rows (what each payment is, where it stands), and the team's "Record payment" form. */
.kv .bill-row { align-items: flex-start; }
.kv .bill-what { display: grid; gap: 2px; min-width: 0; flex: 1 1 220px; color: var(--ink); }
.kv .bill-what small { color: var(--muted); font-size: .875rem; }
.kv .bill-state { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 14px; color: var(--ink); }
.pay-form { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; background: var(--sunken); border-radius: var(--r-md); padding: 12px 14px; }
.kv .pay-form label { display: grid; gap: 4px; font-size: .875rem; color: var(--muted); }
.pay-form input { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--raised); color: var(--ink); padding: 8px 10px; min-height: 42px; font-size: .9375rem; }
#billing .note a, .help-guides + .note a { color: var(--dusk); font-weight: 700; }
@media (max-width: 640px) { .kv .bill-state { justify-content: flex-start; } }

/* Plan: an invoice or a receipt. Printing it prints only the document. */
.doc { gap: 16px; }
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.doc .lockup { font-size: 1.25rem; } .doc .lockup svg { width: 26px; height: 26px; }
.doc .kv div { align-items: flex-start; }
.doc .kv b { text-align: right; white-space: pre-line; overflow-wrap: anywhere; }
@media print {
  body:has(#doc-modal:not([hidden])) > :not(#doc-modal) { display: none !important; }
  #doc-modal:not([hidden]) { display: block !important; position: static; background: none; padding: 0; }
  #doc-modal .sheet { box-shadow: none; max-height: none; width: 100%; height: auto; border-radius: 0; background: #fff; }
  #doc-modal .sheet-head, #doc-modal .sheet-foot { display: none; }
  #doc-modal .receipt { box-shadow: none; }
}

/* Help: contact cards, guides and a guide's text. */
a.contact-card { text-decoration: none; }
.help-guides { display: grid; gap: 14px; }
.guide-body p { color: var(--ink); }
.guide-body ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
#support-shot-row .row label.btn { cursor: pointer; }

/* Agreement: signing in three numbered steps, the payment plan as two clear choices (Archie's live test, Oct 29). */
.ag-step { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.ag-step legend, .ag-step-h { display: flex; align-items: center; gap: 10px; padding: 0; margin: 0 0 10px; font: 700 1.0625rem/1.3 var(--sans); letter-spacing: 0; color: var(--ink); }
.ag-step-h { margin-bottom: 0; }
.ag-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--dusk); color: var(--on-dusk); font: 700 .8125rem/1 var(--sans); }
.plan-cards { display: grid; gap: 10px; }
.plan-card { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); cursor: pointer; transition: border-color .15s, background .15s; }
.plan-card:hover { border-color: var(--dusk); }
.plan-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.plan-dot { width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; background: var(--raised); }
.plan-card input:checked ~ .plan-dot { border-color: var(--dusk); }
.plan-card input:checked ~ .plan-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dusk); }
.plan-card:has(input:checked) { border-color: var(--dusk); background: var(--dusk-soft); }
.plan-card:has(input:focus-visible) { outline: 2px solid var(--dusk); outline-offset: 2px; }
.plan-text { display: grid; gap: 2px; min-width: 0; }
.plan-text b { font-size: 1.0625rem; color: var(--ink); }
.plan-price { font: 700 1.25rem/1.25 var(--display); color: var(--dusk); }
.plan-text small { color: var(--muted); font-size: .875rem; line-height: 1.5; }

/* Agreement: At a glance as a list, each label beside its text; stacked on phones. */
.ag-doc .gl { grid-template-columns: minmax(0, 1fr); gap: 0; }
.ag-doc .gl div { grid-template-columns: 11rem minmax(0, 1fr); gap: 4px 20px; padding: 12px 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.ag-doc .gl div:first-child { border-top: 0; padding-top: 2px; }
.ag-doc .gl dt { font-size: .75rem; padding-top: 4px; }
.ag-doc .gl dd { font-size: 1rem; line-height: 1.6; }
@media (max-width: 640px) { .ag-doc .gl div { grid-template-columns: minmax(0, 1fr); } .ag-doc .gl dt { padding-top: 0; } }

/* Questionnaire: "Go to" a part, on screens where the parts list doesn't fit beside the questions. */
.wq-jump { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: .875rem; font-weight: 700; color: var(--muted); }
.wq-jump .select-wrap { flex: 1; min-width: 0; }
.wq-jump select { min-height: 42px; font-size: .9375rem; }
@media (min-width: 1100px) { .wq-jump { display: none; } }

/* Build week: the tracker on Home from day 1 to launch (the demo's build-week view), and the team's controls. */
.card.bt, .card.bt-team { display: grid; gap: 16px; margin-bottom: 0; }
.bt-days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.bt-days li { display: grid; gap: 6px; font-size: .8125rem; font-weight: 700; color: var(--muted); min-width: 0; }
.bt-days li i { height: 6px; border-radius: 3px; background: var(--sunken); }
.bt-days li.done { color: var(--fern); }
.bt-days li.done i { background: var(--fern); }
.bt-days li.now { color: var(--ink); }
.bt-days li.now i { background: var(--marigold); }
.bt-today { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.bt-today > div { background: var(--sunken); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 6px; align-content: start; font-size: 1rem; }
.bt-today b { font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bt-today .chip { justify-self: start; }
/* The brand picker. Each image sits on white in both themes: it shows the practice's brand, not the dashboard's. */
.bp { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.bp-cell { display: grid; gap: 4px; justify-items: start; align-content: start; min-width: 0; }
.bp-opt { width: 100%; display: grid; gap: 8px; align-content: start; text-align: left; padding: 10px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--raised); color: var(--ink); }
button.bp-opt { cursor: pointer; }
button.bp-opt:hover { border-color: var(--line-strong); }
.bp-opt[aria-pressed="true"] { border-color: var(--dusk); box-shadow: 0 0 0 3px var(--dusk-soft); }
.bp-opt b { font-size: 1rem; padding: 0 4px; }
.bp-opt .d { font-size: .875rem; color: var(--muted); line-height: 1.45; padding: 0 4px 4px; }
.bp-img { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(35, 36, 63, .08); }
.bp-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bp-cell .link-btn { margin-left: 6px; font-size: .875rem; }
.bp-chosen { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 16px; align-items: center; }
.bp-chosen > div { display: grid; gap: 4px; justify-items: start; min-width: 0; }
@media (max-width: 560px) { .bp-chosen { grid-template-columns: minmax(0, 1fr); } }
/* The day-6 review: the full site in a frame (on phones the new tab is easier), and the notes. */
.bt-site .browser-top a { margin-left: auto; font-size: .875rem; white-space: nowrap; min-height: 0; }
.bt-frame { display: block; width: 100%; height: min(70vh, 720px); border: 0; background: #FFFFFF; }
.bt-form { display: grid; gap: 10px; }
.bt-form .row .record { flex: 1 1 200px; }
.bt-sent { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bt-sent li { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-md); background: var(--sunken); }
.bt-sent p { white-space: pre-line; overflow-wrap: anywhere; }
/* Team controls */
.btt-sec { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.bt-daypick { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-daypick button { min-width: 42px; min-height: 42px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink); font-weight: 700; cursor: pointer; }
.bt-daypick button[aria-pressed="true"] { background: var(--dusk); border-color: var(--dusk); color: var(--on-dusk); }
.btt-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.btt-opts li { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: 6px 12px; align-items: center; }
.btt-thumb { display: block; width: 72px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(35, 36, 63, .08); }
.btt-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.btt-txt { display: grid; min-width: 0; }
.btt-txt small { color: var(--muted); font-size: .875rem; }
.btt-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--sunken); border-radius: var(--r-md); padding: 12px 14px; }
.btt-form label { display: grid; gap: 4px; font-size: .875rem; color: var(--muted); flex: 1 1 200px; min-width: 0; }
.btt-form input[type=text], .btt-form input[type=url] { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--raised); color: var(--ink); padding: 8px 10px; min-height: 42px; font-size: .9375rem; width: 100%; }
.btt-form input[type=file] { font-size: .875rem; color: var(--ink); max-width: 100%; }
@media (max-width: 560px) {
  .btt-opts li { grid-template-columns: 56px minmax(0, 1fr); }
  .btt-thumb { width: 56px; }
  .btt-opts li .chip, .btt-opts li .link-btn { grid-column: 2; justify-self: start; }
}
