/* ==========================================================================
   CITYFALL Legal — Light Editorial
   WHYBUY・POKERHUB の法的文書サイトと同じ組み（濃色のヘッダー＋紙色の本文、
   Schibsted Grotesk＋Zen Kaku Gothic New、番号つきの節、枠つきの表）。
   違うのは色と印だけ——本体の橙と黒に合わせ、印は倒れる塔にしてある。
   ========================================================================== */

:root {
  --bg: #FAF8F5;
  --bg-tint: #F2EEE8;
  --surface: #FFFFFF;
  --ink: #1A1714;
  --ink-soft: #54504A;
  --ink-mute: #827B71;
  --heading: #12100E;
  /* 本体の橙（#FF8A1F）は紙の上では読めないので、文字と線には焦がした橙を使い、
     明るい橙は濃色のヘッダーの上の印だけに使う */
  --accent: #C2410C;
  --accent-deep: #9A3412;
  --accent-tint: #FDEDE2;
  --accent-bright: #FF8A1F;
  --line: #E8E3DB;
  --line-soft: #F2EEE8;
  --line-strong: #D8D2C8;
  --header: #0B0D11;

  --shadow-sm: 0 1px 2px rgba(26, 23, 20, .05), 0 1px 1px rgba(26, 23, 20, .03);
  --shadow-lg: 0 22px 56px -16px rgba(26, 23, 20, .18);

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --readw: 720px;

  --font-display: "Schibsted Grotesk", "Zen Kaku Gothic New", -apple-system, sans-serif;
  --font-body: "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; font-size: 17px; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.75;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  line-break: strict;
}

::selection { background: rgba(194, 65, 12, .16); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* --- 読んだところを示す帯 -------------------------------------------------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent));
  transform: scaleX(0); transform-origin: 0 50%; will-change: transform;
}

/* --- ヘッダー（本体の黒） -------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 17, .92);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-header__inner {
  max-width: var(--maxw); margin: 0 auto; padding: .7em 1.5em;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1em; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .6em;
  text-decoration: none; color: #fff;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.05rem; letter-spacing: .12em;
}
/* 印はアプリのアイコンそのもの（角丸は iOS の板と同じ見え方に寄せる） */
.brand__icon { width: 26px; height: 26px; border-radius: 7px; flex: none; display: block; }
.brand__icon--sm { width: 18px; height: 18px; border-radius: 5px; }

.nav { display: flex; align-items: center; gap: 1em; flex-wrap: wrap; }
.nav__group--docs {
  display: flex; background: rgba(255, 255, 255, .08);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.nav__tab {
  padding: .42em .95em; border-radius: 999px; text-decoration: none;
  color: rgba(255, 255, 255, .62); font-size: .82rem; font-weight: 500;
  white-space: nowrap; transition: color .2s, background .2s;
}
.nav__tab.is-active { background: rgba(255, 255, 255, .95); color: var(--heading); }
.nav__tab:hover:not(.is-active) { color: #fff; }
.nav__group--lang { display: flex; align-items: center; gap: .35em; }
.nav__lang {
  font-size: .78rem; font-weight: 600; letter-spacing: .05em;
  color: rgba(255, 255, 255, .5); text-decoration: none;
  padding: .22em .42em; border-radius: 6px; transition: color .2s;
}
.nav__lang:hover { color: #fff; }
.nav__sep { width: 1px; height: 13px; background: rgba(255, 255, 255, .2); }

/* --- 本文の枠 -------------------------------------------------------------- */
.layout { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.4em, 5vw, 4em) 1.5em 2em; }
.doc-article { max-width: var(--readw); }

.doc-head { margin-bottom: 2.4em; }
.doc-eyebrow {
  display: inline-flex; align-items: center; gap: .55em;
  font-size: .74rem; letter-spacing: .17em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 1.2em;
}
.doc-eyebrow__dot { width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); border-radius: 1px; }
.doc-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2rem, 1.5rem + 2.2vw, 2.8rem);
  line-height: 1.14; letter-spacing: -.01em; color: var(--heading); margin: 0 0 .35em;
}
.doc-subtitle { font-size: 1.08rem; color: var(--ink-soft); line-height: 1.7; margin: 0 0 1.5em; max-width: 36em; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 1.2em 2.4em; padding-top: 1.3em; border-top: 1px solid var(--line); }
.doc-meta__item { display: flex; flex-direction: column; gap: .25em; }
.doc-meta__label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); }
.doc-meta__value { font-size: .93rem; color: var(--heading); font-weight: 500; font-variant-numeric: tabular-nums; }
.doc-meta__value a { color: var(--accent); }

