/*
 * ヤルコトの公開ページ（yaru-koto.com。Sprint 22 ①）の共通の見た目。
 * 色・文字の大きさ・余白は docs/design-tokens.md（アプリの mobile/src/theme.ts）に合わせる。
 * 外部のフォント・画像は読まない（システムのフォント。飾りは CSS の線と色だけ）。
 * 赤・警告色は使わない。375px の幅で 1 段・横にスクロールしない（表は狭い幅で 1 行ずつのカードに積む）。
 */
:root {
  --brand: #0f9ba8;
  --brand-soft: #e6f5f6;
  --brand-deep: #0b6f79;
  --text: #1c2530;
  --text-sub: #6b7280;
  --text-faint: #9aa3ae;
  --bg: #f6f7f9;
  --bg-tint: #d9eef1; /* アプリの画面背景の対角グラデーションの右上（BG_GRADIENT） */
  --border: #e5e8ec;
  --border-input: #cfd5db;
  --border-chip: #d9dee3;
  --icon-muted: #c2c8cf;
  --marker: #ffe79a; /* アプリの引用マーカー（「ここを見て」の合図。例の箱の「@ より後ろ」） */
  --white: #ffffff;
  --radius-card: 12px;
  --column: 720px;
  --gutter: 20px;
  /* ヘッダー・本文・足もとの左端をそろえる（広い画面では本文の列の中に入れる） */
  --inset: max(var(--gutter), calc((100% - var(--column)) / 2 + var(--gutter)));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* アプリと同じ: 右上の淡い青緑から白へ。長いページでは上のほうだけに色が乗る */
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, var(--white)) no-repeat,
    linear-gradient(to bottom left, var(--bg-tint), var(--white)) no-repeat,
    var(--white);
  background-size: 100% 640px, 100% 640px;
  color: var(--text);
  font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: break-word;
  line-break: strict;
}

/* ── リンク ─────────────────────────────── */

a {
  color: var(--brand-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--brand);
}

a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── ヘッダー・本文の列・足もと ───────────── */

.site-header {
  padding: 16px var(--inset) 0;
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  /* アプリのロゴと同じブランド色の太字（画像は読まない） */
  color: var(--brand);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;
  text-decoration: none;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: 16px var(--gutter) 56px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 16px var(--inset) 32px;
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-sub);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand-deep);
  text-decoration: underline;
}

/* ── 見出しと段落 ─────────────────────────── */

h1,
h2,
h3 {
  text-wrap: balance;
}

/* 本文（p・li・dd・td）には text-wrap: pretty を付けない。iPhone の Safari では最後の行だけでなく全部の行の長さを
   ならすので、同じ幅の列でも項目ごとに行の右端がそろわなくなる（2026-10-27 の実機）。日本語はふつうに行の幅いっぱいまで詰める */

/* 途中で折り返さない語（アドレス・住所のまとまり・文の中のリンク）。行に収まらないときは前の語のあとで改行する */
.nowrap {
  white-space: nowrap;
}

h1 {
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin: 16px 0 16px;
}

h2 {
  font-size: 20px;
  line-height: 1.45;
  margin: 48px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 16px;
}

h3 {
  font-size: 17px;
  line-height: 1.5;
  margin: 28px 0 8px;
}

h2 + h3 {
  margin-top: 16px;
}

p,
ul,
ol,
dl,
table {
  margin: 8px 0;
}

p + p {
  margin-top: 12px;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin: 6px 0;
}

li::marker {
  color: var(--text-faint);
}

strong {
  font-weight: 700;
}

/* 「設定の手順」などの小見出し（h1 の上の 1 行） */
.sub {
  margin: 8px 0 0;
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.sub + h1 {
  margin-top: 4px;
}

.lead {
  font-size: 17px;
  line-height: 1.7;
}

.note {
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.7;
}

/* 用途の 1 行（アプリの PurposeLine と同じ: 補助文字の大きさ・灰色。警告色にしない） */
.purpose {
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.7;
}

.updated {
  color: var(--text-sub);
  font-size: 14px;
  margin-top: 40px;
}

/* ── 箱 ─────────────────────────────────── */

.box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  margin: 16px 0;
}

