:root {
  --ink: #1d2433; --muted: #5d6677; --line: #d9dee7; --bg: #f5f7fa; --card: #fff;
  --accent: #1f5fbf; --accent-ink: #fff; --ok: #1e7a46; --warn: #a15c00; --bad: #b42318;
  --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.45; }
a { color: var(--accent); }
header.top { background: var(--ink); color: #fff; padding: .6rem 1.2rem; display: flex; gap: 1rem; align-items: center; }
header.top a { color: #fff; text-decoration: none; }
header.top .brand { font-weight: 600; }
header.top .spacer { flex: 1; }
header.top form { margin: 0; }
header.top button { background: none; border: 1px solid #fff6; color: #fff; padding: .25rem .7rem; border-radius: var(--radius); cursor: pointer; }
main { max-width: 1100px; margin: 0 auto; padding: 1.2rem; }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .6rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.btn, button.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; padding: .55rem 1rem; border-radius: var(--radius); text-decoration: none; cursor: pointer; font: inherit; }
.btn.secondary { background: #e8edf5; color: var(--ink); }
.btn.danger { background: #fde8e7; color: var(--bad); }
.btn.small { padding: .3rem .7rem; font-size: .875rem; }
form.inline { display: inline; }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=password], select, textarea {
  font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); width: 100%; background: #fff;
}
label { font-weight: 500; }
.field { margin-bottom: .8rem; }
.field .help { font-size: .85rem; color: var(--muted); }
.errorlist { color: var(--bad); margin: .2rem 0; padding-left: 1rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.tag { display: inline-block; font-size: .75rem; padding: .05rem .45rem; border-radius: 99px; background: #e8edf5; color: var(--muted); }
.tag.ok { background: #e3f4ea; color: var(--ok); }
.tag.warn { background: #fff2dc; color: var(--warn); }
.tag.bad { background: #fde8e7; color: var(--bad); }
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: .4rem; background: #e8edf5; word-break: break-all; }
.messages li.success { background: #e3f4ea; }
.messages li.error { background: #fde8e7; }
.messages li.warning { background: #fff2dc; }
.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.stage { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; }
.stage b { font-size: 1.4rem; display: block; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

/* invite screen */
.invite-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 860px) { .invite-grid { grid-template-columns: 1fr; } }
.cat-item { display: flex; gap: .5rem; align-items: flex-start; padding: .3rem 0; font-weight: 400; }
.cat-item input { margin-top: .3rem; }
.cat-item .form { color: var(--muted); font-size: .8rem; }
.sticky { position: sticky; top: 1rem; }
.chosen-list { margin: .3rem 0 1rem; padding-left: 1.1rem; }

/* client pages (mobile first) */
body.client, :root:has(body.client) { background: #fff; }
.client main { max-width: 560px; padding: 1rem; }
.client h1 { font-size: 1.35rem; }
.client .btn { display: block; width: 100%; text-align: center; padding: .9rem 1rem; font-size: 1.05rem; margin-bottom: .6rem; }
.client .file-btn { position: relative; overflow: hidden; }
.client .file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.progress { height: 6px; background: #e8edf5; border-radius: 99px; margin: .4rem 0 1rem; overflow: hidden; }
.progress div { height: 100%; background: var(--accent); }
.checklist { list-style: none; padding: 0; margin: 0 0 1rem; }
.checklist li { padding: .7rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .6rem; align-items: center; }
.checklist li a { flex: 1; text-decoration: none; color: var(--ink); }
.dot { width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2px solid var(--line); flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.dot.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.dot.na { background: #e8edf5; }
.notice { background: #f0f4fb; border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; }
.error-box { background: #fde8e7; color: var(--bad); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; }
.sin-input { font-size: 1.4rem; letter-spacing: .15em; text-align: center; }
