/* The customer portal, in the shop's storefront look. Structure, type scale and
   controls live here and are the same for every shop. The shop's own values (the
   colour tokens, the two font stacks, the radii --r and --r-inner, the colour
   scheme and the select's --chevron) come from its pack, shops/<slug>/shop.json,
   which the shared head writes as a :root block just before this file. So no
   colour is written here except the shadow and the video letterbox.

   The token names and the first look are the House of Scorpio storefront's
   direction A ("Black altar", shopify/theme/assets/hos-base.css), so that shop
   and its portal read as one site. Customer pages load this file only; the admin
   keeps style.css.

   One deliberate difference from that storefront: --field. Its input border
   (--line2) is 1.5:1 against a panel. The intake form is almost all fields, and a
   field's edge needs 3:1, so inputs and selects use --field (3.3:1) instead. The
   shop loader checks that ratio for every pack.

   Taste's lint flags the hairlines and 1px panel edges: they are the storefront's own
   panel language and stay. The faint footer wordmark is decorative (aria-hidden), as on
   the storefront, so its low contrast is intended. */

:root{
  --m:clamp(16px,2.6vw,32px);
  --ease:cubic-bezier(.23,1,.32,1);
  --lift:0 22px 44px -18px rgba(0,0,0,.75),0 2px 6px rgba(0,0,0,.35);
  scrollbar-color:var(--line2) var(--bg);
}
*,*::before,*::after{box-sizing:border-box}
html{background:var(--bg)}
body{margin:0;min-height:100dvh;display:flex;flex-direction:column;background:var(--bg);color:var(--ink);font:16px/1.55 var(--f-text);font-kerning:normal;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;caret-color:var(--ink)}
h1,h2,h3,p{margin:0}
img,svg{display:block;max-width:100%}
svg{flex:none}
::selection{background:var(--ink);color:var(--bg)}
a{color:inherit;text-underline-offset:.24em;text-decoration-thickness:1px}
:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
strong{font-weight:500;color:var(--ink)}
[hidden]{display:none !important}
.a-sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.a-muted,.text-muted{color:var(--muted)}

/* ---------- shell: storefront header, content column, footer ---------- */
.a-wrap{width:100%;max-width:1320px;margin-inline:auto;padding-inline:var(--m)}
.a-header{border-bottom:1px solid var(--line);background:var(--bg)}
.a-header-in{display:grid;grid-template-columns:1fr auto 1fr;grid-template-areas:"start word end";align-items:center;min-height:72px;gap:8px 24px}
.a-header-start{grid-area:start;justify-self:start;min-width:0;font-size:15px;color:var(--muted)}
.a-header-end{grid-area:end;justify-self:end}
.a-logout{display:contents}
.a-word{grid-area:word;justify-self:center;font:400 25px/1 var(--f-display);letter-spacing:-.01em;white-space:nowrap}
/* A shop with a drawn logo: the pack's width and height set its ratio, this its size. */
.a-word img,.cv-logo img{width:auto;height:auto;max-height:40px}
.a-back{display:inline-flex;align-items:center;gap:8px;min-height:44px;font-size:15px;color:var(--muted);text-decoration:none;transition:color 160ms var(--ease),gap 200ms var(--ease)}
.a-main{flex:1 0 auto;width:100%;padding-block:clamp(36px,5vw,64px) clamp(56px,7vw,96px)}
.a-col{width:100%;max-width:calc(800px + 2 * var(--m));margin-inline:auto;padding-inline:var(--m)}

.a-foot{margin-top:auto;border-top:1px solid var(--line)}
.a-foot-name{margin:0;padding-block:28px 20px;font:200 clamp(38px,10.3vw,136px)/.9 var(--f-display);letter-spacing:-.045em;white-space:nowrap;overflow:hidden;color:var(--raised2);user-select:none}
.a-foot-legal{display:flex;justify-content:space-between;align-items:center;gap:6px 16px;flex-wrap:wrap;padding-block:20px 28px;border-top:1px solid var(--line);font-size:13px;color:var(--muted)}
/* A shop without the footer wordmark: the footer's own rule is enough. */
.a-foot-legal:first-child{border-top:0}

/* ---------- type ---------- */
.a-h1{font:300 clamp(34px,4.2vw,50px)/1.05 var(--f-display);letter-spacing:-.02em;text-wrap:balance}
.a-h2{font:300 clamp(28px,3vw,38px)/1.1 var(--f-display);letter-spacing:-.02em;text-wrap:balance}
.a-p{max-width:62ch;text-wrap:pretty}
.a-small{font-size:14px;line-height:1.5}

/* ---------- controls ---------- */
.a-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:52px;padding:0 26px;border:1px solid var(--ink);border-radius:var(--r);background:var(--ink);color:var(--bg);font:500 15px/1.2 var(--f-text);letter-spacing:.01em;text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;transition:background-color 160ms var(--ease),border-color 160ms var(--ease),color 160ms var(--ease),transform 140ms var(--ease)}
.a-btn:active{transform:scale(.98)}
.a-btn--ghost{background:transparent;color:var(--ink);border-color:var(--line2)}
.a-btn--small{min-height:44px;padding:0 16px;font-size:14px}
.a-btn--row{min-height:44px;padding:0 20px}
.a-btn--full{width:100%;white-space:normal;padding-block:12px}
.a-btn:disabled{opacity:.5;cursor:not-allowed}
.a-arrow{display:inline-flex;transition:transform 200ms var(--ease)}
@media (hover:hover) and (pointer:fine){
  .a-btn:hover{background:var(--white);border-color:var(--white)}
  .a-btn--ghost:hover{background:var(--raised2);border-color:var(--muted)}
  .a-back:hover{color:var(--ink);gap:11px}
  .a-btn:hover .a-arrow{transform:translateX(3px)}
  .a-link:hover{color:var(--white)}
}
.a-link{text-decoration:underline;transition:color 160ms var(--ease)}

