:root { --bg:#f6f7f9; --fg:#1f2328; --muted:#6b7280; --line:#e3e6ea; --accent:#2563eb; --neg:#c62828; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", sans-serif;
  font-size: 13px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.nav { display:flex; align-items:center; gap:.25rem; flex-wrap:wrap; background:#fff; border-bottom:1px solid var(--line);
  padding:.4rem .8rem; position:sticky; top:0; z-index:10; }
header.nav .brand { font-weight:700; margin-right:.8rem; color:var(--fg); }
header.nav a.item { padding:.3rem .6rem; border-radius:6px; color:#374151; }
header.nav a.item.active { background:var(--accent); color:#fff; }
header.nav .right { margin-left:auto; display:flex; gap:.6rem; align-items:center; color:var(--muted); }
header.nav form { margin:0; }
.badge { display:inline-block; min-width:1.4em; padding:0 .35em; border-radius:9px; background:#dc2626; color:#fff;
  font-size:11px; text-align:center; margin-left:.2rem; }
.badge.zero { background:#9ca3af; }
main { padding: .8rem 1rem 2rem; }
h1 { font-size: 17px; margin: .2rem 0 .7rem; }
h2 { font-size: 14px; margin: 1.2rem 0 .4rem; }
.muted { color: var(--muted); }
.neg { color: var(--neg); }
.warn { background:#fff4e5; border:1px solid #f5c27a; padding:.5rem .7rem; border-radius:6px; margin:.5rem 0; }
.note { background:#eef4ff; border:1px solid #c7d7fb; padding:.5rem .7rem; border-radius:6px; margin:.5rem 0; }
form.filters { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; margin-bottom:.6rem; }
form.filters input, form.filters select { font: inherit; padding:.2rem .3rem; }
button, .btn { font: inherit; padding:.2rem .6rem; border:1px solid #cbd0d6; background:#fff; border-radius:5px; cursor:pointer; }
.scroll { overflow:auto; max-height: calc(100vh - 140px); background:#fff; border:1px solid var(--line); border-radius:6px; }
table { border-collapse: collapse; width: max-content; min-width: 100%; background:#fff; }
th, td { padding: 3px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background:#f1f3f5; font-weight:600; text-align:left; position: sticky; top: 0; z-index: 2; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.cf td:first-child, table.cf th:first-child { position: sticky; left: 0; background: #fff; z-index: 1;
  min-width: 220px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; border-right:1px solid var(--line); }
table.cf th:first-child { z-index: 3; background:#f1f3f5; }
table.cf tr.sec td { background:#eef1f5; font-weight:700; cursor:pointer; }
table.cf tr.sec td:first-child { background:#eef1f5; }
table.cf tr.sec td:first-child::before { content:"▾ "; color:var(--muted); }
table.cf tr.sec.collapsed td:first-child::before { content:"▸ "; }
table.cf tr.line td:first-child { padding-left: 1.4em; font-weight: 400; }
table.cf tr.line.child td:first-child { padding-left: 2.4em; color:#374151; }
table.cf tr.line.hidden { display: none; }
table.cf tr.bal td { background:#fbfbfc; }
table.cf tr.bal.strong td { font-weight:700; }
table.cf tr.bal.first td { border-top: 2px solid #9aa3ad; }
td.st-closed { font-weight: 700; background: #ececec; }
td.st-mixed { background: repeating-linear-gradient(135deg, #fff6cc, #fff6cc 4px, #fffdf2 4px, #fffdf2 8px); }
td.cell a { color: inherit; display:block; }
td.cell.exp a::after { content: "•"; color: var(--accent); margin-left: 2px; font-size: 11px; vertical-align: super; }
th.now, td.now { box-shadow: inset 2px 0 0 #93c5fd; }
.legend span { display:inline-block; padding:0 .5rem; margin-right:.4rem; border:1px solid var(--line); }
code.cmd { background:#f3f4f6; padding:1px 4px; border-radius:4px; font-size:12px; }
.login { max-width: 360px; margin: 90px auto; background:#fff; border:1px solid var(--line); border-radius:10px; padding:1.5rem; }
.login label { display:block; font-weight:600; margin:.7rem 0 .2rem; }
.login input { width:100%; padding:.45rem; font: inherit; border:1px solid #cbd0d6; border-radius:6px; }
.login button { width:100%; margin-top:1.1rem; padding:.5rem; background:#1f2328; color:#fff; border:none; border-radius:6px; }
.flash { padding:.45rem .6rem; border-radius:6px; margin-bottom:.5rem; }
.flash.danger { background:#fdecea; color:#8a1c1c; }
.flash.warning { background:#fff4e5; color:#7a4b00; }
