/* Agreement signing tracker (.space). Radix brand: Hubot Sans headings, Inter body, white / Radix blue / navy / greys.
   Motion follows the transitions.dev token scale. */
@import url('https://fonts.googleapis.com/css2?family=Hubot+Sans:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --duration-stagger: 40ms; --duration-micro: 80ms; --duration-quick: 150ms; --duration-fast: 250ms;
  --duration-medium: 350ms; --duration-slow: 400ms; --duration-very-slow: 500ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1); --ease-in-out: ease-in-out; --ease-bounce: cubic-bezier(0.34, 1.36, 0.64, 1);
  --distance-micro: 4px; --distance-small: 6px; --distance-base: 8px; --distance-medium: 12px;
  --scale-large: 0.96; --scale-medium: 0.97; --blur-small: 2px;

  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Hubot Sans', Inter, -apple-system, sans-serif;

  --bg: #f4f6fa; --surface: #ffffff; --surface-2: #f8f9fc; --hover: #f2f5fb;
  --ink: #0b1324; --ink-2: #333c50; --muted: #687187; --faint: #9aa2b4;
  --line: #e3e7ef; --line-strong: #cfd5e1;
  --blue: #065dff; --blue-ink: #0447c4; --blue-soft: #e9f0ff; --navy: #0a1a3c;
  --amber: #a35a00; --amber-soft: #fff3e0; --green: #0c7a4a; --green-soft: #e5f5ec; --red: #c4321c; --red-soft: #fdecea;
  --shadow-1: 0 1px 2px rgb(11 19 36 / 0.06);
  --shadow-2: 0 10px 30px -8px rgb(11 19 36 / 0.18), 0 2px 6px rgb(11 19 36 / 0.06);
  --shadow-3: 0 24px 60px -12px rgb(11 19 36 / 0.28);
  --scrim: rgb(10 26 60 / 0.28);
  --logo-filter: none;
  --jet: #000000;
  --radius: 12px; --radius-sm: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1a; --surface: #111827; --surface-2: #0e1420; --hover: #172033;
    --ink: #eef1f7; --ink-2: #c9d0de; --muted: #8e98ad; --faint: #5f6a80;
    --line: #222c3f; --line-strong: #2f3a50;
    --blue: #4b8bff; --blue-ink: #8db4ff; --blue-soft: #142446; --navy: #c9d7f5;
    --amber: #f0a64a; --amber-soft: #2b1f0e; --green: #4cc98c; --green-soft: #0f2a1e; --red: #ff7a66; --red-soft: #33150f;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4); --shadow-2: 0 12px 32px -8px rgb(0 0 0 / 0.6); --shadow-3: 0 24px 60px -12px rgb(0 0 0 / 0.7);
    --scrim: rgb(0 0 0 / 0.5);
    --logo-filter: invert(1);
    --jet: #f5f7fb;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background-color var(--duration-quick) var(--ease-smooth-out), border-color var(--duration-quick), transform var(--duration-quick) var(--ease-smooth-out), opacity var(--duration-quick); user-select: none; -webkit-user-select: none; }
