/* The client portal (/portal): the pay page's look (brand blue, Inter, white cards on a light grey page), phone first. */
:root {
  --ink: #1a1a2e; --muted: #5a6b7b; --faint: #616d7a;   /* 4.8:1 on the page grey (WCAG AA; was #8c9baa, 2.6:1: the 2026-10-17 accessibility audit) */ --line: #e1e4e8; --soft: #f7f8fa; --bg: #f3f4f6;
  --blue: #0067d1; --blue-dark: #0052b7; --blue-halo: rgba(0, 103, 209, .16); --red: #b42318; --green: #067647; --green-bg: #ecfdf3;
  --amber-bg: #fffaeb; --amber: #93370d; --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Inter", "Segoe UI", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.i { width: 18px; height: 18px; fill: currentColor; flex: none; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header-inner { max-width: 880px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.head-right { display: flex; align-items: center; gap: 14px; }
.brand-logo { display: block; height: 44px; width: auto; }
.secure-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 13px; font-weight: 600; }
.secure-tag .i { width: 15px; height: 15px; }
main { max-width: 880px; margin: 0 auto; padding: 16px 16px 8px; outline: none; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.narrow { max-width: 440px; margin: 32px auto 16px; }
h1 { font-size: 22px; line-height: 28px; margin: 0 0 6px; }
h2 { font-size: 17px; line-height: 24px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--red); margin: 10px 0 0; font-size: 14px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 16px 0 6px; }
input[type="email"], input[type="text"] { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; }
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-halo); }
input.code { letter-spacing: 6px; font-size: 22px; font-weight: 600; text-align: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; border: 0; border-radius: 10px; background: var(--blue); color: #fff;
  font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1; cursor: pointer; margin-top: 16px; text-decoration: none; }
.btn:hover { background: var(--blue-dark); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--blue-halo); }
/* Every other control shows where the keyboard is, the same way everywhere */
a:focus-visible, button:not(.btn):focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--soft); }
.btn.small { width: auto; min-height: 36px; padding: 0 14px; font-size: 14px; margin: 0; }
.links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 14px; }
.link { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; text-decoration: underline; }

/* passkeys */
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; margin: 18px 0 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or + .btn { margin-top: 12px; }
.offer { border-color: #b2ddff; background: #f5faff; }
.offer-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.keys { list-style: none; margin: 0 0 14px; padding: 0; }
.keys li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf0f4; }

