:root {
  --red: #8B0000;
  --red-soft: #f6e9e9;
  --ink: #141414;
  --ink-2: #4a4a4a;
  --line: #dcdcdc;
  --paper: #ffffff;
  --bg: #f4f3f1;
  --ok: #1d6b3a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
header {
  position: sticky; top: 0; z-index: 5;
  background: #0e0e0e; color: #fff;
  padding: 10px 16px 12px;
}
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 680px; margin: 0 auto; }
.head-row img { height: 26px; width: auto; display: block; }
.saved { font-size: 13px; color: #bdbdbd; white-space: nowrap; }
.saved.warn { color: #ffb4a8; }
.bar { max-width: 680px; margin: 10px auto 0; height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--red); transition: width .25s; }
.step-label { max-width: 680px; margin: 6px auto 0; font-size: 13px; color: #bdbdbd; }
main { max-width: 680px; margin: 0 auto; padding: 18px 16px 120px; }
main:focus { outline: none; }
h1 { font-size: 26px; line-height: 1.2; margin: 6px 0 6px; }
.lede { color: var(--ink-2); margin: 0 0 18px; }
.q {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0 0 14px;
}
.q > label.qt, .q > .qt { display: block; font-weight: 650; font-size: 18px; margin: 0 0 4px; }
.help { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
.prefilled { display: inline-block; font-size: 12px; font-weight: 600; color: var(--red); background: var(--red-soft); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
.req { color: var(--red); font-weight: 700; margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 10px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-size: 16px; cursor: pointer; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.chip:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible, .link:focus-visible, .own-toggle:focus-visible { outline: 3px solid #e0a3a3; outline-offset: 2px; }
.group { margin: 0 0 14px; }
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; }
.group-head b { font-size: 15px; }
.link { background: none; border: 0; color: var(--red); font: inherit; font-size: 14px; font-weight: 600; padding: 8px 0; cursor: pointer; }
input[type=text], input[type=tel], input[type=email], input[type=password], textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 12px; background: #fff;
}
textarea { min-height: 88px; resize: vertical; }
.field { position: relative; }
.field.has-mic input, .field.has-mic textarea { padding-right: 58px; }
.mic {
  position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--red-soft); color: var(--red); cursor: pointer;
  display: grid; place-items: center;
}
.mic svg { width: 22px; height: 22px; }
.mic.on { background: var(--red); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(139,0,0,.35); } 50% { box-shadow: 0 0 0 8px rgba(139,0,0,0); } }
@media (prefers-reduced-motion: reduce) { .mic.on { animation: none; } .bar > i { transition: none; } }
.own { margin-top: 10px; }
.own-toggle { background: none; border: 1.5px dashed var(--line); border-radius: 999px; min-height: 44px; padding: 8px 14px; font: inherit; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.mic-note { font-size: 12px; color: var(--ink-2); margin: 6px 2px 0; }
.tip { background: #fff8e6; border: 1px solid #f0dca6; border-radius: 10px; padding: 12px; font-size: 15px; margin: 0 0 14px; }
.homework { border-color: var(--red); }
.pick-note { background: #fff8e6; border: 1px solid #f0dca6; border-radius: 10px; padding: 12px; font-size: 15px; margin: 12px 0 0; color: var(--ink); }
.photos { display: grid; gap: 10px; }
.photo-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.photo-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.photo-top span { font-size: 15px; }
.photo-top small { color: var(--ink-2); display: block; }
.pick { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 84px; }
.pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.files { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.files li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.files img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; background: #eee; }
.files .doc { width: 40px; height: 40px; border-radius: 6px; flex: none; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.files .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .rm { background: none; border: 0; color: var(--red); font: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 0 6px; cursor: pointer; }
.files .busy { color: var(--ink-2); font-style: italic; }
.files .err { color: var(--red); }
footer.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.nav-row { max-width: 680px; margin: 0 auto; display: flex; gap: 10px; }
.btn { min-height: 50px; border-radius: 12px; font: inherit; font-weight: 650; font-size: 17px; cursor: pointer; padding: 0 18px; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); }
.btn.primary { flex: 1; background: var(--red); border-color: var(--red); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.summary dl { margin: 0; }
.summary dt { font-weight: 650; font-size: 15px; margin-top: 10px; }
.summary dd { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; white-space: pre-line; }
.summary .missing { color: var(--red); }
.sent-copy { font-size: 20px; margin: 36px 0 4px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; cursor: pointer; }
.check input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--red); flex: none; }
.welcome-list { padding-left: 20px; margin: 0 0 16px; }
.welcome-list li { margin: 6px 0; }
.dates { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: 16px; }
.notice { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 16px; }
.notice p { margin: 0 0 10px; }
.notice a { color: var(--red); font-weight: 600; }
.err-box { background: #fdecea; border: 1px solid #f3b8b1; color: #7a1b12; border-radius: 10px; padding: 12px; font-size: 15px; margin: 0 0 14px; }
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin: 8px 0 14px; }
.done-mark svg { width: 30px; height: 30px; }
.account { max-width: 440px; }
.account .btn.primary { width: 100%; margin: 6px 0 10px; }
.account .q { margin: 0 0 14px; }
#signOut { margin-left: 8px; }

/* Account screens (sign in, create, code, reset): one calm card on a dark page. Scoped to body.is-auth,
   which account.js adds while an account screen shows and removes the moment the client is in. */
body.is-auth {
  background: #0b0b0c radial-gradient(ellipse 70% 45% at 50% 0%, rgba(139,0,0,.28), rgba(139,0,0,0) 70%) no-repeat;
  background-color: #0b0b0c;
  color: #f2f0ee;
  font-family: "Inter Tight", "Helvetica Neue", Arial, system-ui, sans-serif;
  min-height: 100vh;
}
body.is-auth > header { display: none; }
body.is-auth main { max-width: none; padding: 0; min-height: 100vh; }
body.is-auth main > .lede { color: #b9b4af; text-align: center; padding: 40vh 16px 0; }
body.is-auth noscript .lede { color: #b9b4af; padding: 16px; }
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
}
.auth-logo { display: block; width: 160px; max-width: 60%; height: auto; margin: 0 0 28px; }
.auth-card {
  width: 100%; max-width: 420px; background: #fff; color: #1c1a19;
  border-radius: 16px; padding: 32px 28px 26px;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 24px 60px rgba(0,0,0,.55);
}
.auth-card h1 { font-size: 26px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.01em; }
.auth-card .lede { color: #5f5852; font-size: 15px; line-height: 1.5; margin: 0 0 22px; }
.auth-card .err-box {
  background: #fdecea; border: 1px solid #f0b5ad; border-left: 3px solid #b4231f; color: #7a1b12;
  border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.45; margin: 0 0 16px;
}
.af { margin: 0 0 16px; }
.af-label { display: block; font-size: 14px; font-weight: 600; color: #2a2624; margin: 0 0 6px; }
.af-wrap { position: relative; }
.auth-card input[type=text], .auth-card input[type=email], .auth-card input[type=password] {
  display: block; width: 100%; height: 48px; padding: 0 14px; font: inherit; font-size: 16px; color: #1c1a19;
  background: #fff; border: 1px solid #cfc9c3; border-radius: 10px; box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.af-wrap input { padding-right: 72px; }
.auth-card input:hover:not(:disabled):not([readonly]) { border-color: #9d948c; }
.auth-card input:focus, .auth-card input:focus-visible {
  outline: none; border-color: #8B0000; box-shadow: 0 0 0 3px rgba(139,0,0,.2);
}
.auth-card input[readonly] { background: #f4f2ef; color: #4a4541; }
.auth-card input:disabled { opacity: .6; }
.af-toggle {
  position: absolute; top: 4px; right: 4px; height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: #8B0000; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.af-toggle:hover:not(:disabled) { background: #f6e9e9; }
.af-toggle:focus-visible, .auth-link:focus-visible, .auth-foot a:focus-visible, .auth-card .btn:focus-visible {
  outline: 3px solid rgba(139,0,0,.35); outline-offset: 2px;
}
.af-code input {
  height: 60px; text-align: center; font-size: 28px; font-weight: 600; letter-spacing: .5em;
  padding: 0 0 0 .5em; font-variant-numeric: tabular-nums;
}
.auth-card .help { color: #6a625b; font-size: 13px; line-height: 1.45; margin: -8px 0 16px; }
.auth-card .btn.primary {
  display: block; width: 100%; height: 48px; min-height: 48px; margin: 8px 0 0; padding: 0 18px; border-radius: 10px;
  border: 1px solid #8B0000; background: #8B0000; color: #fff; font: inherit; font-size: 16px; font-weight: 650;
  cursor: pointer; transition: background .15s, transform .05s;
}
.auth-card .btn.primary:hover:not(:disabled) { background: #730000; border-color: #730000; }
.auth-card .btn.primary:active:not(:disabled) { transform: translateY(1px); }
.auth-card .btn.primary:disabled { opacity: .55; cursor: not-allowed; }
.auth-card.is-busy .btn.primary { cursor: progress; }
.auth-alt { margin: 14px 0 0; text-align: center; }
.auth-link {
  background: none; border: 0; padding: 6px 4px; font: inherit; font-size: 14px; color: #6a625b;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #cfc9c3; cursor: pointer;
}
.auth-link:hover:not(:disabled) { color: #8B0000; text-decoration-color: #8B0000; }
.auth-foot { margin: 22px 0 0; text-align: center; font-size: 13px; line-height: 1.8; color: #9a938c; }
.auth-foot a { color: #d8d3ce; text-underline-offset: 3px; }
.auth-foot a:hover { color: #fff; }
@media (min-width: 600px) {
  .auth-card { padding: 36px 36px 30px; }
  .auth-logo { width: 176px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card input, .auth-card .btn.primary { transition: none; }
  .auth-card .btn.primary:active:not(:disabled) { transform: none; }
}
