/* Body Belonging Clinic — reflection sheets, online.
   Palette and faces follow the printed library. Nothing here leaves the device. */

:root{
  --cream:#F7F0E6;
  --card:#FFFBF4;
  --ink:#33131F;
  --ink-soft:#6A4A55;
  --ink-faint:#826770;   /* was #94757F, 3.63:1 on cream. Now 4.50:1. */
  --plum:#5C1B2E;
  --forest:#4C6A3C;
  --terracotta:#CB6843;      /* display type, rules and the lockup only: 3.31:1 */
  --terracotta-ink:#A95738;  /* the same hue for SMALL TEXT: 4.52:1 on cream */
  --butter:#F4D35E;
  --rule:#DCCFBE;
  --rule-soft:#EBE1D3;
  --on-accent:#FFFBF4;
  --base:16.5px;
}
:root[data-theme="dark"]{
  --cream:#1A1013; --card:#241619; --ink:#F2E7DC; --ink-soft:#C0A9AF;
  --ink-faint:#957B81; --plum:#D99BAC; --forest:#9DC084; --terracotta:#E28F6C; --terracotta-ink:#E28F6C;
  --butter:#F4D35E; --rule:#3C2A2F; --rule-soft:#2E1F23; --on-accent:#1A1013;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --cream:#1A1013; --card:#241619; --ink:#F2E7DC; --ink-soft:#C0A9AF;
    --ink-faint:#957B81; --plum:#D99BAC; --forest:#9DC084; --terracotta:#E28F6C; --terracotta-ink:#E28F6C;
    --butter:#F4D35E; --rule:#3C2A2F; --rule-soft:#2E1F23; --on-accent:#1A1013;
  }
}
:root[data-reg="p"]{ --base:19.5px; }

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--cream); color:var(--ink);
  font-family:'Sen',system-ui,-apple-system,'Segoe UI',sans-serif;
  font-size:var(--base); line-height:1.6;
  -webkit-text-size-adjust:100%;
}
:root[data-reg="p"] body{ line-height:1.72; }
button,input,textarea{font-family:inherit;font-size:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2.5px solid var(--terracotta);outline-offset:2px;border-radius:2px}
em{font-style:italic}
strong,b{font-weight:700}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ---------- quick exit: fixed, above everything, never occluded ---------- */
#exit{
  position:fixed; top:10px; right:12px; z-index:9999;
  background:var(--card); color:var(--ink);
  border:1.5px solid var(--ink); border-radius:999px;
  padding:7px 15px; font-size:13.5px; font-weight:700; line-height:1.2;
  box-shadow:0 2px 12px rgba(0,0,0,.2);
}
#exit:hover{background:var(--ink);color:var(--card)}

/* ---------- chrome ---------- */
.bar{
  border-bottom:1px solid var(--rule); background:var(--cream);
  padding:13px 20px 11px; padding-right:118px; display:flex; flex-wrap:wrap; gap:10px 18px; align-items:center;
}
.brand{
  font-family:'Big Shoulders Display',var(--fallback),sans-serif;
  font-weight:700; font-size:19px; letter-spacing:.05em; text-transform:uppercase;
  color:var(--plum); line-height:1; background:none; border:0; padding:0;
}
.brand span{color:var(--forest)}
.sheetid{font-size:12.5px;color:var(--ink-faint);letter-spacing:.05em;text-transform:uppercase;font-weight:700}
.regs{display:flex;margin-left:auto;border:1px solid var(--rule);border-radius:3px;overflow:hidden;flex-wrap:wrap}
.regs button{
  background:transparent;border:0;padding:7px 13px;font-size:13.5px;
  color:var(--ink-soft);border-right:1px solid var(--rule);
}
.regs button:last-child{border-right:0}
.regs button[aria-pressed="true"]{background:var(--plum);color:var(--on-accent);font-weight:700}
.prog{height:2px;background:var(--rule-soft)}
.prog i{display:block;height:100%;background:var(--forest);width:0;transition:width .3s ease}

