/* ============================================
   環境調整Lab. デザインシステム
   正本: website/docs/デザインガイド.md
   ============================================ */

:root {
  --green: #3A5944;
  --green-deep: #2C4435;
  --green-tint: #E9F0EA;
  --paper: #FAF7F0;
  --card: #FFFFFF;
  --line: #E4DECF;
  --ink: #2B2B27;
  --ink-soft: #6B675E;
  --alert: #8A5A44;
  --radius: 12px;
  --radius-s: 8px;
  /* spacing tokens: 既存の実値をそのまま変数化（視覚差分ゼロ）。
     8グリッド外(10/14/20/28)はCSS本体と合わせて将来正規化する暫定値。
     命名は値ベースで一意（例 --space-28 = 28px）。 */
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-14: 14px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;
  --space-32: 32px;
  --space-48: 48px;
}

/* ---- reset (最小限) ---- */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }
input, button, textarea { font: inherit; }

/* ---- base ---- */
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic Medium", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-underline-offset: 4px; }
a:hover { color: var(--green-deep); }
p + p { margin-top: 1em; }

/* ---- アクセシビリティ ---- */
.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 100;
  background: var(--green);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-s);
  transition: top .15s;
}
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: var(--radius-s); }
main:focus { outline: none; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
main section { padding: 56px 0; }
main section + section { border-top: 1px solid var(--line); }
.prose { max-width: 40em; }

/* ---- 見出し ---- */
h1 { font-size: clamp(26px, 5vw, 34px); font-weight: 700; line-height: 1.5; letter-spacing: 0.04em; }
h2 { font-size: 21px; font-weight: 700; line-height: 1.6; }
h3 { font-size: 16.5px; font-weight: 600; line-height: 1.7; }

.kicker {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-title {
  padding-bottom: 14px;
  border-bottom: 2px solid var(--green-tint);
  margin-bottom: 28px;
}
.lead { color: var(--ink-soft); max-width: 40em; margin-top: 16px; }

/* ---- ヘッダー ---- */
.site-head {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.head-in { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand span {
  margin-left: 10px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 2px 6px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--green); }

/* ---- パンくず ---- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; color: var(--ink-soft); font-size: 12px; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--green); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--line); }

/* ---- ヒーロー / ページヘッダ ---- */
.hero { padding: 64px 0 56px; }
.hero .lead { margin-top: 20px; }
.page-head { padding: 40px 0 48px; }
.page-head h1 { margin-top: 14px; }

/* ---- ボタン ---- */
.btn, .btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 26px;
  border-radius: var(--radius-s);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
}
.btn { background: var(--green); border: 1px solid var(--green); color: #fff; }
.btn:hover { background: var(--green-deep); color: #fff; }
.btn-line { background: transparent; border: 1px solid var(--green); color: var(--green); }
.btn-line:hover { background: var(--green-tint); color: var(--green-deep); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---- カード ---- */
.grid-2, .grid-3 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-soft); font-size: 14px; line-height: 1.9; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--green); }
a.card:hover h3 { color: var(--green); }
.card .more { display: inline-block; margin-top: 12px; color: var(--green); font-size: 13px; font-weight: 600; }

/* ---- タグ・価格 ---- */
.tag {
  display: inline-block;
  background: var(--green-tint);
  color: var(--green-deep);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 12px;
  font-weight: 600;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.price { font-size: 15px; font-weight: 700; color: var(--ink); }
.price small { color: var(--ink-soft); font-weight: 500; }

/* ---- 商品カード ---- */
.product { display: grid; grid-template-rows: auto 1fr; overflow: hidden; padding: 0; }
.product img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-bottom: 1px solid var(--line); }
.product .body { padding: 20px; display: grid; gap: 8px; align-content: start; }
.product .btn, .product .btn-line { min-height: 44px; margin-top: 6px; }

/* ---- 注意書き・補足 ---- */
.note-box {
  background: var(--green-tint);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.9;
}
.fine { color: var(--ink-soft); font-size: 12.5px; }

/* ---- 2段CTA（無料→有料） ---- */
.cta-duo {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  gap: 20px;
}
.cta-duo h2 { font-size: 18px; }
.cta-duo .free, .cta-duo .paid { display: grid; gap: 8px; }
.cta-duo .label { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--green); }

/* ---- 定義リスト風（手順） ---- */
.steps { counter-reset: step; display: grid; gap: 16px; }
.steps > li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px 20px 64px;
  position: relative;
}
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 22px;
  top: 22px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--ink-soft); font-size: 14px; }

