/* 文書のページ（プライバシーポリシー・利用規約・サポートなど）の共通の見た目。
   値は docs/design.md（アプリの Tokens.swift を写したもの）とトップページに合わせる */
:root {
  --color-warm-sand: #f7f6f2;
  --color-pure-white: #ffffff;
  --color-vermilion: #b52b22;
  --color-charcoal: #222222;
  --color-soft-slate: #777777;
  --color-hairline: rgba(119, 119, 119, 0.12);
  --color-washi-navy: #2b3d5c;

  --font-sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", sans-serif;
  --font-serif: "Hiragino Mincho ProN", "Noto Serif JP", serif;

  --text-caption: 12px;
  --text-footnote: 13px;
  --text-subheadline: 15px;
  --text-body: 17px;

  --radius-card: 22px;
  --shadow-card: rgba(0, 0, 0, 0.06) 0px 6px 16px 0px;
  --ease-calm: cubic-bezier(0.25, 0.1, 0.25, 1);

  /* 本文の1行の長さ（読みやすい 35〜40 字ほど） */
  --measure: 680px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-warm-sand);
  color: var(--color-charcoal);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.9;
  line-break: strict;
  text-autospace: normal;
  text-spacing-trim: normal;
}
/* 和紙の地（トップページと同じ） */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("washi.jpg") center / 720px repeat;
  filter: saturate(0.35) brightness(1.05);
  mix-blend-mode: multiply; opacity: 0.9;
}
h1, h2, h3, .brand { font-feature-settings: "palt" 1; }
h1, h2, h3 { word-break: auto-phrase; text-wrap: balance; }

/* ヘッダー */
/* すべてのページで同じ形・同じ位置（トップページと同じ）。上に留め、読み進めたら和紙色の半透明の地を敷く（page.js が scrolled を付ける） */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 40px);
  transition: background-color 0.5s var(--ease-calm), box-shadow 0.5s var(--ease-calm);
}
.site-header.scrolled {
  background-color: rgba(247, 246, 242, 0.82);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--color-hairline);
}
/* アプリを入れるボタン（トップページの .button-primary.small と同じ） */
.button-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-vermilion); color: var(--color-pure-white);
  border-radius: 999px; text-decoration: none; font-weight: 600; font-feature-settings: "palt" 1;
  transition: opacity 0.2s ease-in-out;
}
.button-primary:hover { opacity: 0.85; }
.button-primary:focus-visible { outline: 2px solid var(--color-charcoal); outline-offset: 3px; }
.button-primary.small { font-size: var(--text-subheadline); line-height: 1.5; padding: 8px 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 600; }
.brand img { width: 32px; height: 32px; border-radius: 8px; box-shadow: var(--shadow-card); }
.brand small { color: var(--color-soft-slate); font-weight: 400; font-size: var(--text-caption); }
.back-link { color: var(--color-soft-slate); font-size: var(--text-footnote); text-decoration: none; }
.back-link:hover { color: var(--color-charcoal); }
/* ヘッダーの右。トップページへのリンクと、日本語・英語の切り替え（プライバシーポリシーと利用規約） */
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions a { white-space: nowrap; }
/* 言語の切り替えは、文書の頭（見出しの上）の右端に置く */
.doc-head .lang-switch { display: flex; width: fit-content; margin: 0 0 24px auto; }
/* グローバルナビ（いまはサポートだけ）。囲まない文字だけのリンク。乗せると朱の下線、今いるページには朱の点を付ける */
.global-nav { display: flex; }
.global-nav a, .lang-switch a { white-space: nowrap; }
.global-nav a {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 4px;
  color: var(--color-charcoal); font-size: var(--text-subheadline); font-weight: 500; line-height: 1.5; text-decoration: none;
  text-underline-offset: 6px; text-decoration-thickness: 1px;
}
.global-nav a:hover { text-decoration: underline; text-decoration-color: var(--color-vermilion); }
.global-nav a:focus-visible { outline: 2px solid var(--color-vermilion); outline-offset: 2px; border-radius: 4px; }
.global-nav a[aria-current="page"] { font-weight: 600; }
.global-nav a[aria-current="page"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-vermilion); }
.lang-switch {
  display: inline-flex; padding: 3px; border-radius: 999px;
  border: 1px solid rgba(119, 119, 119, 0.2); background: rgba(255, 255, 255, 0.7);
}
.lang-switch a {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  color: var(--color-soft-slate); font-size: var(--text-footnote); line-height: 1.4; text-decoration: none;
  transition: background-color 0.3s var(--ease-calm), color 0.3s var(--ease-calm);
}
.lang-switch a:hover { color: var(--color-charcoal); }
.lang-switch a[aria-current="true"] { background: var(--color-pure-white); color: var(--color-charcoal); font-weight: 600; box-shadow: var(--shadow-card); }
.lang-switch a:focus-visible { outline: 2px solid var(--color-vermilion); outline-offset: 2px; }
.lang-switch .flag { font-size: 15px; line-height: 1; }