/* ---------- layout ---------- */
main{max-width:720px;margin:0 auto;padding:32px 22px 12px;display:flex;flex-direction:column}
.step{display:flex;flex-direction:column;flex:1;min-height:0}
h1{
  font-family:'Big Shoulders Display',sans-serif;font-weight:600;
  font-size:clamp(36px,7vw,56px);line-height:.96;margin:0 0 16px;text-wrap:balance;
}
h1 em{color:var(--plum)}
.q{
  font-family:'Big Shoulders Display',sans-serif;font-weight:500;
  font-size:clamp(27px,4.8vw,38px);line-height:1.07;margin:0 0 10px;text-wrap:balance;
}
:root[data-reg="p"] .q{font-family:'Sen',sans-serif;font-weight:700;font-size:clamp(23px,4vw,28px);line-height:1.28}
.kicker{
  font-family:'Big Shoulders Display',sans-serif;font-weight:600;font-size:13px;
  letter-spacing:.16em;text-transform:uppercase;color:var(--terracotta-ink);margin:0 0 14px;
}
p{margin:0 0 14px;max-width:62ch}
.sub{color:var(--ink-soft)}
.tiny{font-size:.82em;color:var(--ink-faint)}
.reads{overflow-y:auto;max-height:50vh;padding-right:6px;margin-bottom:8px}
/* About is a reading page, not a question inside a sheet. The 50vh inner
   scroll above belongs to a read block that sits above a Next button; here
   it truncated the copy mid-sentence with nothing to say it had. */
