:root {
  --bg: #fbf7ef;
  --paper: #ffffff;
  --ink: #2b2a27;
  --muted: #6d675d;
  --line: #e6dfd2;
  --accent: #2f7d5b;
  --accent-soft: #e3f1ea;
  --accent-deep: #215d43;
  --warn: #b4542a;
  --warn-soft: #fbe9df;
  --tag: #f2e7cf;
  --code-bg: #f6f3ec;
  --radius: 16px;
  --tap: 52px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  font-size: 17px; line-height: 1.85; letter-spacing: 0.02em;
  -webkit-tap-highlight-color: rgba(47,125,91,0.15);
}
img { max-width: 100%; }
a { color: var(--accent-deep); }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------- 上部バー ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(251,247,239,0.95); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 640px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px;
}
.topbar .brand { font-size: 14px; font-weight: 700; color: var(--accent-deep); text-decoration: none; line-height: 1.4; }
.btn-list {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none;
}
.btn-list svg { width: 18px; height: 18px; }

/* ---------- 共通の見出し・本文 ---------- */
h1 { font-size: 26px; line-height: 1.45; margin: 0 0 10px; }
h2 { font-size: 21px; line-height: 1.5; margin: 0 0 12px; }
h3 { font-size: 18px; line-height: 1.5; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 1.3em; }
li { margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 15px; }
.strong { font-weight: 700; color: var(--accent-deep); }

.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 18px; margin: 16px 0;
}
.sec-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 20px; }
.sec-title .icon {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft);
  display: inline-flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0;
}

.note {
  padding: 12px 14px; background: var(--warn-soft); border-radius: 12px;
  font-size: 15px; color: #5f3a26; margin: 14px 0;
}

/* ---------- トップ ---------- */
.hero { padding: 24px 0 4px; }
.hero .eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; margin: 0 0 6px; }
.hero .lead { font-size: 17px; }

.case-list { display: grid; gap: 14px; margin: 14px 0 0; }
.case-link {
  display: block; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}
.case-link:active { transform: scale(0.99); }
.case-link .thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; background: #eee; }
.case-link .body { padding: 14px 16px 16px; }
.case-link .no { color: var(--accent); font-weight: 700; font-size: 14px; }
.case-link .title { font-size: 19px; font-weight: 700; line-height: 1.5; margin: 2px 0 10px; }
.case-link .go { display: flex; justify-content: flex-end; margin-top: 10px; color: var(--accent-deep); font-weight: 700; font-size: 15px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li { margin: 0; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--tag); color: #6b5323; }
.chips li.green { background: var(--accent-soft); color: var(--accent-deep); }

.first-link {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 0;
  padding: 16px; border-radius: var(--radius); background: var(--accent-soft);
  color: var(--accent-deep); text-decoration: none; font-weight: 700; min-height: var(--tap);
}
.first-link .icon { font-size: 26px; }
.first-link small { display: block; font-weight: 400; color: var(--ink); font-size: 14px; }
.first-link .arrow { margin-left: auto; font-size: 20px; }

/* ---------- 事例ページ ---------- */
.case-head { padding: 20px 0 0; }
.case-head .no { color: var(--accent); font-weight: 700; font-size: 14px; margin: 0 0 4px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.fact { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; }
.fact .k { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.fact .v { display: block; font-size: 15px; font-weight: 700; line-height: 1.4; margin-top: 2px; }

.hero-img { margin: 0 0 8px; }
.hero-img img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--line); background: #eee; }
.hero-img figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

.summary { background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; font-weight: 700; color: var(--accent-deep); margin: 14px 0; }

/* ページ内の目次ボタン */
.jump { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 4px; }
.jump a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; padding: 8px 4px; border-radius: 12px; background: var(--paper);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; text-align: center; line-height: 1.35;
}
.jump a span { font-size: 20px; }

/* 先生のお話 */
.story p { margin-bottom: 10px; }
.story .who { font-size: 14px; color: var(--muted); margin-bottom: 8px; }

/* 手順 */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: st; }
.steps > li { position: relative; padding: 0 0 22px 46px; margin: 0; counter-increment: st; }
.steps > li::before {
  content: counter(st); position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 2px; background: var(--accent-soft);
}
.steps .st-title { font-weight: 700; font-size: 18px; line-height: 1.5; margin: 3px 0 6px; }

