/*
 * 利用規約・プライバシーポリシー・サポート（/terms, /privacy, /support）の共通スタイル。
 * JavaScript を使わない静的ページ。色はアプリと同じ（apps/web/src/styles/theme.css と iOS の Theme.swift）。
 * ロゴは暗い背景用の版がないので、ダークモードでは紙色の台の上に置く（docs/brand.md）。
 */

:root {
  color-scheme: light dark;
  --bg: #f8f6e7;
  --card: #ffffff;
  --text: #1c1b1b;
  --muted: #5d4039;
  --primary: #b32100;
  --primary-soft: #fbe9e4;
  --hairline: #eadfdb;
  --surface-low: #f6f3f2;
  --logo-plate: transparent;
  --logo-padding: 6px 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --card: #1c1918;
    --text: #f1ecea;
    --muted: #cdb8b2;
    --primary: #ff8a70;
    --primary-soft: #3a1d16;
    --hairline: #3a3230;
    --surface-low: #232020;
    --logo-plate: #f8f6e7;
    --logo-padding: 10px 12px;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', 'Yu Gothic',
    Meiryo, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.85;
  letter-spacing: 0.02em;
  line-break: strict;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}

.skip-link:focus {
  left: 16px;
}

.container {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  padding: 20px 0 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: var(--logo-padding);
  border-radius: 10px;
  background: var(--logo-plate);
}

.brand img {
  display: block;
  width: auto;
  height: 28px;
}

main {
  padding: 4px 0 40px;
}

.doc {
  padding: 28px 20px 36px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--card);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  word-break: auto-phrase;
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

h2 {
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--hairline);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
  scroll-margin-top: 16px;
}

h3 {
  margin: 1.75rem 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
}

p {
  margin: 0.75rem 0 0;
}

.meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.875rem;
}

.lead {
  margin-top: 24px;
}

ol,
ul {
  margin: 0.75rem 0 0;
  padding-left: 1.6em;
}

li {
  margin-top: 0.4rem;
}

li > ol,
li > ul {
  margin-top: 0.4rem;
}

/* 条文の号: (1) (2) … */
ol.items {
  list-style: none;
  padding-left: 2.4em;
  counter-reset: item;
}

ol.items > li {
  position: relative;
  counter-increment: item;
}

ol.items > li::before {
  content: '(' counter(item) ')';
  position: absolute;
  left: -2.4em;
  width: 2.1em;
  text-align: right;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

strong {
  font-weight: 700;
}

.note {
  margin-top: 1rem;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--primary-soft);
}

.toc {
  margin-top: 24px;
  padding: 0 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface-low);
  font-size: 0.9375rem;
}

.toc summary {
  padding: 10px 0;
  font-weight: 700;
  cursor: pointer;
}

.toc ol {
  margin: 0 0 14px;
  padding-left: 0;
  list-style: none;
}

.toc li {
  margin-top: 0.2rem;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

/* 事業者の情報など、見出しと値の組 */
.facts {
  margin: 0.75rem 0 0;
}

.facts > div {
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
}

.facts dt {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.facts dd {
  margin: 0;
}

/* 委託先・外部送信先の一覧 */
.vendors {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.vendors > li {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface-low);
}

.vendors h3 {
  margin: 0;
  font-size: 0.975rem;
}

.vendors p {
  margin-top: 0.35rem;
  font-size: 0.9375rem;
}

.vendors .label {
  color: var(--muted);
  font-weight: 700;
}

.faq h3 {
  margin-top: 2rem;
}

.contact-box {
  margin-top: 1rem;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface-low);
}

.contact-box p {
  margin: 0;
}

.contact-box .email {
  font-size: 1.125rem;
  font-weight: 700;
}

.site-footer {
  padding: 0 0 40px;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin: 0;
}

.site-footer a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer a[aria-current='page'] {
  color: var(--primary);
}

.site-footer p {
  margin-top: 12px;
}

@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }

  .site-header {
    padding-top: 28px;
  }

  .doc {
    padding: 44px 48px 52px;
  }

  h1 {
    font-size: 2rem;
  }

  .facts > div {
    display: grid;
    grid-template-columns: 8em 1fr;
    align-items: baseline;
    gap: 16px;
  }
}

@media print {
  :root {
    --bg: #ffffff;
    --card: #ffffff;
    --text: #000000;
    --muted: #333333;
    --primary: #000000;
    --primary-soft: #f2f2f2;
    --surface-low: #ffffff;
    --logo-plate: transparent;
    --logo-padding: 0;
  }

  .doc {
    padding: 0;
    border: 0;
  }

  .skip-link,
  .site-footer nav {
    display: none;
  }

  .toc[open] {
    break-inside: avoid;
  }
}
