/* 破産配当 債権管理・配当表作成 ― 見た目（saiken-haitou・kenu-haitou と同じ配色） */
:root {
  --primary: #004878; --primary-light: #e8f0f6; --border: #d6dbdf; --bg: #fafafa; --card: #fff;
  --text: #201f1e; --sub: #605e5c; --danger: #a80000; --warn: #9d5d00; --warn-bg: #fff4ce;
  --radius: 6px;
  font-family: "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", "Hiragino Sans", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
.top { background: var(--primary); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; gap: 12px; flex-wrap: wrap; }
.brand { font-size: 20px; font-weight: 700; }
.top .right { display: flex; gap: 8px; flex-wrap: wrap; }
.privacy { margin: 0; padding: 6px 20px; font-size: 12px; color: var(--sub); background: #f3f6f8; border-bottom: 1px solid var(--border); }
.layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; padding: 16px 20px; max-width: 1900px; margin: 0 auto; align-items: start; }
.result-col { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
@media (max-width: 1300px) { .layout { grid-template-columns: 1fr; } .result-col { position: static; max-height: none; } }
.license { max-width: 1900px; margin: 0 auto 16px; padding: 0 20px; font-size: 12px; color: var(--sub); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.card > summary { list-style: none; cursor: pointer; }
.card > summary::-webkit-details-marker { display: none; }
.card > summary h2::before { content: '▸ '; }
.card[open] > summary h2::before { content: '▾ '; }
.card h2 { font-size: 16px; margin: 0 0 6px; color: var(--primary); display: inline-block; }
.card h3, .hb-extra h3 { font-size: 14px; margin: 12px 0 4px; color: var(--primary); }
.sub-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin: 8px 0; background: #fcfdfe; }
.sub-card.claim { border-left: 4px solid var(--primary); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 12px; align-items: end; }
.row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: end; margin: 6px 0; }
.row.between { justify-content: space-between; align-items: center; }
.field { display: flex; flex-direction: column; gap: 2px; margin: 3px 0; }
.field.wide2 { grid-column: span 2; }
.field.narrow { max-width: 6em; }
.field.narrow2 { display: inline-flex; max-width: 9em; }
.label { font-size: 12px; color: var(--sub); }
.hint { font-size: 12.5px; color: var(--sub); margin: 6px 0; }
.hint.warn { color: var(--warn); background: var(--warn-bg); padding: 6px 10px; border-radius: 4px; }
.span-all { grid-column: 1 / -1; }
.err { color: var(--danger); }
.sub { color: var(--sub); font-size: 12.5px; }
.in { font: inherit; padding: 4px 7px; border: 1px solid #b9c0c6; border-radius: 4px; background: #fff; min-width: 0; width: 100%; }
.in.num { text-align: right; }
textarea.in { font-family: inherit; }
.in:focus, .btn:focus-visible { outline: 2px solid #0f6cbd; outline-offset: 1px; }
.chk { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; margin: 4px 12px 4px 0; }
.btn { font: inherit; padding: 5px 12px; border: 1px solid var(--primary); color: var(--primary); background: #fff; border-radius: 4px; cursor: pointer; line-height: inherit; }
.btn:hover:not(:disabled) { background: var(--primary-light); }
.btn.small { padding: 2px 10px; font-size: 13px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.light { background: transparent; color: #fff; border-color: #fff; }
.btn.light:hover { background: rgba(255,255,255,.15); }
a.btn { text-decoration: none; display: inline-block; }
button.link { background: none; border: none; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; font-weight: 600; text-align: left; }
details summary { cursor: pointer; color: var(--primary); font-size: 13px; margin: 6px 0; }
table.mini { border-collapse: collapse; font-size: 12.5px; width: 100%; }
table.mini th, table.mini td { border: 1px solid var(--border); padding: 3px 5px; vertical-align: middle; }
table.mini th { background: #f3f6f8; font-weight: 600; }
table.mini td.n, .n { text-align: right; white-space: nowrap; }
table.mini td.c, .c { text-align: center; }
table.mini tr.tot td { font-weight: 600; }
table.form .in { padding: 3px 5px; min-width: 5.5em; }
.form-col table.form { display: block; overflow-x: auto; }
.branch { border-top: 1px dashed var(--border); padding-top: 4px; margin-top: 4px; }
.branch-main { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5em, 1fr)); gap: 2px 8px; align-items: end; }
.branch-main .field.wide { grid-column: span 2; }
.branch-main .field.narrow { max-width: none; }
.branch-del { padding-bottom: 6px; }
.calc-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 10px; }
.calc-line .field { min-width: 9em; }
.calc-out { font-size: 13px; color: var(--primary); margin: 4px 0; }
.card.tpl { border: 2px solid var(--primary); background: var(--primary-light); }
.tpl-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.ex-list { list-style: none; padding: 0; margin: 4px 0; font-size: 13px; }
.ex-list li { padding: 5px 0; border-bottom: 1px dotted var(--border); }
.ex-banner { border-left: 4px solid var(--sub); font-size: 13px; }
.ex-banner p { margin: 3px 0; }
.ex-banner.ok { border-left-color: #2e7d32; }
.ex-check { color: #2e7d32; font-weight: 600; }
.warnings { color: var(--warn); background: var(--warn-bg); padding: 6px 10px; border-radius: 4px; font-size: 13px; margin: 8px 0; }
.warnings ul { margin: 4px 0 0; padding-left: 1.4em; }
p.ok { color: #2e7d32; font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--primary); margin-bottom: 8px; flex-wrap: wrap; }
.tab { font: inherit; border: 1px solid var(--border); border-bottom: none; background: #f3f6f8; color: var(--primary); padding: 5px 14px; border-radius: 6px 6px 0 0; cursor: pointer; }
.tab.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.trace { font-size: 12.5px; margin: 4px 0; padding-left: 1.4em; }

/* 破産債権者表兼配当表（破産管財実践マニュアル書式集の「破産債権者表」「配当表」の一覧形式） */
.hb-cite { font-family: "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", "Hiragino Sans", "Noto Sans JP", sans-serif; font-size: 12px; color: var(--sub); background: #f3f6f8; border-left: 3px solid var(--border); border-radius: 4px; padding: 6px 10px; margin: 10px 0 0; }
.hb-cite-tag { display: block; font-size: 11px; font-weight: 600; margin-bottom: 2px; }
.hb-sheetwrap { overflow-x: auto; background: #fff; padding: 6px 0; font-family: "BIZ UDPMincho", "Yu Mincho", "MS PMincho", "Hiragino Mincho ProN", serif; }
.hb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1em; min-width: 980px; }
.hb-kind { display: flex; flex-wrap: wrap; gap: 0 3em; font-size: 15px; padding-top: 10px; padding-left: 22%; }
.hb-round { font-size: 12px; align-self: center; }
.hb-title2 { letter-spacing: .2em; }
.hb-meta { text-align: right; font-size: 12px; line-height: 1.6; flex: none; white-space: nowrap; padding-right: 2px; }
.hb-date { font-size: 12px; min-width: 980px; }
.hb-sheet { border-collapse: collapse; width: 100%; min-width: 980px; table-layout: fixed; font-size: 11.5px; }
.hb-sheet th, .hb-sheet td { border: 1px solid #000; padding: 2px 4px; font-weight: normal; vertical-align: middle; word-break: break-all; }
.hb-sheet th { text-align: center; font-size: 11px; }
.hb-sheet .note { font-size: 10px; }
.hb-sheet td.c { white-space: nowrap; }
.hb-sheet tr.tot td { height: 1.8em; }
.hb-sheet tr.t-excluded td.n:nth-last-child(2), .hb-sheet tr.t-excluded td.n:nth-last-child(3) { color: #888; }
.hb-sheet tr.t-deposit, .hb-sheet tr.t-trust { background: #fffbea; }
.w-no { width: 3.5%; } .w-br { width: 3%; } .w-name { width: 10.5%; } .w-zip { width: 6.5%; } .w-addr { width: 9.5%; } .w-type { width: 8%; }
.w-amt { width: 7.6%; } .w-code { width: 4.4%; } .w-note { width: 16%; }
.hb-sheet.est { min-width: 760px; }
.hb-foot { display: flex; justify-content: space-between; gap: 2em; font-size: 10.5px; margin-top: 4px; min-width: 980px; }
.hb-legend { flex: 1 1 60%; }
.hb-rate { flex: 1 1 40%; }
.hb-sub { border-collapse: collapse; margin-top: 10px; font-size: 11px; min-width: 560px; }
.hb-sub caption { text-align: left; font-size: 11.5px; padding-bottom: 2px; }
.hb-sub th, .hb-sub td { border: 1px solid #000; padding: 2px 6px; font-weight: normal; }
.hb-sub tr.tot td { font-weight: normal; }
.hb-small { font-size: 11px; }
.hb-extra { margin-top: 10px; }

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  .top, .privacy, .form-col, .license, .noprint, .tabs, .ex-banner, .warnings { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  .result-col { position: static; max-height: none; overflow: visible; }
  .card.result { border: none; padding: 0; margin: 0; }
  .hb-sheetwrap { overflow: visible; padding: 0; }
  .hb-head, .hb-date, .hb-sheet, .hb-foot { min-width: 0; }
  .hb-sheet { font-size: 8.5pt; }
  .hb-sheet .note { font-size: 7.5pt; }
  .hb-sheet thead { display: table-header-group; }
  .hb-sheet tr { break-inside: avoid; }
  .hb-sheet tr.t-deposit, .hb-sheet tr.t-trust { background: none; }
}
/* 区分形式の配当表 */
.hb-sec { font-size: 13px; margin: 10px 0 2px; }
.hb-sheet.sec { min-width: 860px; }
.hb-sheet.sec .s-key { width: 7%; } .hb-sheet.sec .s-rank { width: 9%; } .hb-sheet.sec .s-zip { width: 7%; } .hb-sheet.sec .s-amt { width: 12%; }
.hb-sheet.sec td.c .hb-small { font-size: 9.5px; }
/* 画面の中の確認・お知らせ */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: var(--radius); padding: 16px 18px; max-width: 30em; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.modal p { margin: 0 0 10px; }
.modal .row { justify-content: flex-end; }
@media print { .modal-back { display: none !important; } }

/* 設例の論点ごとの分類 */
.ex-group { border: 1px solid var(--border); border-radius: 6px; margin: .4rem 0; padding: .2rem .6rem; }
.ex-group > summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }
.ex-group .ex-list { margin: .2rem 0 .4rem; }
.ex-proc { font-size: .85em; white-space: nowrap; }

/* 誤りの報告・改善の提案 */
.report { font-size: 12.5px; color: var(--sub); margin: 14px 0 0; }
.brand img { vertical-align: middle; margin-right: 8px; }

/* 設例から選ぶ */
.ex-pick > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 4px 0; }
.ex-pick[open] > summary { margin-bottom: 4px; }
.ex-group { background: #fff; }