.box p {
  margin: 4px 0;
}

/* 専用アドレスの箱（アプリの AddressBox と同じ淡いブランド色の地） */
.address-box {
  background: var(--brand-soft);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin: 24px 0;
}

.address-box p {
  margin: 4px 0;
}

.address-box strong {
  color: var(--brand-deep);
  font-size: 14px;
}

/* ── 手順（アプリの StepRow と同じ: 26px の丸・淡いブランド色の地・番号はブランド色の太字） ── */

ol.steps {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  counter-reset: step;
}

ol.steps > li {
  position: relative;
  counter-increment: step;
  padding-left: 38px;
  margin: 0 0 14px;
  min-height: 26px;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
}

/* 手順の中の注記・選択肢（tetoru の②など）は手順の文の列にそろえる */
ol.steps > li > p,
ol.steps > li > ul {
  margin: 6px 0 0;
}

/* 手順の中身が長い段（tetoru の①②）は、番号の下から縦の線を伸ばす（アプリの tetoru のガイドと同じ） */
ol.steps > li:has(> p:not(.sender-example), > ul)::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 33px;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: var(--border-chip);
}

ol.steps > li:has(> p:not(.sender-example), > ul) {
  padding-bottom: 4px;
  margin-bottom: 20px;
}

/* 段の中に書き下ろした手順（tetoru の②の「Gmail の人」「iCloud メールの人」。Sprint 26 ④・D-84）。
   見出し・入れ子の手順・そのあとの注意は、/help/gmail・/help/icloud と同じ部品を縦の線の右に置くだけ。
   余白だけをそろえる（見出しの上 32・入れ子の手順の上 16・注意の行どうし 12＝本体のページと同じ間） */
ol.steps > li > h3 {
  margin: 32px 0 8px;
  scroll-margin-top: 16px;
}

ol.steps > li > ol.steps {
  margin: 16px 0 12px;
}

ol.steps > li > ol.steps + p,
ol.steps > li > p + p {
  margin-top: 12px;
}

/* 差出人を指定する手順のすぐ下の例の箱（D-84 ⑦・Sprint 26）。アプリの例の箱と同じ見た目:
   淡い地の箱（「スマホの人は先に」の箱と同じ地）に 1 文。「@ より後ろ」の部分（.after）は、アプリの「内容と根拠」の
   引用マーカーと同じ黄色（docs/design-tokens.md の「マーカー」＝「ここを見て」の合図）の地に濃紺の太字。
   アドレスの例（info@…）は途中で折り返さず、折り返すのは「なら」の前後だけ。例の箱だけの段には縦の線を引かない（上の :not） */
ol.steps > li > p.sender-example,
main > p.sender-example {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 15px;
  line-height: 1.9;
  overflow-wrap: anywhere;
  width: fit-content;
  max-width: 100%;
}

ol.steps .sender-example .after,
main > p.sender-example .after {
  white-space: nowrap;
  padding: 1px 4px 1px 2px;
  border-radius: 4px;
  background: var(--marker);
  color: var(--text);
  font-weight: 700;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* 手順の図解（D-75・Sprint 24）: 手順の文の列の中。元の SVG はアプリと同じ（site/public/help/figures/）。
   広い画面でも図と中の文字が大きくなりすぎないよう、幅は元の大きさ（アプリの 375px の画面での見え方）まで。狭い画面では幅いっぱいに縮む（Q9） */
ol.steps figure.step-figure {
  margin: 10px 0 4px;
  max-width: 320px;
}

ol.steps figure.step-figure img {
  display: block;
  width: 100%;
  height: auto;
}

/* ── スマホの人は先に（端末名を左の列に。アプリの淡い地の箱と同じ） ── */

.device-steps {
  list-style: none;
  padding: 0 16px;
  margin: 12px 0;
  background: var(--bg);
  border-radius: var(--radius-card);
}

.device-steps li {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  column-gap: 10px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 15px;
}

.device-steps li:first-child {
  border-top: 0;
}

.device-steps strong {
  font-size: 14px;
}

/* アプリのページ（/help/app）の「たとえば」の 2 行だけ: 375px で「をオン」だけが次の行に落ちるので、文節で折り返す
   （「「設定」→」「「メール受信設定」をオン」）。Gmail・iCloud の「スマホの人は先に」の箱は今の折り返しのまま */
.device-steps.app-examples li {
  text-wrap: pretty;
  word-break: auto-phrase;
}

/* 「たとえば」の文の下の小さな 1 行（コドモンの「園や学童がメールでも送ったときだけ届きます」。D-86 ⑭） */
.device-steps .sub {
  grid-column: 2;
  margin-top: 2px;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.6;
}

/* ── リンクだけの一覧（ほかの手順・ご案内）: アプリの設定の行と同じ、押せる行 ── */

ul.link-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

ul.link-list > li {
  margin: 0;
  border-top: 1px solid var(--border);
}

ul.link-list > li:first-child {
  border-top: 0;
}

ul.link-list a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 10px 40px 10px 16px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
}

