/* 規約・プライバシーポリシー・削除の案内(scripts/build.mjs + templates/page.html)、問い合わせ(contact.js)、
   共有リンクの案内(worker.js)、404.html の共通の見た目。
   色・書体は LP(public/index.html の <style>)と同じ値。LP の色を変えたらここも合わせる */
:root {
  color-scheme: light;
  --ground: #F6F6F4; --ground-2: #EEEEEB; --panel: #E4E4E0; --card: #FFFFFF;
  --ink: #1C1D21; --sub: #5F6166; --rule: #E0E0DC; --field: #CFCFCA; --sheet: #FFFFFF;
  --hold: #2F5D8A; --hold-deep: #24476A; --on-hold: #FFFFFF;
  --hero-wall: #EDEDEA; --cat-blend: multiply; --cat-filter: none; --focus-ring: rgba(47, 93, 138, .22);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6166' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --display: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 32px);
  --page: calc(40rem + 2 * var(--gutter));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #141415; --ground-2: #1A1A1B; --panel: #1F1F21; --card: #1F1F21;
    --ink: #EBECEF; --sub: #A8A9AD; --rule: #2E2E31; --field: #3A3A3E; --sheet: #141415;
    --hold: #7FB0E0; --hold-deep: #5F93C4; --on-hold: #101114;
    --hero-wall: #1F1F21; --cat-blend: screen; --cat-filter: invert(1) brightness(.86); --focus-ring: rgba(127, 176, 224, .3);
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8A9AD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #141415; --ground-2: #1A1A1B; --panel: #1F1F21; --card: #1F1F21;
  --ink: #EBECEF; --sub: #A8A9AD; --rule: #2E2E31; --field: #3A3A3E; --sheet: #141415;
  --hold: #7FB0E0; --hold-deep: #5F93C4; --on-hold: #101114;
  --hero-wall: #1F1F21; --cat-blend: screen; --cat-filter: invert(1) brightness(.86); --focus-ring: rgba(127, 176, 224, .3);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8A9AD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* ---------- 土台 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--ground); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.85; font-weight: 500;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--hold); outline-offset: 3px; border-radius: 6px; }
:is(p, li, h1, h2, h3, td, th) { overflow-wrap: anywhere; line-break: strict; }
.nw { white-space: nowrap; }
@media (max-width: 760px) { body { font-feature-settings: "palt"; letter-spacing: .03em; } h1, h2, h3 { font-feature-settings: normal; letter-spacing: 0; } }

/* 見出し・本文・フッタを同じ幅にそろえる */
body > .top, body > main, body > .foot { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }
body > main { flex: 1; }

/* ---------- ヘッダ ---------- */
.top { display: flex; align-items: center; padding-block: 20px; }
/* ロゴと名前の大きさは LP のヘッダ(.brand)と同じ */
/* web のアイコン(public/img/icon-256.jpg・icon-512.jpg)は、アプリのアイコン(mobile/assets/icon.png)と別に持つ。
   アプリ側はまだ旧案(赤)のため。#367 でアプリ側が紺の N1 に替わったら、どちらを正本にするか決めて 1 か所にまとめる */
.brand { display: inline-flex; align-items: center; gap: 18px; text-decoration: none; font-family: var(--display); font-size: clamp(26px, 2.8vw, 36px); font-weight: 900; font-synthesis: none; letter-spacing: .01em; white-space: nowrap; }
.appicon { display: block; flex: none; width: clamp(64px, 6.4vw, 84px); height: clamp(64px, 6.4vw, 84px); border-radius: 22.37%; background: url("/img/icon-512.jpg") center / cover no-repeat; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .12); }
/* 名前の文字はアプリのサインイン画面のロゴ(mobile/src/components/LogoText.tsx)と同じ 4 色のグラデーション。色は mobile/src/theme.ts の logoGradient */
.brand-name { background: linear-gradient(90deg, #2F5D8A, #6856D8, #B948C4, #E5484D); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- フッタ ---------- */
.foot { border-top: 1px solid var(--rule); padding-block: 24px 40px; margin-top: 56px; display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline; font-size: 13px; color: var(--sub); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot nav a { color: var(--ink); text-decoration: none; font-weight: 700; }
.foot nav a:hover { text-decoration: underline; }
.foot nav a[aria-current="page"] { color: var(--sub); }

/* ---------- 文書(規約・プライバシーポリシー・削除の案内) ---------- */
.doc { padding-block: 24px 0; }
.doc h1 { font-family: var(--display); font-weight: 900; font-synthesis: none; font-size: clamp(28px, 5vw, 38px); line-height: 1.3; margin: 0 0 12px; word-break: keep-all; text-wrap: balance; }
.doc h1::before { content: ""; display: block; width: 28px; height: 8px; border-radius: 2px; background: var(--hold); margin-bottom: 18px; }
/* h1 の直後は制定日・改定日。改行を活かして 1 行ずつ出す */
.doc h1 + p { white-space: pre-line; font-size: 14px; color: var(--sub); margin: 0 0 32px; }
.doc h2 { font-family: var(--display); font-weight: 900; font-synthesis: none; font-size: 20px; line-height: 1.5; margin: 48px 0 12px; padding-top: 24px; border-top: 1px solid var(--rule); }
.doc h3 { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.6; margin: 28px 0 8px; }
.doc p { margin: 0 0 1em; }
.doc :is(ol, ul) { margin: 0 0 1em; padding-left: 1.7em; }
.doc :is(ol, ul) :is(ol, ul) { margin: .4em 0 .2em; }
.doc li { margin: .45em 0; padding-left: .2em; }
.doc li::marker { color: var(--sub); font-family: var(--mono); font-size: .9em; }
.doc a { text-decoration-color: var(--hold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc a:hover { text-decoration-thickness: 2px; }
.doc strong { font-weight: 700; }
.doc hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }
.doc blockquote { margin: 0 0 1em; padding: 4px 0 4px 16px; border-left: 3px solid var(--rule); color: var(--sub); }
.doc code { font-family: var(--mono); font-size: .9em; background: var(--ground-2); border-radius: 4px; padding: .1em .35em; }
/* 表は横にはみ出すときだけ表の中で横に送る(ページ全体は横に送らない) */
.doc table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 8px 0 1.4em; font-size: 14px; line-height: 1.7; }
.doc th, .doc td { border: 1px solid var(--rule); padding: 10px 12px; text-align: left; vertical-align: top; background: var(--card); min-width: 8em; }
.doc th { background: var(--ground-2); font-weight: 700; white-space: nowrap; }

/* ---------- 問い合わせ ---------- */
.lede { color: var(--sub); margin: 0 0 8px; }
.contact { display: flex; flex-direction: column; gap: 22px; margin-top: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-weight: 700; font-size: 15px; line-height: 1.5; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.req, .opt { font-size: 11px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 4px; letter-spacing: .04em; }
.req { background: var(--hold); color: var(--on-hold); }
.opt { background: var(--ground-2); color: var(--sub); border: 1px solid var(--rule); }
.hint { font-size: 13px; color: var(--sub); line-height: 1.6; margin: -2px 0 0; }
.contact :is(input[type="email"], input[type="text"], select, textarea) {
  font: inherit; font-size: 16px; font-weight: 500; letter-spacing: normal; color: var(--ink);
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--field); border-radius: 10px; background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.contact textarea { min-height: 200px; resize: vertical; line-height: 1.7; }
.contact select { appearance: none; -webkit-appearance: none; padding-right: 44px; background: var(--card) var(--chev) no-repeat right 14px center / 18px 18px; cursor: pointer; }
.contact :is(input, select, textarea):focus { outline: none; border-color: var(--hold); box-shadow: 0 0 0 4px var(--focus-ring); }
.contact [aria-invalid="true"] { border-color: var(--hold); }
.error { color: var(--hold); font-size: 14px; font-weight: 700; line-height: 1.6; margin: 0; display: flex; gap: 6px; }
.error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--hold); color: var(--on-hold); font-size: 12px; font-family: var(--mono); }
.alert { border: 1px solid var(--hold); border-left-width: 4px; background: var(--card); border-radius: 10px; padding: 14px 16px; margin-top: 20px; }
.alert p { margin: 0; }
.alert p + p { margin-top: 4px; font-size: 14px; color: var(--sub); font-weight: 500; }
.alert .error::before { display: none; }
.field > .consent, .consent { display: flex; flex-wrap: nowrap; align-items: flex-start; font-weight: 500; gap: 12px; padding: 14px 16px; border: 1px solid var(--field); border-radius: 10px; background: var(--card); cursor: pointer; line-height: 1.6; }
.consent > span { word-break: keep-all; overflow-wrap: anywhere; }
.consent input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--hold); cursor: pointer; }
.consent a { font-weight: 700; text-decoration-color: var(--hold); text-underline-offset: 3px; }
.cf-turnstile { min-height: 65px; }
.contact button[type="submit"] {
  font: inherit; font-weight: 700; font-size: 17px; letter-spacing: .04em;
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 0 24px;
  border: 0; border-radius: 12px; background: var(--hold); color: var(--on-hold); cursor: pointer;
}
.contact button[type="submit"]:hover { background: var(--hold-deep); }
.contact button[type="submit"]:disabled { opacity: .6; cursor: progress; }
@media (min-width: 640px) { .contact button[type="submit"] { width: auto; min-width: 240px; align-self: flex-start; } }
.done { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 16px; }
.done .mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--hold); color: var(--on-hold); }
.done .mark svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done h1 { margin: 0; }
.done h1::before { display: none; }
.done p { margin: 0; }
.btn-line { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border: 1px solid var(--ink); border-radius: 12px; font-weight: 700; text-decoration: none; }
.btn-line:hover { background: var(--ground-2); }