/* Submitting: the button keeps its label and gains a small spinner. */
.btn-loading{pointer-events:none;opacity:.75}
.btn-loading::after{content:"";width:14px;height:14px;border:2px solid transparent;border-top-color:currentColor;border-radius:50%;animation:a-spin 600ms linear infinite}
@keyframes a-spin{to{transform:rotate(360deg)}}

.a-tag{display:inline-flex;align-items:center;min-height:26px;padding:0 10px;border:1px solid var(--line2);border-radius:var(--r);font:500 12px/1 var(--f-text);letter-spacing:.02em;color:var(--muted);white-space:nowrap}

/* ---------- panels ---------- */
.a-panel{background:var(--raised);border:1px solid var(--line);border-radius:var(--r)}
/* The storefront hero's inner hairline frame: the portal's one signature detail,
   used on the single-panel pages and the upload zone. */
.a-frame{position:relative}
.a-frame::after{content:"";position:absolute;inset:12px;border:1px solid var(--line);border-radius:var(--r-inner);pointer-events:none}

/* ---------- dashboard ---------- */
.a-sec + .a-sec{margin-top:clamp(48px,6vw,72px)}
.a-sec > .a-h2{margin-bottom:20px}
.a-list{list-style:none;margin:0;padding:0;overflow:hidden}
.a-list > li + li{border-top:1px solid var(--line)}
.a-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px 24px;padding:18px 24px}
.a-row-text{display:flex;flex-direction:column;gap:3px;min-width:0}
.a-row-text .a-muted{font-size:14px;line-height:1.45}
/* A line in ink under a row that changed under the customer: an intake Mai
   opened again. */
.a-row-note{max-width:46ch;margin-top:6px;font-size:14px;line-height:1.5;color:var(--ink)}
.a-row-title{font:400 20px/1.25 var(--f-display);letter-spacing:-.005em}
.a-empty{display:flex;flex-direction:column;align-items:center;gap:12px;padding:clamp(40px,7vw,72px) 32px;text-align:center}
.a-empty .a-p{color:var(--muted)}

/* ---------- single-panel pages: sign in, link sent, error, submitted ---------- */
.a-main--center{display:grid;place-items:center;padding:clamp(40px,8vh,96px) var(--m)}
.a-single{width:100%;max-width:460px;display:flex;flex-direction:column;align-items:center;gap:16px;padding:clamp(40px,6vw,56px) clamp(28px,5vw,48px);text-align:center}
.a-frame > *{position:relative;z-index:1}
.a-single .a-p{color:var(--muted);max-width:40ch}
.a-single .a-p strong{overflow-wrap:anywhere}
.a-single .a-btn{margin-top:8px}
.a-single-note{font-size:14px;line-height:1.55;color:var(--muted);max-width:40ch;text-wrap:pretty}
.a-single-note a{color:var(--ink)}
.a-single-form{width:100%;display:flex;flex-direction:column;gap:12px;margin-top:8px}
.a-single-form .a-btn{margin-top:0}
.a-single .error-message{text-align:center}
/* The sent page is the letter's last page: same column, bare ground. Her
   questions come back in the serif, the customer's answers in the sans. */
.a-sent-status{font:400 clamp(19px,1.5vw,21px)/1.6 var(--f-display);text-wrap:pretty}
.a-sent-answers{border-block:1px solid var(--line)}
.a-sent-answers > summary{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;list-style:none;cursor:pointer;font:500 15px/1.4 var(--f-text)}
.a-sent-answers > summary::-webkit-details-marker{display:none}
.a-sent-answers > summary::after{content:"";flex:none;width:8px;height:8px;margin-right:6px;border-right:1.5px solid var(--muted);border-bottom:1.5px solid var(--muted);transform:translateY(-2px) rotate(45deg);transition:transform 200ms var(--ease)}
.a-sent-answers[open] > summary::after{transform:translateY(2px) rotate(-135deg)}
.a-sent-service{padding-bottom:20px}
.a-sent-service + .a-sent-service{border-top:1px solid var(--line);padding-top:8px}
.a-sent-service-name{margin:12px 0 4px;font:300 22px/1.2 var(--f-display);letter-spacing:-.01em}
.a-sent-answers dl{margin:0}
.a-sent-answer{padding-block:12px}
.a-sent-answer dt{margin-bottom:4px;font:400 17px/1.4 var(--f-display)}
.a-sent-answer dd{margin:0;white-space:pre-line;overflow-wrap:anywhere;line-height:1.55}
.a-sent-answer ol,.a-sent-answer ul{margin:0;padding-left:22px;white-space:normal}
.a-sent-contact{font-size:14px;line-height:1.55;color:var(--muted);max-width:40em;text-wrap:pretty}
/* The way to change it (or finish or set aside changes not yet sent), then
   the way to Mai: one quiet block under what was sent. */