/* 準備するもの */
.need { list-style: none; padding: 0; margin: 0; }
.need li { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.need li:last-child { border-bottom: 0; }
.need b { display: block; font-size: 15px; color: var(--accent-deep); }

/* コピーできる文 */
.copybox { margin: 10px 0 12px; border: 2px solid var(--accent-soft); border-radius: 14px; background: var(--code-bg); overflow: hidden; }
.copybox .label { display: block; background: var(--accent-soft); color: var(--accent-deep); font-size: 13px; font-weight: 700; padding: 6px 12px; }
.copybox .text { padding: 12px 14px; margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 16px; line-height: 1.8; }
.copy {
  display: block; width: 100%; min-height: var(--tap); border: 0; border-top: 1px solid var(--line);
  background: #fff; color: var(--accent-deep); font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.copy:active { background: var(--accent-soft); }
.copy.done { background: var(--accent); color: #fff; }

/* チェック */
.check { list-style: none; padding: 0; margin: 6px 0 12px; }
.check li { position: relative; padding-left: 30px; }
.check li::before {
  content: ""; position: absolute; left: 2px; top: 6px; width: 18px; height: 18px;
  border: 2px solid var(--accent); border-radius: 5px; background: #fff;
}
.check .hot { color: var(--warn); font-weight: 700; font-size: 14px; display: block; }

/* 折りたたみ */
details.fold { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; }
details.fold summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 12px 16px; font-weight: 700; font-size: 18px;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary .icon { font-size: 20px; }
details.fold summary::after { content: "＋"; margin-left: auto; color: var(--accent); font-size: 20px; }
details.fold[open] summary::after { content: "－"; }
details.fold .fold-body { padding: 0 16px 14px; }

.qa { margin: 0 0 14px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.qa:last-child { border-bottom: 0; margin-bottom: 0; }
.qa .q { font-weight: 700; margin: 0 0 4px; }
.qa .q::before { content: "こまった："; color: var(--warn); font-size: 14px; }
.qa .a { margin: 0; }
.qa .a::before { content: "こうする："; color: var(--accent); font-size: 14px; font-weight: 700; }

.learn { background: var(--accent-soft); border-radius: var(--radius); padding: 18px 18px 8px; margin: 16px 0; }
.learn h2 { color: var(--accent-deep); font-size: 19px; }
.learn li b { color: var(--accent-deep); }

/* 下のナビ */
.bottom-nav { display: grid; gap: 10px; margin: 24px 0 8px; }
.nav-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap);
  padding: 10px 16px; border-radius: 14px; text-decoration: none; font-weight: 700; font-size: 16px; text-align: center; line-height: 1.4;
}
.nav-btn.primary { background: var(--accent); color: #fff; }
.nav-btn.ghost { background: var(--paper); border: 1px solid var(--line); color: var(--accent-deep); }

/* 投稿のおさそい */
.cta { margin: 24px 0 0; padding: 20px 18px; background: var(--accent); color: #fff; border-radius: var(--radius); }
.cta h2 { color: #fff; font-size: 19px; }
.cta ol { margin-bottom: 8px; }

footer { margin-top: 28px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
footer p { margin: 0 0 6px; }

@media (min-width: 600px) {
  h1 { font-size: 30px; }
  .case-list { grid-template-columns: 1fr 1fr; }
  .bottom-nav { grid-template-columns: 1fr 1fr; }
}

/* スマホで文の枠を広く：手順の字下げ分を戻す */
@media (max-width: 599px) {
  .card { padding: 18px 14px; }
  .steps > li { padding-left: 42px; }
  .steps .copybox { margin-left: -42px; }
  .copybox .text { font-size: 15.5px; }
}

/* ---------- 検索・しぼりこみ ---------- */
.finder { margin: 4px 0 6px; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--paper);
  border: 2px solid var(--line); border-radius: 14px; padding: 0 12px; min-height: var(--tap);
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 16px; color: var(--ink); padding: 12px 0;
}
.filter-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px;
  min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper); color: var(--accent-deep); font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.filter-toggle .caret { margin-left: auto; transition: transform .2s; }
.filter-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
.filter-toggle .badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
}
.filter-panel { background: var(--paper); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; padding: 6px 14px 12px; margin-top: -10px; padding-top: 16px; }
.fgroup { margin-top: 8px; }
.flabel { font-size: 14px; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.fchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.fchip[aria-pressed="true"]::before { content: "✓ "; }
.result-bar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-top: 6px; font-size: 15px; color: var(--muted); }
.clear { border: 0; background: none; color: var(--warn); font-family: inherit; font-size: 15px; font-weight: 700; min-height: 40px; padding: 0 4px; cursor: pointer; text-decoration: underline; }
.empty { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); padding: 20px 16px; text-align: center; color: var(--muted); margin: 0; }
[hidden] { display: none !important; }
