:root {
  color-scheme: light;
  --ground: #F2F9F8;
  --surface: #FFFFFF;
  --surface-2: #EAF6F4;
  --ink: #36403F;
  --ink-2: #566260;
  --muted: #8A9694;
  --line: #DCEBE8;

  --main: #2FBBA0;
  --main-dark: #1F9A83;
  --main-pastel: #D6F2EC;
  --main-tint: #F0FAF8;

  --amber: #FFC247;
  --amber-deep: #C98A00;
  --amber-tint: #FFF7E3;

  --sky: #6BB6FF;
  --sky-tint: #EAF4FF;

  --shadow: 0 4px 14px rgba(47, 187, 160, .10), 0 1px 3px rgba(54, 64, 63, .06);
  --shadow-lift: 0 8px 22px rgba(47, 187, 160, .16);

  --f-round: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  --f-body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --f-num: "Quicksand", "M PLUS Rounded 1c", sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r: 20px;
  --r-sm: 12px;
  --measure: 42rem;
  --wide: 56rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #101817;
    --surface: #18211F;
    --surface-2: #1F2A28;
    --ink: #E9F0EE;
    --ink-2: #C5D0CD;
    --muted: #93A19E;
    --line: #2A3735;
    --main: #55D3B8;
    --main-dark: #7CE0C8;
    --main-pastel: #1B3B35;
    --main-tint: #16241F;
    --amber: #FFCD66;
    --amber-deep: #FFD98A;
    --amber-tint: #2B2416;
    --sky: #8FC8FF;
    --sky-tint: #17242F;
    --shadow: 0 4px 14px rgba(0, 0, 0, .35);
    --shadow-lift: 0 8px 22px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #101817;
  --surface: #18211F;
  --surface-2: #1F2A28;
  --ink: #E9F0EE;
  --ink-2: #C5D0CD;
  --muted: #93A19E;
  --line: #2A3735;
  --main: #55D3B8;
  --main-dark: #7CE0C8;
  --main-pastel: #1B3B35;
  --main-tint: #16241F;
  --amber: #FFCD66;
  --amber-deep: #FFD98A;
  --amber-tint: #2B2416;
  --sky: #8FC8FF;
  --sky-tint: #17242F;
  --shadow: 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-lift: 0 8px 22px rgba(0, 0, 0, .45);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }

/* ---------- サイトヘッダー ---------- */
.masthead { background: var(--surface); box-shadow: var(--shadow); position: relative; z-index: 2; }
.masthead-in {
  max-width: var(--wide);
  margin: 0 auto;
  padding-block: 16px;
  padding-inline: 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand {
  font-family: var(--f-num);
  font-weight: 700; font-size: 22px; letter-spacing: .06em;
  color: var(--main-dark); text-decoration: none;
  display: inline-flex; align-items: center; gap: 9px;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--main); color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: 0;
  display: grid; place-items: center;
  box-shadow: 0 3px 8px rgba(47,187,160,.35);
}
.brand-sub { font-family: var(--f-round); font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ---------- レイアウト ---------- */
.wrap { max-width: var(--wide); margin: 0 auto; padding-inline: 20px; padding-block: 0 72px; }
.col { max-width: var(--measure); margin-inline: auto; }

/* ---------- 記事ヘッダー ---------- */
.article-head { padding-block: 40px 4px; }
.kicker {
  display: inline-block;
  font-family: var(--f-round); font-weight: 700; font-size: 12px; letter-spacing: .08em;
  color: #fff; background: var(--main);
  padding: 5px 14px; border-radius: 999px; margin: 0 0 16px;
}
h1 {
  font-family: var(--f-round); font-weight: 800;
  font-size: clamp(25px, 5vw, 36px); line-height: 1.55;
  margin: 0; text-wrap: balance;
}
.byline {
  margin-top: 16px; font-family: var(--f-round); font-size: 13px; color: var(--muted);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.byline span {
  background: var(--surface-2); border-radius: 999px; padding: 3px 12px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 囲みボックス ---------- */
.box {
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 24px 26px; margin: 28px 0;
}
.box-ttl {
  font-family: var(--f-round); font-weight: 700; font-size: 16px;
  display: flex; align-items: center; gap: 9px; margin: 0 0 14px;
}
.box-ttl .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--main); flex: none; }

.box--summary { border: 2px solid var(--main-pastel); }
.box--summary dl {
  margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 15.5px;
}
.box--summary dt { color: var(--muted); white-space: nowrap; font-family: var(--f-round); }
.box--summary dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.box--point { background: var(--sky-tint); box-shadow: none; border: 2px dashed var(--sky); }
.box--point .box-ttl .dot { background: var(--sky); }

.box--note { background: var(--amber-tint); box-shadow: none; border: 2px solid var(--amber); }
.box--note .box-ttl { color: var(--amber-deep); }
.box--note .box-ttl .dot { background: var(--amber); }

.box p:last-child, .box ul:last-child, .box ol:last-child { margin-bottom: 0; }

/* ---------- 本文 ---------- */
p { margin: 0 0 1.5em; }
.lead { font-size: 18px; }
h2 {
  font-family: var(--f-round); font-weight: 800;
  font-size: clamp(20px, 3.4vw, 25px); line-height: 1.6;
  margin: 66px 0 24px; padding: 14px 20px;
  background: var(--main-tint); border-left: 7px solid var(--main);
  border-radius: 6px var(--r-sm) var(--r-sm) 6px;
  text-wrap: balance;
}
h3 {
  font-family: var(--f-round); font-weight: 700; font-size: 18px; line-height: 1.7;
  margin: 42px 0 14px; padding-bottom: 8px;
  border-bottom: 3px dotted var(--main-pastel);
}
strong { font-weight: 700; }
mark {
  background: linear-gradient(transparent 62%, var(--amber) 62%);
  color: inherit; padding: 0 .1em;
}
a { color: var(--main-dark); text-underline-offset: .25em; font-weight: 500; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--main); outline-offset: 3px; border-radius: 4px; }
code {
  font-family: var(--f-mono); font-size: .86em;
  background: var(--surface-2); color: var(--ink);
  padding: .15em .45em; border-radius: 6px;
}
.num { font-family: var(--f-num); font-weight: 700; font-variant-numeric: tabular-nums; }
ul, ol { margin: 0 0 1.5em; padding-left: 1.5em; }
li { margin-bottom: .5em; }
ul li::marker { color: var(--main); }
ol li::marker { color: var(--main-dark); font-weight: 700; }

