body{font-family:system-ui,sans-serif;margin:0;background:#f6f6f3;color:#1d1d1b;line-height:1.5}
main{max-width:860px;margin:0 auto;padding:24px 16px}
h1{font-size:1.6rem;margin-bottom:.3rem}
h2{font-size:1.2rem;margin-top:1.6rem}
.lede{margin-top:0}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
label{display:flex;flex-direction:column;font-size:.9rem;gap:4px}
input,textarea,select{padding:8px;font-size:1rem;border:1px solid #bbb;border-radius:6px;font-family:inherit;background:#fff}
textarea{min-height:76px}
.actions{margin:16px 0;display:flex;gap:8px;flex-wrap:wrap}
button{padding:9px 16px;font-size:1rem;border:0;border-radius:6px;background:#1d4f91;color:#fff;cursor:pointer}
button.secondary{background:#e2e2dc;color:#1d1d1b}
.status{min-height:1.5em}
.status.error{color:#a11d1d}
table{border-collapse:collapse;width:100%}
th,td{text-align:left;padding:6px 8px;border-bottom:1px solid #ddd}
th{font-weight:600}
td.num,th.num{text-align:right}
.hint{font-size:.85rem;color:#555}
.rules{margin-top:24px}
.items input{width:100%;box-sizing:border-box}
.items td{padding:4px}
.sheet{background:#fff;border:1px solid #ccc;border-radius:6px;padding:24px;margin-top:16px}
.sheet h2{margin-top:0;font-size:1.5rem;letter-spacing:.05em}
.sheet pre{white-space:pre-wrap;font-family:inherit;margin:4px 0 12px}
.meta{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.totals{margin-left:auto;width:min(320px,100%)}
.totals td{border:0}
.totals tr.grand td{font-weight:700;border-top:2px solid #1d1d1b;font-size:1.1rem}
details{margin:10px 0}
@media print{
  body{background:#fff}
  .no-print{display:none !important}
  .sheet{border:0;padding:0;margin:0}
  main{max-width:none;padding:0}
}

pre{background:#fff;border:1px solid #ccc;border-radius:6px;padding:12px;white-space:pre-wrap;font-size:.85rem}
