:root {
  --bg: #f4f6f9; --surface: #ffffff; --text: #1a1a1c; --muted: #555b66; --line: #d8dde5; --line-strong: #b9c1cd;
  --primary: #1d4f91; --primary-dark: #163d70; --primary-soft: #e8f0fa; --accent: #f5a623;
  --urgent: #b42318; --urgent-bg: #fdecea; --ok-bg: #e9f5ee; --ok: #1e6b3a; --closed-bg: #eceef2;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; font-size: 16px; line-height: 1.8; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }
.sp { display: none; }

/* お知らせ帯・ヘッダー */
.notice { background: #fff8e6; border-bottom: 1px solid #f0dfb0; font-size: .82rem; color: #5c4400; }
.notice .wrap { padding-top: 6px; padding-bottom: 6px; }
.site-header { background: var(--surface); border-bottom: 3px solid var(--primary); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-name { font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; }
.brand-sub { font-size: .78rem; color: var(--muted); }
.hsearch { display: flex; flex: 1 1 280px; max-width: 420px; }
.hsearch input { flex: 1; min-width: 0; padding: 9px 12px; font-size: .95rem; border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); }
.hsearch button { padding: 9px 16px; background: var(--primary); color: #fff; border: 0; border-radius: 0 var(--radius) var(--radius) 0; font-weight: 700; cursor: pointer; }
.gnav { background: var(--primary); }
.gnav .wrap { display: flex; flex-wrap: wrap; gap: 0; }
.gnav a { color: #fff; text-decoration: none; font-size: .9rem; font-weight: 500; padding: 10px 14px; }
.gnav a:hover { background: var(--primary-dark); color: #fff; }
.updated { font-size: .8rem; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--line); }
.updated .wrap { padding-top: 6px; padding-bottom: 6px; }

/* 本文 */
main.wrap { padding-top: 20px; padding-bottom: 56px; }
h1 { font-size: 1.6rem; line-height: 1.45; margin: 8px 0 12px; }
h2 { font-size: 1.2rem; line-height: 1.5; margin: 0 0 14px; padding-left: 12px; border-left: 5px solid var(--primary); }
h3 { font-size: 1rem; }
section { margin: 36px 0; }
.lead { color: var(--muted); }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { margin: 0 6px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 16px; }
.note { font-size: .85rem; color: var(--muted); }
.more { text-align: center; }

/* トップ */
.hero { background: linear-gradient(135deg, #1d4f91 0%, #2b6cb8 100%); color: #fff; border-radius: 12px; padding: 28px 28px 24px; margin-top: 4px; }
.hero h1 { color: #fff; font-size: 1.75rem; margin-top: 0; }
.hero p { color: #e6eefa; margin: 0 0 18px; }
.stats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stats li { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius); padding: 10px 12px; text-align: center; }
.s-num { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.s-label { font-size: .8rem; color: #e6eefa; }
.search-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px 12px; }
.filters label { display: flex; flex-direction: column; font-size: .82rem; color: var(--muted); font-weight: 500; }
.filters input[type=search], .filters select { margin-top: 4px; padding: 9px 10px; font-size: .95rem; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--text); font-family: inherit; }
.filters .chk { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 6px; }
.count { color: var(--muted); font-size: .88rem; margin: 14px 0 10px; }
.btn-sub { background: #fff; color: var(--primary); border: 1px solid var(--primary); border-radius: var(--radius); padding: 10px 24px; font-weight: 700; font-family: inherit; cursor: pointer; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sec-head a { font-size: .88rem; }

/* カード */
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card a { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.card a:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(29,79,145,.12); }
.card h3 { font-size: 1rem; line-height: 1.55; margin: 8px 0 10px; color: var(--primary-dark); }
.card-head, .detail-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kv { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 16px; margin: 0; font-size: .82rem; }
.kv div { min-width: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .75rem; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; color: var(--muted); }
.badge { font-size: .78rem; font-weight: 700; background: var(--ok-bg); color: var(--ok); padding: 2px 10px; border-radius: 4px; }
.badge.urgent { background: var(--urgent-bg); color: var(--urgent); }
.badge.closed { background: var(--closed-bg); color: var(--muted); }
.badge.soon { background: var(--primary-soft); color: var(--primary); }
.chip { font-size: .78rem; background: var(--primary-soft); color: var(--primary); padding: 2px 10px; border-radius: 4px; }
.chip.new { background: #fff3d6; color: #8a5a00; font-weight: 700; }

/* タイル（目的別） */
.tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tiles a { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; height: 100%; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--text); }
.tiles a:hover { border-color: var(--primary); }
.t-name { font-weight: 700; color: var(--primary-dark); }
.t-count { grid-row: 1; grid-column: 2; font-size: .82rem; color: var(--muted); }
.t-desc { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); line-height: 1.6; }

/* 地域（地域 → 都道府県の2段階） */
.nat-link { margin: 0 0 10px; }
.nat-link a { display: inline-block; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 8px 14px; text-decoration: none; font-weight: 700; }
.regions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: start; }
.region { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.region summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 700; color: var(--primary-dark); list-style: none; }
.region summary::-webkit-details-marker { display: none; }
.region summary::after { content: "＋"; color: var(--primary); font-weight: 700; }
.region[open] summary::after { content: "－"; }
.region[open] { grid-column: 1 / -1; }
.region[open] summary { border-bottom: 1px solid var(--line); }
.r-count { margin-left: auto; font-size: .82rem; font-weight: 500; color: var(--muted); }
.region .prefs { padding: 12px; }
.prefs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 6px; }
.prefs.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.prefs li a, .prefs li.empty { display: flex; justify-content: space-between; gap: 6px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--text); font-size: .92rem; }
.prefs li a:hover { border-color: var(--primary); }
.prefs li.empty { color: #9aa1ab; background: #f9fafb; }
.prefs span { color: var(--muted); font-size: .8rem; }

/* ステップ・案内 */
.steps ol { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--bg); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; }
.steps li::before { content: "STEP " counter(step); font-size: .75rem; font-weight: 700; color: var(--primary); }
.steps li span { font-size: .88rem; color: var(--muted); }
.numbered li { margin-bottom: 8px; }
.warn { border-left: 5px solid var(--urgent); }
.warn h2 { border-left: 0; padding-left: 0; }
.faq h2 { font-size: 1.05rem; }
.faq h2::before { content: "Q. "; color: var(--primary); }

/* 詳細 */
.detail h1 { margin-top: 10px; }
.summary { background: var(--primary-soft); border-color: #c9daf1; }
.summary h2 { border-left: 0; padding-left: 0; font-size: 1rem; color: var(--primary-dark); margin-bottom: 6px; }
.summary p { margin: 0; }
.facts { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); margin: 20px 0; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .93rem; }
.facts th { width: 10em; background: #f6f8fb; color: var(--text); font-weight: 700; }
.cta { text-align: center; margin: 24px 0; }
.btn { display: inline-block; background: var(--primary); color: #fff; padding: 14px 28px; border-radius: var(--radius); text-decoration: none; font-weight: 700; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.detail .body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.detail .body p { margin: 0 0 10px; }
.detail .body h3 { margin: 18px 0 8px; color: var(--primary-dark); }
.detail .body a { overflow-wrap: anywhere; }
.docs { padding-left: 1.2em; }
.checklist ul { margin: 0; padding-left: 1.2em; }
.checklist h2 { border-left: 0; padding-left: 0; }
.source { font-size: .85rem; color: var(--muted); }
.related-links a { display: inline-block; margin: 0 12px 6px 0; }

/* 制度一覧（東京都・雇用関係助成金・ガイド） */
.titems { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.titem { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.titem h3 { margin: 0 0 8px; font-size: 1.02rem; color: var(--primary-dark); line-height: 1.55; }
.titem p { margin: 6px 0; font-size: .92rem; }
.tsum { margin: 8px 0; font-size: .9rem; color: var(--text); }
.tsum p { margin: 2px 0; }
.titem .kv { margin: 10px 0; }
.btn-sub.small { display: inline-block; padding: 6px 14px; font-size: .85rem; text-decoration: none; margin-top: 6px; }
.toc ul { margin: 0; padding-left: 1.2em; columns: 2; }
.toc h2 { border-left: 0; padding-left: 0; }
.cal { margin-top: 14px; font-size: .9rem; }
.cal a { margin: 0 4px; }
p.box.summary { margin: 16px 0; }

/* 補助金診断 */
.diag-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: #fff8e6; border: 1px solid #f0dfb0; border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 16px 20px; }
.diag-cta p { margin: 0; }
.dc-title { font-weight: 700; font-size: 1.05rem; color: #5c4400; }
.diag .q { margin-bottom: 18px; }
.q-title { font-weight: 700; margin: 0 0 8px; color: var(--primary-dark); }
.diag select { padding: 9px 10px; font-size: 1rem; border: 1px solid var(--line-strong); border-radius: 6px; font-family: inherit; min-width: 240px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: .92rem; }
.opt:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); font-weight: 700; }
.d-result { margin-top: 24px; }
.r-head { font-size: 1.05rem; color: var(--primary-dark); margin: 20px 0 10px; }

/* 主要補助金の解説 */
.table-wrap { overflow-x: auto; }
.sched th, .sched td { font-size: .88rem; }
.sched thead th { background: var(--primary); color: #fff; width: auto; }
.points { padding-left: 1.2em; }
.points li { margin-bottom: 6px; }
.badge.open { background: var(--ok-bg); color: var(--ok); }
.cta .btn { margin: 4px; }

/* フッター */
.site-footer { background: #1f2a37; color: #cfd6df; font-size: .85rem; padding-top: 32px; }
.site-footer a { color: #e6ebf1; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.3fr; gap: 24px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.f-brand { font-size: 1.1rem; font-weight: 700; color: #fff; margin-top: 0; }
.f-head { font-weight: 700; color: #fff; margin-top: 0; }
.f-legal { border-top: 1px solid #3a4655; margin-top: 20px; padding-top: 16px; padding-bottom: 24px; font-size: .78rem; color: #aab4c0; }

@media (max-width: 860px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .f-q { grid-column: 1 / -1; }
  .cards, .tiles { grid-template-columns: 1fr; }
  .regions { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps ol { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  h1 { font-size: 1.35rem; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 1.4rem; }
  .sp { display: inline; }
  .filters { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr 1fr; }
  .facts th { width: 6.5em; }
  .gnav a { padding: 8px 10px; font-size: .85rem; }
  .hsearch { max-width: none; }
}
