@font-face { font-family: "Plex"; src: url(/plex-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url(/plex-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url(/plex-600.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }
/* Tokens. Paper and ink for the work; cobalt for actions; brass only for money that matters and for unsaved work. */
:root {
  --bg: #f2f3f0; --bg2: #e9ebe6; --card: #fff; --ink: #18202e; --muted: #5f6877; --line: #d9dcd5; --line2: #c6cac1;
  --accent: #2e56c9; --accent2: #2346a8; --accentbg: #e8edfb; --brass: #9a6a12; --brassbg: #fbf1dc;
  --ok: #24733a; --okbg: #e6f4e9; --warn: #8f5600; --warnbg: #fdf2dc; --bad: #b42318; --badbg: #fcebe8; --chip: #e7eae4;
  --rail: #18202e; --railink: #c9d0dc; --railon: #ffffff; --railhover: #243046;
  --radius: 6px; --radius-lg: 10px; --shadow: 0 1px 0 rgba(24, 32, 46, .04);
  --font: "Plex", "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131b; --bg2: #141b26; --card: #161d28; --ink: #e4e8ee; --muted: #98a2b3; --line: #273142; --line2: #354156;
    --accent: #7c9cf2; --accent2: #9db5f6; --accentbg: #1b2742; --brass: #e0b04f; --brassbg: #2e2412;
    --ok: #6cc47f; --okbg: #15291c; --warn: #f0b05a; --warnbg: #2f240f; --bad: #f2867a; --badbg: #36191a; --chip: #222b39;
    --rail: #0a0e14; --railink: #a9b3c4; --railon: #fff; --railhover: #18202e; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131b; --bg2: #141b26; --card: #161d28; --ink: #e4e8ee; --muted: #98a2b3; --line: #273142; --line2: #354156;
  --accent: #7c9cf2; --accent2: #9db5f6; --accentbg: #1b2742; --brass: #e0b04f; --brassbg: #2e2412;
  --ok: #6cc47f; --okbg: #15291c; --warn: #f0b05a; --warnbg: #2f240f; --bad: #f2867a; --badbg: #36191a; --chip: #222b39;
  --rail: #0a0e14; --railink: #a9b3c4; --railon: #fff; --railhover: #18202e; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; margin: 0 0 4px; }
h2 { font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -.005em; margin: 20px 0 8px; }
h3 { font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.muted { color: var(--muted); } .sm { font-size: 13px; } .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.hidden, [hidden] { display: none !important; }
code { font-size: 12px; word-break: break-all; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); border-radius: var(--radius);
  padding: 7px 13px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 36px; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--accent); background: var(--accentbg); }
label.btn.disabled { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0e131b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0e131b; } } .btn.primary:hover { background: var(--accent2); }
.btn.danger { color: var(--bad); } .btn.sm { padding: 4px 9px; min-height: 28px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line2); border-radius: var(--radius); padding: 7px 10px; min-height: 36px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 25%, transparent); outline-offset: 0; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--accent); width: 16px; height: 16px; }
textarea { width: 100%; min-height: 80px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
label.f > input, label.f > select, label.f > textarea { color: var(--ink); font-size: 14px; }
label.ck { display: flex; gap: 8px; align-items: flex-start; }
label.ck > input { margin-top: 3px; flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); margin: 12px 0; }
.card.ok { background: var(--okbg); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.card.warn { background: var(--warnbg); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.card.bad { background: var(--badbg); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; background: var(--card); }
.t th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line2); background: var(--card); position: sticky; top: 0; }
.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; } .t tr.click:hover td { background: var(--bg2); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; background: var(--chip); white-space: nowrap; }
.chip.draft { background: var(--chip); } .chip.sent, .chip.viewed { background: #e3efff; color: #1d4f91; }
.chip.accepted, .chip.paid, .chip.invoiced, .chip.ok { background: var(--okbg); color: var(--ok); }
.chip.declined, .chip.expired, .chip.overdue, .chip.void, .chip.bad { background: var(--badbg); color: var(--bad); }
.chip.changes, .chip.warn, .chip.unpaid { background: var(--warnbg); color: var(--warn); }
.chip.superseded, .chip.converted, .chip.cancelled { opacity: .7; }
.chip.cancelled { text-decoration: line-through; }
@media (prefers-color-scheme: dark) { .chip.sent, .chip.viewed { background: #1d2f47; color: #9cc5f5; } }

/* login */
.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(var(--rail), var(--rail)) top / 100% 38vh no-repeat, var(--bg); }
.login .card { width: 100%; max-width: 400px; padding: 28px 28px 20px; box-shadow: 0 12px 40px rgba(10, 14, 20, .18); }
.login h1 { font-size: 22px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }
.okmsg { color: var(--ok); font-size: 13px; }

/* portal */
.portal .pwrap { max-width: 900px; margin: 0 auto; padding: 18px 16px 40px; }
.phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pdoc { width: 100%; height: 75vh; min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.sigpad { width: 100%; max-width: 520px; height: 160px; border: 1px dashed var(--muted); border-radius: 6px; background: #fff; touch-action: none; display: block; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; cursor: crosshair; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choices label { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.choices input:checked + span { font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* getting the app on a phone: the sign-in page link and the /get-app page */
.getapp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ga .card { max-width: 460px; }
.ga h1 { font-size: 24px; letter-spacing: -.01em; margin: 14px 0 6px; }
.gaicon { display: block; border-radius: 14px; box-shadow: 0 4px 14px rgba(20, 30, 50, .18); }
.gabtn { width: 100%; justify-content: center; padding: 12px; font-size: 15px; margin: 6px 0 12px; }
.gasteps { background: var(--bg2); border-radius: var(--radius-lg, 10px); padding: 14px 16px; margin: 6px 0 14px; }
.gasteps ol, .gaother ol { margin: 6px 0 0; padding-left: 20px; }
.gasteps li, .gaother li { margin: 3px 0; }
.gaother { margin: 0 0 14px; } .gaother summary { cursor: pointer; color: var(--accent); }
.gaother h3 { font-size: 14px; margin: 14px 0 0; }
.gawarn { background: var(--brassbg); color: var(--brass); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }

/* the client's support pages: report a fault, follow one */
.sup .pwrap { max-width: 720px; }
.shead { margin: 10px 0 14px; } .shead h1 { font-size: 24px; }
.sform fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.sform legend { font-weight: 600; margin-bottom: 8px; }
.sgrp { margin-bottom: 8px; } .sgrp > .muted { margin: 2px 0 4px; }
.sopt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 6px; cursor: pointer; }
.sopt:has(input:checked) { border-color: var(--accent); background: var(--accentbg); }
.sopt > input { margin-top: 3px; flex: none; }
.sopt > span { display: flex; flex-direction: column; gap: 1px; }
.spri { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; } .spri .sopt { margin: 0; }
.spri .p1:has(input:checked) { border-color: var(--bad); background: var(--badbg); }
.sform .grid { margin: 12px 0; } .sform > label.f { margin-bottom: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sbig { padding: 10px 18px; font-size: 15px; }
.slist { list-style: none; margin: 0; padding: 0; }
.slist a { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.slist li:last-child a { border-bottom: 0; } .slist a:hover .ssub { color: var(--accent); }
.slist a > .muted { grid-column: 2 / 4; }
.snum { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.schip { font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 4px; background: var(--chip); white-space: nowrap; }
.schip.new { background: var(--warnbg); color: var(--warn); } .schip.open { background: var(--accentbg); color: var(--accent); } .schip.done { background: var(--okbg); color: var(--ok); }
.ssteps { display: flex; list-style: none; margin: 0 0 6px; padding: 0; counter-reset: s; }
.ssteps li { flex: 1; position: relative; padding-top: 22px; font-size: 13px; color: var(--muted); text-align: center; }
.ssteps li::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 3px; background: var(--line); }
.ssteps li::after { content: ""; position: absolute; top: 0; left: calc(50% - 6.5px); width: 13px; height: 13px; border-radius: 50%; background: var(--card); border: 2px solid var(--line2); box-sizing: border-box; }
.ssteps li.past::before, .ssteps li.now::before { background: var(--accent); }
.ssteps li.past::after { background: var(--accent); border-color: var(--accent); }
.ssteps li.now { color: var(--ink); font-weight: 600; } .ssteps li.now::after { border-color: var(--accent); border-width: 4px; }
.stl { list-style: none; margin: 0; padding: 0; }
.stl li { padding: 10px 12px; border-radius: var(--radius); margin-bottom: 8px; background: var(--bg2); }
.stl li.you { background: var(--accentbg); margin-left: 12%; } .stl li.us { margin-right: 12%; }
.stl li.status { background: none; padding: 4px 12px; margin-right: 0; } .stl li.status .sbody { font-size: 13px; color: var(--muted); }
.sbody { white-space: pre-line; overflow-wrap: anywhere; margin-top: 2px; }
.sfoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.legal { line-height: 1.4; } .login .legal { margin: 4px 0 0; font-size: 12px; }
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.grid2[hidden]{display:none}@media (max-width:480px){.grid2{grid-template-columns:1fr}}
