/*
  補助金さがし：検索画面（Vue）と静的ページで共通の見た目（2026-11-26 作り直し、designer）
  題材は「締め切り帳」。事業者が机に置く日めくりと、計算機用紙の緑の帯。
  - 主役は各行の左の「締め切りの札」（月・大きな日・残りの日数）。目立たせるのはここだけで、ほかは静かにする
  - 色：用紙は少し青みのある白（生成りにしない）、罫線と帯は帳票の緑、7 日以内だけ朱。紺と白の帯・紋章のような印は使わない（公認と誤解させない）
  - 書体は BIZ UDP ゴシック（業務文書向けの UD 書体）。数字は等幅
  - 枠の大きさは中身で変えない：行は題名 2 行・情報 1 行に切りそろえ、一覧の枠は画面の高さで最低の高さを取る
*/
:root {
  --paper: #f8faf8;
  --surface: #ffffff;
  --band: #edf5ef;
  --band-strong: #dcebe0;
  --rule: #c6dacb;
  --rule-strong: #5b8f6c;
  --ink: #15231b;
  --muted: #55665b;
  --faint: #89958d;
  --green: #1d6a43;
  --green-dark: #145233;
  --link: #22569c;
  --upcoming: #22569c;
  --shu: #c0392b;
  --shu-bg: #fbeceb;
  --gray: #7b867f;
  --focus: #22569c;
  --row-h: 104px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'BIZ UDPGothic', 'BIZ UDPゴシック', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button { font: inherit; }

h2 { font-size: 1.12rem; line-height: 1.5; margin: 2.2em 0 .7em; padding-bottom: .35em; border-bottom: 2px solid var(--rule-strong); }
h2 .h2__n { font-weight: 400; font-size: .85rem; color: var(--muted); margin-left: .5em; }

/* ---- 上の帯 ---- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  box-shadow: inset 0 -4px 0 var(--band);
}
.masthead__name { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; font-size: 1.08rem; text-decoration: none; letter-spacing: .04em; }
/* 名前の前の小さな日めくりの印（公的な紋章に見えない、ただの帳面の形） */
.masthead__mark { width: 18px; height: 20px; border: 2px solid var(--green); border-top-width: 6px; border-radius: 2px; background: var(--surface); flex: none; }
.masthead__nav { display: flex; gap: 18px; font-size: .9rem; }
.masthead__nav a { color: var(--ink); text-decoration-color: var(--rule-strong); }
.masthead__nav a[aria-current='page'] { font-weight: 700; text-decoration: none; }

/* ---- 用紙 ---- */
.sheet { max-width: 880px; margin: 0 auto; padding: 18px 16px 40px; }
.sheet--wide { max-width: 1200px; }
.sheet__title { font-size: clamp(1.35rem, 3.4vw, 1.9rem); line-height: 1.4; margin: .1em 0 .15em; letter-spacing: .02em; }
.sheet__lead { color: var(--muted); margin: .4em 0 1em; max-width: 46em; }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: .3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs__sep { margin: 0 .5em; color: var(--rule-strong); }

/*
  見出しの下：民間のサイトであること（1 行目）と、データの取得日時・古いときの知らせ（2 行目）。
  2 行目は高さを決めてある（読み込みのあとで「N 日前のデータです」が出ても、下の一覧が動かないように）。
  広い画面は 1 行（取得日時の横に知らせ）、狭い画面は 2 行（取得日時の下に知らせ。はみ出す分は … で切り、全文は title）
*/
.siteline { margin: 0 0 1em; font-size: .8rem; line-height: 1.6; color: var(--muted); }
.siteline__part { display: block; }
.siteline__data { display: block; height: 1.6em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.siteline .stale { color: var(--shu); font-weight: 700; }
.siteline .stale[hidden] { display: none; }
.siteline .stale::before { content: '／'; margin: 0 .3em; color: var(--rule-strong); font-weight: 400; }
@media (max-width: 960px) {
  .siteline__data { height: 3.2em; white-space: normal; }
  .siteline__fetched, .siteline .stale { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .siteline .stale[hidden] { display: none; }
  .siteline .stale::before { content: none; }
}
.sk-text { display: inline-block; width: 11em; height: .9em; vertical-align: -.1em; border-radius: 2px; background: var(--band-strong); }

.note { color: var(--muted); font-size: .85rem; margin: .3em 0; }
.count { margin: 0; }
.error { color: var(--shu); font-weight: 700; }
.prose { max-width: 46em; }
.prose ul { padding-left: 1.2em; }

/* ---- 締め切りの札と帳票の行（検索の結果と、静的ページの一覧で共通）---- */
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 132px;
  grid-template-areas: 'due title max' 'due meta max';
  grid-template-rows: auto 1fr;
  column-gap: 16px;
  height: var(--row-h);
  padding: 10px 12px 10px 10px;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
/* 計算機用紙の帯：3 行ごとに緑 */
.row:nth-child(6n+1), .row:nth-child(6n+2), .row:nth-child(6n+3) { background: var(--band); }

.due {
  grid-area: due;
  align-self: start;
  display: grid;
  justify-items: center;
  width: 84px;
  border: 1px solid var(--rule-strong);
  border-top: 5px solid var(--green);
  border-radius: 2px;
  background: var(--surface);
  line-height: 1.15;
  text-align: center;
}
.due__m { padding-top: 3px; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.due__d { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; }
.due__d small { font-size: .6rem; font-weight: 400; color: var(--muted); margin-left: 1px; }
.due .state { display: block; width: 100%; padding: 2px 0 3px; font-size: .7rem; font-weight: 700; white-space: nowrap; border-top: 1px dashed var(--rule); color: var(--green); }
.due--none .due__d { font-size: .82rem; padding: 6px 0 5px; color: var(--faint); font-weight: 400; }
.is-soon .due { border-top-color: var(--shu); }
.is-soon .due .state { background: var(--shu-bg); color: var(--shu); }
.is-upcoming .due { border-top-color: var(--upcoming); }
.is-upcoming .due .state { color: var(--upcoming); }
.is-closed .due { border-top-color: var(--gray); border-color: var(--rule); }
.is-closed .due .state { color: var(--gray); font-weight: 400; }
.is-closed .due__d { color: var(--muted); }

.row__title {
  grid-area: title;
  align-self: start;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis; /* 2 行で切った印（…）。全文は title */
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink);
  text-decoration-color: var(--rule-strong);
}
.row__title:hover { color: var(--link); }
/* 題名の【…】を移した小さな印 */
.tag { display: inline-block; margin-right: 6px; padding: 0 5px; font-size: .7rem; font-weight: 400; line-height: 1.55; vertical-align: .1em; color: var(--muted); border: 1px solid var(--rule-strong); border-radius: 2px; background: var(--surface); }
.row__meta { grid-area: meta; align-self: end; margin: 2px 0 0; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta span + span::before { content: '｜'; margin: 0 .35em; color: var(--rule); }
.row__max { grid-area: max; align-self: center; text-align: right; font-weight: 700; white-space: nowrap; }
.row__max-label { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); }
.row__max .is-none { font-weight: 400; font-size: .8rem; color: var(--faint); }

/* 読み込み前の行（読み込み後と同じ高さ） */
.row--sk .due { border-color: var(--rule); border-top-color: var(--band-strong); height: 68px; }
.row--sk .sk { display: block; height: .85em; border-radius: 2px; background: var(--band-strong); }
.row--sk .row__title { display: block; padding-top: .3em; }
.row--sk .row__title .sk + .sk { margin-top: .55em; width: 62%; }
.row--sk .row__meta .sk { width: 40%; }
.row--sk .row__max .sk { width: 70%; margin-left: auto; }
@media (prefers-reduced-motion: no-preference) {
  .row--sk .sk, .row--sk .due, .sk-text { animation: sk 1.4s ease-in-out infinite; }
  @keyframes sk { 50% { opacity: .55; } }
}

.empty-line { padding: 18px 4px; color: var(--muted); }

/* ---- トップ：一覧（左）と 3 問（右）---- */
.finder { display: grid; grid-template-columns: minmax(0, 1fr) 344px; grid-template-areas: 'results ask' 'links ask' 'source ask'; gap: 0 28px; align-items: start; }
/* 下の案内と出典も .finder の中（左の列）に置く。右の枠の貼り付きは .finder の下端までなので、ページの下までついてくる */
.finder > .links { grid-area: links; }
.finder > .source { grid-area: source; }
.results { grid-area: results; min-width: 0; }
.ask { grid-area: ask; position: sticky; top: 12px; }
/*
  PC：右の枠はいつも貼り付けて、スクロールしても同じ場所に見える（2026-11-26 ユーザーの指摘）。
  枠が画面より高くなるとき（「さらに絞る」を開いた・低い画面）は、枠の中でスクロールする。3 問は枠の上側にある。
  都道府県の札（.prefs）は枠の外に重ねて出すので、包む箱を .q ではなく .ask にする（枠のスクロールで切れないように）
*/
@media (min-width: 961px) {
  /*
    枠の高さの上限：貼り付く上の 12px と、ページのいちばん下でも .finder の下（用紙の下の余白 16px＋フッター 87px）に押し上げられない分を引く。
    これでページの下までスクロールしても枠の上（3 問）が画面から出ない
  */
  .sheet--wide { padding-bottom: 16px; }
  .ask__panel { max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain; }
  .ask .q { position: static; }
  .ask .prefs { top: 20px; right: calc(100% + 16px); }
}

.results__bar { display: flex; align-items: center; gap: 8px 16px; min-height: 48px; padding: 4px 2px 6px; }
.results__count { margin: 0; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.results__count strong { display: inline-block; min-width: 2.6em; text-align: right; font-size: 1.55rem; color: var(--ink); margin-right: .15em; }
.results__order { margin: 0 0 0 auto; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.results__frame { min-height: max(var(--row-h) * 5, 100svh - 220px); }
.results__more { text-align: center; margin: 18px 0 0; }

.btn-line { display: inline-block; padding: 7px 18px; border: 1.5px solid var(--rule-strong); border-radius: 3px; background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; }
.btn-line:hover { background: var(--band); }
.btn-line:disabled { color: var(--faint); border-color: var(--rule); background: transparent; cursor: default; }
.btn-small { padding: 2px 10px; font-size: .82rem; }
.link-btn { padding: 0; border: 0; background: none; color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .9rem; }

/* 0 件のとき（一覧の枠の中に出す） */
.empty { padding: 28px 20px; border: 1px dashed var(--rule-strong); background: var(--surface); }
.empty__title { margin: 0 0 .4em; font-weight: 700; }
.empty p { margin: .3em 0; color: var(--muted); }
.empty__drops { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; padding: 0; list-style: none; }

/* 3 問の枠 */
.ask__panel { padding: 12px 14px 8px; border: 1px solid var(--rule-strong); border-top: 5px solid var(--green); border-radius: 2px; background: var(--surface); }
.ask__intro { margin: 0 0 6px; font-size: .78rem; line-height: 1.5; color: var(--muted); }
.q { position: relative; margin: 0 0 10px; padding: 0; border: 0; min-width: 0; }
.q__label { display: block; margin: 0 0 4px; padding: 0; font-weight: 700; font-size: .9rem; }
.q__toggle, .q__sheet-head, .ask__toggles, .ask__backdrop { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { padding: 2px 8px; font-size: .82rem; line-height: 1.55; border: 1px solid var(--rule-strong); border-radius: 3px; background: var(--surface); color: var(--ink); cursor: pointer; }
.chip:hover { background: var(--band); }
.chip[aria-pressed='true'] { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.chip--pref { min-width: 9.5em; text-align: left; }
.chip--pref::after { content: '▾'; float: right; margin-left: 8px; }
.check { display: flex; gap: 6px; align-items: center; margin-top: 4px; font-size: .8rem; }
.check:has(input:disabled) { color: var(--faint); }

/* 都道府県を選ぶ札。PC では一覧の上に重ねる（並びを動かさない） */
.prefs { position: absolute; z-index: 20; right: calc(100% + 30px); top: -20px; width: min(640px, calc(100vw - 440px)); padding: 12px 14px; border: 1px solid var(--rule-strong); border-top: 5px solid var(--green); border-radius: 2px; background: var(--surface); box-shadow: 0 8px 28px rgba(21, 35, 27, .16); }
.prefs[hidden] { display: none; }
.prefs__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; font-size: .85rem; font-weight: 700; }
.prefs__row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 4px 8px; padding: 6px 0; border-top: 1px solid var(--rule); }
.prefs__region { font-size: .78rem; color: var(--muted); padding-top: 4px; }
.prefs .chip { padding: 1px 8px; font-size: .82rem; }

.ask__more { margin: 4px 0 0; border-top: 1px solid var(--rule); }
.ask__more > summary { padding: 8px 0 4px; cursor: pointer; font-size: .9rem; color: var(--link); }
.ask__more[open] > summary { color: var(--ink); font-weight: 700; }
.field { margin: 8px 0 10px; }
.field label:not(.check) { display: block; font-weight: 700; font-size: .82rem; margin-bottom: 3px; }
.field select, .field input[type='search'] { width: 100%; font: inherit; font-size: .92rem; padding: 5px 8px; border: 1px solid var(--rule-strong); border-radius: 2px; background: var(--surface); color: var(--ink); }
.field__hint { color: var(--muted); font-size: .78rem; margin: .2em 0 0; }
.ask__reset { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--rule); font-size: .8rem; color: var(--muted); }

/* トップの下：よく見られている制度・都道府県・ホームページ */
.links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; margin-top: 8px; }
.links h2 { margin-top: 1.6em; font-size: 1rem; }
.links ul { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.links li { padding: 3px 0; }
.links p { margin: .3em 0; font-size: .9rem; }

/* ---- 公募 1 件 ---- */
.deadline { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 20px; align-items: center; margin: .6em 0 .8em; padding: 14px 18px; border: 1px solid var(--rule-strong); border-left: 8px solid var(--green); border-radius: 2px; background: var(--surface); }
.deadline .state { display: inline-block; padding: 2px 10px; font-weight: 700; font-size: 1rem; color: var(--green); border: 2px solid currentColor; border-radius: 3px; white-space: nowrap; }
.deadline__label { display: block; font-size: .78rem; color: var(--muted); }
.deadline__date { display: block; font-size: clamp(1.4rem, 4.2vw, 2rem); font-weight: 700; line-height: 1.3; }
.deadline__sub { display: block; font-size: .82rem; color: var(--muted); }
.deadline.is-soon { border-left-color: var(--shu); }
.deadline.is-soon .state { color: var(--shu); background: var(--shu-bg); }
.deadline.is-upcoming { border-left-color: var(--upcoming); }
.deadline.is-upcoming .state { color: var(--upcoming); }
.deadline.is-closed { border-left-color: var(--gray); }
.deadline.is-closed .state { color: var(--gray); }
.item-tags { margin: 0 0 .2em; }

.target { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 1em; padding: 0; list-style: none; font-size: .92rem; }
.target li { white-space: nowrap; }
.target li + li::before { content: '｜'; margin: 0 .5em; color: var(--rule-strong); }
.target b { font-weight: 400; color: var(--muted); font-size: .8rem; margin-right: .4em; }

.go { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 1.4em; }
.go__btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; background: var(--green); color: #fff; font-weight: 700; text-decoration: none; border-radius: 3px; }
.go__btn:hover { background: var(--green-dark); }
.go__ext { width: 14px; height: 14px; flex: none; }
.go__note { font-size: .8rem; color: var(--muted); }

.facts { margin: 0; border: 1px solid var(--rule); background: var(--surface); }
.facts div { display: grid; grid-template-columns: 11em minmax(0, 1fr); border-bottom: 1px solid var(--rule); }
.facts div:nth-child(odd) { background: var(--band); }
.facts div:last-child { border-bottom: 0; }
.facts dt { padding: 7px 12px; font-size: .85rem; color: var(--muted); border-right: 1px solid var(--rule); }
.facts dd { margin: 0; padding: 7px 12px; }
.facts summary { cursor: pointer; color: var(--link); }

.excerpt__catch { margin: .4em 0; font-weight: 700; }
.excerpt blockquote { margin: .6em 0; padding: 4px 16px; border-left: 4px solid var(--rule); background: var(--surface); font-size: .95rem; }
.excerpt blockquote p { margin: .5em 0; }
.excerpt__more { margin: .3em 0 0; font-size: .9rem; }
.excerpt__head { margin: .4em 0; font-size: .92rem; display: flex; flex-wrap: wrap; gap: .2em 1.2em; }
.files { padding-left: 1.2em; font-size: .9rem; }

.hp-hint { margin: 2em 0 0; padding: 10px 14px; border-left: 3px solid var(--rule-strong); background: var(--surface); font-size: .9rem; }
.hp-hint p { margin: .2em 0; }

/* ---- 制度のまとめ：受付の状況の枠 ---- */
.status-box { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: .6em 0 .6em; border: 1px solid var(--rule-strong); border-top: 5px solid var(--green); border-radius: 2px; background: var(--surface); }
.status-box > div { padding: 12px 16px; border-right: 1px solid var(--rule); min-width: 0; }
.status-box > div:last-child { border-right: 0; }
.status-box dt { font-size: .78rem; color: var(--muted); }
.status-box dd { margin: 2px 0 0; font-weight: 700; font-size: 1.15rem; line-height: 1.45; }
.status-box dd small { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.status-box.is-soon { border-top-color: var(--shu); }
.status-box--none { display: block; padding: 14px 18px; border-top-color: var(--gray); }
.status-box--none p { margin: .2em 0; }
.status-box--none strong { font-size: 1.1rem; }

/* 締め切った回の時期（年 × 月のます目。数字はその月に締め切った回の数） */
.season { margin: .6em 0 0; border-collapse: collapse; font-size: .78rem; width: 100%; max-width: 720px; table-layout: fixed; background: var(--surface); }
.season th, .season td { border: 1px solid var(--rule); padding: 0; text-align: center; height: 28px; }
.season thead th { font-weight: 400; color: var(--muted); background: var(--band); }
.season tbody th { width: 4.5em; font-weight: 400; color: var(--muted); background: var(--band); }
.season td.has { background: var(--band-strong); color: var(--green-dark); font-weight: 700; }
.season caption { caption-side: bottom; text-align: left; padding-top: 4px; color: var(--muted); font-size: .78rem; }

/* ---- 都道府県 ---- */
.area-nat { margin: 1em 0; padding: 10px 14px; border-left: 3px solid var(--rule-strong); background: var(--surface); font-size: .92rem; }
.area-nat p { margin: .2em 0; }
.near { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: .4em 0 0; padding: 0; list-style: none; font-size: .9rem; }

.index-list { list-style: none; padding: 0; margin: 0; }
.index-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 10px 4px; border-bottom: 1px solid var(--rule); }
.index-list span { color: var(--muted); font-size: .88rem; }
.pref-regions h2 { margin-top: 1.4em; font-size: 1rem; }
.pref-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.pref-grid a { display: flex; justify-content: space-between; padding: 8px 10px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); background: var(--surface); }
.pref-grid a:hover { background: var(--band); }
.pref-grid span { color: var(--muted); font-size: .85rem; }

/* ---- ホームページを作るとき ---- */
.checks { margin: 1em 0 1.2em; padding: 14px 18px 12px; border: 2px solid var(--green); border-radius: 2px; background: var(--surface); }
.checks__title { margin: 0 0 .5em; font-weight: 700; }
.checks ul { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding: 4px 0 4px 30px; }
.checks li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 16px; height: 16px; border: 2px solid var(--green); border-radius: 2px; }
.checks li::after { content: ''; position: absolute; left: 8px; top: calc(.55em + 3px); width: 5px; height: 9px; border: solid var(--green); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.maker { margin: 3em 0 0; padding: 12px 16px; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--muted); }
.maker h2 { margin: .2em 0 .4em; padding: 0; border: 0; font-size: .9rem; color: var(--ink); }
.maker p { margin: .3em 0; }

/* ---- 出典・下の帯 ---- */
.source { margin-top: 2.5em; padding: 12px 16px; border-top: 2px solid var(--rule-strong); font-size: .8rem; color: var(--muted); }
.source p { margin: .3em 0; }
.foot { padding: 16px; border-top: 1px solid var(--rule); background: var(--surface); font-size: .85rem; color: var(--muted); text-align: center; }
.foot p { margin: .2em 0; }
.foot a { margin: 0 .5em; }

.static-summary { padding: 0 16px; }

/* ---- 狭い画面 ---- */
@media (max-width: 960px) {
  .finder { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'ask' 'results' 'links' 'source'; gap: 6px; }
  .ask { position: static; }
  .prefs { right: auto; left: 0; top: calc(100% + 6px); width: min(640px, calc(100vw - 32px)); }
  .links { grid-template-columns: minmax(0, 1fr); }
}

/* スマホ：3 問は横に並んだ 3 つのボタン。押すと下からせり上がる紙で選ぶ */
/*
  3 問のボタン＋下からの紙：スマホと、横向きのスマホ（幅 960px 以下で高さ 500px 以下）。
  横向きでは 3 問を開いたままにすると最初の画面が 3 問で埋まり一覧が見えないので、縦向きと同じ形にする
*/
@media (max-width: 720px), (max-width: 960px) and (max-height: 500px) {
  /* 3 つのボタンの帯は上に貼り付けて、スクロールしても見える。下からの紙（z 30）と暗くする幕（z 25）より上に置く */
  .ask { position: sticky; top: 0; z-index: 30; margin: 0 -16px; padding: 6px 16px; background: var(--paper); border-bottom: 1px solid var(--rule); }
  .sheet { padding-top: 12px; }
  .siteline { margin-bottom: .7em; }
  .ask__panel { padding: 0; border: 0; background: none; }
  .ask__intro { display: none; }
  .ask__toggles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 6px; }
  .q__toggle { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; height: 52px; padding: 4px 8px; border: 1px solid var(--rule-strong); border-top: 4px solid var(--green); border-radius: 2px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; line-height: 1.35; }
  .q__toggle-label { font-size: .7rem; color: var(--muted); }
  .q__toggle-value { width: 100%; font-weight: 700; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .q__toggle[data-set='true'] { background: var(--band); }
  .q__toggle--more { align-items: center; justify-content: center; padding: 4px 8px; border-top-width: 1px; }
  .q__toggle--more .q__toggle-value { font-size: .78rem; font-weight: 400; color: var(--link); }

  .q, .ask__more, .ask__reset { display: none; }
  .q.is-open, .ask__more.is-open { display: block; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; max-height: 82svh; overflow-y: auto; margin: 0; padding: 0 16px 16px; border: 0; border-top: 5px solid var(--green); background: var(--surface); box-shadow: 0 -8px 28px rgba(21, 35, 27, .2); }
  .q.is-open .q__label { display: none; }
  .q__sheet-head { display: flex; position: sticky; top: 0; z-index: 1; justify-content: space-between; align-items: center; gap: 12px; margin: 0 -16px 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--rule); font-weight: 700; }
  .q__sheet-head .btn-line { padding: 5px 14px; background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; white-space: nowrap; }
  .ask__more.is-open > summary { display: none; }
  .ask__backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(21, 35, 27, .35); border: 0; }
  .ask__backdrop[hidden] { display: none; }
  .chip { padding: 6px 12px; font-size: .9rem; }
  .prefs, .prefs[hidden] { display: block; position: static; width: auto; padding: 0; border: 0; box-shadow: none; }
  .prefs__head { display: none; }
  .prefs .chip { padding: 5px 10px; font-size: .88rem; }
  .q .chip--pref { display: none; }

  .results__bar { min-height: 44px; }
  .results__count strong { font-size: 1.35rem; }
  .results__frame { min-height: max(var(--row-h) * 4, 100svh - 300px); }
}
@media (max-width: 960px) and (max-height: 500px) {
  /* 横向き：見出しを小さくして、一覧の 1 行目を最初の画面に入れる */
  .sheet__title { font-size: 1.2rem; margin: 0; }
  .masthead { padding-top: 6px; padding-bottom: 6px; }
  .q.is-open, .ask__more.is-open { max-height: 88svh; }
}