/* ---- セルフチェック ---- */
.q-list { display: grid; gap: 14px; counter-reset: q; }
.q-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.q-card.q-missing { border-color: var(--alert); }
.q-card .q-text { font-weight: 600; font-size: 15px; line-height: 1.85; }
.q-card .q-text::before {
  counter-increment: q;
  content: counter(q) ". ";
  color: var(--green);
  font-weight: 700;
}
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pills label { cursor: pointer; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}
.pills input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.pills input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }

.bar-row { display: grid; grid-template-columns: 96px 1fr 48px; gap: 12px; align-items: center; }
.bar-row + .bar-row { margin-top: 10px; }
.bar-label { font-size: 13px; font-weight: 600; }
.bar-track { height: 10px; border-radius: 999px; background: var(--green-tint); overflow: hidden; }
.bar-fill { display: block; width: 0; height: 100%; background: var(--green); border-radius: 999px; transition: width .4s ease; }
.bar-score { font-size: 12px; color: var(--ink-soft); text-align: right; }
.warn { color: var(--alert); font-size: 13px; font-weight: 600; margin-top: 14px; }

/* ---- チェックリスト ---- */
.cl-progress { color: var(--green); font-weight: 700; font-size: 15px; }
.cl-list { display: grid; gap: 10px; margin-top: 20px; }
.cl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 2px 12px 2px 4px;
}
.cl-item label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 4px 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.cl-item input[type="checkbox"] { width: 22px; height: 22px; margin-left: 10px; accent-color: var(--green); flex: none; }
.cl-item input:checked ~ span { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--green); }
.cl-item .rm {
  border: 0; background: none; color: var(--ink-soft);
  font-size: 12px; min-height: 36px; padding: 0 10px; cursor: pointer;
}
.cl-item .rm:hover { color: var(--alert); }
.cl-add { display: flex; gap: 10px; margin-top: 20px; }
.cl-add input {
  flex: 1; min-height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--card); font-size: 16px;
}
.cl-add input:focus-visible { outline: 2px solid var(--green); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg button {
  border: 0; background: none; min-height: 44px; padding: 0 20px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--green); color: #fff; }

/* ---- フッター ---- */
.site-foot { border-top: 1px solid var(--line); padding: 56px 0 40px; margin-top: 64px; }
.foot-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
.foot-mission { color: var(--ink-soft); font-size: 13px; margin-top: 12px; max-width: 26em; }
.foot-grid h2 { font-size: 12px; letter-spacing: 0.12em; color: var(--ink-soft); margin-bottom: 10px; }
.foot-grid nav { display: grid; gap: 8px; align-content: start; }
.foot-grid nav a { color: var(--ink-soft); font-size: 13px; text-decoration: none; }
.foot-grid nav a:hover { color: var(--green); }
.foot-note { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; }
.foot-note a { color: inherit; }

/* ---- テーブル ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-size: 12.5px; letter-spacing: 0.06em; }

/* ---- 印刷（チェックリスト用） ---- */
.print-only { display: none; }
@media print {
  .site-head, .site-foot, .crumbs, .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; font-size: 14px; }
  main section { padding: 8px 0; border: 0 !important; }
  .cl-item { border: 0; border-bottom: 1px solid #999; border-radius: 0; break-inside: avoid; }
  .cl-item .rm { display: none; }
  .cl-item input:checked ~ span { color: inherit; text-decoration: none; }
}

/* ---- レスポンシブ ---- */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
@media (min-width: 880px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  main section { padding: 72px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar-fill { transition: none; }
}
