/* 請求書の作成だけで使う見た目。書類の見本はA4の大きさで組み、画面では幅に合わせて縮めて見せる */
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 16px; margin: 0; display: grid; gap: 12px; min-width: 0; }
.box legend { font-weight: 700; padding: 0 6px; font-family: var(--display); }
.form { display: grid; gap: 16px; }
.form .field { align-content: start; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; font-size: 15px; min-height: 44px; }
.seg label { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; min-height: 44px; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }

/* 明細の行。パソコンでは1行に並べ、スマホでは2段に折る */
.lines { display: grid; gap: 8px; }
.line {
  display: grid; gap: 6px 8px; align-items: end;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.4fr) minmax(0, 1.1fr) auto auto;
  border-bottom: 1px dashed var(--line); padding-bottom: 8px;
}
.line .field > span { font-size: 12px; font-weight: 400; color: var(--muted); }
.line .wh { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.line .wh input { margin: 11px 0; }
.line .amt { grid-column: 1 / -1; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.line .del { min-height: 44px; padding: 8px 12px; }
.no-wh .line .wh { display: none; }
@media (max-width: 720px) {
  .line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .line .name { grid-column: 1 / -1; }
  .line .price { grid-column: span 1; }
  .line .del { grid-column: 3; justify-self: end; }
}

.notice { display: grid; gap: 6px; }
.notice p { margin: 0; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.notice p.warn { border-color: var(--warn); background: var(--warn-soft); color: var(--ink); }
.notice p.ok { border-color: var(--ok); color: var(--ink); }

/* 書類の見本 */
.sheet-wrap { overflow: hidden; border-radius: 6px; background: #8a909c; padding: 12px; }
.sheet-wrap.full { overflow: auto; }
.view { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.view h2 { margin: 0; font-size: 17px; }
.sheet {
  width: 210mm; min-height: 297mm; padding: 14mm 15mm 16mm; background: #fff; color: #1f2933;
  font-family: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 10pt; line-height: 1.5; transform-origin: top left; box-shadow: 0 2px 10px rgba(0,0,0,.25);
  color-scheme: light;
}
.sheet .title { text-align: center; font-size: 20pt; letter-spacing: .5em; margin: 0 0 8mm; padding-left: .5em; font-weight: 400; }
.sheet .head { display: flex; justify-content: space-between; gap: 8mm; margin-bottom: 5mm; }
.sheet .to { width: 95mm; }
.sheet .to .nm { font-size: 14pt; border-bottom: 1px solid #1f2933; padding-bottom: 1mm; margin: 0; overflow-wrap: anywhere; }
.sheet .to p, .sheet .from p { margin: 0; overflow-wrap: anywhere; }
.sheet .to .sub { margin-top: 1mm; color: #52606d; }
.sheet .from { width: 72mm; }
.sheet .from .co { font-size: 12pt; margin-top: 3mm; }
.sheet .stamp { width: 24mm; height: 30mm; border: 1px dashed #9aa5b1; color: #9aa5b1; font-size: 8pt; display: grid; place-items: center; text-align: center; margin-top: 3mm; }
.sheet .subj { margin: 0 0 2mm; }
.sheet .leadtxt { margin: 0 0 2mm; color: #52606d; }
.sheet .amount { display: flex; width: 100mm; border: 1px solid #245d7a; margin-bottom: 5mm; }
.sheet .amount span { background: #e6eef3; padding: 2mm 3mm; width: 32mm; }
.sheet .amount b { flex: 1; text-align: right; padding: 1mm 3mm; font-size: 15pt; font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sheet thead th { background: #e6eef3; border-bottom: 1px solid #245d7a; font-weight: 400; text-align: left; padding: 1.4mm 1.5mm; font-size: 9pt; }
.sheet tbody td { border-bottom: .5px solid #9aa5b1; padding: 1.4mm 1.5mm; vertical-align: top; overflow-wrap: anywhere; }
.sheet .r { text-align: right; }
.sheet .c { text-align: center; }
.sheet .empty td { color: #9aa5b1; }
.sheet .sum { margin: 3mm 0 0 auto; width: 92mm; }
.sheet .sum div { display: flex; justify-content: space-between; gap: 4mm; border-bottom: .5px solid #9aa5b1; padding: 1mm 0; font-variant-numeric: tabular-nums; }
.sheet .sum .total { font-weight: 700; }
.sheet .sum .note { border: 0; font-size: 8pt; color: #52606d; justify-content: flex-start; }
.sheet .block { margin-top: 5mm; break-inside: avoid; }
.sheet .block h4 { margin: 0; color: #52606d; font-weight: 400; font-size: 9pt; }
.sheet .block p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet .ph { color: #9aa5b1; }

@page { size: A4; margin: 0; }
@media print {
  main.page > div:first-child { display: none !important; }
  .tool { display: block; }
  .sheet-wrap { padding: 0; background: none; overflow: visible; height: auto !important; border-radius: 0; }
  .sheet { transform: none !important; box-shadow: none; margin: 0 !important; min-height: 296mm; }
  .sheet .ph { color: transparent; }
}