/* --- 本文 ------------------------------------------------------------------ */
.doc-section { counter-reset: section; }
.doc-body > :first-child { margin-top: 0; }

.doc-body h2 {
  counter-increment: section;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); line-height: 1.3;
  color: var(--heading); margin: 2.8em 0 .8em;
  padding-top: 1.7em; border-top: 1px solid var(--line); scroll-margin-top: 84px;
}
.doc-body h2::before {
  content: counter(section, decimal-leading-zero);
  display: block; font-family: var(--font-display);
  font-size: .8rem; font-weight: 600; letter-spacing: .18em;
  color: var(--accent); margin-bottom: .45em;
}
.doc-section > h2:first-of-type { padding-top: 0; border-top: none; margin-top: 1em; }
.doc-body h3 { font-weight: 700; font-size: 1.05rem; color: var(--heading); margin: 2em 0 .5em; }
.doc-body p { margin: 1em 0; }
.doc-body a { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
.doc-body a:hover { color: var(--accent-deep); text-decoration-thickness: 2px; }
.doc-body b, .doc-body strong { font-weight: 700; color: var(--heading); }

.doc-body ul { list-style: none; padding-left: .2em; margin: 1.1em 0; }
.doc-body ul li { position: relative; padding-left: 1.3em; margin: .5em 0; }
.doc-body ul li::before {
  content: ""; position: absolute; left: .1em; top: .72em;
  width: 6px; height: 6px; background: var(--accent); transform: rotate(45deg); border-radius: 1px;
}

/* 補足（囲みの注記） */
.note {
  background: var(--bg-tint); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1em 1.2em; margin: 1.5em 0; font-size: .95rem; color: var(--ink-soft);
}
.note b, .note strong { color: var(--accent-deep); }

/* 英語の節の見出し（番号を振らない） */
.doc-head h2.doc-title { counter-increment: none; padding-top: 0; border-top: none; margin: 0 0 .35em; }
.doc-head h2.doc-title::before { content: none; }

/* --- 表 -------------------------------------------------------------------- */
table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: .93rem; line-height: 1.65; margin: 1.6em 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm);
}
th, td { padding: .8em 1.1em; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
tr:last-child th, tr:last-child td { border-bottom: none; }
/* 見出しの列（左）と、見出しの行（上）で色を変える */
tr > th:first-child { background: var(--bg-tint); color: var(--heading); font-weight: 600; font-size: .86rem; width: 10em; }
tr:first-child > th:not(:first-child) { background: var(--bg-tint); color: var(--heading); font-weight: 700; font-size: .8rem; letter-spacing: .03em; }
td:first-child { color: var(--heading); font-weight: 500; }

hr { border: none; height: 1px; background: var(--line); margin: 3.4em 0; }

/* --- footer ---------------------------------------------------------------- */
.site-footer {
  max-width: var(--readw); margin: 4em 0 0; padding: 2.4em 0 1em;
  border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 1em;
}
.site-footer__brand {
  display: flex; align-items: center; gap: .5em;
  font-family: var(--font-display); font-weight: 600; color: var(--heading);
  font-size: .92rem; letter-spacing: .1em;
}
.site-footer__brand .brand__icon { width: 18px; height: 18px; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: .4em 1.4em; font-size: .88rem; }
.site-footer__links a { color: var(--ink-soft); text-decoration: none; }
.site-footer__links a:hover { color: var(--accent); }
.site-footer__legal { font-size: .8rem; color: var(--ink-mute); margin: 0; }

/* --- 表紙 ------------------------------------------------------------------ */
.home { max-width: 940px; margin: 0 auto; padding: clamp(3em, 9vw, 6em) 1.5em 3em; }
.hero { text-align: center; margin-bottom: clamp(2.4em, 6vw, 4em); }
.hero__icon {
  width: 96px; height: 96px; border-radius: 22px; display: block; margin: 0 auto 1.8em;
  box-shadow: 0 14px 36px -12px rgba(11, 13, 17, .45);
}
.hero__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem); line-height: 1.12;
  letter-spacing: -.015em; color: var(--heading); margin: 0 0 .5em;
}
.hero__lead { font-size: 1.05rem; color: var(--ink-soft); line-height: 1.75; margin: 0; }
.hero__lead-en { color: var(--ink-mute); font-size: .9rem; }

