:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #20252b;
  --muted: #545c65;
  --tint: #f0f2f4;
  --rule: #c8cfd6;
  --blue: #244e85;
}
*, *::before, *::after { box-sizing:border-box; }
body { margin:0; background:var(--paper); color:var(--ink); font:1rem/1.6 "Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,system-ui,sans-serif; }
a { color:var(--blue); text-underline-offset:.24em; }
:focus-visible { outline:3px solid var(--blue); outline-offset:3px; }
[hidden] { display:none !important; }
.shell { max-width:73rem; width:calc(100% - 3rem); margin-inline:auto; }
.masthead { border-bottom:1px solid var(--rule); background:var(--tint); color:var(--ink); }
.masthead .shell { min-height:56px; display:flex; justify-content:space-between; align-items:center; gap:.6rem; }
.masthead strong { letter-spacing:.09em; }
.masthead a { color:var(--blue); display:inline-flex; min-height:44px; align-items:center; font-size:.875rem; }
.intro { display:grid; grid-template-columns:minmax(0,1fr) minmax(14rem,.55fr); align-items:end; gap:1.2rem; margin:clamp(1.5rem,4vw,3rem) 0 1.25rem; }
.intro h1 { font-size:clamp(1.9rem,4vw,3.2rem); line-height:1.22; margin:0; font-weight:750; color:var(--ink); }
.intro h1 span { white-space:nowrap; }
.scope { display:grid; gap:.15rem; }
.scope strong { font-size:1.15rem; }
.scope span { color:var(--muted); font-size:.875rem; }
#filters { display:grid; grid-template-columns:minmax(0,1.6fr) repeat(4,minmax(0,1fr)); gap:.65rem 1rem; background:var(--tint); border-top:3px solid var(--blue); padding:.9rem; }
label { min-width:0; display:grid; gap:.23rem; font-size:.875rem; font-weight:750; }
input,select,button { font:inherit; }
input,select { min-width:0; width:100%; min-height:44px; border:1px solid #737e8a; border-radius:4px; color:var(--ink); background:var(--paper); padding:.4rem .5rem; font-size:1rem; font-weight:400; }
.result-bar { display:flex; justify-content:space-between; align-items:center; gap:.7rem; margin-top:.8rem; }
#count { color:var(--muted); font-variant-numeric:tabular-nums; }
#reset { min-height:44px; border:0; padding:.3rem .1rem; color:var(--blue); background:transparent; text-underline-offset:.25em; text-decoration:underline; cursor:pointer; }
.ledger { border-top:2px solid var(--ink); }
.record { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,3.1fr) minmax(10rem,1fr); gap:.7rem 1.4rem; padding:.85rem .65rem .6rem; border-bottom:1px solid var(--rule); overflow-wrap:anywhere; }
.record:nth-child(even) { background:var(--tint); }
.agency { color:var(--ink); }
.record-meta { display:grid; align-content:start; gap:.22rem; color:var(--muted); font-size:.875rem; }
.record-meta time { font-variant-numeric:tabular-nums; }
.record h2 { margin:0; color:var(--ink); font-size:1.08rem; line-height:1.45; }
.winner, .contract-id { margin:.3rem 0 0; color:var(--muted); }
.contract-id { font-size:.875rem; }
.record-money { text-align:right; display:grid; align-content:start; justify-items:end; }
.record-money span { color:var(--muted); font-size:.78rem; }
.record-money strong { font-size:1.27rem; color:var(--ink); font-variant-numeric:tabular-nums; }
.record-money a { display:inline-flex; align-items:center; min-height:44px; font-size:.875rem; }
.sources { margin:3rem 0 2.5rem; padding:1rem min(3vw,1.25rem); background:var(--tint); }
.sources h2 { font-size:1.2rem; margin:0; }
.sources p { max-width:48em; margin:.35rem 0; color:var(--muted); }
.sources a { display:inline-flex; align-items:center; min-height:44px; }
@media (max-width:760px) {
  .shell { width:calc(100% - 2rem); }
  .intro { grid-template-columns:1fr; align-items:start; }
  #filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .keyword { grid-column:1/-1; }
  .record { grid-template-columns:1fr; gap:.3rem; }
  .record-meta { display:flex; flex-wrap:wrap; gap:.3rem .6rem; }
  .record-money { grid-template-columns:minmax(0,1fr) auto; gap:0 .5rem; align-items:center; justify-items:start; text-align:left; }
  .record-money span { grid-row:1; }
  .record-money strong { grid-row:2; }
  .record-money a { grid-row:1/3; grid-column:2; justify-self:end; }
}

.sort-note { color:var(--muted); font-size:.875rem; margin:.5rem 0 0; }
#pagination { display:flex; align-items:center; justify-content:center; gap:1rem; margin-top:1rem; font-variant-numeric:tabular-nums; }
#pagination button { min-height:44px; min-width:64px; border:1px solid var(--rule); border-radius:4px; color:var(--blue); background:var(--paper); }
#pagination button:disabled { color:var(--muted); background:var(--tint); }