/* 本文 */
.doc { max-width: var(--measure); margin: 0 auto; padding: clamp(48px, 9vw, 112px) 16px clamp(72px, 10vw, 128px); }
.doc-head { margin-bottom: 48px; }
.doc-kicker { margin: 0 0 12px; color: var(--color-vermilion); font-size: var(--text-footnote); font-weight: 600; letter-spacing: 0.12em; }
.doc h1 { margin: 0; font-family: var(--font-serif); font-size: clamp(32px, 5vw, 44px); font-weight: 600; line-height: 1.35; letter-spacing: 0.02em; }
.doc-date { margin: 16px 0 0; color: var(--color-soft-slate); font-size: var(--text-footnote); }
.doc-lead { margin: 32px 0 0; }

/* 要点。白いカードに短く並べる */
.summary {
  margin: 0 0 64px; padding: 28px 32px;
  border-radius: var(--radius-card); background: var(--color-pure-white); box-shadow: var(--shadow-card);
}
.summary h2 { margin: 0 0 12px; font-size: var(--text-subheadline); font-weight: 600; }
.summary ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.summary li { position: relative; padding-left: 20px; font-size: var(--text-subheadline); line-height: 1.8; }
.summary li::before {
  content: ""; position: absolute; left: 2px; top: 0.72em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--color-vermilion);
}

.doc section { padding: 40px 0; border-top: 1px solid var(--color-hairline); }
.doc section h2 { display: flex; align-items: baseline; gap: 14px; margin: 0 0 16px; font-size: clamp(20px, 2.6vw, 22px); font-weight: 600; line-height: 1.5; }
.doc section h2 .num { flex: none; color: var(--color-vermilion); font-family: var(--font-serif); font-size: var(--text-subheadline); font-weight: 600; }
.doc h3 { margin: 28px 0 6px; font-size: var(--text-body); font-weight: 600; }
.doc p { margin: 0 0 12px; }
.doc section > ul { margin: 0 0 12px; padding-left: 1.2em; }
.doc section > ul li { margin-bottom: 6px; }
.doc a { color: inherit; text-underline-offset: 4px; text-decoration-color: rgba(34, 34, 34, 0.3); }
.doc a:hover { text-decoration-color: currentColor; }

/* 用語と説明の組（カメラ：〜 など） */
.terms-list { margin: 0 0 12px; display: grid; gap: 16px; }
.terms-list div { display: grid; grid-template-columns: 7.5em 1fr; gap: 4px 20px; }
.terms-list dt { font-weight: 600; }
.terms-list dd { margin: 0; }
@media (max-width: 560px) {
  .terms-list div { grid-template-columns: 1fr; }
  .summary { padding: 24px 22px; }
  /* 狭い幅では読みを「印帖」の下に小さく重ねる（読み方が分かるよう、いつも出しておく） */
  .brand > span { display: flex; flex-direction: column; line-height: 1.25; }
  .brand small { line-height: 1.2; }
}
/* 狭い幅では、名前・サポート・アプリを入れるボタンが1行に収まるよう詰める（トップページと同じ） */
@media (max-width: 420px) {
  .header-actions { gap: 8px; }
  .header-actions .global-nav a { padding: 5px 2px; }
  .header-actions .button-primary.small { padding: 7px 12px; font-size: var(--text-footnote); }
}

.note { color: var(--color-soft-slate); font-size: var(--text-subheadline); }

