:root {
  --bg: #0d0d10;
  --panel: #17171c;
  --panel-2: #202027;
  --line: #2c2c35;
  --text: #f3f3f5;
  --muted: #9a9aa6;
  --accent: #c6ff3d;
  --accent-ink: #111;
  --ok: #3ddc84;
  --warn: #ffb547;
  --err: #ff5d5d;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
main { max-width: 640px; margin: 0 auto; padding: 8px 16px 24px; }
a { color: var(--accent); }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 12px 0 4px; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 28px 0 10px; }
h2.creators-heading { font-size: 22px; color: var(--text); text-align: center; }
p.sub { color: var(--muted); margin: 0 0 16px; }
.muted { color: var(--muted); font-style: italic; font-weight: 400; }

.top { position: sticky; top: 0; z-index: 5; background: rgba(13,13,16,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 0; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.catchphrase { font-size: 12.5px; font-weight: 600; color: var(--accent); letter-spacing: .01em; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spacer { flex: 1; }

label { display: block; font-size: 12px; color: var(--accent); margin: 10px 0 4px; }
input, textarea, select { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-size: 16px; }
input[type="date"] { -webkit-appearance: none; appearance: none; text-align: left; }
/* Native date inputs ignore placeholder and always show their own "mm/dd/yyyy" hint, so we
   show our own styled text underneath and make the real input invisible-but-tappable on top —
   taps still hit the native input directly, so the OS picker opens normally everywhere. */
.date-field { position: relative; }
.date-display { padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 16px; }
.date-field input[type="date"] { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { min-height: 70px; resize: vertical; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger { color: var(--err); }

.creator { position: relative; }
.creator .x { position: absolute; top: 10px; right: 10px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 10px; }

.total { display: flex; justify-content: space-between; padding: 12px 16px; border-radius: 12px; background: var(--panel-2); margin: 8px 0; font-weight: 600; }
.total.good { color: var(--ok); }
.total.bad { color: var(--warn); }

.bar { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin: 10px 0 4px; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }

.person { display: flex; gap: 12px; align-items: center; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--panel-2); flex: none; }
.person.signed .avatar { background: var(--ok); color: #062; }
.person .meta { flex: 1; min-width: 0; }
.person .name { font-weight: 600; }
.person .small { font-size: 13px; color: var(--muted); }
.pct { font-weight: 800; font-size: 20px; text-align: right; }
.pct small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--panel-2); color: var(--muted); }
.badge.ok { background: rgba(61,220,132,.15); color: var(--ok); }
.badge.you { background: rgba(198,255,61,.15); color: var(--accent); }

.done { text-align: center; padding: 28px 16px; border-color: var(--ok); }
.done .big { font-size: 48px; }

.list a { display: flex; justify-content: space-between; color: var(--text); text-decoration: none; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list a:last-child { border: 0; }

.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--panel); width: 100%; max-width: 640px; max-height: 94vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal { align-items: center; } .sheet { border-radius: 20px; } }

.terms { width: 100%; border-collapse: collapse; font-size: 14px; }
.terms td, .terms th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.terms td.n, .terms th.n { text-align: right; }
.terms tr.me td { color: var(--accent); font-weight: 600; }

.table-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }
tr.admin-user.clickable { cursor: pointer; }
tr.admin-user.clickable:hover td { background: var(--panel-2); }
.admin-caret { display: inline-block; color: var(--muted); }
tr.admin-sheets td { white-space: normal; padding: 0; border-bottom: 1px solid var(--line); }
.admin-sheet-link { display: flex; justify-content: space-between; gap: 12px; padding: 8px 4px; text-decoration: none; color: var(--text); border-top: 1px solid var(--line); }
.admin-sheet-link:first-child { border-top: 0; }
.admin-sheet-link:hover { color: var(--accent); }

.pad-wrap { position: relative; background: #fff; border-radius: 12px; margin-top: 6px; touch-action: none; }
.pad-wrap canvas { display: block; width: 100%; height: 180px; border-radius: 12px; }
.pad-wrap .hint { position: absolute; left: 16px; bottom: 36px; right: 16px; border-bottom: 1px solid #bbb; color: #aaa; font-size: 12px; pointer-events: none; }
.pad-wrap .clear { position: absolute; top: 8px; right: 8px; background: #eee; color: #333; border: 0; }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; font-size: 14px; }
.check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--accent); }

.qr { background: #fff; border-radius: 16px; padding: 16px; width: 260px; margin: 16px auto; }
.qr img { display: block; width: 100%; }
.link { word-break: break-all; font-size: 12px; color: var(--muted); text-align: center; }

.errors { color: var(--err); font-size: 14px; margin: 10px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-weight: 600; z-index: 30; }
.sig-img { background: #fff; border-radius: 8px; height: 44px; margin-top: 8px; padding: 2px 6px; }
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: 36px; line-height: 1.1; }
.steps { color: var(--muted); padding-left: 18px; }
.steps li { margin: 6px 0; }
[hidden] { display: none !important; }
#nav { display: flex; align-items: center; gap: 12px; }
.navlink { color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
@media (max-width: 400px) {
  #nav { gap: 8px; }
  .navlink { font-size: 13px; }
  #nav .btn.sm { padding: 8px 10px; font-size: 12px; }
}
.list a { align-items: center; gap: 12px; }
.li-main { display: flex; flex-direction: column; min-width: 0; }
.li-main .small { color: var(--muted); font-size: 13px; }
.share-label { font-size: 12px; color: var(--muted); margin-top: 14px; }
.actions.share { margin-top: 6px; }
.actions.share .btn { flex: 1; }
.notice { border-color: var(--warn); }
.notice strong { color: var(--warn); }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.unlock { border-color: var(--accent); }
.foot { max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; text-align: center; font-size: 12px; color: var(--muted); }
.foot a { color: var(--muted); }
.legal { padding-bottom: 24px; line-height: 1.6; }
.legal h2 { text-transform: none; letter-spacing: 0; font-size: 17px; color: var(--text); margin: 28px 0 8px; }
.legal p, .legal li { color: #d6d6dc; }
.legal ul { padding-left: 20px; }
.legal li { margin: 6px 0; }
.legal-note { font-size: 12px; color: var(--muted); text-align: center; margin: 12px 0 0; }
.legal-note a { color: var(--muted); }
.wordmark { height: 24px; width: auto; display: block; }
.tm { font-size: 9px; font-weight: 600; margin-left: -7px; align-self: flex-start; margin-top: -2px; opacity: .8; }
.plan { margin-top: 16px; padding: 14px; border-radius: 14px; border: 1px solid var(--accent); background: rgba(198,255,61,.06); }
.plan .row > * { flex: none; }
.plan .row { justify-content: space-between; }
.plan-price { font-weight: 800; color: var(--accent); }
.member { margin-top: 20px; border-color: var(--accent); }
.member .row { justify-content: space-between; }
.member .row > strong { flex: none; }
.modes { display: grid; gap: 10px; margin: 12px 0 16px; }
.mode { text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.mode b { display: block; font-size: 16px; margin-bottom: 4px; }
.mode span { color: var(--muted); font-size: 13px; }
.mode.on { border-color: var(--accent); background: rgba(198,255,61,.07); }
.badge.warn { background: rgba(255,181,71,.15); color: var(--warn); }
.activity { list-style: none; padding: 6px 16px; }
.activity li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.activity li:last-child { border: 0; }
.activity time { color: var(--muted); font-size: 12px; flex: none; }
.activity .sys { color: var(--muted); font-style: italic; }
.notice-text { color: var(--warn); font-size: 13px; }
.status-top > .btn { flex: none; } .status-top > strong { flex: 1; font-size: 16px; }
.pdf-frame { width: 100%; height: 75vh; border: 0; border-radius: 12px; background: #fff; margin-top: 10px; }
.small { font-size: 12px; color: var(--muted); }
.audit-trail summary { cursor: pointer; list-style: none; }
.audit-trail summary::-webkit-details-marker { display: none; }
.audit-trail summary::before { content: "▸ "; color: var(--muted); }
.audit-trail[open] summary::before { content: "▾ "; }
.audit-list { list-style: none; padding: 0; margin: 4px 0 0; }
.audit-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.audit-list li:first-child { border-top: 0; }
