:root { color-scheme: light; --ink: #1d2327; --line: #c9cfd4; --muted: #5f6b73; }
* { box-sizing: border-box; }
body { margin: 0; background: #eef1f3; color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.toolbar .note { color: var(--muted); font-size: 13px; flex: 1; }
.toolbar button:disabled { background: #9aa5ab; cursor: not-allowed; }
.toolbar button { padding: 8px 16px; font-size: 15px; background: #1f5f4a; color: #fff; border: 0; border-radius: 6px; cursor: pointer; }
.settings { max-width: 210mm; margin: 16px auto; padding: 16px; background: #fff; border-radius: 8px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.settings h2 { grid-column: 1 / -1; margin: 0; font-size: 16px; }
.settings label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.settings input, .settings textarea, .settings select { font: inherit; padding: 6px; border: 1px solid var(--line); border-radius: 4px; }
.warn, .error { color: #a4262c; margin: 0; font-size: 13px; }
.error { max-width: 210mm; margin: 16px auto; padding: 0 16px; }
.sheet { width: 210mm; min-height: 297mm; margin: 16px auto; padding: 18mm 16mm; background: #fff; font-size: 10.5pt; }
.sheet h1 { text-align: center; letter-spacing: .5em; font-size: 20pt; margin: 0 0 8mm; }
.head { display: flex; justify-content: space-between; gap: 8mm; }
.head p { margin: 0 0 1.5mm; }
.customer { font-size: 14pt; border-bottom: 1px solid var(--ink); padding-bottom: 1mm; min-width: 80mm; }
.from { text-align: right; }
.issuer { font-size: 12pt; font-weight: bold; margin-top: 3mm !important; }
.addr, .bank { white-space: pre-wrap; }
.amount { font-size: 13pt; margin: 8mm 0 5mm; border-bottom: 2px solid var(--ink); display: inline-block; padding-bottom: 1mm; }
.amount strong { font-size: 16pt; margin-left: 4mm; }
table { border-collapse: collapse; width: 100%; }
.lines th, .lines td { border: 1px solid var(--line); padding: 1.8mm 2mm; }
.lines th { background: #f2f4f5; font-weight: normal; }
.num { text-align: right; white-space: nowrap; }
.summary { width: 90mm; margin: 4mm 0 0 auto; }
.summary td { border-bottom: 1px solid var(--line); padding: 1.5mm 2mm; }
.summary tr:last-child td { font-weight: bold; border-bottom: 2px solid var(--ink); }
.mark { font-size: 9pt; color: var(--muted); }
.foot { margin-top: 8mm; }
.foot p { margin: 0 0 1mm; }
@page { size: A4; margin: 0; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .sheet { margin: 0; box-shadow: none; }
}
@media screen and (max-width: 820px) { .sheet { width: auto; min-height: 0; padding: 16px; } .head { flex-direction: column; } .from { text-align: left; } }
