:root { --ink: #16202c; --mut: #5b6675; --line: #dfe3e8; --bg: #f5f6f8; --card: #fff; --acc: #0b6e4f; --acc2: #e8f4ef; --bad: #b42318; --badbg: #fdecea; --warn: #8a5a00; --r: 10px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--acc); }
.top { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand a { color: var(--ink); font-weight: 700; text-decoration: none; }
.langs button { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 4px 9px; margin-left: 2px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; }
.langs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tier { font-size: 13px; color: var(--mut); }
.tier.pro { color: var(--acc); font-weight: 600; }
.hero { max-width: 1180px; margin: 0 auto; padding: 22px 20px 8px; }
.hero h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
.hero .sub { margin: 0 0 12px; color: var(--mut); }
.better { margin: 0 0 14px; padding-left: 20px; max-width: 1000px; }
.better li { margin: 4px 0; }
.better li.monthly { color: var(--mut); font-size: 14px; }
.cta { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.btn, button { display: inline-block; font: inherit; font-size: 14px; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--acc); background: var(--acc); color: #fff; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn.ghost, button.ghost { background: #fff; color: var(--acc); }
.btn.buy { font-weight: 600; }
button.small, .btn.small { padding: 5px 9px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
.free { color: var(--mut); font-size: 14px; margin: 6px 0 0; }
.app { max-width: 1180px; margin: 10px auto; padding: 0 20px; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button { background: transparent; color: var(--mut); border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 10px 12px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--acc); font-weight: 600; }
.panel { background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); padding: 16px; }
.deskbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: #fff; color: var(--ink); }
.seg button.on { background: var(--ink); color: #fff; }
.inl { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.muted { color: var(--mut); font-size: 13px; }
.deskgrid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
@media (max-width: 920px) { .deskgrid { grid-template-columns: 1fr; } .previewcol { order: -1; } }
.form fieldset { border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 12px; padding: 8px 12px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.form legend { font-weight: 600; padding: 0 4px; }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--mut); }
.form label.wide, .form fieldset.lines { grid-column: 1 / -1; }
.form label.chk { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); }
input, select, textarea { font: inherit; font-size: 14px; color: var(--ink); padding: 7px 8px; border: 1px solid #cfd5dc; border-radius: 7px; background: #fff; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; }
.form fieldset.lines { display: block; }
#linesT { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
#linesT th { font-size: 12px; color: var(--mut); text-align: left; font-weight: 500; padding: 2px 3px; }
#linesT td { padding: 2px 3px; }
#linesT td:nth-child(1) { width: 44%; }
#linesT td:nth-child(2), #linesT td:nth-child(3) { width: 11%; }
#linesT td:nth-child(4) { width: 16%; }
#linesT td:nth-child(5) { width: 10%; }
button.x { background: #fff; color: var(--mut); border-color: var(--line); padding: 4px 9px; }
.previewcol { position: sticky; top: 8px; }
.result { background: var(--acc2); border: 1px solid #bfe0d2; border-radius: var(--r); padding: 10px 14px; margin-bottom: 10px; }
.result .big { font-size: 28px; font-weight: 700; line-height: 1.1; }
.result .what { font-weight: 600; }
.result .tr { font-size: 13px; color: #1d4d3c; margin-top: 4px; }
.paperwrap { background: #e9ecef; border-radius: var(--r); padding: 12px; }
.paper { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); padding: 28px 30px; font-size: 12.5px; color: #111; min-height: 300px; }
.pp-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 12px; }
.pp-title { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.pp-meta th { text-align: left; font-weight: 500; color: #555; padding: 0 10px 0 0; }
.pp-meta td { text-align: right; }
.pp-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.pp-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #666; margin-bottom: 2px; }
.pp-items { width: 100%; border-collapse: collapse; margin: 8px 0; }
.pp-items th { border-bottom: 1px solid #111; text-align: left; font-weight: 600; padding: 4px 4px; }
.pp-items td { border-bottom: 1px solid #e3e3e3; padding: 4px 4px; vertical-align: top; }
.pp-items .n, .pp-totals td { text-align: right; white-space: nowrap; }
.pp-items tr.off td { color: #999; text-decoration: line-through; }
.pp-items em { color: #777; font-style: normal; font-size: 11px; }
.pp-totals { margin-left: auto; border-collapse: collapse; min-width: 58%; }
.pp-totals th { text-align: left; font-weight: 500; padding: 2px 12px 2px 0; }
.pp-totals tr.sub th, .pp-totals tr.sub td { color: #666; font-size: 11.5px; }
.pp-totals tr.tot th, .pp-totals tr.tot td { border-top: 1px solid #111; font-weight: 600; }
.pp-totals tr.pay th, .pp-totals tr.pay td { border-top: 2px solid #111; font-size: 14px; font-weight: 700; padding-top: 4px; }
.pp-note { font-size: 11.5px; color: #333; margin: 6px 0; }
.pp-pay { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #ddd; margin-top: 12px; padding-top: 10px; }
.pp-qr { width: 110px; text-align: center; flex: 0 0 110px; }
.pp-qr svg { width: 104px; height: 104px; }
.pp-qrl { font-size: 10px; color: #555; }
.pp-pix code { display: block; font-size: 9.5px; word-break: break-all; background: #f6f6f6; padding: 4px; margin-top: 3px; }
.pp-clauses { padding-left: 18px; margin: 0 0 10px; }
.pp-clauses li { margin: 4px 0; }
.pp-rec { font-size: 11.5px; background: #f1f8f4; border-left: 3px solid var(--acc); padding: 5px 8px; }
.pp-hash { font-family: ui-monospace, Menlo, monospace; font-size: 9.5px; word-break: break-all; color: #444; }
.pp-sig { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
.pp-sig div { border-top: 1px solid #111; padding-top: 4px; min-height: 30px; }
.pp-sig span { display: block; font-size: 10.5px; color: #666; }
.pp-foot { margin-top: 18px; font-size: 9.5px; color: #999; text-align: center; }
.checks { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin-top: 10px; }
.checks h3 { font-size: 14px; margin: 0 0 6px; }
.checks ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 14px; }
@media (max-width: 600px) { .checks ul { columns: 1; } }
.checks li { font-size: 13px; padding: 1px 0; break-inside: avoid; cursor: pointer; }
.checks li.ok { color: #1b6e46; }
.checks li.bad { color: var(--bad); font-weight: 600; }
.cnt { font-size: 12px; padding: 1px 7px; border-radius: 10px; margin-left: 4px; }
.cnt.ok { background: var(--acc2); color: var(--acc); }
.cnt.bad { background: var(--badbg); color: var(--bad); }
.info { font-size: 12.5px; background: #fff8e6; border-left: 3px solid #e0a800; padding: 6px 8px; margin: 6px 0; color: #4a3b00; }
.src { font-size: 12px; color: var(--mut); margin: 6px 0 0; }
.proact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.proact button.locked::before { content: "🔒 "; }
.lock { background: #fff; border: 1px dashed var(--acc); border-radius: var(--r); padding: 10px 14px; margin-top: 10px; }
.lock p { margin: 0 0 8px; }
.status { min-height: 1.2em; font-size: 13.5px; margin-top: 8px; }
.status.ok { color: var(--acc); }
.status.bad { color: var(--bad); }
.lockcard { max-width: 760px; }
.lockcard ul { padding-left: 20px; }
.phead { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.phead h2 { margin: 0; font-size: 20px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.board .col { background: var(--bg); border-radius: var(--r); padding: 8px; min-height: 120px; }
.board h3 { font-size: 13px; margin: 0 0 6px; }
.ccard { display: block; width: 100%; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); margin-bottom: 6px; padding: 8px; }
.ccard span { display: block; font-size: 12px; color: var(--mut); }
.ccard .due { color: var(--warn); }
.cdetail .cform, .cform { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin-bottom: 10px; }
.cform label, .panel label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--mut); }
.cnew { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.notes p { margin: 4px 0; font-size: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.row input { flex: 1 1 260px; width: auto; }
table.dt { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 14px; }
table.dt th { text-align: left; font-size: 12px; color: var(--mut); font-weight: 500; border-bottom: 1px solid var(--line); padding: 4px 6px; }
table.dt td { border-bottom: 1px solid #eef0f3; padding: 6px; vertical-align: top; }
table.dt .n { text-align: right; white-space: nowrap; }
table.dt .acts { white-space: nowrap; text-align: right; }
table.dt .acts > * { margin-left: 3px; }
td.log div { font-size: 12.5px; color: var(--mut); }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #eef0f3; color: var(--mut); }
.pill.paid, .pill.signed, .pill.accepted, .pill.done { background: var(--acc2); color: var(--acc); }
.pill.overdue { background: var(--badbg); color: var(--bad); }
.pill.today { background: #fff3cd; color: var(--warn); }
.pill.viewed, .pill.sent { background: #e8f0fe; color: #1a4fb3; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.kpis div { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.kpis span { display: block; font-size: 12px; color: var(--mut); }
.kpis strong { font-size: 18px; }
.kpis .bad strong { color: var(--bad); }
.enc { font-size: 13px; color: #1d4d3c; }
.plan { font-weight: 600; }
label.file { position: relative; overflow: hidden; }
label.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.keybox, .faq { max-width: 1180px; margin: 18px auto; padding: 0 20px; }
.keybox h2, .faq h2 { font-size: 18px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 6px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.foot { max-width: 1180px; margin: 10px auto 30px; padding: 0 20px; }
.printonly { display: none; }
@media (max-width: 600px) { .hero h1 { font-size: 24px; } .form fieldset { grid-template-columns: 1fr; } .paper { padding: 16px; } .cdetail .cform, .cform { grid-template-columns: 1fr; } .kpis { grid-template-columns: 1fr 1fr; } .pp-parties { grid-template-columns: 1fr; } }
@page { size: A4; margin: 14mm; }
@media print {
  body { background: #fff; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; }
  #printArea .paper { box-shadow: none; padding: 0; font-size: 11pt; }
  .noprint-free { font: 14pt system-ui, sans-serif; }
}