.a-sent-change{display:flex;flex-direction:column;align-items:flex-start;gap:16px;margin-top:28px}
.a-sent-change-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px 24px}
.a-sent-change-actions form{display:contents}
.a-sent-contact a,.a-sent-contact .a-link-btn{color:var(--ink)}
/* A button that changes something, set as words in a sentence. */
.a-link-btn{display:inline;padding:0;border:0;background:none;color:inherit;font:inherit;text-underline-offset:.24em;text-decoration-thickness:1px;cursor:pointer}
/* Keep what I sent: a secondary way out, a full 44px tall, in ink. */
.a-keep-sent{display:inline-flex;align-items:center;min-height:44px;font-size:15px;color:var(--ink)}
.a-submit .a-keep-sent{margin-top:12px}
.a-sent-actions{margin-top:16px}
.a-sent-courses{display:inline-flex;align-items:center;min-height:44px;font-size:15px}
.a-sent-reading{display:inline-flex;align-items:center;min-height:44px;margin-top:-6px;font-size:15px;color:var(--ink)}
.a-row-link{align-self:flex-start;display:inline-flex;align-items:center;min-height:44px;margin-bottom:-10px;font-size:14px;color:var(--ink)}
/* A delivered reading on the dashboard: the inset frame, its service's name
   in the serif, a dateline, the opening of Mai's note, and its button. */