.reads.whole{overflow:visible;max-height:none;padding-right:0;margin-bottom:16px}
.read{border-top:1px solid var(--rule);padding:14px 0}
.read:last-child{border-bottom:1px solid var(--rule)}
.read h3{
  margin:0 0 4px;font-family:'Big Shoulders Display',sans-serif;font-weight:600;
  font-size:20px;letter-spacing:.03em;text-transform:uppercase;color:var(--forest);
}
:root[data-reg="p"] .read h3{font-family:'Sen',sans-serif;text-transform:none;letter-spacing:0;font-size:1.05em}
.read p{margin:0;color:var(--ink-soft)}
.note{border-left:3px solid var(--butter);background:rgba(244,211,94,.14);padding:14px 16px;margin:14px 0}
.note p:last-child{margin-bottom:0}
.alt{display:block;margin-top:8px;padding-left:13px;border-left:2px solid var(--rule);color:var(--ink-faint);font-size:.92em}
figure{margin:10px 0;background:#FFFBF4;border:1px solid var(--rule);border-radius:3px;padding:10px}
figure svg{display:block;width:100%;height:auto}

/* ---------- answer ---------- */
.field{margin-top:auto;padding-top:16px}
/* 🔴 The height here is a FLOOR, not the size. fitAnswer() in app.js grows the
   box until the Next button reaches the bottom of the screen, because a fixed
   116px box on a phone with 300px of empty screen under it is asking for three
   lines when there is room for nine. Measured 6 Sep: a taller answer space
   roughly doubles what people write and changes nothing about whether they
   answer at all. The floor is what a small screen falls back to. */
textarea{
  width:100%;min-height:116px;resize:vertical;background:var(--card);
  border:1px solid var(--rule);border-left:3px solid var(--plum);border-radius:2px;
  padding:12px 13px;line-height:1.55;
}
:root[data-reg="p"] textarea{min-height:150px}
/* The second box under a tick row, for whatever was not on the list. Smaller
   than a main answer box on purpose: it is an opening, not the question. */
textarea.aside{min-height:60px}
:root[data-reg="p"] textarea.aside{min-height:76px}
.asideLbl{display:block;font-size:.85em;color:var(--ink-soft);margin:11px 0 5px}
.errline{color:var(--terracotta-ink);font-size:.88em;margin:8px 0 0;font-weight:700}
textarea.marked{border-left-color:var(--forest)}
textarea::placeholder{color:var(--ink-faint)}
.mark{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;align-items:center}
.mark .lbl{font-size:.78em;color:var(--ink-faint);margin-right:4px}
.mark button{background:transparent;border:1px solid var(--rule);color:var(--ink-soft);padding:5px 12px;font-size:.85em;border-radius:999px}
.mark button[aria-pressed="true"]{border-color:var(--plum);background:var(--plum);color:var(--on-accent);font-weight:700}
.mark button[data-v="bring"][aria-pressed="true"]{border-color:var(--forest);background:var(--forest)}
.linkish{background:none;border:0;padding:0;color:var(--forest);font-size:.85em;text-decoration:underline;text-underline-offset:3px;margin-top:9px}
.photo{display:none}
/* The exit blanks the page before it navigates, so the picture the app switcher
   keeps of the last frame is not the sheet. White in both themes, on purpose. */
html[data-exiting],html[data-exiting] body{background:#FFFFFF!important}
.photoName{font-size:.82em;color:var(--forest);margin-top:8px}
.photoName img{display:block;max-width:190px;margin-top:6px;border:1px solid var(--rule);border-radius:2px}

.chips{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 4px}
.chips button{background:var(--card);border:1px solid var(--rule);padding:8px 14px;border-radius:999px}
.chips button[aria-pressed="true"]{background:var(--butter);border-color:var(--butter);color:#33131F;font-weight:700}

/* ---------- nav ---------- */
.nav{display:flex;gap:10px;align-items:center;padding:14px 22px 16px;max-width:720px;margin:0 auto;border-top:1px solid var(--rule-soft)}
.state{font-size:.78em;color:var(--ink-faint);margin-right:auto;display:flex;align-items:center;gap:6px}
.dot{width:7px;height:7px;border-radius:50%;background:var(--plum);flex:none}
.btn{background:var(--plum);color:var(--on-accent);border:0;padding:11px 22px;font-weight:700;border-radius:2px}
.btn.ghost{background:transparent;color:var(--ink-soft);border:1px solid var(--rule);font-weight:400}
.btn:disabled{opacity:.35;cursor:not-allowed}

/* ---------- library ---------- */
.libhead{padding:40px 0 6px}
.list{display:grid;gap:0;margin:18px 0 8px}
.card{
  display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:0 14px;align-items:baseline;
  border-top:1px solid var(--rule);padding:16px 2px;background:none;text-align:left;width:100%;
}
.list > *:last-child{border-bottom:1px solid var(--rule)}
.card:hover{background:var(--card)}
.card,.card:visited{color:inherit;text-decoration:none}
#stage .list button.card .n{visibility:hidden}
.card .n{font-family:'Big Shoulders Display',sans-serif;font-weight:700;font-size:15px;color:var(--terracotta-ink);letter-spacing:.05em}
.card .t{font-family:'Big Shoulders Display',sans-serif;font-weight:600;font-size:23px;line-height:1.1;letter-spacing:.01em}
:root[data-reg="p"] .card .t{font-family:'Sen',sans-serif;font-weight:700;font-size:1.05em;line-height:1.35}
.card .d{font-size:.8em;color:var(--ink-faint);grid-column:2;margin-top:3px}
.card .badge{font-size:.72em;color:var(--forest);letter-spacing:.06em;text-transform:uppercase;font-weight:700;white-space:nowrap}

/* ---------- footer ---------- */
footer{border-top:1px solid var(--rule);margin:24px auto 0;padding:20px 22px 80px;max-width:720px}
footer .stop{font-size:.88em;color:var(--ink-soft)}
footer .nums{font-size:.8em;color:var(--ink-soft);line-height:1.75}
footer .sig{display:flex;flex-wrap:wrap;gap:4px 16px;margin-top:12px;font-size:.72em;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-faint)}
footer .sig b{color:var(--plum)}
footer a{color:var(--forest)}

/* ---------- bring-page ---------- */
#bring{position:fixed;inset:0;z-index:900;background:var(--cream);overflow-y:auto;padding:26px 22px 60px;display:none}
#bring.open{display:block}
#bring .inner{max-width:640px;margin:0 auto}
#bring h2{font-family:'Big Shoulders Display',sans-serif;font-weight:600;font-size:30px;margin:0 0 6px;letter-spacing:.02em}
.bringrow{border-top:1px solid var(--rule);padding:14px 0}
.bringrow .qq{font-size:.82em;color:var(--ink-faint);margin-bottom:4px}
.bringrow .aa{white-space:pre-wrap}
@media print{
  #exit,.bar,.nav,.prog,footer,.noprint{display:none!important}
  #bring{position:static;display:block;padding:0}
  body{background:#fff;color:#000}
}

/* ---------- your own pages, sending, the gathered page ---------- */
.libhead.own{padding-top:30px}
.btns{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 6px}
.sendrow{margin-top:22px;border-top:1px solid var(--rule);padding-top:14px}
.sendrow .tiny{margin-top:10px}
.sendstate{color:var(--forest);font-weight:700;min-height:1.4em}
.bringh{margin-top:22px}
.entryq{margin-top:0;padding-top:18px}
.entryq .q{font-size:clamp(21px,3.6vw,26px)}
@media print{.sendrow{display:none!important}}
.regrow{margin:4px 0 6px}
.regrow .regs{margin-left:0;display:inline-flex}
.regrow .tiny{margin-top:8px}
