.status-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.badge-ok {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.badge-warn {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}
.badge-info {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}
.result-hero {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  margin: 6px 0 12px;
}
.result-hero.ok { color: #15803d; }
.result-hero.warn { color: #b45309; }

.progress-wrap {
  margin: 16px 0 20px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}
.progress-bar-bg {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 999px;
  transition: width 0.3s ease, background-color 0.3s ease;
}
.progress-bar-fill.complete {
  background: #16a34a;
}

/* 書類タイプ選択ボタン（4枠対応・枠内の改行崩れ防止） */
.seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
@media (max-width: 760px) {
  .seg {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 440px) {
  .seg {
    grid-template-columns: 1fr;
  }
}
.seg label {
  min-width: 0;
}
.seg span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  text-align: center;
  min-height: 58px;
  border-radius: 8px;
}
.seg-title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.seg-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--sub);
  margin-top: 3px;
  white-space: nowrap;
}
.seg input:checked + span .seg-sub {
  color: rgba(255, 255, 255, 0.9);
}

/* 請求書見本カード（本物の請求書らしく見やすく・詰まり感を完全解消） */
.invoice-sample-wrap {
  margin: 16px 0 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 16px;
}
.invoice-paper {
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}
@media (max-width: 580px) {
  .invoice-paper {
    padding: 16px 12px;
  }
}
.invoice-paper-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.35em;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid #0f172a;
  color: #0f172a;
}
.invoice-header-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
@media (max-width: 620px) {
  .invoice-header-row {
    flex-direction: column;
    gap: 14px;
  }
}
.invoice-to-col {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.invoice-from-col {
  flex: 0.9;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.invoice-dest-box, .invoice-meta-box, .invoice-seller-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}
.sample-badge-row {
  margin-bottom: 6px;
}
.sample-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.invoice-dest-name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 4px;
}
.invoice-dest-sub {
  font-size: 11px;
  color: var(--sub);
  margin-top: 4px;
}
.invoice-subject-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
}
.sub-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
}
.sub-text {
  color: #1e293b;
  font-weight: 500;
}
.invoice-bill-box {
  padding: 12px 16px;
  background: #eef4ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.bill-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
}
.bill-amount {
  font-size: 22px;
  font-weight: 700;
  color: #1e3a8a;
  font-variant-numeric: tabular-nums;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 3px 0;
  color: #334155;
}
.meta-row.highlight-due {
  border-top: 1px dashed #cbd5e1;
  margin-top: 4px;
  padding-top: 6px;
  color: #0f172a;
}
.seller-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}
.seller-reg {
  font-size: 12px;
  margin: 3px 0;
  color: #334155;
}
.reg-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  background: #ffffff;
  padding: 1px 4px;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
}
.seller-addr, .seller-contact {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

/* 明細セクション */
.invoice-table-section {
  margin: 18px 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}
.table-badge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}
.badge-hint {
  font-size: 11px;
  color: var(--sub);
}
.rate-tag {
  display: inline-block;
  padding: 1px 6px;
  background: #e2e8f0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.rate-tag.rate-8 {
  background: #fef3c7;
  color: #92400e;
}
.invoice-table-wrap {
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.invoice-table {
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: collapse;
  font-size: 12px;
  background: #ffffff;
  table-layout: fixed;
  box-sizing: border-box;
}
.invoice-table th, .invoice-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 6px;
  text-align: left;
  box-sizing: border-box;
}
.invoice-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #334155;
}
.invoice-table .r {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.col-item { width: 38%; }
.col-qty { width: 10%; }
.col-price { width: 18%; }
.col-subtotal { width: 18%; }
.col-rate { width: 16%; }

@media (max-width: 620px) {
  .invoice-sample-wrap {
    padding: 10px 4px;
  }
  .invoice-paper {
    padding: 12px 6px;
  }
  .invoice-table-section {
    padding: 10px 6px;
    box-sizing: border-box;
  }
  .invoice-table {
    font-size: 10px;
  }
  .invoice-table th, .invoice-table td {
    padding: 6px 2px;
  }
  .col-item {
    width: 28%;
    word-break: break-all;
    white-space: normal;
    line-height: 1.3;
  }
  .col-qty {
    width: 12%;
  }
  .col-price {
    width: 20%;
  }
  .col-subtotal {
    width: 20%;
  }
  .col-rate {
    width: 20%;
  }
  .rate-tag {
    font-size: 9px;
    padding: 1px 3px;
    white-space: nowrap;
  }
}

.invoice-table-foot-note {
  font-size: 11px;
  color: var(--sub);
  margin-top: 6px;
}

/* 税率区分集計グリッド */
.invoice-tax-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 580px) {
  .invoice-tax-breakdown-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
.tax-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}
.tax-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 3px 0;
  color: #334155;
}
.tax-row .num {
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.tax-note {
  font-size: 11px;
  color: var(--sub);
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}

/* 下部合計・振込先エリア */
.invoice-bottom-area {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
}
@media (max-width: 600px) {
  .invoice-bottom-area {
    flex-direction: column-reverse;
    gap: 12px;
  }
}
.invoice-bank-info {
  flex: 1.1;
  font-size: 12px;
  color: #334155;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.bank-title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}
.bank-detail {
  line-height: 1.5;
}
.invoice-grand-total-block {
  flex: 0.9;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 14px;
}
.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: #475569;
}
.total-row strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.total-row.total-highlight {
  border-top: 1px solid #cbd5e1;
  padding-top: 6px;
  margin-top: 4px;
  font-size: 14px;
}
.total-row.total-highlight strong {
  font-size: 16px;
  color: var(--blue);
}

/* 点検リスト（カード型で見やすく） */
.check-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.check-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}
.check-item.checked {
  border-color: #86efac;
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
}
.check-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: #16a34a;
  cursor: pointer;
  flex-shrink: 0;
}
.check-content {
  flex: 1;
  min-width: 0;
}
.check-title {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.4;
}
.check-desc {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.65;
}
.check-ng {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 12.5px;
  color: #991b1b;
  line-height: 1.55;
}
.check-ng-tag {
  display: inline-block;
  background: #dc2626;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: 1px;
}

/* 端数処理テーブルと早見表 */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}
.quick-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 13px;
}
.quick-table th, .quick-table td {
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}
.quick-table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.tbl-method {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.badge-status-ok {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
}
.badge-status-ng {
  display: inline-block;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
}

.field-hint {
  font-size: 13px;
  color: var(--sub);
  margin-top: 6px;
}
.copy-summary-wrap {
  margin-top: 16px;
}
.btn-reset {
  margin-top: 10px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #c9d0dc;
  border-radius: 6px;
  font-size: 13px;
  color: var(--sub);
  cursor: pointer;
  font-family: inherit;
}
.btn-reset:hover {
  background: #f1f5f9;
  color: var(--ink);
}
.calc-card {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 16px;
  margin-top: 14px;
}
.calc-card h3 {
  font-size: 15px;
  margin: 0 0 8px;
  color: #1e40af;
}
.calc-result-box {
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  font-size: 14px;
}