/* 右端の山括弧（アプリの iconMuted と同じ色） */
ul.link-list a::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--icon-muted);
  border-right: 2px solid var(--icon-muted);
  transform: translateY(-50%) rotate(45deg);
}

ul.link-list a:hover {
  background: var(--bg);
  color: var(--brand-deep);
}

ul.link-list a:focus-visible {
  outline-offset: -2px;
  border-radius: 0;
}

/* ── 表（取得する情報・委託先） ──────────────── */

.table-wrap {
  margin: 16px 0;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 14px;
  line-height: 1.65;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--border);
}

thead th {
  border-top: 0;
  background: var(--bg);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
}

td:first-child {
  font-weight: 600;
}

th:first-child,
td:first-child {
  width: 11.5em;
}

/* 狭い幅では 1 行を 1 枚のカードにして縦に積む（列の見出しは data-label から各値の上に小さく出す） */
@media (max-width: 599px) {
  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap table {
    background: none;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table-wrap tr {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 12px 16px;
    margin: 0 0 8px;
  }

  .table-wrap td {
    border: 0;
    padding: 0;
  }

  .table-wrap td:first-child {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
  }

  .table-wrap td[data-label] {
    margin-top: 10px;
  }

  .table-wrap td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
  }
}

/* ── 事実の並び（運営者・特商法の表記など）: 白い箱に、項目名と値の組を罫線で区切る ── */

dl.facts {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0 16px;
  margin: 16px 0;
}

dl.facts dt {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-sub);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

dl.facts dt:first-child {
  border-top: 0;
}

dl.facts dd {
  margin: 2px 0 0;
  padding-bottom: 12px;
}

@media (min-width: 600px) {
  dl.facts {
    display: grid;
    grid-template-columns: minmax(8em, 13em) 1fr;
  }

  /* 項目名と値の罫線を 1 本につなげる（列の間にすき間を作らない） */
  dl.facts dt {
    padding: 14px 16px 12px 0;
  }

  dl.facts dd {
    margin: 0;
    padding: 12px 0;
    border-top: 1px solid var(--border);
  }

  dl.facts dt:first-child + dd {
    border-top: 0;
  }
}

/* ── 招待の受け皿のボタン（アプリの Btn と同じ: 高さ 52・角丸 12・17/600） ── */

.buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
}

.buttons .note {
  margin: 0;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.4;
  border-radius: 12px;
  padding: 12px 16px;
  min-height: 52px;
}

.button.primary {
  background: var(--brand);
  color: var(--white);
}

.button.primary:hover {
  background: var(--brand-deep);
  color: var(--white);
}

.button.secondary {
  background: var(--white);
  color: var(--brand);
  border: 1px solid var(--border-input);
}

.button.secondary:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.button:focus-visible {
  outline-offset: 3px;
  border-radius: 12px;
}

[hidden] {
  display: none !important;
}

/* 広い画面では本文の上に少し余白を足す（文字の大きさと本文の列 720px はそのまま） */
@media (min-width: 768px) {
  main {
    padding-top: 32px;
  }

  /* 招待の受け皿のボタンは広い画面で横に伸ばしすぎない */
  .buttons {
    max-width: 420px;
  }
}