@media (max-width: 720px) {
  :root { --row-h: 100px; }
  .row { grid-template-columns: 62px minmax(0, 1fr) auto; grid-template-areas: 'due title title' 'due meta max'; column-gap: 10px; padding: 9px 8px; }
  .due { width: 62px; }
  .due__d { font-size: 1.35rem; }
  .due .state { font-size: .64rem; }
  .row__title { font-size: .93rem; line-height: 1.5; }
  .row__max { align-self: end; font-size: .85rem; }
  .row__max-label { display: inline; margin-right: .3em; font-size: .7rem; }
  .row--sk .due { height: 60px; }

  .deadline { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; }
  .deadline .state { justify-self: start; }
  .go__btn { width: 100%; justify-content: center; }
  .facts div { grid-template-columns: 7.5em minmax(0, 1fr); }
  .status-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-box > div:nth-child(2) { border-right: 0; }
  .status-box > div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .season { font-size: .68rem; }
  .season tbody th { width: 3.6em; }
}

@media (max-width: 420px) {
  .masthead { padding: 8px 12px; }
  .masthead__nav { gap: 12px; font-size: .84rem; }
}

/* 画面には出さず、読み上げにだけ渡す文字 */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 720px) {
  .target { gap: 2px 16px; }
  .target li + li::before { content: none; }
}
/* 0 件の知らせは一覧の枠いっぱいに出す（件数で枠が縮んで見えないように） */
.results__frame { display: flex; flex-direction: column; }
.results__frame > .empty { flex: 1 0 auto; }

/* 補助金さがし 2026-11-26 追加：小見出し・個人事業主の印 */
.sub { margin: 1.4em 0 .3em; font-size: .98rem; }
.row__meta .tag--sole { margin-right: 0; font-size: .68rem; color: var(--green-dark); border-color: var(--green); vertical-align: .05em; }