/* 目次（サポート）。白いカードに2列で並べる */
.toc {
  margin: 0 0 64px; padding: 28px 32px;
  border-radius: var(--radius-card); background: var(--color-pure-white); box-shadow: var(--shadow-card);
}
.toc h2 { margin: 0 0 12px; font-size: var(--text-subheadline); font-weight: 600; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; columns: 2; column-gap: 32px; }
.toc li { counter-increment: toc; break-inside: avoid; font-size: var(--text-subheadline); line-height: 2; }
.toc li::before {
  content: counter(toc, decimal-leading-zero); display: inline-block; width: 2.2em;
  color: var(--color-vermilion); font-family: var(--font-serif); font-weight: 600;
}
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* 番号つきの手順 */
.doc ol.steps { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.doc ol.steps li { counter-increment: step; position: relative; padding-left: 2.4em; }
.doc ol.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.2em;
  width: 1.7em; height: 1.7em; display: grid; place-items: center; border-radius: 50%;
  background: var(--color-pure-white); box-shadow: var(--shadow-card);
  color: var(--color-vermilion); font-size: var(--text-footnote); font-weight: 600; line-height: 1;
}

/* 文と、アプリの画面の図を横に並べる。狭い幅では図を下に置く */
.with-shot { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 32px; align-items: start; margin-bottom: 12px; }
.with-shot ul { margin: 0 0 12px; padding-left: 1.2em; }
.with-shot ul li { margin-bottom: 6px; }
.shot { margin: 0; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-card); background: var(--color-pure-white); }
.shot img { display: block; width: 100%; height: auto; }
@media (max-width: 560px) {
  .with-shot { grid-template-columns: 1fr; }
  .shot { width: 200px; margin: 8px auto 0; }
  .toc { padding: 24px 22px; }
  .toc ol { columns: 1; }
}

/* 使い方の動画。押すまでは手元のサムネイルだけを出し、押すと同じ大きさの YouTube の再生枠に替える */
.video { margin: 28px 0 0; }
.video-play, .video iframe {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0;
  border-radius: var(--radius-card); overflow: hidden; background: var(--color-pure-white); box-shadow: var(--shadow-card);
}
.video-play img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-play-icon {
  position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border-radius: 50%; background: var(--color-vermilion); box-shadow: rgba(0, 0, 0, 0.18) 0px 6px 16px 0px;
  transition: transform 0.3s ease;
}
.video-play-icon::after {
  content: ""; position: absolute; left: 29px; top: 23px;
  border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent var(--color-pure-white);
}
.video-play:hover .video-play-icon { transform: scale(1.06); }
.video-play:focus-visible { outline: 2px solid var(--color-vermilion); outline-offset: 3px; }
.video figcaption { margin-top: 10px; color: var(--color-soft-slate); font-size: var(--text-footnote); }
@media (prefers-reduced-motion: reduce) { .video-play-icon { transition: none; } }

/* 困ったとき（開いて読む問いと答え。トップページのよくある質問と同じ見た目） */
.faq { border-top: 1px solid var(--color-hairline); }
.faq details { border-bottom: 1px solid var(--color-hairline); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 4px;
  cursor: pointer; list-style: none; font-weight: 600; font-feature-settings: "palt" 1;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; border: solid var(--color-soft-slate); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-3px); transition: transform 0.5s var(--ease-calm);
}
.faq details[open] summary::after { transform: rotate(225deg) translateY(-3px); }
.faq summary:focus-visible { outline: 2px solid var(--color-vermilion); outline-offset: 2px; border-radius: 8px; }
.faq details p { margin: 0 4px 20px; color: var(--color-soft-slate); font-size: var(--text-subheadline); }
.doc section > ul, .doc section > p { text-wrap: pretty; }