/* ---------- 目次 ---------- */
.toc {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 22px 26px; margin: 34px 0 8px;
}
.toc-title {
  font-family: var(--f-round); font-weight: 700; font-size: 15px;
  text-align: center; margin-bottom: 14px; color: var(--main-dark);
}
.toc ol { margin: 0; padding-left: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin-bottom: .45em; padding-left: 34px; position: relative; font-size: 15.5px; }
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute; left: 0; top: .28em;
  font-family: var(--f-num); font-size: 12px; font-weight: 700; color: #fff;
  background: var(--main); border-radius: 7px; padding: 1px 7px;
}
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- 画面の引用 ---------- */
.screenquote {
  margin: 0 0 1.6em; background: var(--surface-2);
  border-radius: var(--r-sm); padding: 16px 20px 18px;
}
.screenquote .sq-label {
  font-family: var(--f-round); font-weight: 700; font-size: 11.5px; letter-spacing: .06em;
  color: var(--main-dark); display: block; margin-bottom: 7px;
}
.screenquote p { margin: 0; font-size: 15.5px; line-height: 1.85; color: var(--ink-2); }
.screenquote p + p { margin-top: .5em; }

/* ---------- 吹き出し ---------- */
.balloon { display: flex; gap: 12px; align-items: flex-start; margin: 26px 0 30px; }
.balloon-face {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: var(--main); color: #fff;
  font-family: var(--f-num); font-weight: 700; font-size: 14px;
  display: grid; place-items: center; box-shadow: 0 3px 9px rgba(47,187,160,.32);
}
.balloon-body {
  position: relative; background: var(--surface); border: 2px solid var(--main-pastel);
  border-radius: var(--r-sm); padding: 13px 18px; font-size: 15.5px; line-height: 1.8;
}
.balloon-body::before {
  content: ""; position: absolute; left: -9px; top: 16px;
  width: 14px; height: 14px; background: var(--surface);
  border-left: 2px solid var(--main-pastel); border-bottom: 2px solid var(--main-pastel);
  transform: rotate(45deg); border-radius: 0 0 0 4px;
}
.balloon p { margin: 0; }

/* ---------- スクリーンショット ---------- */
figure { margin: 30px auto 34px; max-width: var(--wide); }
figure img {
  display: block; width: 100%; height: auto;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lift);
  background: var(--surface);
  cursor: zoom-in;
}
figcaption {
  margin: 12px auto 0; max-width: var(--measure);
  font-family: var(--f-round); font-size: 13px; line-height: 1.75; color: var(--muted);
}
.shot-note {
  display: inline-block; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--main); border-radius: 999px; padding: 1px 9px; margin-right: .6em;
}

