:root {
  --bg: #f4f6f8; --card: #fff; --ink: #1f2933; --muted: #6b7280; --line: #e2e6ea;
  --primary: #2c3e50; --primary-ink: #fff; --accent: #18bc9c; --danger: #e74c3c; --warn: #f39c12; --info: #3498db;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif; }
main { padding: 16px; max-width: 1400px; margin: 0 auto; }
.topbar { background: var(--primary); color: var(--primary-ink); display: flex; align-items: center; gap: 24px; padding: 8px 16px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; }
.tabs { display: flex; gap: 4px; }
.tab { background: transparent; color: rgba(255,255,255,.8); border: 0; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 0.95rem; }
.tab:hover { color: #fff; background: rgba(255,255,255,.1); }
.tab.active { background: rgba(255,255,255,.18); color: #fff; }
.pill { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }
.panel { display: none; }
.panel.active { display: block; }
.cols { display: flex; gap: 16px; align-items: flex-start; }
.col.left { flex: 0 0 44%; min-width: 0; }
.col.right { flex: 1; min-width: 0; }
@media (max-width: 900px) { .cols { flex-direction: column; } .col.left { flex: 1 1 auto; width: 100%; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; min-width: 0; overflow: hidden; }
.card h2 { margin: 0 0 10px; font-size: 1.02rem; }
.card h3 { margin: 14px 0 6px; font-size: .95rem; }
.row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
label { display: block; margin: 8px 0; font-size: .9rem; }
label.check { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; }
input[type=text], input:not([type]), input[type=number], select, textarea {
  width: 100%; padding: 6px 8px; border: 1px solid #cfd6dd; border-radius: 6px; font: inherit; background: #fff;
}
input[type=number] { width: 100px; }
.add-row input:not([type]) { flex: 1; }
.add-row input[type=number] { width: 90px; }
textarea { min-height: 100px; resize: vertical; font-family: ui-monospace, Menlo, monospace; }
button { font: inherit; padding: 6px 12px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; background: #e9edf1; color: var(--ink); }
button.primary { background: var(--primary); color: #fff; }
button.ghost { background: transparent; border-color: #b8c2cc; }
button.ghost.danger { color: var(--danger); border-color: var(--danger); }
button:hover { filter: brightness(.95); }
.filebtn { display: inline-block; padding: 6px 12px; border: 1px solid #b8c2cc; border-radius: 6px; cursor: pointer; margin: 0; font-size: 14px; }
table.grid { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .9rem; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
table.grid th { background: #f7f9fb; font-weight: 600; color: #374151; }
table.grid .num, table.grid td.num { text-align: right; white-space: nowrap; }
table.grid td.small { font-size: .8rem; color: var(--muted); }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover { background: #f4f8fc; }
table.clickable tbody tr.selected { background: #e6f2ff; }
table.editable input { padding: 4px 6px; }
table.editable input[type=number] { width: 80px; }
.sub { display: block; font-size: .78em; color: var(--muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #e9edf1; font-weight: 600; font-size: .85rem; }
.badge.ok { background: #d4f5ec; color: #0b6b56; }
.badge.warn { background: #fdebd0; color: #7a4a00; }
.badge.bad { background: #fadbd8; color: #7b241c; }
.alert { padding: 8px 10px; border-radius: 6px; margin: 8px 0; font-size: .88rem; border: 1px solid transparent; }
.alert.warn { background: #fff6e5; border-color: #f7d9a6; color: #6b4a00; }
.alert.danger { background: #fdecea; border-color: #f5b7b1; color: #7b241c; }
.alert.info { background: #eaf4fc; border-color: #b9d7f0; color: #1b4f72; }
.alert.success { background: #e8f8f3; border-color: #a9e4d1; color: #0b6b56; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
pre.copy { background: #f7f9fb; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all; font-size: .88rem; margin: 4px 0 10px; }
.copyhead { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .85rem; margin-top: 8px; }
.copyhead button { padding: 2px 8px; font-size: .8rem; }
.flag { font-size: .75rem; color: var(--muted); }
.notes { padding-left: 18px; margin: 6px 0; }
.notes li { font-size: .82rem; color: var(--muted); }
.prose ol, .prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
footer { text-align: center; padding: 16px; }
.disclaimer { background: #fbfbfc; border-left: 3px solid #b8c2cc; padding: 8px 10px; color: #4b5563; border-radius: 4px; }
dialog#reg-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(760px, 94vw); }
dialog#reg-dialog::backdrop { background: rgba(0,0,0,.35); }
.dialog-body { padding: 16px 18px; }
.dialog-body h2 { margin: 0 0 8px; font-size: 1.05rem; }
/* 長い一覧はカード内でスクロール (右のフォームと高さを揃える) */
.scroll { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; margin: 8px 0; }
.scroll table.grid { margin: 0; }
.scroll table.grid thead th { position: sticky; top: 0; z-index: 1; }
.tabs { flex-wrap: wrap; }
.tab .pill { max-width: 6em; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
details.claims { margin: 10px 0; }
details.claims summary { cursor: pointer; }
.intro { max-width: 1400px; margin: 0 auto 8px; padding: 4px 2px 0; }
.intro h1 { font-size: 1.25rem; margin: 6px 0 4px; }
.intro h1 small { font-weight: 500; color: var(--muted); font-size: .95rem; margin-left: 8px; }
.intro p { margin: 0 0 6px; color: #374151; font-size: .9rem; }
.prose h4 { margin: 12px 0 2px; font-size: .92rem; }
details.faq { border-bottom: 1px solid var(--line); padding: 6px 0; }
details.faq summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
details.faq p { margin: 6px 0 2px 14px; font-size: .9rem; }
details.claims summary .more { color: var(--info); font-size: .85rem; text-decoration: underline; }
details.claims[open] summary .more { display: none; }
@media (min-width: 901px) {
  #tab-label .col.right { position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow: auto; }
}
td.rowops { white-space: nowrap; }
button.mini { padding: 2px 7px; font-size: .8rem; margin-left: 2px; }
button.mini:disabled { opacity: .35; cursor: default; }