.a-ready{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:clamp(28px,4vw,40px) clamp(24px,4vw,40px)}
.a-ready + .a-ready{margin-top:16px}
.a-ready-title{font:300 clamp(26px,2.6vw,32px)/1.15 var(--f-display);letter-spacing:-.015em;text-wrap:balance}
.a-ready-date{font-size:14px;line-height:1.5;color:var(--muted)}
.a-ready-note{max-width:34em;font:400 19px/1.6 var(--f-display);letter-spacing:-.003em;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
.a-ready .a-btn{margin-top:10px}
/* What a section asks, said once under its heading. */
.a-sec > .a-h2 + .a-sec-lead{margin:-8px 0 20px;font-size:14px;line-height:1.55;color:var(--muted)}
.a-portal-contact{margin-top:clamp(40px,5vw,56px);font-size:14px;line-height:1.55;color:var(--muted)}
.a-portal-contact a{color:var(--ink)}

/* ---------- intake ---------- */
.a-intake-head{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-bottom:40px}
.a-intake-head .a-h1{margin-bottom:4px}
.a-alert{display:flex;gap:12px;align-items:flex-start;margin-bottom:20px;padding:16px 20px;scroll-margin-top:24px;border-color:color-mix(in srgb,var(--error) 45%,transparent)}
.a-alert svg{margin-top:2px;color:var(--error)}
.a-alert .error-message{margin:0}
.a-alert-title{font-weight:400}
.a-alert:focus-visible{outline-offset:2px}
.a-alert-body{display:flex;flex-direction:column;gap:8px;min-width:0}
.a-alert-list{margin:0;padding-left:18px;font-size:14px;line-height:1.5}
.a-alert-list:empty{display:none}
.a-alert-list a{color:var(--ink)}
.intake-copy{white-space:pre-line;font-size:17px;line-height:1.65;max-width:62ch;text-wrap:pretty;margin-bottom:32px}
.intake-copy:last-child{margin-bottom:0}
.form-group{margin-bottom:32px}
.form-group:last-child{margin-bottom:0}
.form-label{display:block;max-width:62ch;margin-bottom:8px;font:500 15px/1.4 var(--f-text);color:var(--ink)}
/* The star marks a needed answer; rose stays for errors only. */
.required{color:var(--muted)}
.form-help{max-width:62ch;margin:-2px 0 12px;font-size:14px;line-height:1.55;color:var(--muted);text-wrap:pretty}
/* Mai's help text can carry a paragraph break (both tarot services do). */
.intake-section .form-help{white-space:pre-line}

.input{display:block;width:100%;min-height:52px;margin:0;padding:0 16px;border:1px solid var(--field);border-radius:var(--r);background:var(--bg);color:var(--ink);font:16px/1.4 var(--f-text);transition:border-color 160ms var(--ease)}
.input::placeholder{color:var(--muted)}
/* Focus: the edge turns ink and thickens to 2px; no second ring outside it. */
.input:focus,.input:focus-visible{outline:none;border-color:var(--ink);box-shadow:0 0 0 1px var(--ink)} /* taste-skill-ignore: focus ring, not a shadow */
.textarea{min-height:128px;padding:13px 16px;line-height:1.55;resize:vertical}
select.input{appearance:none;-webkit-appearance:none;padding-right:48px;cursor:pointer;background-image:var(--chevron);background-repeat:no-repeat;background-position:right 14px center}
select.input option{background:var(--raised);color:var(--ink)}
.input.input-error{border-color:var(--error)}
@media (hover:hover) and (pointer:fine){
  .input:hover:not(:focus){border-color:var(--muted)}
  .input.input-error:hover:not(:focus){border-color:var(--error)}
}
.char-counter{margin-top:6px;font-size:13px;color:var(--muted);text-align:right;font-variant-numeric:tabular-nums}
.char-counter.near{color:var(--ink)}
.char-counter.limit{color:var(--error)}
.error-message{font-size:14px;line-height:1.5;color:var(--error)}
.field-error{margin-top:8px}

/* question list (Dowsing): numbered rows, numerals in the display face */
.question-item{display:grid;grid-template-columns:32px minmax(0,1fr) 44px;align-items:start;gap:12px;margin-bottom:10px}
/* One line to begin with, growing with the question so it can be reread on a
   phone. Its 13px padding and 24px line keep the 52px of a text field. */
.question-input{display:block;min-height:52px;padding:13px 16px;line-height:24px;resize:none;overflow:hidden;field-sizing:content}
.question-item .question-number{padding-top:17px}
.question-item .question-remove{margin-top:4px}
.question-remove{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:0;border-radius:var(--r);background:none;color:var(--muted);cursor:pointer;transition:color 160ms var(--ease),background-color 160ms var(--ease)}
@media (hover:hover) and (pointer:fine){.question-remove:hover{color:var(--ink);background:var(--raised2)}}
.question-count{font:400 14px/1 var(--f-text);color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
/* A question list's label and count share one line; the label is inline so
   the count follows its last word (a plain space, so a wrapped count starts
   flush, not indented). */
.form-label-line > .form-label{display:inline;margin:0}
/* A lone empty row has nothing to remove: the cross keeps its place, unseen. */
.question-list.is-lone-empty .question-remove{visibility:hidden}
/* What the rows cannot show: a removal and its undo, or pasted lines that did not fit. */
.question-note{margin:2px 0 10px 44px;font-size:14px;line-height:1.5;color:var(--muted);max-width:40em;text-wrap:pretty}
.question-note .a-link-btn{color:var(--ink)}
/* A larger tap area for Undo, without moving the line. */
.question-undo{padding:10px 6px;margin-inline:-6px}
.question-number{font:400 18px/1 var(--f-display);color:var(--muted);text-align:right;font-variant-numeric:tabular-nums lining-nums}
.btn-add-question{margin:4px 0 0 44px}

/* upload zone (no live form uses one today, kept working) */
.upload-area{display:flex;flex-direction:column;align-items:center;gap:6px;padding:40px 28px;background:var(--raised2);border:1px solid var(--line2);border-radius:var(--r);text-align:center;cursor:pointer;transition:border-color 160ms var(--ease),background-color 160ms var(--ease)}
.upload-area svg{margin-bottom:6px;color:var(--muted)}
.upload-area p{font-size:15px}
.upload-area p.text-muted{font-size:13px}
.upload-area.drag-over,.upload-area.drag-over::after{border-color:var(--ink)}
@media (hover:hover) and (pointer:fine){.upload-area:hover{border-color:var(--muted)}}
.upload-progress{display:none;margin-top:12px}
.upload-progress.active{display:block}
.progress-bar{height:4px;border-radius:var(--r-inner);background:var(--line);overflow:hidden}
.progress-fill{width:100%;height:100%;background:var(--ink);transform:scaleX(0);transform-origin:left;transition:transform 200ms linear}
.upload-progress-text{margin-top:6px;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.file-list:not(:empty){margin-top:12px;border:1px solid var(--line);border-radius:var(--r)}
.file-item{display:flex;justify-content:space-between;gap:16px;padding:12px 16px;font-size:14px}
.file-item + .file-item{border-top:1px solid var(--line)}
.file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-size{color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}

/* ---------- the intake as Mai's letter ----------
   Her words (intro, questions, sign-off) are set in the display serif at a
   reading measure; the fields sit in the same single column, with no panels
   around them. The logistics stay quiet under the title. */
.a-letter-col{max-width:calc(40rem + 2 * var(--m))}
.a-letter-back{margin:-8px 0 20px -2px}
.a-letter-meta{font-size:14px;line-height:1.55;color:var(--muted);max-width:40em;text-wrap:pretty}
.a-letter-note{display:flex;gap:10px;align-items:flex-start}
.a-letter-note svg{width:16px;height:16px;margin-top:2px;color:var(--muted)}
.turnaround-notice{white-space:pre-line}
.a-letter + .a-letter{margin-top:64px;padding-top:48px;border-top:1px solid var(--line)}
.a-letter-service{margin-bottom:16px;font:300 clamp(26px,2.6vw,32px)/1.15 var(--f-display);letter-spacing:-.015em;text-wrap:balance}
.a-letter-prose{margin-bottom:40px;font:400 clamp(19px,1.5vw,21px)/1.6 var(--f-display);letter-spacing:-.003em;max-width:none}
.a-letter-close{margin-top:48px;margin-bottom:0}
.a-letter .form-group{margin-bottom:40px}
.a-letter .form-group--follows{margin-top:-24px}
.a-letter .form-label{margin-bottom:6px;font:400 19px/1.4 var(--f-display);letter-spacing:-.003em;max-width:none}
.a-letter .form-label-line > .form-label{margin:0}
.a-letter .form-help{max-width:34em}
.a-letter .input{background:var(--raised)}
.a-letter .char-counter:not(.near):not(.limit){display:none}
.a-letter-steps{scroll-margin-top:24px;list-style:none;margin:0 0 32px;padding:0;display:flex;flex-wrap:wrap;gap:10px 24px;counter-reset:lstep;font-size:14px;color:var(--muted)}
.a-letter-steps li{counter-increment:lstep;min-width:0}
/* Three states: ahead (muted), current (filled ink), done (ink ring, and a
   button back to that letter). */
.a-step{display:flex;align-items:center;gap:10px;min-height:44px;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
.a-step:disabled,.a-step[aria-current]{cursor:default}
.a-step::before{content:counter(lstep);flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid var(--line2);border-radius:50%;font:400 15px/1 var(--f-display);font-variant-numeric:lining-nums;transition:background-color 160ms var(--ease),border-color 160ms var(--ease)}
.a-letter-steps li.is-current,.a-letter-steps li.done{color:var(--ink)}
.a-letter-steps li.is-current .a-step::before{border-color:var(--ink);background:var(--ink);color:var(--bg)}
.a-letter-steps li.done .a-step::before{border-color:var(--ink)}
/* Any letter already passed is a way back, answered or not: a quiet underline
   says so on touch screens too, and it darkens under a pointer. */
.a-step:not(:disabled):not([aria-current]){text-decoration:underline;text-decoration-color:var(--line2);text-underline-offset:.3em}
@media (hover:hover) and (pointer:fine){.a-step:not(:disabled):not([aria-current]):hover{text-decoration-color:currentColor}}
/* Stepping: one letter on screen, so no divider between letters, and the
   marker names the service (the heading stays for screen readers and focus). */
.is-stepped .a-letter + .a-letter{margin-top:0;padding-top:0;border-top:0}
.is-stepped .a-letter-service{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.a-letter-nav{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:16px;margin-top:48px}
.a-letter-nav .a-nav-status{flex-basis:100%;margin:0}
.a-submit + .a-letter-nav{margin-top:24px}
/* Below Send, the save state is already drawn just above the button. */
.a-submit + .a-letter-nav .a-nav-status{display:none}
.a-letter-end-note{margin-top:40px}
.a-submit-turnaround{margin-bottom:16px}
.a-save-line .save-indicator{display:inline;margin-left:4px}
.a-field-status{display:none}
.a-letter .form-group,.a-letter .form-pair{position:relative}
/* It is about saving, not the answer: Ash even when the save has not gone
   through (the rose .save-indicator.error below must not win). */
.save-indicator.a-field-status.error{color:var(--muted)}
/* Changing a sent intake: the line that says Mai still has what was sent. */
.a-edit-line{color:var(--ink)}
/* Small selects as radios: every answer in view, as the storefront's add-on rows. */
.choice-group{display:flex;flex-direction:column;gap:8px}
.choice{display:flex;align-items:center;gap:12px;min-height:52px;padding:0 16px;border:1px solid var(--field);border-radius:var(--r);background:var(--raised);font-size:16px;cursor:pointer;transition:border-color 160ms var(--ease)}
/* The radio is drawn, so it reads the same in every browser (Chromium's dark
   default is a filled grey disc that looks disabled): a field-edge ring, ink
   when chosen, with an ink dot. */
.choice input{flex:none;display:grid;place-content:center;width:18px;height:18px;margin:0;border:1.5px solid var(--field);border-radius:50%;background:transparent;appearance:none;-webkit-appearance:none;cursor:pointer;transition:border-color 160ms var(--ease)}
.choice input::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--ink);transform:scale(0);transition:transform 160ms var(--ease)}
.choice input:checked{border-color:var(--ink)}
.choice input:checked::before{transform:scale(1)}
@media (forced-colors:active){.choice input{appearance:auto;-webkit-appearance:auto}}
.choice:has(input:checked){border-color:var(--ink)}
.choice:has(input:focus-visible){outline:2px solid var(--ink);outline-offset:2px}
.choice input:focus-visible{outline:none}
/* In error, one rose edge around the whole question, not a rose box on every answer. */
.choice-group.input-error{margin:-9px;padding:8px;border:1px solid var(--error);border-radius:var(--r)}
@media (hover:hover) and (pointer:fine){.choice:hover,.choice:hover input:not(:checked){border-color:var(--muted)}}
.a-letter-next{margin-left:auto}
.a-letter-prev{padding:0;border:0;background:none;font:inherit;cursor:pointer}
.a-submit{display:block}
.a-letter + .a-submit{margin-top:48px}
.a-submit-note{margin-bottom:16px;font-size:14px;line-height:1.55;color:var(--muted);max-width:40em;text-wrap:pretty}
.a-submit-note a{color:var(--ink)}
.a-submit .save-indicator{display:block;margin-bottom:10px}

/* Auto-save state: shown in the head and above Submit, fading in once and then
   staying; it holds its space, so it never reflows the page. */
.save-indicator{min-height:1.5em;font-size:14px;color:var(--muted);opacity:0;transition:opacity 160ms var(--ease)}
.save-indicator.visible{opacity:1}
.save-indicator.saved{color:var(--ink)}
.save-indicator.error{color:var(--error)}

/* ---------- course viewer ---------- */
.cv{flex:1 0 auto;display:flex;flex-direction:column;width:100%}
.cv-bar{position:relative;z-index:10;display:flex;justify-content:space-between;align-items:center;gap:12px 24px;min-height:72px;padding:12px var(--m);border-bottom:1px solid var(--line);background:var(--bg)}
.cv-bar-left,.cv-bar-right{display:flex;align-items:center;gap:20px;min-width:0}
.cv-logo{font:400 25px/1 var(--f-display);letter-spacing:-.01em;white-space:nowrap}
.cv-divider{width:1px;height:22px;background:var(--line2)}
.cv-course-title{min-width:0;font-size:15px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cv-section-toggle svg{transition:transform 200ms var(--ease)}
.cv-section-toggle.open svg{transform:rotate(180deg)}
/* The Lessons menu is a real overlay, so it carries the storefront's lift. */
.cv-section-panel{display:none;position:absolute;top:calc(100% + 8px);left:var(--m);width:min(380px,calc(100% - 2 * var(--m)));padding:6px;background:var(--raised);border:1px solid var(--line2);border-radius:var(--r);box-shadow:var(--lift);transform-origin:top left} /* taste-skill-ignore: overlay */
.cv-section-panel.open{display:block}
.cv-section-list{display:flex;flex-direction:column}
.cv-section-link{display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:48px;padding:10px 14px;border-radius:var(--r-inner);font-size:15px;color:var(--muted);text-decoration:none;transition:background-color 160ms var(--ease),color 160ms var(--ease)}
.cv-section-link.active{background:var(--raised2);color:var(--ink)}
.cv-section-num{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.cv-progress-text{font-size:14px;color:var(--muted);font-variant-numeric:tabular-nums}
.cv-back{display:inline-flex;align-items:center;min-height:44px;font-size:15px;color:var(--muted);text-decoration:none;transition:color 160ms var(--ease)}
@media (hover:hover) and (pointer:fine){
  .cv-section-link:hover{background:var(--raised2);color:var(--ink)}
  .cv-back:hover{color:var(--ink)}
}
.cv-main{flex:1 0 auto;width:100%;max-width:calc(800px + 2 * var(--m));margin-inline:auto;padding:clamp(36px,5vw,64px) var(--m) clamp(56px,7vw,96px)}
.cv-section-heading{margin-bottom:32px}
.cv-video-wrap{margin-bottom:24px;overflow:hidden;background:var(--raised);border:1px solid var(--line);border-radius:var(--r)}
.cv-video-wrap video,.cv-video-wrap iframe{display:block;width:100%;aspect-ratio:16 / 9;border:0;background:#000}
.cv-action-row{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:32px}
.cv-action-left{display:flex;flex-wrap:wrap;gap:10px}
.cv-action-right{margin-left:auto}
.cv-text-block{white-space:pre-wrap;font-size:17px;line-height:1.65;max-width:62ch;text-wrap:pretty}
.cv-text-block + .cv-text-block{margin-top:24px}
.cv-empty{color:var(--muted);text-align:center;padding-block:48px}

/* ---------- reading: a delivered intake (Mai's note, then her files) ---------- */
/* Mai's preview of a reading page from the admin: one quiet line above the
   page, so it can't be mistaken for the customer's own. */
.a-preview-line{margin:0;padding:10px var(--m);border-bottom:1px solid var(--line);background:var(--raised2);font-size:14px;line-height:1.45;text-align:center;color:var(--ink)}
/* The reading is Mai's reply to the intake letter: the letter column, her
   note in the letter serif on bare ground, her files as its enclosures. */
.a-reading-letter{margin-bottom:48px}
.a-reading-letter p{font:400 clamp(19px,1.5vw,21px)/1.6 var(--f-display);letter-spacing:-.003em;white-space:pre-line;text-wrap:pretty}
.a-reading-letter p + p{margin-top:1em}
.a-reading-letter .a-reading-sign{margin-top:28px}
.a-reading-enclosure{margin:0 0 8px}
.a-reading-well{overflow:hidden;background:var(--raised);border:1px solid var(--line);border-radius:var(--r)}
.a-reading-well video{display:block;width:100%;aspect-ratio:16 / 9;background:#000}
/* The well clips its corners, which would clip a focused video's ring too:
   draw the ring on the well instead. */
.a-reading-well:has(video:focus-visible){outline:2px solid var(--ink);outline-offset:3px}
.a-reading-well video:focus-visible{outline:none}
.a-reading-cannot{margin-top:12px}
/* A file row followed by a video: space between, not a rule against the well. */
.a-reading-file + .a-reading-enclosure{margin-top:24px}
.a-reading-well img{display:block;width:100%}
.a-reading-file{display:flex;justify-content:space-between;align-items:center;gap:12px 20px;padding:16px 0;border-bottom:1px solid var(--line)}
.a-reading-enclosure .a-reading-file{padding-top:14px}
.a-reading-file-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.a-reading-name{font:400 19px/1.3 var(--f-display);letter-spacing:-.003em;overflow-wrap:anywhere}
.a-reading-meta{font-size:13px;line-height:1.5;color:var(--muted);font-variant-numeric:tabular-nums}
.a-reading-actions{display:flex;flex-wrap:wrap;gap:8px}
.a-reading-doc.is-lead{border-top:1px solid var(--line)}
/* Sections, when Mai's files are split across services: each service's
   name over its files, as the cards' heading sits over theirs, a letter
   break between. A section's first document takes the hairline above, as
   the lead does, so its rows start on a rule under the heading. */
.a-reading-section + .a-reading-section{margin-top:48px}
.a-reading-section-h{margin-bottom:20px}
.a-reading-section-h + .a-reading-doc{border-top:1px solid var(--line)}
.a-reading-held{margin-bottom:0}
.a-reading-close{display:flex;flex-direction:column;align-items:flex-start;gap:12px;margin-top:40px}
.a-reading-close .a-letter-meta a{color:var(--ink)}
.a-reading-sent{display:inline-flex;align-items:center;min-height:44px;font-size:14px;color:var(--ink)}
/* Read along: a video's reviewed transcript under it, closed until asked
   for. Mai's words in the letter serif; the times are operated, so they are
   in the sans, each a 44px target that plays the video from there. */
.a-reading-transcript{margin:0 0 8px;border-bottom:1px solid var(--line)}
.a-reading-transcript > summary{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;list-style:none;cursor:pointer;font:500 15px/1.4 var(--f-text)}
.a-reading-transcript > summary::-webkit-details-marker{display:none}
.a-reading-transcript > summary::after{content:"";flex:none;width:8px;height:8px;margin-right:6px;border-right:1.5px solid var(--muted);border-bottom:1.5px solid var(--muted);transform:translateY(-2px) rotate(45deg);transition:transform 200ms var(--ease)}
.a-reading-transcript[open] > summary::after{transform:translateY(2px) rotate(-135deg)}
/* Set as her letter is (19 to 21px) in the same column, so a line of the
   transcript runs a little shorter than a line of her note (the time takes
   the rest), not the 90 or more characters 17px gave. */
.a-reading-para{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:baseline;gap:0 12px;font:400 clamp(19px,1.5vw,21px)/1.6 var(--f-display);letter-spacing:-.003em;text-wrap:pretty}
.a-reading-para + .a-reading-para{margin-top:.8em}
/* The transcript's own scrolling box, between hairlines (the summary's
   and the meta line's, at the column's width), so the video above stays on
   screen while the words scroll. The script sizes it to the room under the
   video (--read-along-height); this is the height without it. Its scroll
   doesn't run on into the page's. The box reaches 10px into the gutter so a
   marked passage's ground has room around the words. Its edges fade rather
   than cut a line in half, which also says the words go on (an overlay
   scrollbar shows nothing at rest); a mask reads only alpha, so its stop is
   a token. The padding lets the first and last lines clear the fades, and
   the scroll padding keeps a focused time clear of them. */
.a-reading-transcript[open] > summary{border-bottom:1px solid var(--line)}
.a-reading-scroll{max-height:var(--read-along-height,min(60vh,34rem));overflow:hidden auto;overscroll-behavior:contain;margin-inline:-10px;padding:16px 10px 40px;scroll-padding:16px 0 40px;-webkit-mask-image:linear-gradient(transparent,var(--ink) 16px,var(--ink) calc(100% - 40px),transparent);mask-image:linear-gradient(transparent,var(--ink) 16px,var(--ink) calc(100% - 40px),transparent)}
/* Focus rings inside the box, which clips: the box's own drops the fade
   and is drawn within its edge, rounded; a time's is drawn within its 44px. */
.a-reading-scroll:focus-visible{-webkit-mask-image:none;mask-image:none;outline-offset:-2px;border-radius:var(--r)}
.a-reading-scroll .a-ts:focus-visible{outline-offset:-2px}
/* The passage being spoken, while the video plays: stepped up as a choice
   is, a raised ground inside a field edge, and its time in ink. The edge is
   what shows on a dim screen (the ground alone is barely a step). Border
   and padding are taken back, so the words don't move. */
.a-reading-para{padding:3px 9px;margin-inline:-10px;border:1px solid transparent;border-radius:var(--r);transition:background-color 240ms var(--ease),border-color 240ms var(--ease)}
.a-reading-para.is-now{border-color:var(--field);background:var(--raised)}
.a-reading-para.is-now .a-ts{color:var(--ink);text-decoration-color:currentColor}
.a-ts{display:inline-flex;align-items:center;min-width:44px;min-height:44px;margin:-8px 0 -8px -8px;padding:0 8px;border:0;border-radius:var(--r-inner);background:none;color:var(--muted);font:500 13px/1 var(--f-text);font-variant-numeric:tabular-nums lining-nums;text-decoration:underline;text-decoration-color:var(--line2);text-underline-offset:.3em;cursor:pointer;transition:color 160ms var(--ease),text-decoration-color 160ms var(--ease)}
@media (hover:hover) and (pointer:fine){.a-ts:hover{color:var(--ink);text-decoration-color:currentColor}}
.a-reading-transcript .a-reading-meta{margin:0 0 24px;padding-top:20px;border-top:1px solid var(--line)}
/* The captions file, a quiet ink link at the end of that line. */
.a-reading-vtt{color:var(--ink);white-space:nowrap;text-underline-offset:.24em;text-decoration-thickness:1px}
/* Where the captions are: under the video's caption row, before Read along. */
.a-reading-cc{margin-top:12px}
/* It steps aside while Read along is open in a box sized under the video,
   giving the words its room: the box is reading along already. */
.a-reading-enclosure:has(+ .a-reading-transcript.is-sized[open]) .a-reading-cc{display:none}
/* A transcript followed by another video: space between, as after a file row. */
.a-reading-transcript + .a-reading-enclosure{margin-top:24px}
/* Mai's oracle cards, a section of their own after the files: a line under
   the heading saying a picture opens full size, then each card's booklet's
   pages side by side in wells, each a link to itself full size, where its
   words are read, and under them the card's name, then its Downloads on
   the same three columns, each under its own page. Every card keeps three
   columns at every width, so a black card's one page is the size of each of
   a white card's three, and no page sits alone under a gap. */
.a-reading-cards{margin-top:48px}
.a-reading-cards-h{margin-bottom:4px}
.a-reading-cards-hint{margin:0 0 20px}
.a-reading-card + .a-reading-card{margin-top:32px}
.a-reading-photos{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.a-reading-photo{display:block}
/* An upright card's shape until the picture arrives, so the cards don't
   jump as they load; then the picture's own. */
.a-reading-photo img{height:auto;aspect-ratio:auto 3 / 4;transition:opacity 160ms var(--ease)}
.a-reading-photo:focus-visible img{opacity:.88}
@media (hover:hover) and (pointer:fine){.a-reading-photo:hover img{opacity:.88}}
/* The card viewer: a picture opened on the page. On a phone it takes the
   whole screen on the bare ground, the card's name and Close at the top,
   its Download (and a booklet's Previous and Next) at the foot, in reach
   of a thumb. On a wider screen it is a raised panel over the page, which
   is dimmed by its own ground. */
.a-viewer{flex-direction:column;width:min(92vw,960px);max-width:none;max-height:92dvh;padding:0;border:1px solid var(--line2);border-radius:var(--r);background:var(--raised);color:var(--ink);box-shadow:var(--lift);overscroll-behavior:contain}
.a-viewer[open]{display:flex}
.a-viewer::backdrop{background:color-mix(in srgb,var(--bg) 86%,transparent)}
.a-viewer-head,.a-viewer-foot{display:flex;align-items:center;gap:12px;padding:12px 12px 12px 20px}
.a-viewer-foot{justify-content:space-between;padding-left:12px}
.a-viewer-title{flex:1;min-width:0}
.a-viewer-title .a-reading-meta{margin-top:2px}
.a-viewer-close{gap:8px;padding-inline:14px 16px}
.a-viewer-stage{position:relative;display:grid;grid-template:minmax(0,1fr) / minmax(0,1fr);place-items:center;flex:1;min-height:0;padding:0 20px;touch-action:pan-y pinch-zoom}
.a-viewer-stage img{max-width:100%;max-height:calc(92dvh - 150px);object-fit:contain;border-radius:var(--r-inner)}
.a-viewer-steps{display:flex;gap:8px}
.a-viewer-step{width:44px;padding:0}
.a-viewer-foot .a-viewer-steps[hidden] + .a-btn{margin-left:auto}
/* Waiting on a picture that isn't there yet, after a moment: the small
   spinner a button shows while it sends. */
.a-viewer-wait{position:absolute;width:20px;height:20px;border:2px solid transparent;border-top-color:var(--muted);border-radius:50%;animation:a-spin 600ms linear infinite}
html:has(.a-viewer[open]){overflow:hidden}
@media (max-width:760px){
  .a-viewer{width:100%;height:100%;max-height:none;border:0;border-radius:0;background:var(--bg);box-shadow:none}
  .a-viewer-head{padding:max(12px,env(safe-area-inset-top)) 12px 12px var(--m)}
  .a-viewer-foot{padding:12px var(--m) max(16px,env(safe-area-inset-bottom))}
  .a-viewer-stage{padding:0 var(--m)}
  .a-viewer-stage img{max-height:100%}
}
.a-reading-photo:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.a-reading-card .a-reading-file{flex-direction:column;align-items:stretch;gap:12px}
.a-reading-card .a-reading-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;width:100%}
/* A third of a phone's column: room for "Download" and its icon. */
.a-reading-card .a-reading-actions .a-btn{min-width:0;gap:6px;padding-inline:8px;white-space:normal}

/* ---------- motion: the single-panel pages settle in once; nothing else moves on load ---------- */
@media (prefers-reduced-motion:no-preference){
  .a-single{animation:a-rise 280ms var(--ease) both}
  .cv-section-panel.open{animation:a-pop 180ms var(--ease)}
  .a-viewer[open]{animation:a-pop 180ms var(--ease)}
  .a-viewer[open]::backdrop{animation:a-fade 180ms var(--ease)}
}
@keyframes a-fade{from{opacity:0}}
@keyframes a-rise{from{opacity:.4;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes a-pop{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition-property:opacity,color,background-color,border-color !important;animation:none !important}
  .btn-loading::after{animation:a-spin 1200ms linear infinite !important}
}

/* ---------- phone ---------- */
@media (max-width:760px){
  .a-header-in{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(44px,auto);grid-template-areas:"word end" "start start";min-height:64px;padding-block:10px;row-gap:2px}
  .a-word{justify-self:start;font-size:21px}
  .a-word img,.cv-logo img{max-height:32px}
  .a-header-start{font-size:14px}
  .a-header-start:empty{display:none}
  .a-row{grid-template-columns:minmax(0,1fr);padding:18px 18px 20px}
  .a-row .a-btn{width:100%}
  .a-ready .a-btn{width:100%}
  /* Phone order: the save state, then Continue in thumb reach, then Back. */
  .a-letter-nav{flex-direction:column;align-items:stretch}
  .a-letter-nav .a-nav-status{order:0}
  .a-letter-next{order:1;width:100%;margin-left:0;white-space:normal}
  .a-letter-prev{order:2;align-self:flex-start}
  .a-letter .form-label{font-size:18px}
  /* Under the field just left, in the gap below it, so it never moves the
     page; right-aligned like a counter, so it reads as the field's and not
     as the next question's. */
  .a-field-status{display:block;position:absolute;right:0;top:100%;margin:4px 0 0;text-align:right}
  .btn-add-question{margin-left:0}
  .question-note{margin-left:32px}
  .question-item{grid-template-columns:24px minmax(0,1fr) 44px;gap:8px}
  .a-foot-legal{flex-direction:column;align-items:flex-start}
  .a-reading-file{flex-direction:column;align-items:stretch}
  .a-reading-actions .a-btn{flex:1 1 0}
  /* Two rows: wordmark and the way out first, then Lessons and progress. The two
     groups dissolve into one grid so Exit keeps the end of the top row. */
  .cv-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 16px;min-height:64px;padding-block:10px}
  .cv-bar-left,.cv-bar-right{display:contents}
  .cv-logo{grid-row:1;grid-column:1;font-size:21px}
  .cv-back{grid-row:1;grid-column:2;justify-self:end}
  .cv-section-toggle{grid-row:2;grid-column:1;justify-self:start}
  .cv-progress-text,.cv-preview-badge{grid-row:2;grid-column:2;justify-self:end}
  .cv-course-title,.cv-divider{display:none}
  .cv-action-right{flex:1 1 100%}
  .cv-action-right .a-btn{width:100%}
}