/* home */
.hello { margin: 4px 0 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 14px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.chip small { font-weight: 500; color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--blue); background: #eff6ff; color: var(--blue-dark); }
.todo { display: grid; gap: 10px; }
.todo-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.todo-item .what { font-weight: 600; }
.todo-item .sub { font-size: 13px; color: var(--muted); }
.todo-item .btn { width: auto; min-height: 40px; padding: 0 18px; margin: 0; white-space: nowrap; }
.empty { color: var(--muted); font-size: 14px; margin: 0; }
/* Filled status pills with an icon, as in the staff portal (user 2026-10-17); text at 4.5:1 or more on every fill (dark on the light amber, 2026-10-18). */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px 0 7px; border-radius: 7px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; color: #fff; }
.pill::before { content: ''; width: 13px; height: 13px; flex: none; background: currentColor; -webkit-mask: var(--pill-ico) center / contain no-repeat; mask: var(--pill-ico) center / contain no-repeat; }
.pill.open { background: #f79009; color: #3d2002; --pill-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
.pill.paid { background: #067647; --pill-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.7 2.7L16 10'/%3E%3C/svg%3E"); }
.pill.pending { background: #5f6b7a; --pill-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
.pill.late { background: #d92d20; --pill-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.8L2.9 19.6h18.2z'/%3E%3Cpath d='M12 10v4.2M12 17.1v.1'/%3E%3C/svg%3E"); }
.bills { width: 100%; border-collapse: collapse; font-size: 14px; }
.bills th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--line); padding: 8px 6px; }
.bills td { border-bottom: 1px solid #edf0f4; padding: 10px 6px; vertical-align: middle; }
.bills .num { text-align: right; white-space: nowrap; }
.bills a { color: var(--blue); font-weight: 600; }
.total-line { display: flex; justify-content: space-between; font-weight: 700; padding: 12px 6px 0; }

/* where things stand */
.rets { display: grid; gap: 12px; margin-bottom: 14px; }
.ret { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.ret-head .what { font-weight: 600; }
.steps { display: flex; gap: 6px; margin: 10px 0 8px; }
.steps .dot { flex: 1; height: 6px; border-radius: 3px; background: #e4e7ec; }
.steps .dot.on { background: var(--blue); }
.steps .dot.now { box-shadow: 0 0 0 2px var(--blue-halo); }
.ret-state { font-size: 14px; color: var(--ink); }
.ret-wait { margin-top: 6px; font-size: 14px; color: var(--amber); background: var(--amber-bg); border-radius: 8px; padding: 6px 10px; }
.mats { list-style: none; margin: 0; padding: 0; }
.mats li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf0f4; font-size: 14px; }

/* documents and uploads */
.docs { list-style: none; margin: 0 0 6px; padding: 0; }
.docs li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf0f4; }
.doc-main { min-width: 0; }
.doc-main .what { font-weight: 600; }
/* the matter an item is on, shown when the client has two or more (user 2026-11-10) */
.on-matter { margin-top: 2px; overflow-wrap: anywhere; }
.send-matter { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 10px; max-width: 460px; }
.send-matter select { width: 100%; }
.doc-note { margin-top: 6px; font-size: 14px; background: var(--soft); border-left: 3px solid var(--blue); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; }
.new { margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .4px; }
.send-own { margin-top: 12px; }
.up-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.up-btns .btn { width: auto; margin: 0; }
.cam { display: none; }
@media (pointer: coarse) { .cam { display: inline-flex; } }
.scan-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 12px; }
.scan-clean { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 10px; }
.scan-page { margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--soft); }
.scan-page img { display: block; width: 100%; height: 160px; object-fit: contain; background: #fff; }
.scan-page figcaption { display: flex; gap: 10px; align-items: center; font-size: 13px; padding-top: 6px; }
.sent { margin-top: 4px; font-size: 13px; color: var(--green); }
.up-progress { border-color: #b2ddff; background: #f5faff; }
.up-progress.done { border-color: #abefc6; background: var(--green-bg); color: var(--green); font-weight: 600; }

/* messages */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.threads { list-style: none; margin: 0 0 8px; padding: 0; }
.thread-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #edf0f4; padding: 12px 2px; font: inherit; color: inherit; cursor: pointer; }
.thread-row .small { flex-basis: 100%; }
.thread-row.unread .what { font-weight: 700; }
.thread-row.unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.thread h1 { margin-top: 6px; }
.msgs { display: grid; gap: 8px; margin: 14px 0; max-height: 60vh; overflow-y: auto; padding: 2px; }
.msg-day { justify-self: center; font-size: 12px; color: var(--muted, #6b7280); margin: 6px 0 2px; }
.msg { border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; max-width: 85%; }
.msg.mine { border-bottom-right-radius: 4px; }
.msg.theirs { border-bottom-left-radius: 4px; }
.msg.mine { justify-self: end; background: #eff6ff; border-color: #b2ddff; }
.msg.theirs { justify-self: start; background: #fff; }
.msg-body { white-space: pre-wrap; margin-top: 4px; overflow-wrap: anywhere; }
.msg-share { margin-top: 8px; }
.msg-share .btn { width: auto; margin: 0; }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font: inherit; font-size: 16px; color: var(--ink); resize: vertical; }
textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-halo); }
select { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.msg-attach { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.msg-attach .btn { width: auto; margin: 0; }

.boot { max-width: 520px; margin: 40px auto; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #eef0f3, #f6f7f9, #eef0f3); background-size: 200% 100%; animation: sk 1.2s infinite; margin-bottom: 12px; }
.skeleton.tall { height: 30px; } .w40 { width: 40%; } .w70 { width: 70%; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.site-footer { margin-top: 12px; }
.footer-inner { max-width: 880px; margin: 0 auto; padding: 8px 16px 36px; color: var(--faint); font-size: 12px; line-height: 18px; }
.footer-inner p { margin: 0 0 6px; }
.footer-inner strong { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) {
  .card { padding: 18px; } .brand-logo { height: 34px; } .secure-tag { display: none; }
  .todo-item { flex-direction: column; align-items: stretch; } .todo-item .btn { width: 100%; }
  .bills .hide-sm { display: none; }
}

/* An admin's read-only preview of a client's portal (api/_lib/portal/preview.js) */
.preview-bar { position: sticky; top: 0; z-index: 5; max-width: 880px; margin: 12px auto 0; box-sizing: border-box; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--amber-bg); color: var(--amber); border: 1px solid #fedf89; border-radius: var(--radius); font-size: 14px; }
.preview-bar > span { flex: 1; }
.preview-bar .btn { flex: none; }
@media (max-width: 640px) { .preview-bar { margin: 12px 16px 0; flex-direction: column; align-items: stretch; } }

/* Who can see your records (phase 4) */
h3 { font-size: 15px; margin: 18px 0 6px; }
.shares { list-style: none; margin: 8px 0; padding: 0; }
.shares li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.shares li:first-child { border-top: 0; }
.share-act { display: flex; align-items: center; gap: 8px; flex: none; }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.inline-form input, .inline-form select { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 16px; background: #fff; }
.inline-form.wrap { flex-wrap: wrap; }
.inline-form.wrap input, .inline-form.wrap select { flex: 1 1 180px; }
.add-person summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 14px; margin-top: 6px; }
.years { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 12px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.lbl { font-weight: 600; margin-top: 12px; }
.card select { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 16px; background: #fff; margin-bottom: 10px; }
.consent-words { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; margin-bottom: 16px; background: var(--soft); max-height: 50vh; overflow-y: auto; }
.consent-words h1 { font-size: 17px; line-height: 24px; margin: 12px 0; }
@media (max-width: 640px) { .shares li { flex-direction: column; align-items: flex-start; } .inline-form { flex-direction: column; align-items: stretch; } }

/* Your IRS account (phase 5) */
.irs-year { border-top: 1px solid var(--line); padding: 12px 0; }
.irs-year:first-child { border-top: 0; }
.irs-year > summary { cursor: pointer; list-style: none; }
.irs-year > summary::-webkit-details-marker { display: none; }
.irs-head { font-weight: 600; margin-top: 4px; }
.irs-figs { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.irs-figs td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.irs-figs td.num { text-align: right; white-space: nowrap; }
.irs-figs tr.strong td { font-weight: 700; }
.irs-status { margin: 8px 0; padding-left: 18px; font-size: 14px; }
.irs-events summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 14px; }
.irs-events ul { list-style: none; margin: 8px 0; padding: 0; font-size: 14px; }
.irs-events li { padding: 4px 0; }

/* Messages from Clio's client portal, read only, folded above the conversation (portal/clio-history.js) */
.msg-history { margin: 12px 0 4px; border: 1px solid #d0d5dd; border-radius: 8px; padding: 10px 12px; background: #f9fafb; }
.msg-history > summary { cursor: pointer; font-weight: 600; min-height: 28px; display: flex; align-items: center; }
.msg-history[open] > summary { margin-bottom: 6px; }
.msg-history .msgs-history { max-height: 50vh; margin: 8px 0 0; }
