:root{--ink:#1d2125;--mut:#5b636b;--line:#d5dbe0;--bg:#f5f7f9;--card:#fff;--brand:#1b2a6b;--brand2:#2f45a8;--ok:#1f7a45;--okbg:#e5f4ea;--need:#8a5a00;--needbg:#fff1d6;--err:#b3261e;--errbg:#fdeceb}
*{box-sizing:border-box}
body{margin:0;font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:var(--ink);background:var(--bg)}
h1{font-size:1.5rem;margin:.2em 0}h2{font-size:1.25rem;margin:.2em 0}h3{font-size:1.05rem;margin:0}
.muted{color:var(--mut)}.small{font-size:.85rem}
.logo{max-width:260px;height:auto;display:block;margin:0 auto 12px}.logo.small{height:40px;width:auto;margin:0}
.auth{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:16px}
.auth-card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:24px;width:100%;max-width:420px;display:flex;flex-direction:column;gap:12px}
.auth-card h1,.auth-card>p{text-align:center;margin:0}
label{display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:.92rem}
input,textarea{font:inherit;padding:12px;border:1px solid #9aa5ad;border-radius:8px;background:#fff;width:100%}
input:focus,textarea:focus,button:focus-visible{outline:3px solid #9db1ff;outline-offset:1px}
.pw{display:flex;gap:6px}.pw input{flex:1}.eye{border:1px solid var(--line);background:#fff;border-radius:8px;padding:0 12px;cursor:pointer}
.hint{font-size:.82rem;color:var(--mut);margin-top:-6px}
.note{background:#eef2ff;border-radius:8px;padding:10px;font-size:.9rem}
.error{background:var(--errbg);color:var(--err);padding:10px;border-radius:8px;font-size:.92rem}
.ok{background:var(--okbg);color:var(--ok);padding:10px;border-radius:8px;font-size:.92rem}
button{font:inherit;cursor:pointer}
button:disabled{opacity:.5;cursor:not-allowed}
.primary{background:var(--brand);color:#fff;border:0;border-radius:8px;padding:10px 18px;font-weight:600}
.primary:hover:not(:disabled){background:var(--brand2)}
.big{padding:14px 18px;font-size:1.05rem}
.outline{background:#fff;color:var(--brand);border:1.5px solid var(--brand);border-radius:8px;padding:9px 16px;font-weight:600}
.linkbtn{display:inline-block;text-decoration:none}
.ghost{background:none;border:1px solid var(--line);border-radius:8px;padding:6px 12px}
.link{background:none;border:0;color:var(--brand);text-decoration:underline;padding:6px}
.mini{font-size:.78rem;padding:3px 8px;border:1px solid var(--brand);color:var(--brand);background:#fff;border-radius:6px}
.top{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5}
.who{display:flex;gap:10px;align-items:center;font-weight:600}
.wrap{max-width:1000px;margin:0 auto;padding:16px}
.hero{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px;margin-bottom:16px}
.bar{height:12px;background:#e3e8ec;border-radius:8px;overflow:hidden;margin:10px 0}.bar.sm{height:8px;margin:4px 0}
.fill{height:100%;background:var(--ok)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:12px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:8px}
.card.done{border-color:#9fd2b3}
.card-h{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}
.card p{margin:0}.star{color:#c28a00}
.pill{font-size:.75rem;font-weight:700;padding:3px 9px;border-radius:99px;white-space:nowrap}
.pill.ok{background:var(--okbg);color:var(--ok)}.pill.need{background:var(--needbg);color:var(--need)}.pill.wait{background:#e8ecf0;color:var(--mut)}
.file{font-size:.85rem;background:#f1f4f6;border-radius:6px;padding:6px 8px;word-break:break-all}
.refs{display:flex;flex-direction:column;font-size:.85rem}
.row{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto}
.final{text-align:center;padding:24px 0;display:flex;flex-direction:column;gap:8px;align-items:center}
.overlay{position:fixed;inset:0;background:rgba(15,20,30,.55);display:flex;align-items:flex-end;justify-content:center;z-index:20}
@media(min-width:700px){.overlay{align-items:center}}
.modal,.dialog{background:#fff;border-radius:14px 14px 0 0;width:100%;max-width:680px;max-height:92vh;display:flex;flex-direction:column}
.dialog{padding:20px;border-radius:14px;max-width:440px;margin:16px}
@media(min-width:700px){.modal{border-radius:14px}}
.modal-body{padding:18px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}
.sticky{padding:12px 18px;border-top:1px solid var(--line);margin:0;justify-content:flex-end}
.picks{display:flex;gap:10px;flex-wrap:wrap}
.drop{flex:1;min-width:200px;border:2px dashed #9aa5ad;background:#fafbfc;border-radius:10px;padding:22px 12px;color:var(--brand);font-weight:600;word-break:break-all}
.drop.has{border-style:solid;border-color:var(--ok);color:var(--ok)}
.or{text-align:center;color:var(--mut)}
.list{display:flex;flex-direction:column;gap:6px}.li{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:8px;border:1px solid var(--line);border-radius:8px;word-break:break-all}
.big-in{font-size:1.2rem;letter-spacing:.04em}
.sec{display:flex;flex-direction:column;gap:12px}.sech{border-bottom:2px solid var(--ink);padding-bottom:4px;margin-top:8px}
.fl{font-weight:600;font-size:.92rem}
.chips{display:flex;gap:8px;flex-wrap:wrap}.chips.two .chip{flex:1}
.chip{border:1.5px solid #9aa5ad;background:#fff;border-radius:99px;padding:9px 16px;font-weight:600}
.chip.on{background:var(--brand);border-color:var(--brand);color:#fff}
.chk{flex-direction:row;gap:10px;align-items:flex-start;font-weight:500}.chk input{width:22px;height:22px;flex:none}
.readbox{border:1px solid var(--line);background:#fafbfc;border-radius:8px;padding:12px;max-height:240px;overflow-y:auto;white-space:pre-wrap;font-size:.92rem}
.sigwrap{position:relative;border:1.5px solid #9aa5ad;border-radius:8px;background:#fff}
#sigpad{width:100%;height:150px;display:block}
.sig-hint{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#9aa5ad;pointer-events:none}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 18px;border-radius:8px;z-index:30}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:12px}
.stat{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;flex-direction:column}.stat b{font-size:1.6rem}.stat span{font-size:.82rem;color:var(--mut)}
.panel{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px;margin:16px 0;display:flex;flex-direction:column;gap:10px}
.tablewrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:.9rem}th,td{text-align:left;padding:8px;border-bottom:1px solid var(--line);vertical-align:top}
.refpage{max-width:680px;margin:0 auto;padding:16px;display:flex;flex-direction:column;gap:12px}
.refpage .box{background:#fff;border:1px solid var(--line);border-radius:14px;padding:18px;display:flex;flex-direction:column;gap:12px}
.ghost{white-space:nowrap}.who span{text-align:right}

.group{margin:20px 0}.group-h{display:flex;justify-content:space-between;align-items:baseline;border-bottom:2px solid var(--ink);padding-bottom:6px;margin-bottom:10px}
.list-rows{display:flex;flex-direction:column;gap:8px}
.item{display:flex;gap:12px;align-items:center;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px 14px}
.item.done{border-color:#9fd2b3;background:#fbfefc}
.tick{flex:none;width:28px;height:28px;border-radius:50%;border:2px solid #b8c1c8;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700}
.item.done .tick{background:var(--ok);border-color:var(--ok)}
.item-main{flex:1;min-width:0}.item-main p{margin:2px 0 0;font-size:.9rem}
.item-act{display:flex;flex-direction:column;align-items:flex-end;gap:6px;flex:none}
.item-act .row{margin:0;justify-content:flex-end}
.nextbox{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#eef2ff;border-radius:10px;padding:12px 14px;margin-top:12px}
@media(max-width:640px){.item{flex-wrap:wrap}.item-act{flex-direction:row;align-items:center;width:100%;justify-content:space-between}.item-main{flex-basis:calc(100% - 44px)}}

/* repeating groups, yes/no lists, pick chips */
.rows { display: grid; gap: 12px; margin: 8px 0 14px; }
.rowcard { border: 1px solid var(--line, #d9dee3); border-radius: 12px; padding: 12px; display: grid; gap: 8px; background: #fbfcfd; }
.rowhead { display: flex; justify-content: space-between; align-items: center; }
.ynl { display: grid; gap: 0; margin: 6px 0 14px; border: 1px solid var(--line, #d9dee3); border-radius: 12px; overflow: hidden; }
.ynrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line, #e6eaee); }
.ynrow:last-child { border-bottom: 0; }
.ynrow:nth-child(even) { background: #f6f8fa; }
.ynrow > span:first-child { flex: 1; min-width: 0; }
.ynrow .chips { flex: none; margin: 0; }
.calc { background: #eef6f0; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.mini.danger { color: #a3261c; border-color: #e3b5b0; }
td.acts { white-space: nowrap; }
@media (max-width: 520px) { .ynrow { flex-direction: column; align-items: flex-start; } }

/* collapsible groups */
.group-h.gtoggle { width: 100%; background: none; border: 0; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.group-h.gtoggle h2 { margin: 0; font-size: 1.05rem; }
.group-h.gtoggle .muted { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.chev { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; margin-left: 4px; }
.group.open .chev { transform: rotate(-135deg); }
.group { margin: 10px 0; border: 1px solid #d9dee3; border-radius: 14px; background: #fff; overflow: hidden; }
.group-h.gtoggle { border-bottom: 0; margin-bottom: 0; }
.group.open .group-h.gtoggle { border-bottom: 1px solid #e3e7eb; }
.group .list-rows { padding: 8px 10px 12px; }

.rules { background: #f3f6fb; border: 1px solid #dbe3ef; border-radius: 12px; padding: 10px 14px; margin: 10px 0 14px; font-size: .92rem; }
.rules ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 3px; }

/* grouped sections: new look */
.group { border: 1px solid #d5dbe3; border-left: 6px solid #9fb0c7; border-radius: 16px; background: #fff; box-shadow: 0 1px 3px rgba(20,30,60,.06); margin: 14px 0; overflow: hidden; }
.group.started { border-left-color: #e0a526; }
.group.complete { border-color: #86c79a; border-left-color: #1f8f4a; background: #eef8f1; }
.group-h.gtoggle { gap: 14px; padding: 16px 18px; }
.group.open .group-h.gtoggle { border-bottom: 1px solid rgba(0,0,0,.08); }
.gring { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; color: #1b2a6b; background: conic-gradient(#1b2a6b calc(var(--p) * 1%), #e2e7ee 0); position: relative; }
.gring::before { content: ""; position: absolute; inset: 5px; background: #fff; border-radius: 50%; z-index: -1; }
.gring { isolation: isolate; }

.group.started .gring { background: conic-gradient(#e0a526 calc(var(--p) * 1%), #e2e7ee 0); color: #8a5d00; }
.group.complete .gring { background: #1f8f4a; color: #fff; font-size: 1.3rem; }
.group.complete .gring::before { display: none; }
.gring { text-indent: 0; }
.gtext { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: left; }
.gtext h2 { margin: 0; font-size: 1.08rem; }
.gsub { font-size: .88rem; color: #5b6572; }
.group.complete .gsub { color: #17703a; font-weight: 600; }
.gcount { display: flex; align-items: center; gap: 8px; color: #5b6572; font-weight: 600; white-space: nowrap; }
.group.complete .gcount { color: #17703a; }
.group.complete .list-rows .item { background: #fff; }

.sys { display: grid; gap: 4px; padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; border: 1px solid; }
.sys.good { background: #eef8f1; border-color: #86c79a; color: #17703a; }
.sys.bad { background: #fdecea; border-color: #e3a29b; color: #8f1f15; }
.sys.wait { background: #f3f6fb; border-color: #dbe3ef; color: #3c4756; }
.sys .mini { justify-self: start; }

.warnbox{background:#fff7e0;border:1px solid #e0a526;border-radius:10px;padding:10px 14px;margin:12px 0;color:#5c3d00;text-align:left}.warnbox ul{margin:6px 0 6px 18px;padding:0}.warnbox p{margin:6px 0 0;font-size:.92rem}
.top{gap:8px}.top>*{min-width:0}.who{flex:0 1 auto;min-width:0}.who span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:42vw}
@media (max-width:420px){.top{padding:10px 12px}.top img,.top .logo{max-width:46vw;height:auto}}
