* [hidden] { display: none !important; }
:root { --ink: #1f2937; --mut: #6b7280; --acc: #059669; --line: #e5e7eb; --soft: #f6f7f9; }
* { box-sizing: border-box; margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: #fafafa; line-height: 1.6; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.top { border-bottom: 1px solid var(--line); background: #fff; }
.top .wrap { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.logo-mark { display: block; height: 28px; width: auto; flex: none; }
.tag { color: var(--mut); font-size: 13px; }
h1 { font-size: 30px; letter-spacing: -0.5px; margin: 34px 0 8px; }
h1 em { color: var(--acc); font-style: normal; }
.lede { color: var(--mut); font-size: 17px; margin-bottom: 22px; max-width: 660px; }
h2 { font-size: 19px; margin: 26px 0 10px; }
h3 { font-size: 15px; margin: 16px 0 6px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.tool { display: grid; grid-template-columns: 1fr 1.05fr; gap: 24px; padding: 22px; align-items: start; }
@media (max-width: 860px) { .tool { grid-template-columns: 1fr; } .logo-mark { height: 24px; } .tag { display: none; } }
label { display: block; font-size: 13px; font-weight: 600; color: var(--mut); margin-bottom: 10px; }
input[type=text], input[type=email], input[type=date], input[type=number], select, textarea {
  display: block; width: 100%; min-height: 40px; margin-top: 4px; padding: 9px 11px; font-size: 15px;
  font-family: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
textarea { min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #a7f3d0; outline-offset: 0; border-color: var(--acc); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > label { flex: 1 1 140px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 4px; }
legend { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); padding: 14px 0 6px; }
.item { display: grid; grid-template-columns: 1fr 62px 92px 30px; gap: 8px; margin-bottom: 8px; align-items: center; }
.item input { margin-top: 0; }
.item-remove { display: flex; align-items: center; justify-content: center; width: 30px; height: 40px; border: 0; border-radius: 8px; background: var(--soft); color: var(--mut); font-size: 16px; cursor: pointer; }
.item-remove:hover { background: #fee2e2; color: #b91c1c; }
.linkbtn { margin-top: 2px; padding: 8px 12px; font-size: 13.5px; font-weight: 600; color: var(--acc); background: #ecfdf5; border: 1px dashed #6ee7b7; border-radius: 8px; cursor: pointer; }
.btn { width: 100%; margin-top: 6px; padding: 12px; font-size: 16px; font-weight: 700; color: #fff; background: var(--acc); border: 0; border-radius: 9px; cursor: pointer; }
.btn:hover { background: #047857; }
.btn.sec { color: var(--ink); background: var(--soft); border: 1px solid var(--line); }
.btn.sec:hover { background: #eef0f3; }
.hint { font-size: 12.5px; color: var(--mut); margin-top: 8px; }
.warn { margin-top: 10px; padding: 10px 12px; font-size: 13px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 9px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
/* A4 preview */
.sheet { position: relative; padding: 26px 26px 18px; font-size: 12.5px; line-height: 1.5; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.sheet-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.sheet-head .biz { font-size: 17px; font-weight: 700; }
.sheet-head .biz small { display: block; font-size: 12px; font-weight: 400; color: var(--mut); white-space: pre-line; }
.sheet-head .meta { text-align: right; white-space: nowrap; }
.sheet-head .doc { font-size: 20px; font-weight: 700; letter-spacing: .08em; }
.sheet-head .meta small { display: block; color: var(--mut); font-size: 11.5px; }
.billto { margin: 12px 0; font-size: 12px; }
.billto b { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.billto span { white-space: pre-line; }
table.items { width: 100%; border-collapse: collapse; margin-top: 6px; }
table.items th { padding: 7px 6px; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: var(--ink); text-align: left; }
table.items th.num, table.items td.num { text-align: right; }
table.items td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.items td.desc { white-space: pre-line; }
.totals { width: 62%; margin: 12px 0 0 auto; font-size: 12.5px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .due { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 6px; font-weight: 700; font-size: 14px; }
.sheet-note { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: #374151; white-space: pre-line; }
.sheet-foot { margin-top: 12px; font-size: 10px; color: #9ca3af; text-align: center; }
.info { margin: 34px 0; }
.info p, .info li { color: #374151; margin-bottom: 10px; }
.info ol, .info ul { padding-left: 20px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 12px 0 6px; }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr; } }
.steps div { padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.steps b { display: block; margin-bottom: 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 12px 0; }
.cards a { display: block; padding: 13px 15px; color: var(--ink); text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 14.5px; font-weight: 600; }
.cards a:hover { border-color: var(--acc); }
.cards a small { display: block; margin-top: 3px; font-weight: 400; color: var(--mut); font-size: 12.5px; }
dl.faq { margin: 10px 0; }
dl.faq dt { font-weight: 700; margin-top: 14px; }
dl.faq dd { color: #374151; margin: 2px 0 0; }
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 18px 20px 30px; color: var(--mut); font-size: 13px; }
.foot a { color: var(--acc); }
.crumb { margin-top: 20px; font-size: 13px; color: var(--mut); }
.crumb a { color: var(--acc); text-decoration: none; }
.note-box { margin: 14px 0; padding: 12px 14px; font-size: 13.5px; color: #374151; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; }
@media print {
  body { background: #fff; }
  .top, .foot, .info, form, .actions, .crumb, h1, .lede, .note-box, .cards, .no-print { display: none !important; }
  .tool { display: block; padding: 0; border: 0; box-shadow: none; }
  .sheet { border: 0; border-radius: 0; padding: 0; font-size: 12pt; }
  @page { size: A4; margin: 14mm; }
}
