:root { --brand: #1f4e79; --accent: #1f4e79; --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #5d6675; --line: #e2e5ea;
  --ok: #e7f5ec; --ok-text: #1d6b3a; --err: #fdecec; --err-text: #9b1c1c; color-scheme: light dark; }
@media (prefers-color-scheme: dark) { :root { --bg: #14171c; --card: #1d2128; --text: #e6e8ec; --muted: #9aa3b2; --line: #2c323b;
  --ok: #173022; --ok-text: #8fd6a8; --err: #3a1c1c; --err-text: #f2a3a3; } }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.bar { background: var(--brand); color: #fff; }
.bar-in { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.firm { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.1rem; }
.firm img { max-height: 36px; max-width: 160px; background: #fff; border-radius: 4px; padding: 2px; }
.who { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.who .link { color: #fff; }
main { padding-top: 24px; padding-bottom: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; margin-bottom: 20px; }
.narrow { max-width: 460px; margin: 40px auto; }
h1 { font-size: 1.4rem; margin: 0 0 12px; } h2 { font-size: 1.1rem; margin: 0 0 12px; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.stack { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; } .row input { flex: 1 1 200px; }
label { display: grid; gap: 6px; font-weight: 500; }
input[type=email], input[name=name] { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); }
.drop { border: 2px dashed var(--line); border-radius: 8px; padding: 18px; font-weight: 400; color: var(--muted); }
button { font: inherit; cursor: pointer; }
.primary { background: var(--brand); color: #fff; border: 0; border-radius: 6px; padding: 10px 16px; font-weight: 600; }
.link { background: none; border: 0; text-decoration: underline; padding: 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { color: var(--muted); font-weight: 500; }
.flash { padding: 10px 14px; border-radius: 6px; background: var(--ok); color: var(--ok-text); overflow-wrap: anywhere; }
.flash.error { background: var(--err); color: var(--err-text); }
.flash.dev { background: #fff6d6; color: #6b5400; }
.foot { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .85rem; padding-bottom: 32px; }
@media (max-width: 600px) { th:nth-child(3), td:nth-child(3) { display: none; } .card { padding: 16px; } }
.btn { display: inline-block; text-decoration: none; text-align: center; }
.head-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
input.text, input[type=search], input[name=tax_year], textarea, select { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); }
textarea { width: 100%; resize: vertical; } input.text { width: 100%; }
.row input.year, input.year { flex: 0 0 90px; width: 90px; }
.invite { margin-bottom: 16px; } .invite summary { list-style: none; width: max-content; } .invite summary::-webkit-details-marker { display: none; }
.invite-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.search input { flex: 1 1 260px; }
th.pick, td.pick { width: 32px; }
.bulk-bar { margin-top: 14px; align-items: center; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; flex-wrap: wrap; }
.tag { font-size: .75rem; background: var(--ok); color: var(--ok-text); border-radius: 4px; padding: 1px 6px; }
tr.bad td { color: var(--err-text); }
.summary { padding-left: 20px; } code { font-size: .9em; }
@media (max-width: 600px) { th.pick + th + th + th, td.pick + td + td + td { display: none; } }
.note { white-space: pre-line; margin-top: 2px; }
.tag.new { background: var(--brand); color: #fff; }
.return-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.returned { border-left: 4px solid var(--brand); }
.tag.lock { background: #fff3d6; color: #6b4a00; }
@media (prefers-color-scheme: dark) { .tag.lock { background: #3a2f12; color: #f2d48f; } }
.invoice-due { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.locked { color: var(--muted); }
form.inline { display: inline; margin-left: 8px; }
.gate { border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px 10px; margin: 0; } .gate legend { padding: 0 6px; }
.gate-fields { margin-top: 6px; } .row label.grow { flex: 1 1 260px; } input.money { width: 130px; }
.invoice { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 4px; }
.invoice-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.invoice-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 16px; margin-top: 6px; }
.markpaid { flex-basis: 100%; } .markpaid summary { cursor: pointer; width: max-content; }
.markpaid form { margin-top: 10px; padding: 12px; background: var(--bg); border-radius: 6px; }
