:root {
  --bg: #f6f7f9; --surface: #fff; --text: #1d2330; --muted: #5f6878; --line: #d9dee6;
  --accent: #1f6f5c; --accent-soft: #e3f1ec; --ok: #1a7f4b; --ng: #c0392b; --ng-soft: #fbe9e7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171c; --surface: #1d2128; --text: #e7eaf0; --muted: #9aa3b2; --line: #333a45;
    --accent: #5cc8a8; --accent-soft: #1d3a33; --ok: #4cc38a; --ng: #ff7a6b; --ng-soft: #3a2220;
  }
}
:root[data-theme="dark"] {
  --bg: #14171c; --surface: #1d2128; --text: #e7eaf0; --muted: #9aa3b2; --line: #333a45;
  --accent: #5cc8a8; --accent-soft: #1d3a33; --ok: #4cc38a; --ng: #ff7a6b; --ng-soft: #3a2220;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.7;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
main, header.site, footer.site { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header.site { padding-top: 28px; }
.eyebrow { margin: 0; font-size: .8rem; font-weight: 700; color: var(--accent); }
h1 { margin: 4px 0 8px; font-size: 1.55rem; line-height: 1.35; }
.lead { margin: 0 0 20px; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 700; margin-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; margin-bottom: 8px; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.unit { display: flex; align-items: center; gap: 6px; color: var(--text); }
input, select {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { margin: 4px 0 0; font-size: .8rem; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; cursor: pointer; }
.seg input { width: auto; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.tab.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 700; }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.summary div { display: flex; flex-direction: column; }
.summary .k { font-size: .8rem; color: var(--muted); }
.summary .v { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict { margin: 14px 0; padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.verdict.ok { background: var(--accent-soft); }
.verdict.ng { background: var(--ng-soft); color: var(--ng); }
.verdict:empty { display: none; }
.walls { list-style: none; padding: 0; margin: 0; }
.walls li { border-top: 1px solid var(--line); padding: 12px 0; }
.walls .row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.walls .limit { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 5.5em; }
.walls .who { font-size: .72rem; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; color: var(--muted); }
.walls .title { flex: 1 1 200px; }
.walls .state { font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; }
.walls li.over .state { color: var(--ng); }
.bar { height: 6px; background: var(--line); border-radius: 3px; margin: 6px 0; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.walls li.over .bar span { background: var(--ng); }
.cap { margin: 4px 0 0; font-size: .9rem; }
.note { margin: 4px 0 0; font-size: .8rem; color: var(--muted); }
.parent { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.parent h3 { font-size: 1rem; margin: 8px 0 4px; }
.parent p { margin: 4px 0; }

.doc h2 { font-size: 1.2rem; margin: 32px 0 8px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); }
th, td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
td:first-child { white-space: nowrap; font-weight: 700; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; margin-bottom: 8px; }
summary { cursor: pointer; font-weight: 700; }
.small { font-size: .82rem; color: var(--muted); }
footer.site { margin: 40px auto 32px; color: var(--muted); font-size: .8rem; }
footer.site a { color: inherit; }
