/* 使い方のページ（/guide/）。CSP で style 属性とインラインの style が使えないので、見た目はすべてこのファイルに置く */
:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-bg: #eff6ff;
  --note-bg: #fffbeb;
  --note-line: #f59e0b;
  --shot-line: #cbd5e1;
  --max: 880px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020617;
    --card: #0f172a;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --line: #1e293b;
    --accent: #60a5fa;
    --accent-bg: #172554;
    --note-bg: #1c1917;
    --note-line: #b45309;
    --shot-line: #334155;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  line-height: 1.8;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 24px 16px 64px; }
header.top { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 24px; }
header.top .brand { color: var(--accent); font-weight: 700; font-size: 14px; margin: 0; }
h1 { font-size: 28px; line-height: 1.4; margin: 4px 0 8px; }
h2 {
  font-size: 22px;
  line-height: 1.4;
  margin: 56px 0 12px;
  padding-left: 12px;
  border-left: 5px solid var(--accent);
}
h3 { font-size: 18px; margin: 32px 0 8px; }
h4 { font-size: 16px; margin: 20px 0 4px; }
p { margin: 8px 0; }
a { color: var(--accent); }
.lead { color: var(--muted); }
.updated { color: var(--muted); font-size: 13px; margin: 0; }
ol.steps, ul.points { padding-left: 1.4em; margin: 8px 0; }
ol.steps li, ul.points li { margin: 4px 0; }
b.ui { font-weight: 700; white-space: nowrap; }
b.ui::before { content: "「"; font-weight: 400; }
b.ui::after { content: "」"; font-weight: 400; }

nav.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 16px 0 8px;
}
nav.toc p { margin: 0 0 4px; font-weight: 700; }
nav.toc p.toc-first { font-weight: 400; margin: 0 0 6px; }
nav.toc ol { margin: 0; padding-left: 1.4em; columns: 2; column-gap: 24px; }
nav.toc li { break-inside: avoid; }
@media (max-width: 560px) { nav.toc ol { columns: 1; } }

.flow { display: flex; flex-wrap: wrap; gap: 8px 0; align-items: center; margin: 12px 0; padding: 0; list-style: none; }
.flow li {
  background: var(--accent-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 14px;
  font-weight: 600;
}
.flow li { position: relative; }
.flow li + li { margin-left: 22px; }
.flow li + li::before { content: "→"; position: absolute; left: -22px; width: 22px; text-align: center; color: var(--muted); font-weight: 400; }

.note {
  background: var(--note-bg);
  border-left: 4px solid var(--note-line);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 15px;
}
.note p { margin: 4px 0; }

/* 画面写真。スマホの写真は細く、PC の写真は横いっぱい */
.shots { display: grid; gap: 16px; margin: 16px 0; align-items: start; }
.shots.sp-pc { grid-template-columns: minmax(0, 1fr); }
.shots.sp-row { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@media (min-width: 720px) {
  .shots.sp-pc { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
}
figure { margin: 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--shot-line);
  border-radius: 10px;
  background: #020617;
}
figure.sp img { max-width: 300px; margin: 0 auto; }
.shots.sp-row figure.sp img { max-width: 100%; }
figcaption { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 6px; text-align: center; }
/* スマホ幅では PC の写真は小さくて読めないので出さない（スマホの写真で足りる） */
@media (max-width: 719px) { figure.pc-only-wide { display: none; } }

table.menu { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
table.menu th, table.menu td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
table.menu th { white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.back-top { margin-top: 24px; font-size: 14px; }
footer { border-top: 1px solid var(--line); margin-top: 56px; padding-top: 16px; color: var(--muted); font-size: 13px; }

/* スクロールしている間だけ右上に出る「目次へ戻る」（guide.js が is-on を付け外しする。止まって2秒で消える） */
.to-toc {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.25s, transform 0.25s, visibility 0s linear 0.25s;
}
.to-toc.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s, transform 0.2s;
}
@media (prefers-color-scheme: dark) { .to-toc { color: #020617; } }
@media (prefers-reduced-motion: reduce) { .to-toc, .to-toc.is-on { transition: none; } }

/* ホーム画面に追加したアプリの中で開いたときだけ出す上の帯（guide.js が hidden を外す）。閉じる手段が無いので常に出しておく */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.app-bar[hidden] { display: none; }
.app-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
@media (prefers-color-scheme: dark) { .app-back { color: #020617; } }
.app-bar-title { font-weight: 700; color: var(--muted); font-size: 14px; }
body.in-app .to-toc { top: 72px; }
body.in-app { scroll-padding-top: 72px; }
html:has(body.in-app) { scroll-padding-top: 72px; }
/* 説明図（SVG・白地）。PC の図は横いっぱい、スマホ幅でも出す（文字は図の中で大きめに描いてある） */
figure.pc-fig img { max-width: 720px; margin: 0 auto; background: #fff; }
.shots.sp-row figure.sp img[src$=".svg"] { background: #fff; max-width: 240px; margin: 0 auto; }