/* ---------- ストアのボタン(LP の締めと同じ。公開までは「近日公開」) ---------- */
.stores { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .stores { grid-template-columns: 1fr; } }
.btn-soon { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--ink); color: var(--ground); border-radius: 12px; padding: 12px 20px; font-weight: 700; font-size: 15px; line-height: 1.5; text-decoration: none; cursor: default; white-space: nowrap; }
a.btn-soon { cursor: pointer; }
.btn-soon svg { width: 18px; height: 18px; fill: currentColor; }
.btn-soon small { font-family: var(--body); font-weight: 400; font-size: 11px; letter-spacing: .06em; opacity: .7; border-left: 1px solid currentColor; padding-left: 10px; }

/* ---------- 404 ---------- */
.nf { display: flex; flex-direction: column; gap: 20px; padding-top: 16px; }
.nf .code { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; color: var(--sub); }
.nf h1 { font-family: var(--display); font-weight: 900; font-synthesis: none; font-size: clamp(28px, 5vw, 38px); line-height: 1.3; margin: 0; }
.nf h1::before { content: ""; display: block; width: 28px; height: 8px; border-radius: 2px; background: var(--hold); margin-bottom: 18px; }
.nf p { margin: 0; color: var(--sub); }
.nf .btn-line { align-self: flex-start; }