/* 問い合わせ先 */
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 20px 0 24px; }
.copy-button {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 12px 24px 12px 26px; border-radius: 999px;
  border: 1px solid rgba(119, 119, 119, 0.25); background: rgba(119, 119, 119, 0.08);
  color: #555555; text-decoration: none; font: inherit; font-size: var(--text-subheadline); line-height: 1.4;
  cursor: pointer; transition: background-color 0.3s var(--ease-calm), color 0.3s var(--ease-calm);
}
.copy-button:hover { background: rgba(119, 119, 119, 0.14); color: var(--color-charcoal); }
.copy-button:focus-visible { outline: 2px solid var(--color-vermilion); outline-offset: 3px; }
.copy-button.copied { color: var(--color-charcoal); }
.copy-fallback { font-weight: 600; user-select: all; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* フッター（トップページと同じ） */
.site-footer { padding: 48px clamp(16px, 6.5vw, 96px); background: var(--color-washi-navy); color: var(--color-pure-white); font-size: var(--text-footnote); }
.site-footer .inner { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: inherit; text-decoration: none; opacity: 0.85; }
.site-footer a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.site-footer a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.site-footer small { opacity: 0.6; font-size: var(--text-caption); }


/* 広い画面では、目次を左の列に置き、スクロールしても見えるようにする（サポート）。
   目次は本文と同じ grid の1列目に置き、全行にまたがらせて sticky で止める */
@media (min-width: 1080px) {
  .doc.has-toc {
    max-width: calc(var(--measure) + 240px);
    display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 40px; align-items: start;
  }
  .doc.has-toc > :not(.toc) { grid-column: 2; }
  .doc.has-toc > .toc {
    grid-column: 1; grid-row: 1 / span 40; align-self: start;
    position: sticky; top: 88px; max-height: calc(100vh - 120px); overflow-y: auto;
    margin: 0; padding: 4px 0; background: none; box-shadow: none; border-radius: 0;
  }
  .doc.has-toc > .toc h2 { margin-bottom: 8px; color: var(--color-soft-slate); font-size: var(--text-footnote); }
  .doc.has-toc > .toc ol { columns: 1; }
  .doc.has-toc > .toc li { font-size: var(--text-footnote); line-height: 1.5; }
  .doc.has-toc > .toc li::before { width: 2em; font-size: var(--text-caption); }
  .doc.has-toc > .toc a {
    display: inline-block; padding: 5px 0; color: var(--color-soft-slate);
    transition: color 0.3s var(--ease-calm);
  }
  .doc.has-toc > .toc a:hover { color: var(--color-charcoal); text-decoration: none; }
  /* 今読んでいる節 */
  .doc.has-toc > .toc a[aria-current="true"] { color: var(--color-charcoal); font-weight: 600; }
}
/* 目次から飛んだとき、見出しが画面の上に貼りつかないよう少しあける */
.doc.has-toc section h2 { scroll-margin-top: 24px; }

/* ページの中を探す（サポート） */
.search { margin-top: 32px; }
.search input {
  width: 100%; padding: 14px 20px 14px 48px; border-radius: 999px;
  border: 1px solid rgba(119, 119, 119, 0.25); font: inherit; font-size: var(--text-subheadline); color: var(--color-charcoal);
  background: var(--color-pure-white) no-repeat 18px center / 18px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777777' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  box-shadow: var(--shadow-card); -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--color-soft-slate); }
.search input:focus-visible { outline: 2px solid var(--color-vermilion); outline-offset: 2px; }
.doc .search-status { margin: 12px 4px 0; color: var(--color-soft-slate); font-size: var(--text-footnote); }
.search-status a { color: var(--color-charcoal); }
.doc mark { background: rgba(181, 43, 34, 0.18); color: inherit; border-radius: 3px; padding: 0 1px; }
/* 探している間、当たらない節の目次の項目は淡くする */
.toc li.is-dimmed { opacity: 0.35; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: 0.6; cursor: pointer; }
/* 狭い幅では、探している間は冒頭の目次を隠して結果をすぐ下に出す */
@media (max-width: 1079px) { .doc.is-searching > .toc { display: none; } }
/* 押すとそのことばで探す例。検索のボックスを押したときの朱の枠（outline-offset 2px）に重ならないよう、上を広めにあける。本文の段落の余白（.doc p）より強く効かせる */
.doc .search-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 4px 0; color: var(--color-soft-slate); font-size: var(--text-footnote); }
.search-examples button {
  padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(119, 119, 119, 0.25); background: rgba(119, 119, 119, 0.06);
  color: var(--color-charcoal); font: inherit; cursor: pointer; transition: background-color 0.3s var(--ease-calm);
}
.search-examples button:hover { background: rgba(119, 119, 119, 0.14); }
.search-examples button:focus-visible { outline: 2px solid var(--color-vermilion); outline-offset: 2px; }