.doc-cards { display: grid; gap: 1.3em; grid-template-columns: 1fr; }
@media (min-width: 680px) { .doc-cards { grid-template-columns: 1fr 1fr; } }
.doc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2em 1.8em; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: flex-start;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(194, 65, 12, .3); }
.doc-card__icon {
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 13px; background: var(--accent-tint); color: var(--accent); margin-bottom: 1.2em;
}
.doc-card__icon svg { width: 25px; height: 25px; }
.doc-card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; color: var(--heading); margin: 0 0 .1em; }
.doc-card__title-en { font-size: .8rem; letter-spacing: .08em; color: var(--accent); text-transform: uppercase; font-weight: 600; margin: 0 0 1em; }
.doc-card__desc { font-size: .92rem; color: var(--ink-soft); line-height: 1.65; margin: 0 0 1.6em; }
.doc-card__desc span { color: var(--ink-mute); font-size: .84rem; }
.doc-card__links { display: flex; gap: .7em; margin-top: auto; }
.pill {
  padding: .55em 1.35em; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); text-decoration: none; color: var(--heading);
  font-size: .88rem; font-weight: 500; transition: background .2s, color .2s, border-color .2s;
}
.pill:hover { background: var(--heading); color: #fff; border-color: var(--heading); }

/* --- 狭い画面 -------------------------------------------------------------- */
@media (max-width: 560px) {
  html { font-size: 16px; }
  .layout { padding-left: 1.1em; padding-right: 1.1em; }
  /* 2 列の表は見出しの列を折り返させる（「商品代金以外の必要料金」を 1 行に保つと
     表そのものが画面より広くなり、右端が切れる） */
  th, td { padding: .7em .8em; overflow-wrap: anywhere; }
  tr > th:first-child { width: auto; min-width: 6.2em; }
  /* 列の多い表は行ごとの塊に積む（4 列を 375px に押し込むと 1 文字ずつ折り返す） */
  table.wide, table.wide tbody, table.wide tr, table.wide td { display: block; width: 100%; }
  table.wide { border-radius: var(--radius-sm); }
  table.wide tr:first-child { display: none; }
  table.wide tr { border-bottom: 1px solid var(--line); padding: .7em 1em; }
  table.wide tr:last-child { border-bottom: none; }
  table.wide td { border: 0; padding: .15em 0; }
  table.wide td::before { content: attr(data-l) "： "; color: var(--ink-mute); font-weight: 500; }
  table.wide td:first-child { font-weight: 500; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .progress { display: none; }
}

@media print {
  .site-header, .progress, .site-footer__links { display: none !important; }
  body { background: #fff; }
  .layout { max-width: none; padding: 0; }
  .doc-article, .site-footer { max-width: none; }
  .doc-body a { color: var(--ink); text-decoration: none; }
  table { box-shadow: none; }
  .doc-body h2 { break-after: avoid; }
}