/* ---------- 手順 ---------- */
.step { margin-top: 46px; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.step-no {
  font-family: var(--f-num); font-size: 15px; font-weight: 700; color: #fff;
  background: var(--main); width: 38px; height: 38px; border-radius: 13px;
  display: grid; place-items: center; flex: none;
  box-shadow: 0 3px 9px rgba(47,187,160,.32);
}
.step-head h3 { margin: 0; padding: 0; border: 0; }

/* ---------- つまずき ---------- */
.snag {
  background: var(--amber-tint); border-radius: var(--r);
  border: 2px solid var(--amber); padding: 24px 26px 8px; margin: 28px 0;
}
.snag h3 {
  margin: 0 0 14px; padding: 0; border: 0; color: var(--amber-deep);
  display: flex; align-items: flex-start; gap: 9px;
}
.snag h3 .mark {
  font-family: var(--f-num); font-size: 13px; color: #fff; background: var(--amber-deep);
  border-radius: 8px; padding: 2px 9px; flex: none; margin-top: .35em;
}
.snag .screenquote { background: rgba(255,255,255,.62); }

/* ---------- 表 ---------- */
.table-scroll { overflow-x: auto; margin: 0 0 1.6em; border-radius: var(--r-sm); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 260px; font-size: 15.5px; background: var(--surface); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
thead th { font-family: var(--f-round); font-size: 13px; color: #fff; background: var(--main); border: 0; }
tbody tr:last-child td { border-bottom: 0; }
td:last-child { font-family: var(--f-num); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 記事末 ---------- */
.next {
  margin-top: 60px; background: var(--main-tint);
  border-radius: var(--r); padding: 28px 26px; text-align: center;
}
.next .next-label {
  font-family: var(--f-round); font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: #fff; background: var(--main); border-radius: 999px;
  padding: 4px 14px; display: inline-block; margin-bottom: 14px;
}
.next h2 {
  font-size: 20px; margin: 0 0 12px; padding: 0; background: none; border: 0; border-radius: 0;
}
.next p { margin: 0 0 20px; font-size: 15.5px; }
.btn {
  display: inline-block; font-family: var(--f-round); font-weight: 700; font-size: 16px;
  color: #fff; background: var(--main); text-decoration: none;
  padding: 14px 34px; border-radius: 999px; box-shadow: 0 5px 0 var(--main-dark);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 var(--main-dark); }

.about { margin-top: 36px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 26px; }
.about h2 { font-size: 17px; margin: 0 0 12px; padding: 0; background: none; border: 0; border-radius: 0; }
.about p { font-size: 15.5px; color: var(--ink-2); }
.about p:last-child { margin-bottom: 0; }

footer.site { background: var(--surface); margin-top: 0; }
footer.site .foot-in {
  max-width: var(--wide); margin: 0 auto; padding-block: 28px 36px; padding-inline: 20px;
  font-family: var(--f-round); font-size: 12.5px; color: var(--muted); text-align: center;
}

/* ---------- ライトボックス ---------- */
.zoom-note { font-family: var(--f-round); font-size: 13px; color: var(--muted); margin: 18px 0 0; text-align: center; }
#lb {
  position: fixed; inset: 0; background: rgba(18, 30, 28, .93);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 50; cursor: zoom-out;
}
#lb img { max-width: 100%; max-height: 100%; border-radius: var(--r-sm); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 560px) {
  body { font-size: 16px; line-height: 1.9; }
  h2 { padding: 12px 14px; }
  .box, .snag, .toc, .about, .next { padding: 20px 18px; border-radius: var(--r-sm); }
  .box--summary dl { grid-template-columns: 1fr; gap: 2px 0; }
  .box--summary dt { margin-top: 10px; }
  .balloon-face { width: 40px; height: 40px; font-size: 13px; }
}

/* ---------- トップ・一覧・404 ---------- */
.home-head { padding-block: 40px 8px; }
.home-head h1 { margin: 0 0 14px; }
.home-head p { color: var(--ink-2); }
.notfound { text-align: center; padding-block: 72px 24px; }
.list-title {
  font-family: var(--f-round); font-size: 18px; color: var(--main-dark);
  background: none; border: 0; padding: 0; margin: 32px 0 16px;
}
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.post-list .empty { color: var(--muted); }
.post-card {
  display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 16px; color: inherit; text-decoration: none;
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.post-card img { width: 100%; height: auto; aspect-ratio: 1440 / 1000; object-fit: cover; border-radius: var(--r-sm); display: block; }
.post-card-body h2 {
  font-size: 18px; line-height: 1.6; margin: 6px 0 8px;
  background: none; border: 0; padding: 0; color: var(--ink);
}
.post-card-body p { font-size: 14px; line-height: 1.8; color: var(--ink-2); margin: 0 0 8px; }
.post-card-body time { font-family: var(--f-num); font-size: 13px; color: var(--muted); }
@media (max-width: 560px) {
  .post-card { grid-template-columns: 1fr; gap: 12px; }
}

/* 見出しは文節で折り返す（対応ブラウザのみ。非対応でも従来どおり表示） */
h1, h2, h3 { word-break: auto-phrase; }