/* ---------- 共有リンクの案内(/u/<handle>) ---------- */
.invite { --page: 552px; }
.invite > main { display: flex; flex-direction: column; gap: 20px; padding-bottom: 8px; }
.invite .foot { margin-top: 32px; }
/* カードはライトでは白、ダークでは地の色。上の帯(--hero-wall)と見分けがつくようにする */
.invite .card { background: var(--sheet); border-radius: 8px; border: 1px solid var(--rule); overflow: hidden; }
/* 上の帯は LP のヒーローの壁と同じ面の色。右端を猫が登る(LP と同じ画像と、ダークでの反転) */
.invite .band { position: relative; height: 150px; background: var(--hero-wall); overflow: hidden; isolation: isolate; }
.invite .band .cat { position: absolute; right: clamp(12px, 5%, 28px); top: 12px; width: auto; height: 236px; max-width: none; mix-blend-mode: var(--cat-blend); filter: var(--cat-filter); pointer-events: none; }
.invite .who { padding: 0 22px 24px; display: flex; flex-direction: column; gap: 14px; margin-top: -46px; position: relative; }
.invite .av { width: 92px; height: 92px; border-radius: 50%; background: var(--ink); color: var(--ground); display: grid; place-items: center; border: 4px solid var(--sheet); font-family: var(--display); font-weight: 900; font-synthesis: none; font-size: 40px; line-height: 1; text-transform: uppercase; }
.invite .name { font-family: var(--display); font-weight: 900; font-synthesis: none; font-size: 26px; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.invite .msg { margin: 0; word-break: keep-all; }
.invite .msg b { font-weight: 700; }
.invite .open { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; border-radius: 12px; background: var(--hold); color: var(--on-hold); font-weight: 700; font-size: 17px; text-decoration: none; }
.invite .open:hover { background: var(--hold-deep); }
.invite .open svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.invite .sub { font-size: 13px; color: var(--sub); text-align: center; margin: -8px 0 0; word-break: keep-all; }
.invite .noapp { border-top: 1px solid var(--rule); padding-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.invite .noapp h2 { margin: 0; font-size: 15px; font-weight: 700; word-break: keep-all; }
.invite .noapp ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.invite .noapp li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; font-size: 14px; line-height: 1.7; align-items: start; word-break: keep-all; }
.invite .noapp li > i { font-style: normal; font-family: var(--mono); font-size: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--ground); margin-top: 1px; }
.invite .noapp .stores { display: grid; margin-top: 10px; }
