/* Angell workspace, one screen. Brand from angellcompany.com: navy #005d8c, arc gold #e59700, Proxima Nova. */
:root {
  --blue: #005d8c; --blue-deep: #003550; --blue-wash: #e8f1f6;
  --gold: #e59700; --gold-wash: #fdf2de; --gold-ink: #8a5700;
  --ink: #231f20; --ink-2: #4e5961; --ink-3: #7b868e;
  --paper: #fff; --ground: #f3f6f8; --rule: #d8e0e5; --rule-soft: #e7ecef; --ok: #2d7a4f; --ok-wash: #e4f2ea; --bad: #a8322d;
  --font: "proxima-nova", "Proxima Nova", "Figtree", system-ui, sans-serif;
  --r: 8px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--ground); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-weight: 600; margin: 0; }

.proto { background: var(--ink); color: #fff; font-size: 13px; text-align: center; padding: 5px 16px; }
.proto b { color: var(--gold); }
.proto a { color: #fff; }

.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--rule); background: var(--paper); padding: 8px 14px; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #004c73; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn svg { width: 15px; height: 15px; }
.icon-btn { border: 0; background: none; padding: 8px; border-radius: 6px; cursor: pointer; color: var(--ink-3); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--ground); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- sign in ---------- */
.signin { min-height: calc(100vh - 29px); display: grid; grid-template-columns: 1.1fr 1fr; }
.signin-brand { background: var(--blue-deep); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.signin-brand img { width: 240px; }
.signin-brand h1 { font-size: 42px; line-height: 1.1; margin-bottom: 14px; max-width: 14ch; }
.signin-brand p { color: #b9ccd8; max-width: 42ch; margin: 0; font-size: 17px; }
.arc { position: absolute; right: -160px; top: -160px; width: 520px; height: 520px; pointer-events: none; }
.signin-form { display: grid; place-items: center; padding: 40px 24px; background: var(--paper); }
.signin-card { width: 100%; max-width: 340px; }
.signin-card h2 { font-size: 24px; margin-bottom: 4px; }
.signin-card p { color: var(--ink-2); margin: 0 0 24px; }
.ms-btn { display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid #8c8c8c; background: #fff; padding: 12px 16px; border-radius: 4px; font-weight: 600; color: var(--ink); text-decoration: none; }
.ms-btn:hover { background: #f3f3f3; }

/* ---------- the screen ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: calc(100vh - 29px); }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.client { display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 36%, 500px); flex: 1; min-height: 0; }

/* ---------- navigation ---------- */
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.nav a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; padding: 9px 10px; border-radius: 6px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current] { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .tag { margin-left: auto; font-size: 11px; color: #8fb0c4; border: 1px solid #3f6a84; padding: 0 6px; border-radius: 99px; }
.rail-foot { margin-top: auto; }
.crumbs { font-size: 13px; color: var(--ink-3); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [data-convo-back] { color: var(--ink-2); font-weight: 500; }   /* which client, at a glance */

/* ---------- pages ---------- */
.page-head { margin-bottom: 22px; display: flex; align-items: flex-end; gap: 4px 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; line-height: 1.2; margin: 0; flex-basis: 100%; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.page-head .lock { margin-left: auto; }
.muted { color: var(--ink-3); font-size: 13px; }
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--rule-soft); }
.panel-head h2 { font-size: 16px; }
.panel-head .muted { margin-left: auto; }
.panel-body { padding: 18px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.grid-2.letters { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.quick button { text-align: left; cursor: pointer; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.quick button:hover { border-color: var(--blue); }
.quick svg { width: 22px; height: 22px; color: var(--blue); margin-bottom: 6px; }
.quick strong { font-size: 15px; }
.quick span { color: var(--ink-2); font-size: 13px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--rule-soft); }
.rows li:last-child { border-bottom: 0; }
.rows .avatar { background: var(--blue-wash); color: var(--blue); }
.rows .row-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.rows .row-link:hover { color: var(--blue); }
.rows .sub { display: block; font-size: 13px; color: var(--ink-3); font-weight: 400; }
.rows .end { margin-left: auto; text-align: right; }
.status { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.status.waiting::before { background: var(--gold); }
.status.review::before { background: var(--blue); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 18px 10px 38px; position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 20px; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: var(--rule); }
.timeline time { display: block; font-size: 12px; color: var(--ink-3); }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--blue-wash); }
.page .find { background: var(--paper); border: 1px solid var(--rule); margin: 0 0 16px; max-width: 360px; }
.page .find input { color: var(--ink); }
.page .find input::placeholder { color: var(--ink-3); }

/* ---------- letters and invoices ---------- */
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.input { width: 100%; border: 1px solid var(--rule); border-radius: 6px; padding: 9px 12px; background: #fff; }
textarea.input { min-height: 96px; resize: vertical; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; cursor: pointer; border: 1px solid var(--rule); border-radius: 99px; padding: 6px 12px; font-size: 14px; }
.choices input { accent-color: var(--blue); }
.choices label:has(input:checked) { border-color: var(--blue); background: var(--blue-wash); }
.attached { display: flex; align-items: center; gap: 10px; border: 1px solid var(--rule); border-radius: 6px; padding: 8px 12px; font-size: 14px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.letterhead.panel { padding: 40px 48px; position: relative; }
.letterhead .mark { position: absolute; top: 18px; right: 18px; font-size: 12px; font-weight: 700; color: var(--gold); border: 1.5px solid var(--gold); padding: 2px 8px; border-radius: 3px; }
.from-chat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; padding: 10px 14px; background: var(--blue-wash); border: 1px solid #c5dbe8; border-radius: var(--r); font-size: 14px; color: var(--blue-deep); }
.from-chat svg { width: 18px; height: 18px; color: var(--blue); }
.from-chat span { flex: 1; min-width: 200px; }
.lock { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); }
.lock svg { width: 14px; height: 14px; }
.ask { display: flex; gap: 10px; align-items: center; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 10px 10px 16px; margin-bottom: 16px; color: var(--ink-3); }
.ask input { flex: 1; border: 0; outline: none; font-size: 16px; background: transparent; min-width: 0; color: var(--ink); }
.inv-log { display: grid; gap: 12px; justify-items: start; margin-bottom: 24px; }
.inv-log:empty { display: none; }
.inv-log .msg.ai { background: var(--paper); border: 1px solid var(--rule); }
.inv-log .msg.ai:has(> .card:only-child) { background: none; border: 0; padding: 0; }

.rail { background: var(--blue-deep); color: #cfdde6; display: flex; flex-direction: column; min-height: 0; }
.logo { width: 170px; margin: 22px 20px 18px; }
.find { display: flex; align-items: center; gap: 8px; margin: 0 14px 10px; padding: 8px 10px; border-radius: 6px; background: rgba(255,255,255,.08); }
.find svg { width: 15px; height: 15px; flex: none; }
.find input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: #fff; }
.find input::placeholder { color: #8fb0c4; }
.clients { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 1; }
.clients button { width: 100%; text-align: left; border: 0; background: none; color: inherit; padding: 9px 12px; border-radius: 6px; cursor: pointer; display: grid; }
.clients button:hover { background: rgba(255,255,255,.06); color: #fff; }
.clients button[aria-current] { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.clients small { font-size: 12px; color: #8fb0c4; }
.rail-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.rail-foot small { display: block; font-size: 12px; color: #8fb0c4; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--blue-deep); font-weight: 700; font-size: 13px; flex: none; }
.rail-link { margin-left: auto; color: #cfdde6; text-decoration: none; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.rail-link svg { width: 12px; height: 12px; }
.rail-link:hover { color: #fff; }

.chat { display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-right: 1px solid var(--rule); }
.chat-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 24px; border-bottom: 1px solid var(--rule); }
.chat-head > div:first-child { min-width: 0; max-width: 100%; }
.chat-head h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.years { display: flex; gap: 4px; margin-left: auto; }
.years button { border: 1px solid transparent; background: none; padding: 4px 11px; border-radius: 99px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.years button[aria-selected="true"] { background: var(--blue-wash); color: var(--blue); }
.years button:hover { color: var(--ink); }
.years .new { color: var(--ink-3); font-weight: 500; }

.log { flex: 1; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 72ch; font-size: 15px; }
.msg.you { align-self: flex-end; background: var(--blue); color: #fff; padding: 10px 14px; border-radius: 14px 14px 3px 14px; }
.msg.ai { background: var(--ground); padding: 12px 16px; border-radius: 14px 14px 14px 3px; }
.msg.ai ul, .msg.ai ol { margin: 6px 0 0; padding-left: 20px; }
.msg.ai li + li { margin-top: 2px; }
.msg .file { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; background: rgba(255,255,255,.18); border-radius: 99px; padding: 2px 10px; }
.msg .file svg { width: 12px; height: 12px; }
.msg.ai .file { background: #fff; color: var(--blue); }
.msg .why { font-size: 13px; color: var(--ink-3); }
.msg .card { background: #fff; border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 12px; margin-top: 10px; display: grid; gap: 4px; font-size: 14px; }
.msg .card b { font-weight: 600; }
.msg .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg .done { color: var(--ok); font-weight: 600; font-size: 14px; margin-top: 8px; }
.msg .card.inv, .msg .card[data-failed] { margin-top: 0; }
/* the invoice card: it says Sent only once QuickBooks has emailed it */
.card.inv .done, .card.inv .bad, .card.inv .why { margin: 4px 0 0; }
.card.inv .actions { margin-top: 6px; }
.card .amt { display: flex; align-items: center; gap: 4px; }
.card .amt b { margin-right: 2px; }
.card .amt input { width: 110px; border: 1px solid var(--rule); border-radius: 6px; padding: 4px 8px; background: #fff; }
.card .confirm { margin: 6px 0 0; padding-top: 8px; border-top: 1px solid var(--rule-soft); }
.bad { color: var(--bad); font-weight: 600; }
.msg p.bad { font-size: 14px; }
.msg .card[data-failed] { display: block; }
.msg .card.warn { background: var(--gold-wash); border-color: #f0d7a8; color: var(--gold-ink); }
.suggests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.suggest { border: 1px solid var(--rule); background: #fff; border-radius: 99px; padding: 4px 11px; font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; }
.suggest:hover { border-color: var(--blue); }
@keyframes pulse { 50% { opacity: .25; } }
.msg.ai .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.msg.ai .steps li { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--rule); }
.steps li.now { color: var(--ink-2); }
.steps li.now::before { background: var(--blue); animation: pulse 1s ease-in-out infinite; }
.steps li.done { color: var(--ink-2); }
.steps li.done::before { background: var(--ok); }
@media (prefers-reduced-motion: reduce) { .steps li.now::before { animation: none; } }

.composer { border-top: 1px solid var(--rule); padding: 12px 24px 16px; display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--rule); background: var(--paper); border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chips button:hover { border-color: var(--blue); color: var(--blue); }
.input-row { display: flex; align-items: flex-end; gap: 8px; }
.input-row textarea { flex: 1; resize: none; border: 1px solid var(--rule); border-radius: 6px; padding: 9px 12px; min-height: 42px; max-height: 160px; }

.folder { background: var(--ground); overflow-y: auto; padding: 18px 18px 24px; display: grid; gap: 14px; align-content: start; }
.folder h2 { font-size: 15px; }
.folder h3 { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.folder h3 span { color: var(--ink-3); font-weight: 500; }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.files li { display: flex; align-items: center; gap: 9px; padding: 4px 8px; border-radius: 6px; font-size: 14px; }
.files li.fresh { background: var(--blue-wash); }
.files button.open { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; display: grid; }
.files button.open:hover .name { color: var(--blue); }
.files .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.files small { font-size: 12px; color: var(--ink-3); }
.files li.pending { opacity: .55; }
.files li.missing { background: var(--gold-wash); color: var(--gold-ink); font-size: 13px; padding-left: 51px; }
.files li.bill { align-items: baseline; }
.files .amt { flex: none; min-width: 52px; text-align: right; font-weight: 700; }
.files .what { flex: 1; min-width: 0; display: grid; }
.files li.bill .name { white-space: normal; }   /* not clickable, so what it was for is read in full */
/* a letter's line naming the notice it answers; it opens the notice */
.files .answers { justify-self: start; max-width: 100%; font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unsent { padding: 6px; margin: 0 0 16px; }
.files small.bad { font-weight: 600; color: var(--bad); }
/* ⋯ on each row and work group: shown on hover and focus, always on small screens. On a row it sits over the row's
   end rather than taking width, so names and notes wrap exactly as they did without it. */
.more { flex: none; border: 0; background: none; padding: 2px 4px; border-radius: 5px; cursor: pointer; color: var(--ink-3); display: inline-grid; place-items: center; opacity: 0; }
.more svg { width: 16px; height: 16px; }
.files li { position: relative; }
.files li > .more { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: var(--paper); box-shadow: -8px 0 8px var(--paper); }
.files li.fresh > .more { background: var(--blue-wash); box-shadow: -8px 0 8px var(--blue-wash); }
.more:hover, .more[aria-expanded="true"], .files li > .more:hover, .files li > .more[aria-expanded="true"] { background: var(--rule-soft); color: var(--ink); }
.files li:hover .more, .files li:focus-within .more, .work-head:hover .more, .work-head:focus-within .more, .more:focus-visible, .more[aria-expanded="true"] { opacity: 1; }
@media (max-width: 960px), (hover: none) { .more { opacity: 1; } .files li > .more { position: static; transform: none; background: none; box-shadow: none; } }
.menu { position: fixed; z-index: 35; min-width: 170px; max-width: min(300px, calc(100vw - 16px)); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 30, 50, .16); padding: 4px; display: grid; }
.menu > button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 5px; font-size: 14px; cursor: pointer; }
.menu > button:hover, .menu > button:focus-visible { background: var(--blue-wash); color: var(--blue); outline: none; }
.menu p { margin: 0; padding: 8px 10px 4px; font-size: 14px; }
.menu-row { display: flex; gap: 6px; padding: 6px 10px 8px; }

/* From the client, by category; deliverables, by the work done */
.cats, .work { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); }
.cat + .cat { border-top: 1px solid var(--rule-soft); }
.cat-head { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 12px; cursor: pointer; font-weight: 600; font-size: 14px; text-align: left; }
.cat-head:hover { color: var(--blue); }
.cat-head svg { width: 14px; height: 14px; flex: none; color: var(--ink-3); transition: transform .15s; }
.cat-head[aria-expanded="true"] svg { transform: rotate(90deg); }
.cat-head .miss { margin-left: auto; }
.cat .files { padding: 0 6px 8px; }
.n { color: var(--ink-3); font-weight: 500; }
.miss { color: var(--gold-ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.works { display: grid; gap: 10px; }
/* Billing: its own section under Prepared by us, with the lock on the right */
.sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.folder .sec-head h3 { margin: 0; }
.sec-head .lock { margin-left: auto; font-size: 12px; }
.billing .files { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 6px; }
/* Conversations: one box, one row per conversation in the year. A row is a file row's shape, lined up with them: a kind
   badge in the format badge's place and width, then the title over a note. The one on screen carries the left nav's
   gold "you are here" bar. */
.sec-head .new-convo { margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; }
.new-convo svg { width: 11px; height: 11px; margin-right: 5px; vertical-align: -1px; }
.convos { list-style: none; margin: 0; padding: 4px 6px; display: grid; gap: 2px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); }
.convos button { width: 100%; display: flex; align-items: center; gap: 9px; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left; }
.convos button:hover .name { color: var(--blue); }
.convos button[aria-current] { background: var(--blue-wash); box-shadow: inset 3px 0 0 var(--gold); }
.convos .what { flex: 1; min-width: 0; display: grid; }
.convos .name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convos small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind { flex: none; width: 34px; height: 22px; border-radius: 3px; display: grid; place-items: center; }
.kind svg { width: 14px; height: 14px; }
.kind.k-return { background: var(--blue); color: #fff; }
.kind.k-letter { background: var(--gold-wash); color: var(--gold-ink); }
.kind.k-side { background: var(--blue-wash); color: var(--blue); }
.convos [aria-current] .kind.k-side { background: var(--paper); }   /* on the row on screen, the same blue would lose the badge */
.kind.k-ask { background: var(--ground); color: var(--ink-2); }
/* the one moment of motion: a conversation just made arrives in gold and settles into the "you are here" blue */
@keyframes arrive { from, 30% { background-color: var(--gold-wash); } }
.convos .born { animation: arrive .4s ease-in; }
@media (prefers-reduced-motion: reduce) { .convos .born { animation: none; } }
.work { padding: 10px 6px 6px; }
.work-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 0 8px 6px; }
.work-head h4 { font-size: 14px; font-weight: 600; margin: 0; }
.work-head .pill, .work-head .lock, .work-head .more { margin-left: auto; }
/* the return's ⋯ follows its title, so the pill keeps the right edge and a wrap never leaves a blank line */
.work-head h4 { order: -2; }
.work-head .pill ~ .more { order: -1; margin-left: 0; }
.work-head .lock { font-size: 12px; }
.work .hint { margin: 2px 8px 4px; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--ground); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-wash); color: var(--ok); }
.pill.info { background: var(--blue-wash); color: var(--blue); }
.pill.warn { background: var(--gold-wash); color: var(--gold-ink); }
.link { border: 0; background: none; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-align: left; }
.link:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .cat-head svg { transition: none; } }
.ext { font-family: "proxima-nova-condensed", "Figtree", sans-serif; font-size: 11px; font-weight: 700; width: 34px; text-align: center; flex: none; padding: 2px 0; border-radius: 3px; color: #fff; background: var(--ink-3); }
.ext.pdf { background: #b0413e; } .ext.xls { background: #1f7244; } .ext.doc { background: #2b579a; } .ext.img { background: #6a5a8e; }
.drop { margin-top: 10px; width: 100%; border: 1.5px dashed var(--rule); border-radius: var(--r); background: none; padding: 9px 12px; cursor: pointer; font-weight: 600; color: var(--blue); display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 8px; text-align: center; }
.drop small { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.drop:hover { border-color: var(--blue); background: var(--blue-wash); }
.hint { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); }

/* ---------- partners ---------- */
.page { padding: 28px 32px 64px; max-width: 1100px; }
.page h1 { font-size: 26px; margin: 8px 0 20px; }
.page h2 { font-size: 16px; margin: 26px 0 10px; }
.back { font-size: 14px; }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 13px; padding: 10px 16px; border-bottom: 1px solid var(--rule); background: #fafbfc; white-space: nowrap; }
td { padding: 10px 16px; border-bottom: 1px solid var(--rule-soft); }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
tr.flagged td { background: var(--gold-wash); }
tr.total td { font-weight: 700; border-top: 1px solid var(--ink); }

/* ---------- preview ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(0, 30, 50, .45); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px; }
.sheet { background: var(--paper); border-radius: 10px; width: min(860px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.sheet-head h2 { font-size: 16px; flex: 1; }
.sheet-body { overflow-y: auto; padding: 18px; }
.sheet-body h3 { font-size: 14px; color: var(--ink-2); margin: 18px 0 8px; }
.sheet-body h3:first-child { margin-top: 0; }
.sheet-body p { margin: 0 0 10px; max-width: 70ch; }
.sheet-body .table-wrap { margin-bottom: 6px; }
.sheet-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--rule); }
.sheet-foot .muted { margin-right: auto; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- add documents ---------- */
.sheet.up { width: min(560px, 100%); }
.up-drop { margin: 12px 0; padding: 22px 12px; display: block; cursor: default; font-weight: 500; color: var(--ink-2); }
.up-drop:hover { background: none; border-color: var(--rule); }
.up-drop .link { font-weight: 600; }
.up-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.up-list li { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 10px; border-radius: 6px; background: var(--ground); font-size: 14px; }
.up-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-list small { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.up-list .icon-btn { padding: 5px; }
.up-list .icon-btn svg { width: 14px; height: 14px; }
.up-ok { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 12px; border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; }
.up-ok:has(input:checked) { border-color: var(--blue); background: var(--blue-wash); }
.up-ok input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--blue); }
.msg .audit { display: block; margin-top: 8px; }
.letterhead { max-width: 640px; padding: 8px 4px; font-size: 14px; line-height: 1.6; }
.letterhead img { width: 210px; margin-bottom: 20px; display: block; }
.letterhead .addr { color: var(--ink-2); }
.pv-note { font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 16px; }

/* ---------- drop hint, toast ---------- */
.drop-hint { position: fixed; inset: 0; z-index: 50; pointer-events: none; background: rgba(0, 53, 80, .6); display: grid; place-items: center; padding: 24px; }
.drop-hint > div { border: 2px dashed rgba(255,255,255,.85); border-radius: 12px; padding: 40px 52px; color: #fff; text-align: center; display: grid; gap: 6px; max-width: 520px; }
.drop-hint strong { font-size: 22px; font-weight: 600; }
.drop-hint span { color: #d2e2ec; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); font-size: 14px; max-width: 90vw; }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; height: auto; min-height: calc(100vh - 29px); }
  .main { overflow: visible; }
  .rail { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .logo { width: 130px; margin: 0 8px 0 0; }
  .nav { flex-direction: row; flex-wrap: wrap; padding: 0; }
  .nav .tag { display: none; }
  .rail-foot { display: none; }
  .client { grid-template-columns: minmax(0, 1fr); }
  .chat { border-right: 0; min-height: 60vh; }
  .years { margin-left: 0; }
  .grid-2, .grid-2.letters { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .page { padding-inline: 16px; }
  .letterhead.panel { padding: 24px 20px; }
  .signin { grid-template-columns: 1fr; }
  .signin-brand { padding: 32px 24px; gap: 28px; }
  .chat-head, .log, .composer { padding-inline: 16px; }
  .new-convo { padding-block: 12px; margin-block: -12px; }   /* a thumb-sized target, same look */
  .overlay { padding: 12px; }
  .sheet-foot { justify-content: flex-end; }
  .sheet-foot .muted { flex-basis: 100%; }
  .sheet { max-height: calc(100vh - 24px); }
}

/* the billing table fits a phone: its headers wrap */
@media (max-width: 480px) { .bills th { white-space: normal; } .bills th, .bills td { padding-inline: 8px; } .bills td:last-child { white-space: nowrap; } }

/* ---------- real files in the preview ---------- */
.pv-frame { display: block; width: 100%; height: min(72vh, 900px); border: 1px solid var(--rule); border-radius: 6px; }
.pv-img { display: block; max-width: 100%; }
.xl table { font-size: 13px; }
.xl td { padding: 5px 12px; white-space: nowrap; }
.xl td[data-t="n"] { text-align: right; }
.docx h1 { font-size: 18px; margin: 0 0 12px; }
.docx h2 { font-size: 15px; margin: 16px 0 6px; }
.docx ul { padding-left: 20px; }
.docx img { display: block; width: 220px; height: auto; margin-bottom: 18px; }
