.grant-page {
  --ink: #25392e;
  --forest: #234626;
  --muted: #526253;
  --line: #d4dccd;
  --paper: #f9faf5;
  --leaf: #67a72b;
  --amber: #edab38;
  --serif: Georgia, "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: Inter, "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.75 var(--sans);
  color-scheme: light;
  overflow-wrap: anywhere;
}
.grant-page *, .grant-page *::before, .grant-page *::after { box-sizing: border-box; }
.grant-page [hidden] { display: none !important; }
.grant-page :is(h1, h2, h3, h4, p, dl, dd) { margin: 0; }
.grant-page a { color: #315c35; text-underline-offset: .2em; }
.grant-page a:hover { color: #1d4124; text-decoration-thickness: 2px; }
.grant-page :is(a, input, select, button, summary):focus-visible { outline: 3px solid #805714; outline-offset: 3px; }
.grant-page .skip-link {
  position: fixed;
  z-index: 3;
  top: 8px;
  left: 12px;
  padding: .55em 1em;
  background: white;
  transform: translateY(-180%);
}
.grant-page .skip-link:focus { transform: none; }
.grant-shell { width: min(1160px, calc(100% - clamp(36px, 9vw, 128px))); margin-inline: auto; }
.grant-mast { background: #fff; border-bottom: 1px solid var(--line); }
.grant-mast .grant-shell { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 14px; }
.grant-mast img { display: block; width: clamp(130px, 13vw, 178px); height: auto; }
.grant-mast nav, .grant-page footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem clamp(.8rem, 2vw, 2rem); }
.grant-mast nav a { color: var(--forest); font-size: .87rem; font-weight: 650; }
.grant-intro { padding-block: clamp(2rem, 6vw, 5.5rem) clamp(1.5rem, 3.6vw, 3rem); }
.grant-crumb, .grant-date { color: var(--muted); font-size: .86rem; }
.grant-crumb { margin-bottom: 1rem !important; }
.grant-intro h1 {
  padding-left: .4em;
  border-left: 5px solid var(--amber);
  color: var(--forest);
  font: 650 clamp(2rem, 4.8vw, 4.35rem)/1.18 var(--serif);
  letter-spacing: -.025em;
}
.grant-lead { max-width: 64em; margin-top: 1.15rem !important; font-size: clamp(1.02rem, 1.45vw, 1.18rem); }
.grant-date { margin-top: .75rem !important; }
.grant-page :is(.grant-comparison, #catalogue) { scroll-margin-top: 1.25rem; }
.grant-page :is(.grant-comparison, #catalogue) h2 { color: var(--forest); font: 650 clamp(1.5rem, 3vw, 2.45rem)/1.4 var(--serif); }
.grant-comparison { border-top: 1px solid var(--line); padding-block: clamp(1.5rem, 3.2vw, 2.8rem); }
.grant-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin-top: 1.05rem; }
.grant-pair article {
  padding: clamp(17px, 2vw, 27px);
  border: 1px solid #d7e1cc;
  border-top: 4px solid var(--leaf);
  border-radius: 3px 15px 11px 11px;
  background: #f2f6ec;
}
.grant-pair article:nth-child(2) { border-color: #e6d9be; border-top-color: var(--amber); background: #faf5e9; }
.grant-pair h3 { color: var(--forest); font: 650 clamp(1.2rem, 2.2vw, 1.65rem)/1.45 var(--serif); }
.grant-pair article p { margin-top: .45rem; }
.grant-reading { margin-top: .85rem !important; color: var(--muted); font-size: .9rem; }
#catalogue { border-top: 1px solid var(--line); padding-top: clamp(1.7rem, 4vw, 3.5rem); }
#catalogue > header p { margin-block: .5rem 1.1rem; }
#grant-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr) auto;
  align-items: end;
  gap: 10px 14px;
  padding: clamp(12px, 2vw, 24px);
  color: var(--forest);
  border: 1px solid #d5dfcb;
  border-radius: 10px;
  background: #eef3e8;
}
#grant-controls label { display: grid; align-content: start; gap: 4px; font-size: .86rem; font-weight: 650; }
#grant-controls :is(input, select, button) {
  min-height: 44px;
  max-width: 100%;
  border: 1px solid #899984;
  border-radius: 6px;
  padding: .5rem .65rem;
  background: white;
  color: var(--ink);
  font: 500 1rem/1.45 var(--sans);
}
#grant-controls :is(input, select) { width: 100%; }
#grant-controls button { background: #fff; color: var(--forest); cursor: pointer; font-weight: 650; }
#grant-controls button:hover { background: #f3f6ef; }
#grant-count { margin-block: 1.1rem .55rem; color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; }
#grant-empty { margin-block: 1rem 2rem; padding: 1rem 1.2rem; border: 1px dashed #a7b59f; }
#grant-list { display: grid; gap: 12px; }
.grant-row {
  display: grid;
  grid-template-columns: minmax(155px, .85fr) minmax(0, 3.5fr);
  padding: clamp(15px, 2.1vw, 25px);
  gap: 12px clamp(20px, 2.5vw, 34px);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.grant-place { min-width: 0; border-right: 1px solid var(--line); padding-right: 14px; }
.grant-place small { display: block; color: var(--muted); font-size: .78rem; }
.grant-place h3 { margin-block: .07em .35em; color: var(--forest); font: 650 clamp(1.15rem, 1.8vw, 1.5rem)/1.4 var(--serif); }
.grant-state { display: inline-block; max-width: 100%; padding: .12em .55em; border: 1px solid #bfceaf; border-radius: .3em; background: #eff5e7; color: #2c512c; font-size: .78rem; font-weight: 650; }
.grant-row[data-status="過年度"] .grant-state { background: #fbf2de; color: #67480e; border-color: #e0ca97; }
.grant-row[data-status="公表資料で未確認"] .grant-state { background: #f2f3f0; color: #4f584e; border-color: #cfd4cc; }
.grant-info { min-width: 0; }
.grant-info h4 { color: var(--forest); font-size: clamp(1.05rem, 1.5vw, 1.23rem); line-height: 1.5; }
.grant-terms { margin-top: .45rem !important; }
.grant-info details { margin-top: .55rem; font-size: .94rem; }
.grant-info summary { display: list-item; width: fit-content; max-width: 100%; padding: .3rem 0; color: #3b6037; cursor: pointer; font-weight: 650; }
.grant-info summary:hover { text-decoration: underline; text-underline-offset: .17em; }
.grant-info details dl { display: grid; grid-template-columns: minmax(5em, max-content) minmax(0, 1fr); gap: .4rem .9rem; margin-top: .35rem; }
.grant-info details dt { color: var(--muted); font-weight: 650; }
.grant-sources { display: flex; gap: .4em 1em; flex-wrap: wrap; align-items: baseline; padding-top: .6rem; font-size: .87rem; }
.grant-page footer { margin-top: clamp(2rem, 5vw, 4rem); padding: 1.4rem 0; border-top: 1px solid var(--line); background: #edf2e8; color: var(--forest); }
.grant-page footer > :not(.grant-shell) { margin-inline: auto; width: min(1160px, calc(100% - 36px)); }
@media (max-width: 800px) {
  #grant-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grant-row { grid-template-columns: minmax(120px, .7fr) minmax(0, 2.6fr); }
}
@media (max-width: 620px) {
  .grant-mast .grant-shell { flex-wrap: wrap; gap: 10px 15px; padding-block: 10px; }
  .grant-mast nav a { font-size: .82rem; }
  .grant-pair, .grant-row { grid-template-columns: minmax(0, 1fr); }
  .grant-place { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .6rem; border: 0; padding: 0; }
  .grant-place h3 { margin: 0; }
  .grant-place .grant-state { margin-left: auto; }
  .grant-info details dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .grant-info details dd { margin-bottom: .5rem; }
}
@media (max-width: 450px) {
  #grant-controls { grid-template-columns: minmax(0, 1fr); }
  #grant-controls button { justify-self: start; }
}
@media print {
  .grant-page { background: white; color: black; }
  .grant-shell { width: 100%; }
  .grant-mast nav, #grant-controls, .skip-link { display: none; }
  .grant-row { break-inside: avoid; }
}
