/* Client portal. Loads after app.css. One calm column, one bold card. */

.pt { max-width: 720px; margin: 0 auto; padding: 18px 16px 64px; }
.pt-top { display: flex; align-items: center; gap: 10px; padding: 4px 0 26px; }
.pt-top svg.mark { width: 28px; height: 28px; }
.pt-top b { font-weight: 700; font-size: 14px; }
.pt-top .r { margin-left: auto; }

.hello .eyebrow { color: var(--brass-ink); }
.hello h1 { font-size: clamp(34px, 7vw, 46px); line-height: 1.05; margin: 8px 0 10px; }
.hello h1 em { color: var(--green-ink); }
.hello p { color: var(--muted); font-size: 16px; max-width: 54ch; }

/* stage tracker */
.track { list-style: none; margin: 28px 0 22px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.track li { position: relative; display: grid; justify-items: start; gap: 8px; font-size: 13px; font-weight: 600; color: var(--faint); padding-right: 8px; }
.track li::before { content: ''; position: absolute; top: 7px; left: 16px; right: 0; height: 2px; background: var(--line-2); }
.track li:last-child::before { display: none; }
.track li.done::before { background: var(--green-ink); }
.track .dot { position: relative; z-index: 1; width: 16px; height: 16px; border-radius: 50%; background: var(--ground); border: 2px solid var(--line-2); display: grid; place-items: center; }
.track li.done .dot { background: var(--green-ink); border-color: var(--green-ink); }
.track li.done .dot::after { content: ''; width: 6px; height: 3px; border-left: 2px solid var(--surface); border-bottom: 2px solid var(--surface); transform: rotate(-45deg) translate(1px, -1px); }
.track li.cur { color: var(--ink); }
.track li.cur .dot { border-color: var(--brass); background: var(--brass); box-shadow: 0 0 0 5px rgba(165, 129, 63, .18); }
.track li.bad .dot { border-color: var(--bad); background: var(--bad); box-shadow: 0 0 0 5px var(--bad-wash); }
.track li.done { color: var(--ink-2); }

/* the next-step card: the one bold moment */
.next {
  position: relative; overflow: hidden; border-radius: 20px; padding: 24px 24px 22px; margin-bottom: 34px;
  background: #123329; color: #f1ecdf; box-shadow: var(--sh-2);
}
.next::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  border: 1px solid rgba(200, 171, 115, .25); box-shadow: 0 0 0 26px rgba(200, 171, 115, .05), 0 0 0 52px rgba(200, 171, 115, .035); pointer-events: none;
}
.next .eyebrow { color: #d9bf8a; }
.next h2 { font-size: clamp(24px, 5vw, 30px); line-height: 1.12; margin: 8px 0 8px; color: #fbf8f1; max-width: 22ch; }
.next p { color: rgba(241, 236, 223, .78); font-size: 15.5px; max-width: 50ch; position: relative; z-index: 1; }
.next .go { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.next .btn-gold { background: #d9bf8a; border-color: #d9bf8a; color: #16241f; }
.next .btn-gold:hover { background: #e6cf9f; border-color: #e6cf9f; }
.next .btn-ghost { background: transparent; border-color: rgba(241, 236, 223, .28); color: #f1ecdf; }
.next .btn-ghost:hover { background: rgba(241, 236, 223, .08); border-color: rgba(241, 236, 223, .45); }
.next .clock { margin-top: 16px; position: relative; z-index: 1; }
.next .clock .ticks { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; }
.next .clock .ticks i { height: 10px; border-radius: 3px; background: rgba(241, 236, 223, .14); }
.next .clock .ticks i.on { background: #d9bf8a; }
.next .clock .lbl { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: rgba(241, 236, 223, .72); font-variant-numeric: tabular-nums; }
.next .clock .lbl b { color: #fbf8f1; }
.next.ok { background: #1f4a37; }
.next.bad { background: #3b1f1a; }

/* sections */
.psec { margin-bottom: 34px; }
.psec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.psec-head h2 { font-size: 24px; }
.psec-head .r { margin-left: auto; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pbar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: flex; margin-bottom: 18px; }
.pbar i { height: 100%; background: var(--ok); transition: width .6s var(--ease); }
.pbar i + i { background: var(--brass-soft, #c8ab73); }

/* documents grouped by what they ask of the client */
.grp + .grp, .grp + .done-toggle { margin-top: 26px; }
.cat-h { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px; }
.cat-h span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.cat-h small { font-size: 13px; color: var(--muted); }
.cat-h em { margin-left: auto; font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.grp.todo .cat-h span { color: var(--brass-ink, #7a5b23); }
.grp.done .pdoc { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.done-toggle { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line-2); background: transparent; text-align: left; font-size: 14px; color: var(--muted); transition: border-color .15s, background .15s; }
.done-toggle:hover { border-color: var(--ok); background: var(--ok-wash); }
.done-toggle svg { width: 16px; height: 16px; color: var(--ok); flex: none; }
.done-toggle b { color: var(--ink); font-weight: 650; margin-right: 4px; }
.done-toggle span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done-toggle .r { font-weight: 600; color: var(--green-ink); }
.target { display: flex; align-items: center; gap: 8px; margin: -8px 0 22px; font-size: 13.5px; color: var(--muted); }
.target svg { width: 16px; height: 16px; flex: none; color: var(--brass); }
.target b { color: var(--ink); font-weight: 650; }
.pdoc .timing { display: grid; grid-template-columns: 18px 1fr; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; line-height: 1.5; }
.pdoc .timing svg { width: 16px; height: 16px; margin-top: 2px; color: var(--brass); }
.pdoc .timing b { font-weight: 650; color: var(--ink); }
.pdoc .timing.late { background: var(--warn-wash); }
.pdoc .timing.late svg { color: var(--warn); }
.next .clock-note { margin-top: 8px; font-size: 12.5px; color: rgba(241, 236, 223, .55); }
.pdocs { display: grid; gap: 8px; }
.pdoc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; transition: border-color .15s, box-shadow .15s; }
.pdoc.open { border-color: var(--line-2); box-shadow: var(--sh-1); }
.pdoc.fix { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.pdoc > button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; }
.pdoc .st { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--faint); }
.pdoc .st svg { width: 15px; height: 15px; }
.pdoc .st.ok { background: var(--ok-wash); color: var(--ok); }
.pdoc .st.info { background: var(--info-wash); color: var(--info); }
.pdoc .st.bad { background: var(--bad-wash); color: var(--bad); }
.pdoc .nm { flex: 1; min-width: 0; }
.pdoc .nm b { display: block; font-weight: 650; font-size: 15px; }
.pdoc .nm small { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.pdoc .chev { width: 16px; height: 16px; color: var(--faint); transition: transform .2s; flex: none; }
.pdoc.open .chev { transform: rotate(180deg); }
.pdoc .in { padding: 0 16px 16px 56px; display: grid; gap: 12px; font-size: 14.5px; color: var(--ink-2); }
.pdoc .from { padding: 12px 14px; border-radius: 12px; background: var(--bad-wash); color: var(--ink); }
.pdoc .from .eyebrow { display: block; color: var(--bad); margin-bottom: 4px; }
.pdoc .how { line-height: 1.6; }
.pdoc .lead { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pdoc .lead svg { width: 14px; height: 14px; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--brass); background: var(--brass-wash); }
.drop .hint { font-size: 13px; color: var(--muted); flex: 1; min-width: 160px; }
.prog { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; flex-basis: 100%; }
.prog i { display: block; height: 100%; width: 0; background: var(--green-ink); transition: width .2s; }
.drop.err { border-color: var(--bad); }
.drop .errmsg { flex-basis: 100%; font-size: 13.5px; color: var(--bad); }

/* payments + contact */
.plist { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.prow { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.prow + .prow { border-top: 1px solid var(--line); }
.prow .nm { flex: 1; min-width: 0; }
.prow .nm b { display: block; font-weight: 650; }
.prow .nm small { display: block; color: var(--muted); font-size: 13px; }
.contact { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 20px; }
.contact .av { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #f1ecdf; font-family: var(--serif); font-size: 20px; }
.contact p { color: var(--muted); font-size: 14.5px; }
.contact b { display: block; font-weight: 650; color: var(--ink); font-size: 15.5px; }
.contact .go { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.contact .contact-addr { font-size: 13.5px; color: var(--faint); margin-top: 2px; user-select: all; word-break: break-all; }
.pfoot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pfoot button { color: var(--muted); font-weight: 600; margin-left: auto; }
.pfoot button:hover { color: var(--ink); }

@media (max-width: 520px) {
  .track li { font-size: 11.5px; }
  .next { padding: 20px 18px 18px; border-radius: 18px; }
  .pdoc .in { padding-left: 16px; }
}
@media (max-width: 520px) {
  .cat-h { flex-wrap: wrap; row-gap: 2px; }
  .cat-h small { order: 3; flex-basis: 100%; }
}

.preview-bar { position: sticky; top: 8px; z-index: 20; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 10px 14px; border-radius: 12px; background: #2b2417; color: #f1ecdf; font-size: 13.5px; box-shadow: var(--sh-2); }
.preview-bar svg { width: 16px; height: 16px; flex: none; color: #d9bf8a; }
.preview-bar span { flex: 1; }
.preview-bar button { color: #d9bf8a; font-weight: 600; }

.pdoc .ordered-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }

/* ---------- proposal: read, sign, pay ---------- */
button.link { color: var(--green-ink); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
button.link svg { width: 15px; height: 15px; }
button.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.psec-head .r.link { margin-left: auto; }
.confirming { margin: -6px 0 18px; font-size: 14px; color: var(--muted); }

.note-card { margin: 0 0 18px; padding: 18px 20px; border-radius: 16px; background: var(--brass-wash); color: var(--ink); }
.note-card .eyebrow { color: var(--brass-ink); }
.note-card p { margin-top: 6px; font-family: var(--serif); font-size: 18px; line-height: 1.5; white-space: pre-line; }

.terms { display: grid; grid-template-columns: minmax(150px, 200px) 1fr; gap: 6px 26px; padding: 22px 22px 18px; margin-bottom: 34px; }
.terms .fee { display: grid; align-content: start; gap: 4px; padding-right: 22px; border-right: 1px solid var(--line); }
.terms .fee .eyebrow { color: var(--brass-ink); }
.terms .fee b { font-family: var(--serif); font-size: 44px; line-height: 1; font-weight: 500; letter-spacing: -.01em; color: var(--green-ink); font-variant-numeric: lining-nums; }
.terms .fee small { font-size: 13px; color: var(--muted); }
.terms dl { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 0; font-size: 14.5px; align-content: start; }
.terms dt { font-weight: 650; color: var(--ink); }
.terms dd { margin: 0; color: var(--ink-2); }
.terms .fine { grid-column: 1 / -1; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.fine { font-size: 12.5px; line-height: 1.55; color: var(--muted); }

/* the letter reads like paper, not like an app */
.letter { background: #fffefb; color: #24211b; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--sh-2); padding: clamp(22px, 5vw, 48px) clamp(20px, 6vw, 56px); font-family: var(--serif); font-size: 16.5px; line-height: 1.62; }
.letter header { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1px solid #e3dccb; font-family: var(--sans); font-size: 12.5px; color: #6b6454; line-height: 1.5; }
.letter header b { display: block; font-family: var(--serif); font-size: 17px; color: #24211b; font-weight: 600; margin-bottom: 2px; }
.letter header span { display: block; }
.letter header .ref { text-align: right; }
.letter header .ref b { font-family: var(--sans); font-size: 13px; letter-spacing: .04em; }
.letter h2 { font-size: clamp(28px, 5vw, 36px); font-weight: 500; line-height: 1.1; margin: 0; }
.letter .sub { margin: 6px 0 22px; font-family: var(--sans); font-size: 13.5px; color: #6b6454; }
.letter .toc { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 26px; padding: 14px 0; border-top: 1px solid #efe8d8; border-bottom: 1px solid #efe8d8; font-family: var(--sans); font-size: 12.5px; }
.letter .toc a { color: #6b6454; text-decoration: none; }
.letter .toc a:hover { color: #174036; text-decoration: underline; text-underline-offset: 3px; }
.letter section { scroll-margin-top: 20px; }
.letter section + section { margin-top: 22px; }
.letter h3 { display: flex; align-items: baseline; gap: 12px; font-family: var(--sans); font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #174036; margin: 0 0 10px; }
.letter h3 span { font-family: var(--serif); font-size: 18px; letter-spacing: 0; color: #8a6a2c; font-weight: 600; min-width: 18px; }
.letter section p { margin: 0 0 10px; display: grid; grid-template-columns: 38px 1fr; gap: 0 6px; }
.letter section p b { font-family: var(--sans); font-size: 12px; font-weight: 700; color: #736b5a; padding-top: 4px; font-variant-numeric: tabular-nums; }
.letter.signed-text pre { margin: 0; white-space: pre-wrap; font-family: var(--serif); font-size: 15.5px; line-height: 1.6; }
.letter .stamp { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 12px; border-radius: 999px; background: #e3efe6; color: #2f6f4e; font-family: var(--sans); font-size: 13px; font-weight: 650; }
.letter .stamp svg { width: 16px; height: 16px; }
.agreement { margin-top: 14px; display: grid; gap: 10px; }
.agreement > .link { justify-self: start; }
.done-toggle { min-width: 0; }

.sign { padding: clamp(22px, 5vw, 32px); margin: 34px 0; border-color: var(--line-2); box-shadow: var(--sh-2); scroll-margin-top: 24px; }
.sign .eyebrow { color: var(--brass-ink); }
.sign h2 { font-size: 28px; margin: 6px 0 6px; }
.sign > p { color: var(--muted); font-size: 15px; max-width: 52ch; }
.sign form { display: grid; gap: 16px; margin-top: 18px; max-width: 520px; }
.input-lg { height: 52px; font-family: var(--serif); font-size: 21px; letter-spacing: .01em; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--green-ink); }
.sign .err { padding: 10px 12px; border-radius: 10px; background: var(--bad-wash); color: var(--bad); font-size: 14px; }
.sign .btn-lg { justify-self: start; }
.sign .as-in { margin-top: -8px; font-size: 13px; color: var(--muted); }
.sign .as-in b { color: var(--ink); font-weight: 650; }

/* on a long letter, the way to the signature is always one tap away */
.sign-jump { white-space: nowrap; position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; background: #123329; color: #f1ecdf; font-weight: 650; font-size: 14.5px; text-decoration: none; box-shadow: var(--sh-3); transition: opacity .2s, transform .2s; }
.sign-jump svg { width: 16px; height: 16px; }
.sign-jump.gone { opacity: 0; pointer-events: none; transform: translate(-50%, 12px); }
.pt.reading { padding-bottom: 110px; }

.prow .amt { font-weight: 500; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.pill svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }

@media (max-width: 560px) {
  .terms { grid-template-columns: 1fr; }
  .terms .fee { border-right: 0; padding-right: 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
  .terms dl { grid-template-columns: 1fr; gap: 2px; }
  .terms dd { margin-bottom: 8px; }
  .letter { font-size: 15.5px; }
  .letter section p { grid-template-columns: 1fr; }
  .letter section p b { padding: 0; }
  .letter header .ref { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .sign-jump { transition: none; } }

/* "Save a copy": the letter alone, on white paper */
@media print {
  body.print-letter * { visibility: hidden; }
  body.print-letter #letter-doc, body.print-letter #letter-doc * { visibility: visible; }
  body.print-letter #letter-doc { position: absolute; inset: 0 auto auto 0; width: 100%; border: 0; box-shadow: none; padding: 0; background: #fff; color: #000; }
  body.print-letter .letter .toc { display: none; }
  body.print-letter .toasts, body.print-letter .sign-jump { display: none; }
}

/* after approval: the steps the grant starts */
.steps-after { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps-after li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.steps-after .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--green-wash); color: var(--green-ink); font-family: var(--serif); font-size: 16px; font-weight: 600; }
.steps-after b { font-weight: 650; font-size: 15.5px; margin-right: 8px; }
.steps-after .due { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--brass-ink); background: var(--brass-wash); padding: 2px 8px; border-radius: 999px; vertical-align: 1px; }
.steps-after .due svg { width: 13px; height: 13px; }
.steps-after p { margin: 6px 0 8px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.steps-after a { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--green-ink); text-decoration: none; }
.steps-after a svg { width: 14px; height: 14px; }
.steps-after a:hover { text-decoration: underline; text-underline-offset: 3px; }
.steps-after .due.late { color: var(--bad); background: var(--bad-wash); }
.steps-after .due.ok { color: var(--ok); background: var(--ok-wash); }
.steps-after li.is-done { background: transparent; }
.steps-after li.is-done b { color: var(--ink-2); }
.steps-after li.is-done .n { background: var(--ok-wash); color: var(--ok); }
.steps-after li.is-done .n svg { width: 15px; height: 15px; }
.after-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.after-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; font-size: 14.5px; color: var(--ink-2); }
.after-note svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--ok); }
.after-renew { display: grid; grid-template-columns: 22px 1fr; gap: 10px; margin-top: 14px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line); color: var(--ink-2); }
.after-renew svg { width: 18px; height: 18px; margin-top: 2px; color: var(--brass-ink); }
.after-renew b { color: var(--ink); font-weight: 650; }
.after-renew p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.55; }

/* a photo that would be hard to read, caught before it is sent */
.drop.photo-warn { border-style: solid; border-color: var(--warn); background: var(--warn-wash); display: grid; gap: 10px; }
.drop.photo-warn .pw-text { font-size: 14px; line-height: 1.5; color: var(--ink); }
.drop.photo-warn .pw-text b { color: var(--warn); }
.drop.photo-warn .pw-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* the case's dates, subscribed in the client's calendar */
.cal-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 20px; }
.cal-card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brass-wash); color: var(--brass-ink); }
.cal-card .ico svg { width: 22px; height: 22px; }
.cal-card p { color: var(--muted); font-size: 14.5px; margin: 2px 0 0; }
.cal-card b { display: block; font-weight: 650; color: var(--ink); font-size: 15.5px; }
.cal-card .go { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.after-renew.referral .btn { margin-top: 10px; }

/* ---------- the letter, folded until asked for ---------- */
.letter-fold { display: grid; gap: 14px; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.letter-fold p { margin: 0; color: var(--ink-2); }
.fold-toc { margin: 0; padding: 0 0 0 1.4em; columns: 2 220px; column-gap: 24px; font-size: 14.5px; line-height: 1.9; }
.fold-toc a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.fold-toc a:hover { border-color: var(--ink); }
.letter-fold .btn { justify-self: start; }
.letter-fold .btn .muted { font-weight: 400; }
