/*
  Perch client portal, ported from the Claude Design handoff (TaxCRM Client Portal.dc.html, workshop.dc.html).
  Loaded after perch.css (fonts, tokens and the shared classes). Portal-only classes carry a "p-" prefix. The portal's
  basics differ from the staff app: 16px text and controls, cards with a 16px radius, a 78px header and a 720px
  mobile breakpoint. Strict CSP: no inline styles anywhere, so every visual rule lives here.
*/

/* ---------- Base ---------- */
body { font-size: 16px; }
.p-app input, .p-app select, .p-app textarea, .p-app button { font-size: inherit; }
a:hover { text-decoration: none; }
.p-app { min-height: 100vh; display: flex; flex-direction: column; }
.auth-aside-firm-name { font-family: var(--serif); font-size: clamp(28px, 2.4vw, 40px); font-weight: 700; color: var(--cream); line-height: 1.1; }
.auth-mobile-firm { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--cream); }

/* ---------- Header ---------- */
.p-hdr { background: var(--navy); color: var(--cream); border-bottom: 1px solid var(--navy); position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); }
.p-hdr-row { max-width: 1680px; margin: 0 auto; padding: 0 24px; height: 78px; display: flex; align-items: center; gap: 12px; }
.p-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--cream); }
.p-brand:hover { color: var(--cream); }
.p-logo { height: 66px; width: auto; margin: 0 -12px; flex-shrink: 0; display: block; }
.p-brand-rule { width: 1px; height: 28px; background: rgba(201,168,76,0.6); flex-shrink: 0; }
.p-brand-text { display: flex; flex-direction: column; min-width: 0; }
.p-firm { font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.1; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-firm-sub { font-size: 12px; font-weight: 600; color: #C9C3B3; }
.p-acct { display: flex; align-items: center; gap: 6px; }
.p-acct-select { height: 36px; border: 1px solid rgba(250,248,243,0.25); border-radius: 8px; padding: 0 10px; background: #0B1A40; font-weight: 600; color: var(--cream); max-width: 260px; }
.p-acct-go { height: 36px; border: 1px solid rgba(250,248,243,0.25); border-radius: 8px; padding: 0 10px; background: transparent; color: var(--gold-light); font-weight: 700; cursor: pointer; }
.p-me { display: flex; align-items: center; gap: 8px; }
.p-me-av { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.p-me-text { display: flex; flex-direction: column; }
.p-me-name { font-weight: 700; font-size: 14px; line-height: 1.1; }
.p-me-role { font-size: 12px; color: #C9C3B3; }
.p-signout { background: none; border: 1px solid rgba(250,248,243,0.25); border-radius: 8px; color: var(--tab-ink); height: 36px; padding: 0 12px; font-weight: 700; font-size: 14px; cursor: pointer; }
.p-signout:hover { color: var(--gold-light); border-color: rgba(228,200,119,0.6); }

/* ---------- Desktop tabs ---------- */
.p-navrow { border-top: 1px solid rgba(250,248,243,0.12); }
.p-nav { max-width: 1680px; margin: 0 auto; padding: 0 24px; display: flex; gap: 4px; overflow-x: auto; }
.p-tab { padding: 12px 14px; font-size: 14px; font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; color: var(--tab-ink); }
.p-tab:hover { color: var(--gold-light); }
.p-tab.is-active { color: var(--gold-light); border-bottom-color: var(--gold); }
.p-badge { font-size: 11px; font-weight: 800; background: var(--gold); color: var(--navy); border-radius: 999px; padding: 1px 7px; }

/* ---------- Mobile bottom bar ---------- */
.p-tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; background: var(--white); border-top: 1px solid var(--line); padding: 6px 6px calc(10px + env(safe-area-inset-bottom)); z-index: 30; }
.p-tabbar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; min-height: 48px; position: relative; color: var(--ink-2); }
.p-tabbar-item.is-active { color: var(--navy); }
.p-tabbar-line { width: 24px; height: 4px; border-radius: 999px; background: transparent; }
.p-tabbar-item.is-active .p-tabbar-line { background: var(--navy); }
.p-tabbar-label { font-size: 12px; font-weight: 700; white-space: nowrap; }
.p-tabbar-badge { position: absolute; top: 2px; right: 18%; font-size: 10px; font-weight: 800; background: var(--gold); color: var(--navy); border-radius: 999px; padding: 0 6px; }

/* ---------- Main and page header ---------- */
.p-main { flex: 1; width: 100%; max-width: 1680px; margin: 0 auto; padding: 28px 24px 48px; display: flex; flex-direction: column; gap: 20px; }
.p-foot { max-width: 1680px; width: 100%; margin: 0 auto; padding: 0 24px 24px; font-size: 12px; color: var(--faint); display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.p-head { display: flex; flex-direction: column; gap: 4px; }
.p-h1 { font-family: var(--serif); font-weight: 700; font-size: 30px; line-height: 1.15; margin: 0; }
.p-head-sub { font-size: 15px; color: var(--muted); }
.p-h2 { font-family: var(--serif); font-weight: 700; font-size: 20px; margin: 0; }
.p-section-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

/* ---------- Cards and rows ---------- */
.p-card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.p-card-clip { overflow: hidden; }
.p-pad-20 { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.p-pad-18 { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.p-card-hd { padding: 14px 20px; border-bottom: 1px solid var(--track); display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.p-card-hd-lg { padding: 16px 20px; }
.p-card-title { font-family: var(--serif); font-weight: 700; font-size: 18px; margin: 0; }
.p-card-title-lg { font-size: 20px; }
.p-card-count { font-size: 13px; font-weight: 600; color: var(--muted); }
.p-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--track); min-height: 60px; color: var(--navy); }
.p-row:last-child { border-bottom: 0; }
a.p-row:hover, .p-row-link:hover { background: var(--hover); color: var(--navy); }
.p-row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.p-row-name { font-weight: 600; overflow-wrap: anywhere; }
.p-row-name-strong { font-weight: 700; overflow-wrap: anywhere; }
.p-row-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.p-empty { padding: 18px 20px; color: var(--muted); }
.p-empty-lg { padding: 20px; color: var(--muted); }
.p-link { font-size: 14px; font-weight: 700; color: var(--gold-ink); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.p-link:hover { color: var(--navy); }
.p-link-danger { font-size: 14px; font-weight: 700; color: var(--danger); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.p-arrow { font-weight: 700; color: var(--gold-ink); }
.p-note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.p-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ---------- Buttons and inputs ---------- */
.p-btn { border: 0; border-radius: 10px; font-weight: 700; padding: 0 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; font-family: inherit; }
.p-btn-gold { background: var(--gold); color: var(--navy); }
.p-btn-gold:hover { background: var(--gold-hover); color: var(--navy); }
.p-btn-outline { background: var(--white); color: var(--gold-ink); border: 1px solid var(--input-line); }
.p-btn-outline:hover { background: var(--pale-gold); color: var(--gold-ink); }
.p-btn-navy { background: var(--navy); color: var(--white); }
.p-btn-navy:hover { background: #0B1B45; color: var(--white); }
.p-btn-danger { background: var(--white); color: var(--danger); border: 1px solid #F3C6C1; }
.p-h38 { height: 38px; padding: 0 14px; }
.p-h40 { height: 40px; padding: 0 16px; }
.p-h44 { height: 44px; }
.p-h48 { height: 48px; }
.p-btn-block { width: 100%; }
.p-btn-start { align-self: flex-start; }
.p-btn-sign { width: 100%; height: 48px; border: 0; border-radius: 10px; background: var(--gold); color: var(--navy); font-family: var(--serif); font-weight: 700; font-size: 18px; cursor: pointer; }
.p-btn-sign:hover { background: var(--gold-hover); }
.p-input { height: 46px; border: 1px solid var(--input-line); border-radius: 10px; padding: 0 12px; font-size: 15px; font-weight: 400; color: var(--navy); background: var(--white); width: 100%; font-family: inherit; }
.p-input:disabled { background: var(--cream); color: var(--muted); }
.p-input-lg { height: 48px; padding: 0 14px; font-size: 16px; }
.p-textarea { border: 1px solid var(--input-line); border-radius: 10px; padding: 10px 12px; font-size: 15px; resize: vertical; font-family: inherit; color: var(--navy); width: 100%; min-height: 64px; }
.p-field-full { grid-column: 1 / -1; }
.p-select-auto { width: auto; max-width: 260px; }
.p-code-input { width: 150px; height: 44px; font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.2em; text-align: center; }
.p-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: #3F4658; line-height: 1.45; cursor: pointer; }
.p-check .box { width: 22px; height: 22px; margin-top: -1px; }
.p-form { display: flex; flex-direction: column; gap: 12px; }
.p-btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Pills, dots, tiles, avatars ---------- */
.p-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.p-pill-done { background: #E3F5EC; color: #11703F; }
.p-pill-default { background: var(--chip); color: var(--navy); }
.p-pill-warn { background: #FFF1DB; color: #8A5300; }
.p-pill-overdue { background: var(--danger-bg); color: var(--danger); }
.p-pill-void { background: var(--track); color: var(--ink-2); }
.p-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.p-dot-amber { background: #F0A640; }
.p-dot-navy { background: var(--navy); }
.p-dot-red { background: var(--danger); }
.p-dot-green { background: var(--ok); }
.p-tile { width: 40px; height: 30px; border-radius: 6px; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.p-tile-dir { background: #FFF1DB; color: #8A5300; }
.p-tile-mine { background: #EFE8FD; color: #5B35B0; }
.p-tile-team { background: var(--chip); color: var(--navy); }
.p-av { border-radius: 50%; background: var(--chip); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.p-av-36 { width: 36px; height: 36px; font-size: 13px; }
.p-av-44 { width: 44px; height: 44px; font-size: 16px; }
.p-you { font-size: 12px; font-weight: 700; color: var(--navy); }
.p-ok-text { font-size: 13px; font-weight: 700; color: var(--ok); white-space: nowrap; }
.p-warn-text { font-size: 13px; font-weight: 700; color: #8A5300; white-space: nowrap; }

/* ---------- Home ---------- */
.p-greet { line-height: 1.15; }
.p-todo { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--track); min-height: 64px; color: var(--navy); }
.p-todo:last-child { border-bottom: 0; }
.p-todo:hover { background: var(--hover); color: var(--navy); }
.p-todo-title { font-weight: 700; }
.p-todo-sub { font-size: 14px; color: var(--muted); }
.p-todo-act { font-size: 14px; font-weight: 700; color: var(--gold-ink); white-space: nowrap; }
.p-sign { background: var(--white); border: 2px solid var(--gold); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 140px; }
.p-sign-title { font-family: var(--serif); font-weight: 700; font-size: 21px; margin: 0; }
.p-sign-sub { font-size: 14px; color: var(--muted); }
.p-agr-text { border: 1px solid var(--line); border-radius: 10px; padding: 16px; max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.6; color: #1E2740; background: #FCFAF6; }
.p-agr-text > span { white-space: pre-line; }
.p-agr-head { font-weight: 800; font-size: 15px; color: var(--navy); }
/* A letter that keeps the firm's PDF design (Amendment A10): the PDF in a frame from this site, its text folded away. */
.p-agr-pdf { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 10px; background: #FCFAF6; }
.p-agr-open { align-self: flex-start; }
.p-agr-summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--gold-ink); }
.p-agr-version[open] > .p-agr-summary { margin-bottom: 10px; }
.p-svc-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; color: var(--navy); }
a.p-svc-card:hover { border-color: var(--gold); color: var(--navy); }
.p-svc-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.p-svc-title { font-family: var(--serif); font-weight: 700; font-size: 18px; }
.p-svc-sub { font-size: 13px; color: var(--muted); }
.p-svc-due { font-size: 13px; color: var(--muted); }
.p-acct-card { padding: 18px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.p-acct-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 160px; }
.p-acct-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.p-acct-name { font-family: var(--serif); font-weight: 700; font-size: 18px; }

/* ---------- Documents ---------- */
.p-status { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #F0A640; background: var(--white); color: var(--white); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.p-status.is-in { border-color: var(--ok); background: var(--ok); }
.p-drop { border: 2px dashed var(--input-line); background: var(--white); border-radius: 16px; padding: 22px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.p-drop { transition: border-color 0.12s, background-color 0.12s; }
.p-drop.is-dragging { border-color: var(--gold); background: var(--cream); }
.p-drop-title { font-family: var(--serif); font-weight: 700; font-size: 18px; }
.p-drop-text { font-size: 14px; color: var(--muted); }
.p-drop-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.p-file-input { max-width: 100%; font-size: 14px; }
.p-crumbs { display: flex; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--muted); align-items: baseline; }
.p-crumb-root { font-weight: 700; color: var(--gold-ink); }
.p-crumb { font-weight: 700; color: var(--navy); }
.p-sign-details { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0 0 14px; display: grid; gap: 6px; }
.p-sign-details-title { font-weight: 700; padding: 0 4px; }
.p-sign-details .p-label { margin-top: 6px; font-weight: 600; font-size: 14px; }
.p-sort { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.p-files-hd { padding: 14px 20px; border-bottom: 1px solid var(--track); display: flex; flex-direction: column; gap: 6px; }
.p-restricted { background: #FFF7E8; border: 1px solid #F3DFB5; border-radius: 10px; padding: 12px 14px; font-size: 14px; color: #6B4400; line-height: 1.5; }
.p-upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.p-upload-row .p-file-input { max-width: 220px; }

/* ---------- Services ---------- */
.p-steps { display: flex; flex-direction: row; gap: 6px; list-style: none; margin: 0; padding: 0; }
.p-step { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; }
.p-step.is-current { background: var(--pale-gold); }
.p-step-dot { width: 22px; height: 22px; border-radius: 50%; color: var(--white); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--input-line); }
.p-step.is-done .p-step-dot { background: var(--ok); }
.p-step.is-current .p-step-dot { background: var(--navy); }
.p-step-label { font-size: 13px; line-height: 1.25; font-weight: 600; color: var(--faint); }
.p-step.is-done .p-step-label { color: var(--navy); }
.p-step.is-current .p-step-label { color: var(--navy); font-weight: 800; }
.p-svc-note { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.p-svc-title-lg { font-family: var(--serif); font-weight: 700; font-size: 21px; }
.p-svc-sub-lg { font-size: 14px; color: var(--muted); }

/* ---------- Messages ---------- */
.p-thread { padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow-y: auto; }
.p-msg { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.p-msg.is-mine { align-items: flex-end; }
.p-msg-meta { font-size: 12px; font-weight: 600; color: var(--muted); }
.p-bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; line-height: 1.45; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--track); color: var(--navy); }
.p-msg.is-mine .p-bubble { background: var(--navy); color: var(--white); }
.p-msg.is-system .p-bubble { background: var(--cream); color: var(--navy); }
.p-compose { border-top: 1px solid var(--track); padding: 12px; display: flex; gap: 8px; }
.p-compose .p-textarea { flex: 1; min-width: 0; resize: none; min-height: 0; }
.p-compose .p-btn { align-self: stretch; }

/* ---------- Workshops ---------- */
.p-ws-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.p-ws-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--navy); }
.p-ws-seats { font-size: 13px; font-weight: 700; color: var(--muted); }
.p-ws-seats.is-mine { color: var(--ok); }
.p-ws-seats.is-full { color: var(--danger); }
.p-ws-title { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.25; }
.p-ws-when { font-size: 14px; color: var(--ink-2); }
.p-ws-desc { font-size: 14px; color: var(--muted); line-height: 1.45; }
.p-ws-price { font-weight: 700; }

/* ---------- Billing ---------- */
.p-inv { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--track); flex-wrap: wrap; }
.p-inv:last-child { border-bottom: 0; }
.p-inv-text { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 2px; }
.p-inv-no { font-weight: 700; }
.p-inv-dates { font-size: 13px; color: var(--muted); }
.p-inv-meta { font-size: 13px; font-weight: 600; color: var(--navy); }
.p-inv-amount { font-weight: 800; min-width: 90px; text-align: right; }
.p-inv-lines { padding: 0 20px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); flex-basis: 100%; }
.p-inv-line { display: flex; justify-content: space-between; gap: 12px; }
/* Billing's invoice history: its period filter sits in the card header. */
.p-hist-filter { display: flex; gap: 8px; align-items: center; }
.p-hist-select { height: 40px; width: auto; min-width: 170px; font-size: 14px; font-weight: 600; }
/* Pay now (Amendment A11): a form, so a Stripe page is made only when the client asks. */
.p-inv-pay { margin: 0; display: flex; }
/* A balance under Stripe's smallest charge: why there's no Pay now. */
.p-inv-small { max-width: 200px; }
.p-callout { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.p-callout-ok { background: #E3F5EC; border-color: #BFE6D0; color: #11703F; }
.p-callout-wait { background: #FFF7E8; border-color: #F3DFB5; color: #6B4400; }
.p-callout-title { font-weight: 800; font-size: 16px; }

/* ---------- Profile ---------- */
.p-pending { background: #FFF7E8; border: 1px solid #F3DFB5; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #6B4400; }
.p-more { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; min-height: 56px; color: var(--navy); }
.p-more:hover { color: var(--navy); border-color: var(--gold); }
.p-more-list { display: none; flex-direction: column; gap: 10px; }
.p-recovery { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: 0.08em; padding: 14px 16px; border: 1px dashed var(--gold); border-radius: 10px; background: #FCFAF6; text-align: center; overflow-wrap: anywhere; }
.p-sec-row { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--track); }
.p-sec-row:last-child { border-bottom: 0; }
.p-sec-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.p-sec-name { font-weight: 700; }
.p-sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.p-qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* ---------- Toast and session dialogs ---------- */
.p-toast { border-radius: 12px; bottom: 28px; z-index: 50; font-size: 14px; }
.p-dialog { border: 0; border-radius: 16px; padding: 24px; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 30px 60px -20px rgba(4,15,46,0.5); color: var(--navy); }
.p-dialog::backdrop { background: rgba(4,15,46,0.45); }
.p-dialog-body { display: flex; flex-direction: column; gap: 14px; }
.p-dialog-title { font-family: var(--serif); font-weight: 700; font-size: 24px; margin: 0; }
.p-dialog-text { font-size: 15px; color: var(--ink-2); line-height: 1.5; margin: 0; }
.p-dialog-error { font-size: 14px; font-weight: 600; color: var(--danger); min-height: 1em; }

/* ---------- Public workshop page ---------- */
.w-hdr { background: var(--white); border-bottom: 1px solid var(--line); }
.w-hdr-row { max-width: 1680px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 12px; }
.w-firm { display: flex; flex-direction: column; min-width: 0; }
.w-firm-name { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-firm-sub { font-size: 12px; font-weight: 600; color: var(--muted); }
.w-login { font-size: 14px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.w-main { max-width: 1680px; width: 100%; margin: 0 auto; padding: 36px 20px 64px; display: flex; flex-direction: column; gap: 24px; flex: 1; }
.w-foot { border-top: 1px solid var(--line); background: var(--white); }
.w-foot-row { max-width: 1680px; margin: 0 auto; padding: 18px 20px; font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.w-intro { max-width: 640px; display: flex; flex-direction: column; gap: 8px; }
.w-title { font-family: var(--serif); font-weight: 700; font-size: 39px; line-height: 1.1; margin: 0; }
.w-lead { font-size: 17px; color: var(--ink-2); line-height: 1.5; margin: 0; }
.w-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.w-pill { padding: 9px 18px; border-radius: 999px; font-size: 15px; font-weight: 700; border: 1px solid var(--input-line); background: var(--white); color: var(--ink-2); }
.w-pill:hover { color: var(--navy); }
.w-pill.is-on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.w-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.w-card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.w-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.w-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.w-chip-business { background: var(--chip); color: var(--navy); }
.w-chip-personal { background: #FDEDE3; color: #9A3A0B; }
.w-chip-format { background: var(--track); color: var(--ink-2); }
.w-card-title { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.25; margin: 0; }
.w-desc { font-size: 14px; color: var(--ink-2); line-height: 1.5; flex: 1; margin: 0; }
.w-when { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.w-when-time { font-weight: 700; }
.w-when-where { color: var(--muted); }
.w-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line-3); }
.w-price { font-family: var(--serif); font-weight: 700; font-size: 21px; }
.w-spots { font-size: 13px; font-weight: 600; color: var(--muted); }
.w-spots.is-low { color: #9A3A0B; }
.w-spots.is-full { color: var(--danger); }
.w-book { background: var(--navy); color: var(--white); border-radius: 8px; height: 40px; padding: 0 18px; font-weight: 700; display: inline-flex; align-items: center; }
.w-book:hover { color: var(--white); background: #0B1B45; }
.w-book.is-full { background: var(--box-line); cursor: default; }
.w-empty { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 32px; color: var(--ink-2); font-size: 15px; }
.w-narrow { max-width: 720px; display: flex; flex-direction: column; gap: 20px; }
.w-back { font-size: 14px; font-weight: 700; color: var(--gold-ink); }
.w-session { padding: 24px; gap: 10px; }
.w-session-title { font-family: var(--serif); font-weight: 700; font-size: 30px; line-height: 1.2; margin: 0; }
.w-session-desc { font-size: 15px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.w-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding-top: 8px; }
.w-fact { display: flex; flex-direction: column; gap: 2px; }
.w-fact-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.w-fact-value { font-size: 15px; font-weight: 600; }
.w-form { padding: 24px; gap: 16px; }
.w-form-title { font-family: var(--serif); font-weight: 700; font-size: 21px; margin: 0; }
.w-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.w-label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.w-input { height: 44px; border: 1px solid var(--input-line); border-radius: 8px; padding: 0 12px; font-weight: 400; color: var(--navy); background: var(--white); font-family: inherit; font-size: 16px; }
.w-optin { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.w-error { font-size: 14px; font-weight: 600; color: var(--danger); }
.w-submit { height: 46px; padding: 0 22px; border-radius: 8px; border: 0; background: var(--gold); color: var(--navy); font-weight: 700; font-size: 15px; cursor: pointer; align-self: flex-start; font-family: inherit; }
.w-submit:hover { background: var(--gold-hover); }
.w-done { border-color: #BFE6D0; padding: 24px; gap: 10px; }
.w-done-title { font-family: var(--serif); font-weight: 700; font-size: 23px; color: var(--ok); margin: 0; }
.w-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.w-card-pad { display: flex; flex-direction: column; }

/* ---------- Mobile (< 720px) ---------- */
@media (max-width: 719px) {
  .p-hdr-row { padding: 0 16px; }
  .p-logo { height: 54px; margin: 0 -10px; }
  .p-acct-select { max-width: 150px; }
  .p-me, .p-navrow, .p-signout-desk { display: none; }
  .p-tabbar { display: flex; }
  .p-main { padding: 18px 16px 104px; }
  .p-foot { padding: 0 16px 96px; }
  .p-h1 { font-size: 26px; }
  .p-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .p-steps { flex-direction: column; }
  .p-thread { max-height: 52vh; }
  .p-toast { bottom: 96px; }
  .p-more-list { display: flex; }
  .p-agr-pdf { display: none; }
  .sign-pdf-phone { display: flex; }
  .p-brand-rule, .p-firm-sub { display: none; }
  .w-title { font-size: 32px; }
}
@media (min-width: 720px) {
  .p-mobile-only { display: none; }
}

/* Perch support and notification settings (Amendment A5). */
.support-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.notify-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.notify-row input { margin-top: 4px; }
/* Email notifications in groups: one column on phones, two side by side on wider screens. */
.notify-groups { display: grid; grid-template-columns: 1fr; }
.notify-group { border: 0; margin: 0; padding: 0; min-width: 0; border-bottom: 1px solid var(--track); }
.notify-group-hd { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 20px 6px; float: left; }
.notify-group-hd + * { clear: both; }
.notify-group-title { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-ink); }
.notify-group-note { font-size: 12px; font-weight: 600; color: var(--muted); }
.notify-group .p-row { min-height: 0; padding: 10px 20px; }
.notify-group .p-row:last-child { border-bottom: 0; }
@media (min-width: 960px) {
  .notify-groups { grid-template-columns: 1fr 1fr; }
  .notify-group:nth-child(odd) { border-right: 1px solid var(--track); }
}

/* An invoice email's pay link (/pay). */
.auth-box:has(.sign-pdf) { max-width: 880px; }
.sign-pdf { height: 75vh; min-height: 520px; }
.sign-pdf-phone { display: none; }
.sign-text { max-height: 55vh; overflow-y: auto; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--white); font-size: 15px; line-height: 1.55; white-space: pre-line; }
.sign-text p { margin: 0 0 12px; }
textarea.auth-input { height: auto; padding: 12px 14px; }
.pay-lines { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.pay-total { font-weight: 700; color: var(--navy); }
.pay-note { font-size: 13px; }
.p-inv-copy { font-size: 13px; align-self: flex-start; }

/* Perch's own public pages at www.perchbv.com (PublicSite): the workshop page's frame around a column of text. */
.w-hdr.s-hdr { background: var(--navy); border-bottom-color: var(--navy); }
.s-hdr .w-hdr-row { gap: 20px; }
.s-hdr .w-login { color: var(--cream); }
.s-logo { display: block; height: 62px; width: auto; margin: 0 -10px 0 -12px; }
.w-main.s-main { max-width: 760px; gap: 28px; }
.s-section { display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.s-section p, .s-section ul { margin: 0; }
.s-section ul { padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.s-mono { overflow-wrap: anywhere; font-weight: 600; color: var(--navy); }
.s-note { font-size: 13px; color: var(--muted); }

/* Terms of Service (/terms): the firm's own text, read like a document. */
.terms { max-width: 760px; margin: 0 auto; padding: 32px 0 48px; color: var(--ink-2); line-height: 1.6; }
.terms-title { font-size: 26px; font-weight: 700; margin: 0 0 8px; color: var(--navy); }
.terms-h { font-size: 18px; font-weight: 700; margin: 28px 0 8px; color: var(--navy); }
.terms-p { font-size: 15px; margin: 0 0 12px; }
.terms-list { font-size: 15px; margin: 0 0 12px; padding-left: 22px; }
.terms-list li { margin-bottom: 6px; }
@media (max-width: 640px) { .terms { padding: 20px 0 32px; } .terms-title { font-size: 22px; } }