.btn:active { transform: scale(0.97); }
a.btn { text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:disabled { opacity: 0.55; cursor: default; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-danger { color: var(--red); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 38px; padding: 0; }
@media (hover: hover) {
  .btn:hover { background: var(--hover); }
  .btn-primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
  .btn-ghost:hover { background: var(--hover); }
}
@media (hover: hover) and (prefers-color-scheme: dark) { .btn-primary:hover { background: #2f74f0; border-color: #2f74f0; } }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.input { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 16px; transition: border-color var(--duration-quick), box-shadow var(--duration-quick); }
@media (min-width: 761px) { .input { font-size: 14px; } }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
textarea.input { resize: vertical; min-height: 72px; line-height: 1.45; }
select.input { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23687187' stroke-width='1.8' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.prefix { position: relative; }
.prefix > b { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--muted); font-weight: 500; pointer-events: none; }
.prefix > .input { padding-left: 26px; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left)); }
.login-card { width: 100%; max-width: 400px; }
/* Radix | Squarespace lockup. Heights are optically matched: the Radix caps fill their box, Squarespace's
   wordmark sits beside a taller symbol, so it gets a taller box. */
.lockup { display: inline-flex; align-items: center; gap: 18px; flex: none; }
.lockup img { display: block; width: auto; filter: var(--logo-filter); }
.lockup .lg-radix { height: 20px; }
.lockup .lg-sqsp { height: 32px; }
.lockup .pipe { width: 1px; height: 34px; background: var(--line-strong); }
.lockup-lg { gap: 18px; margin-bottom: 40px; }
.login-card .lockup-lg { display: flex; justify-content: center; }
.login-card h1, .login-card p.lead { text-align: center; }
.login-card h1 + form { margin-top: 28px; }
.lockup-lg .lg-radix { height: 19px; }
.lockup-lg .lg-sqsp { height: 31px; }
.lockup-lg .pipe { height: 31px; }
.login-card h1 { font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
.login-card p.lead { color: var(--muted); margin: 0 0 26px; font-size: 14.5px; }
.login-card form { display: grid; gap: 14px; }
.login-card .btn-primary { min-height: 44px; font-size: 14.5px; }
.code-input { font-size: 26px !important; letter-spacing: 0.42em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; min-height: 56px; padding-left: calc(12px + 0.42em); }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; margin: -4px 0 0; }
.code-links { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.code-links .linkish { padding: 10px 2px; min-height: 44px; }
.faint { color: var(--faint); }
.tall { min-height: 42px; }
.span-all { grid-column: 1 / -1; margin: 0; min-height: 0; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
/* © line: bottom of every page, centred */
.legal { text-align: center; color: var(--faint); font-size: 12px; padding: 0 16px max(24px, env(safe-area-inset-bottom)); }
.login + .legal { margin-top: -64px; }
.linkish { background: none; border: 0; padding: 6px 0; color: var(--blue); font-weight: 600; font-size: 13px; justify-self: start; }
.step { transition: opacity var(--duration-fast) var(--ease-smooth-out), transform var(--duration-fast) var(--ease-smooth-out), filter var(--duration-fast); }
.step.enter { opacity: 0; transform: translateX(var(--distance-base)); filter: blur(var(--blur-small)); }
.shake { animation: shake calc(var(--duration-micro) * 5) var(--ease-smooth-out); }
@keyframes shake { 20% { transform: translateX(calc(var(--distance-base) * -1)); } 40% { transform: translateX(var(--distance-base)); } 60% { transform: translateX(calc(var(--distance-small) * -1)); } 80% { transform: translateX(var(--distance-small)); } }
.done-check { display: grid; place-items: center; gap: 14px; text-align: center; padding: 30px 0; color: var(--muted); }
.done-check svg { width: 52px; height: 52px; color: var(--green); }
.done-check circle { animation: pop var(--duration-very-slow) var(--ease-bounce) both; transform-origin: center; }
.done-check path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw var(--duration-slow) var(--ease-smooth-out) 120ms forwards; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- app shell ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 84px; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color var(--duration-fast); }
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 32px; min-width: 0; }
/* Product name: 21px jet black at full width, scaling down with the window so it never collides with the buttons. */
.brand strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-head); font-size: clamp(16px, calc((100vw - 660px) / 17.2), 21px); line-height: 1; font-weight: 700; text-transform: uppercase; letter-spacing: -0.01em; color: var(--jet); white-space: nowrap; }
@media (max-width: 940px) { .brand strong { display: none; } }
.top .grow { flex: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: #fff; background: var(--navy); border: 0; flex: none; }
@media (prefers-color-scheme: dark) { .avatar { color: #0a0f1a; } }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.menu { position: absolute; right: 16px; top: 74px; min-width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2);
  transform-origin: top right; transition: opacity var(--duration-fast) var(--ease-smooth-out), transform var(--duration-fast) var(--ease-smooth-out); }
.menu.closed { opacity: 0; transform: scale(var(--scale-medium)) translateY(-4px); pointer-events: none; transition-duration: var(--duration-quick); }
.menu .who { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { display: block; font-size: 14px; }
.menu .who span { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.menu .roles { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: none; text-align: left; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.menu button:hover, .menu a:hover { background: var(--hover); }
.menu svg { width: 16px; height: 16px; color: var(--muted); }

.wrap { max-width: 1320px; margin: 0 auto; padding: 18px max(20px, env(safe-area-inset-right)) 48px max(20px, env(safe-area-inset-left)); min-height: calc(100dvh - 84px - 60px); }
.page-head { display: flex; align-items: end; gap: 16px; margin: 6px 0 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; line-height: 1.1; font-weight: 800; }
.page-head .sub { color: var(--muted); margin-top: 6px; font-size: 13.5px; }
.page-head .grow { flex: 1; }
.search { position: relative; width: 300px; max-width: 100%; }
.search svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 34px; min-height: 38px; }
.search kbd { position: absolute; right: 9px; top: 50%; translate: 0 -50%; font: 600 11px var(--font); color: var(--faint); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; }

/* tabs with a sliding indicator */
.tabs { position: relative; display: flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; width: max-content; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border: 0; background: none; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: color var(--duration-fast) var(--ease-smooth-out); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.tab.attention .count { background: var(--blue); border-color: var(--blue); color: #fff; }
.tab-indicator { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 8px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform var(--duration-fast) var(--ease-smooth-out), width var(--duration-fast) var(--ease-smooth-out); }
.count.bump { animation: bump var(--duration-very-slow) var(--ease-bounce); }
@keyframes bump { 0% { transform: scale(0.6); filter: blur(var(--blur-small)); opacity: 0; } 100% { transform: none; filter: none; opacity: 1; } }

/* ---------- list ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow-x: auto; }
@media (max-width: 1180px) { .list .c-sign, .list th.h-sign { display: none; } }
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.list th.r, .list td.r { text-align: right; }
.list td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr { cursor: pointer; transition: background-color var(--duration-quick), opacity var(--duration-fast) var(--ease-smooth-out); }
@media (hover: hover) { .list tbody tr:hover { background: var(--hover); } }
.list tr.selected { background: var(--blue-soft) !important; }
.list tr.open-row { box-shadow: inset 3px 0 0 var(--blue); }
.list tr.leaving { opacity: 0; }
.list .sel { width: 44px; padding-right: 0; }
.chk { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; margin: 0; display: block; }
.partner b { display: block; font-weight: 600; font-size: 14px; }
.list td.partner { width: 100%; max-width: 0; min-width: 220px; }
.partner > span { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.person { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--ink-2); }
.person .muted { color: var(--faint); }
.age { color: var(--muted); white-space: nowrap; font-size: 13px; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.amount.zero { color: var(--faint); font-weight: 400; }
.row-act { width: 1%; white-space: nowrap; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.awaiting_check { color: var(--amber); background: var(--amber-soft); }
.pill.ready_to_sign { color: var(--blue-ink); background: var(--blue-soft); }
.pill.signed { color: var(--green); background: var(--green-soft); }
.flag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; height: 22px; padding: 0 7px; border-radius: 11px; font-size: 11.5px; font-weight: 600; color: var(--red); background: var(--red-soft); vertical-align: middle; }
.flag svg { width: 12px; height: 12px; }
.tag { display: inline-flex; height: 20px; align-items: center; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }

.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--green); margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; font-family: var(--font-head); }

.skeleton .w50 { width: 50%; } .skeleton .w60 { width: 60%; } .skeleton .w65 { width: 65%; } .skeleton .w70 { width: 70%; } .skeleton .w75 { width: 75%; } .skeleton .w80 { width: 80%; } .skeleton .w90 { width: 90%; }
.skeleton td div { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--hover) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* mobile: rows become cards */
@media (max-width: 760px) {
  .top { height: 64px; }
  .menu { top: 58px; }
  .brand strong { display: none; }
  #new-btn { width: 38px; padding: 0; border-radius: 50%; }
  #new-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .top { gap: 10px; }
  .list .sel { width: auto; }
  .lockup { gap: 12px; }
  .lockup .lg-radix { height: 14px; }
  .lockup .lg-sqsp { height: 22px; }
  .lockup .pipe { height: 24px; }
  .lockup-lg { gap: 14px; }
  .lockup-lg .lg-radix { height: 16px; }
  .lockup-lg .lg-sqsp { height: 25px; }
  .lockup-lg .pipe { height: 27px; }
  .page-head h1 { font-size: 24px; }
  .search { width: 100%; }
  .search kbd { display: none; }
  .tabs { width: 100%; }
  .card { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.list, .list tbody { display: block; }
  .list thead { display: none; }
  .list tbody tr { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; padding: 14px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
  .list td { display: block; padding: 0; border: 0; }
  .list td.sel { grid-row: 1 / span 2; padding-top: 2px; }
  .list td.partner { grid-column: 2 / 4; width: auto; max-width: none; min-width: 0; }
  .partner > span { max-width: none; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .list td.c-amount { grid-column: 2; text-align: left; }
  .list td.c-status { grid-column: 3; grid-row: 2; justify-self: end; }
  .list td.c-req, .list td.c-check, .list td.c-sign { display: none; }
  .list td.c-age { grid-column: 2; font-size: 12.5px; }
  .list td.row-act { grid-column: 3; justify-self: end; }
  .list td.c-amount:empty { display: none; }
}

/* ---------- bulk bar ---------- */
.bulkbar { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 14px;
  background: var(--navy); color: #fff; box-shadow: var(--shadow-3); transform: translate(-50%, 0); transition: transform var(--duration-slow) var(--ease-smooth-out), opacity var(--duration-fast); }
@media (prefers-color-scheme: dark) { .bulkbar { background: #1c2740; } }
.bulkbar.closed { transform: translate(-50%, calc(100% + 40px)); opacity: 0; pointer-events: none; transition-duration: var(--duration-medium); }
.bulkbar span { font-weight: 600; margin-right: 6px; white-space: nowrap; }
.bulkbar .btn { border-color: rgb(255 255 255 / 0.18); background: rgb(255 255 255 / 0.08); color: #fff; }
.bulkbar .btn-primary { background: var(--blue); border-color: var(--blue); }
@media (hover: hover) { .bulkbar .btn:hover { background: rgb(255 255 255 / 0.16); } .bulkbar .btn-primary:hover { background: #2f74f0; } }

/* ---------- drawer (side panel; bottom sheet on phones) ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); transition: opacity var(--duration-slow) var(--ease-smooth-out); }
.scrim.closed { opacity: 0; pointer-events: none; transition-duration: var(--duration-medium); }
.drawer { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3);
  transition: transform var(--duration-slow) var(--ease-smooth-out); }
.drawer.closed { transform: translateX(104%); transition-duration: var(--duration-medium); pointer-events: none; }
@media (max-width: 760px) {
  .drawer { top: auto; left: 0; width: 100%; height: min(92dvh, 100%); border-left: 0; border-radius: 18px 18px 0 0; }
  .drawer.closed { transform: translateY(104%); }
  .drawer .grabber { display: block; }
}
.grabber { display: none; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; flex: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0 22px; }
.drawer-head .grow { flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px 22px 24px; }
.drawer-body > * { animation: rise var(--duration-slow) var(--ease-smooth-out) both; }
.drawer-body > *:nth-child(2) { animation-delay: calc(var(--duration-stagger) * 1); }
.drawer-body > *:nth-child(3) { animation-delay: calc(var(--duration-stagger) * 2); }
.drawer-body > *:nth-child(4) { animation-delay: calc(var(--duration-stagger) * 3); }
.drawer-body > *:nth-child(n+5) { animation-delay: calc(var(--duration-stagger) * 4); }
@keyframes rise { from { opacity: 0; transform: translateY(var(--distance-base)); } }
.drawer h2 { font-size: 22px; line-height: 1.2; font-weight: 800; margin: 6px 0 10px; }
.subject { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.subject svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--faint); }
.subject .btn { margin-left: auto; flex: none; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin: 20px 0 22px; }
.facts dt { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.facts dd { margin: 0; font-weight: 500; }
.section-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.steps { list-style: none; margin: 0 0 24px; padding: 0; }
.steps li { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding-bottom: 16px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: ''; position: absolute; left: 12px; top: 26px; bottom: 2px; width: 2px; background: var(--line); border-radius: 1px; }
.steps li:last-child::before { display: none; }
.steps li.done::before { background: var(--green); }
.steps .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); background: var(--surface); }
.steps .dot svg { width: 14px; height: 14px; }
.steps li.done .dot { border-color: var(--green); background: var(--green); color: #fff; }
.steps li.now .dot { border-color: var(--blue); }
.steps li.now .dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: pulse 1.6s var(--ease-in-out) infinite; }
@keyframes pulse { 50% { transform: scale(0.6); opacity: 0.5; } }
.steps b { display: block; font-size: 14px; }
.steps span { color: var(--muted); font-size: 13px; }
.callout { padding: 12px 14px; border-radius: 10px; background: var(--red-soft); color: var(--ink); margin-bottom: 22px; border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); }
.callout b { color: var(--red); display: block; margin-bottom: 4px; font-size: 13px; }
.callout p { margin: 0 0 10px; white-space: pre-wrap; }
.callout form { display: grid; gap: 8px; }
.note { white-space: pre-wrap; margin: 0 0 22px; color: var(--ink-2); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.feed li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
.feed .line { font-size: 13px; color: var(--ink-2); }
.feed .line b { color: var(--ink); font-weight: 600; }
.feed time { color: var(--faint); font-size: 12px; margin-left: 4px; }
.feed .bubble { margin-top: 5px; padding: 8px 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 10px 10px 10px; white-space: pre-wrap; font-size: 13.5px; color: var(--ink); }
.comment-box { display: flex; gap: 8px; margin-top: 16px; }
.comment-box textarea { min-height: 42px; height: 42px; }
.drawer-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.drawer-foot .btn-primary { flex: 1; min-height: 44px; font-size: 14.5px; }
.drawer-foot .btn { min-height: 44px; }

/* ---------- dialogs ---------- */
dialog { padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: hidden;
  opacity: 0; transform: scale(var(--scale-large)); transition: opacity var(--duration-quick) var(--ease-smooth-out), transform var(--duration-quick) var(--ease-smooth-out), overlay var(--duration-quick) allow-discrete, display var(--duration-quick) allow-discrete; }
dialog[open] { opacity: 1; transform: none; transition-duration: var(--duration-fast); }
@starting-style { dialog[open] { opacity: 0; transform: scale(var(--scale-large)); } }
dialog::backdrop { background: var(--scrim); opacity: 0; transition: opacity var(--duration-fast), overlay var(--duration-fast) allow-discrete, display var(--duration-fast) allow-discrete; }
dialog[open]::backdrop { opacity: 1; }
@starting-style { dialog[open]::backdrop { opacity: 0; } }
dialog.wide { width: min(880px, calc(100vw - 32px)); }
.dlg { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px 22px; }
.dlg-head h2 { font-size: 19px; font-weight: 800; flex: 1; }
.dlg-body { padding: 10px 22px 6px; overflow-y: auto; display: grid; gap: 16px; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 16px 22px 20px; }
.dlg-foot .form-error { flex: 1; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.byline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  dialog, dialog.wide { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; transform: translateY(24px); }
  @starting-style { dialog[open] { opacity: 0; transform: translateY(24px); } }
  .dlg-foot { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .dlg-foot .btn { flex: 1; min-height: 44px; }
}

/* Squarespace reference details in the add form */
.ref { border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line)); background: color-mix(in srgb, var(--blue-soft) 55%, var(--surface)); border-radius: 12px; padding: 0; }
.ref summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink); list-style: none; }
.ref summary::-webkit-details-marker { display: none; }
.ref summary svg { width: 16px; height: 16px; color: var(--blue); flex: none; }
.ref summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg); transition: transform var(--duration-fast) var(--ease-smooth-out); }
.ref[open] summary::after { transform: rotate(-135deg); }
.ref > p { margin: -4px 14px 8px; color: var(--muted); font-size: 12.5px; }
.ref dl { margin: 0; padding: 0 8px 8px 14px; display: grid; gap: 2px; }
.ref dl > div { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 8px; }
.ref dt { color: var(--muted); font-size: 12.5px; }
.ref dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.ref dd .btn { width: 30px; min-height: 30px; flex: none; }
.ref dd .btn.copied { color: var(--green); }
@media (max-width: 560px) { .ref dl > div { grid-template-columns: 1fr; gap: 0; padding: 4px 0; } }
.help-link { font-weight: 600; }
@media (max-width: 760px) { .help-link { display: none; } }

/* guide page */
.guide { max-width: 760px; margin: 0 auto; padding: 28px max(20px, env(safe-area-inset-right)) 56px max(20px, env(safe-area-inset-left)); }
.guide h1 { font-size: 34px; font-weight: 800; line-height: 1.1; }
.guide h2 { font-size: 20px; font-weight: 800; margin: 0 0 12px; }
.guide section { padding: 28px 0 8px; border-top: 1px solid var(--line); margin-top: 24px; scroll-margin-top: 100px; }
.guide p { color: var(--ink-2); line-height: 1.6; margin: 0 0 12px; font-size: 14.5px; }
.guide-lead { font-size: 16px !important; color: var(--ink-2); margin-top: 10px !important; max-width: 60ch; }
.you { display: inline-block; padding: 6px 12px; border-radius: 8px; background: var(--blue-soft); color: var(--blue-ink) !important; font-weight: 600; font-size: 13.5px !important; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.guide-toc a { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 13px; transition: border-color var(--duration-quick), color var(--duration-quick); }
@media (hover: hover) { .guide-toc a:hover { border-color: var(--blue); color: var(--blue-ink); } }
.flow { list-style: none; counter-reset: step; margin: 6px 0 14px; padding: 0; display: grid; gap: 10px; }
.flow li { counter-increment: step; position: relative; display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.flow li::before { content: counter(step); grid-row: 1 / span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; font-family: var(--font-head); }
@media (prefers-color-scheme: dark) { .flow li::before { color: #0a0f1a; } }
.flow b { font-family: var(--font-head); font-size: 15px; align-self: center; }
.flow span { grid-column: 2 / 4; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.flow em { grid-column: 3; grid-row: 1; font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); align-self: center; white-space: nowrap; }
.note-line { font-size: 13.5px !important; color: var(--muted) !important; }
.times { display: grid; gap: 0; margin: 6px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.times > div { display: grid; grid-template-columns: 64px 110px 1fr; gap: 12px; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.times > div:last-child { border-bottom: 0; }
.times time { font-family: var(--font-head); font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.times b { font-weight: 600; }
.times span { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
@media (max-width: 560px) { .times > div { grid-template-columns: 56px 1fr; } .times span { grid-column: 1 / -1; } .flow li { grid-template-columns: 34px 1fr; } .flow em { grid-column: 2; grid-row: auto; } .flow span { grid-column: 2; } }
.ref-static { padding-top: 10px; }
.roles-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .roles-grid { grid-template-columns: 1fr; } }
.roles-grid > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color var(--duration-fast); }
.roles-grid > div.mine { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent); }
.roles-grid b { display: block; font-family: var(--font-head); margin-bottom: 4px; }
.roles-grid span { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.guide details { border-bottom: 1px solid var(--line); }
.guide details summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.guide details summary::-webkit-details-marker { display: none; }
.guide details summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 18px; line-height: 1; transition: transform var(--duration-fast) var(--ease-smooth-out); }
.guide details[open] summary::after { transform: rotate(45deg); }
.guide details p { margin-top: -4px; }

/* partner picker */
.combo-list { list-style: none; margin: 0; padding: 4px; max-height: 232px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-2);
  animation: rise var(--duration-fast) var(--ease-smooth-out); }
.combo-list li { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.combo-list li b { color: var(--ink); font-weight: 700; }
.combo-list li[aria-selected="true"] { background: var(--blue-soft); color: var(--ink); }
.combo-list li.none { color: var(--muted); cursor: default; }
.money-row { grid-template-columns: 140px 1fr; }
@media (max-width: 560px) { .money-row { grid-template-columns: 120px 1fr; } }
.dlg-head .grow { flex: 1; min-width: 0; }
.dlg-head .byline { margin-top: 6px; }
.input[aria-invalid="true"] { border-color: var(--red); }

/* people */
.people-add { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 8px; align-items: end; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 640px) { .people-add { grid-template-columns: 1fr; } }
.people { width: 100%; border-collapse: collapse; }
.people th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.people th.c, .people td.c { text-align: center; }
.people td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.people td .em { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.people tr.inactive td:not(:last-child) { opacity: 0.45; }
@media (max-width: 640px) { .people .em-col { display: none; } }
.people .na { color: var(--faint); }
.switch { position: relative; display: inline-block; width: 36px; height: 22px; vertical-align: middle; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 11px; background: var(--line-strong); transition: background-color var(--duration-fast) var(--ease-smooth-out); }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform var(--duration-fast) var(--ease-smooth-out); }
.switch input:checked + i { background: var(--blue); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }

/* activity log */
.dlg-head a.btn { text-decoration: none; }
.log-tools { display: flex; gap: 8px; padding: 6px 22px 10px; flex-wrap: wrap; }
.log-tools .search { flex: 1; min-width: 200px; width: auto; }
.log-tools select { width: auto; min-height: 38px; }
.log-body { gap: 0; padding-bottom: 22px; min-height: 320px; }
.log-day { font-size: 13px; font-weight: 700; color: var(--muted); padding: 14px 0 6px; position: sticky; top: -10px; background: var(--surface); z-index: 1; border-bottom: 1px solid var(--line); }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-item { display: grid; grid-template-columns: 44px 24px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); animation: rise var(--duration-fast) var(--ease-smooth-out) both; }
.log-item time { color: var(--faint); font-size: 12px; padding-top: 3px; font-variant-numeric: tabular-nums; }
.log-text { font-size: 13.5px; color: var(--ink-2); min-width: 0; }
.log-text b { color: var(--ink); font-weight: 600; }
.log-extra { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.log-ref { display: inline; border: 0; background: var(--blue-soft); color: var(--blue-ink); font-weight: 600; font-size: 12.5px; padding: 1px 7px; border-radius: 6px; margin-left: 2px; }
.log-ref.gone { background: var(--surface-2); color: var(--faint); text-decoration: line-through; }
.avatar.sys { background: var(--blue-soft); color: var(--blue-ink); }
.avatar.sys svg { width: 13px; height: 13px; }
.a-signed .avatar, .a-checked .avatar { box-shadow: 0 0 0 2px var(--green-soft); }
.log-more { display: flex; justify-content: center; padding-top: 14px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); font-weight: 500; font-size: 13.5px;
  transition: opacity var(--duration-fast) var(--ease-smooth-out), transform var(--duration-fast) var(--ease-smooth-out); }
.toast.enter { opacity: 0; transform: translateY(var(--distance-base)) scale(var(--scale-medium)); }
.toast.leave { opacity: 0; transform: translateY(var(--distance-micro)); transition-duration: var(--duration-medium); }
.toast svg { width: 16px; height: 16px; color: var(--green); flex: none; }
.toast.err svg { color: var(--red); }
.toast button { border: 0; background: color-mix(in srgb, var(--bg) 16%, transparent); color: var(--bg); font-weight: 600; font-size: 13px; padding: 6px 10px; border-radius: 8px; }
body.bulk-open .toasts { bottom: max(84px, calc(env(safe-area-inset-bottom) + 64px)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .steps li.now .dot::after { animation: none; }
}
