/* 思い出あつめ プロトタイプ 共通スタイル
   トークンはこの :root だけで定義する。色・角丸・文字はここから使う。 */

:root {
  --bg: #FBFAF8;
  --surface: #FFFFFF;
  --line: #EDE8E1;
  --ink: #5C544C;
  --ink-soft: #7A7066;      /* 指示書の #8C8378 は生成り地で 3.6:1。高齢の読者向けに 4.6:1 へ */
  --ink-faint: #9A9085;     /* 飾り・プレースホルダー専用。本文に使わない */

  --sky: #ACC8C9;      --sky-soft: #EAF2F7;
  --focus: #4F7F82;    /* フォーカスの枠・入力中の枠。sky を濃くした色。白・生成り・淡い 4 色の面で 3.9:1 以上（sky は 1.77:1 で 3:1 に届かなかった。10/10 山上さん） */
  --leaf: #A0AC98;     --leaf-soft: #EEF2EA;
  --sun: #E7D5B3;      --sun-soft: #FBF3E6;
  --sakura: #F6B09E;   --sakura-soft: #FBEDE8;

  --accent: #E89A86;
  --accent-ink: #AD5A3B;        /* 文字で使うときの桃。生成り地で 4.7:1 */

  --btn-fill: #5C544C;
  --btn-text: #FBFAF8;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(92, 84, 76, 0.04), 0 8px 24px rgba(92, 84, 76, 0.06);

  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-serif: "Hiragino Mincho ProN", "Noto Serif JP", serif;

  --fs: 17px;
  --lh: 1.7;
  --tap: 56px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
h1, h2, h3, h4, p { margin: 0; }
p, li { text-wrap: pretty; }   /* 最後の行が「す。」だけになるのを防ぐ（対応ブラウザだけ） */
/* 日本語を文節で折る（Chrome 119+。lang="ja" が前提）。Safari は通常の折り返しのまま。
   長い文節が枠より長いときだけ文節の途中で折る（はみ出し防止） */
body { word-break: auto-phrase; overflow-wrap: break-word; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
::placeholder { color: var(--ink-faint); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- アイコン ---------- */
.ic { width: 1.25em; height: 1.25em; flex: 0 0 auto; vertical-align: -0.3em; }
.ic-lg { width: 1.8em; height: 1.8em; }

/* ---------- 文字 ---------- */
.serif { font-family: var(--font-serif); font-weight: 500; letter-spacing: 0.04em; }
.soft { color: var(--ink-soft); }
.small { font-size: 15px; }
.tiny { font-size: 13px; line-height: 1.6; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.accent { color: var(--accent-ink); }

/* ---------- 画面の器（スマホ） ---------- */
.screen {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
}
.screen.has-sticky { padding-bottom: calc(var(--tap) + 40px); }
.pad { padding: 0 20px; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 28px; }
.section { padding: 28px 20px; }
.section + .section { padding-top: 0; }
.section-title { font-size: 19px; font-weight: 600; margin-bottom: 14px; }

/* ---------- ヘッダー（スマホ） ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; padding: 8px 12px 8px 16px;
}
.topbar .brand img { height: 30px; }
.topbar .back {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--ink-soft);
  font-size: 15px; border-radius: 12px; cursor: pointer;
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 24px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-size: 17px; font-weight: 600; line-height: 1.3; white-space: nowrap;
  text-decoration: none; cursor: pointer; width: 100%;
  transition: transform 0.12s ease, background-color 0.2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-fill); color: var(--btn-text); }
.btn-primary:hover { background: #4E463F; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: #F6F3EE; }
.btn-tint { background: var(--sakura-soft); color: var(--ink); }
.btn-tint:hover { background: #F7E3DC; }
.btn-ghost { background: transparent; color: var(--ink-soft); min-height: 48px; font-weight: 500; }
.btn-ghost:hover { color: var(--ink); background: #F3F0EA; }
.btn-auto { width: auto; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; width: auto; }
.btn .ic { width: 1.3em; height: 1.3em; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { flex: 1 1 0; }

.link-quiet {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; color: var(--ink-soft); font-size: 15px;
  text-decoration: underline; text-underline-offset: 0.25em; text-decoration-color: var(--line);
}
.link-quiet:hover { color: var(--ink); }

/* ---------- 面 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card-tint { border-color: transparent; box-shadow: none; }
.tint-sky { background: var(--sky-soft); }
.tint-leaf { background: var(--leaf-soft); }
.tint-sun { background: var(--sun-soft); }
.tint-sakura { background: var(--sakura-soft); }
/* 淡い色の面の上では補助文字を一段濃く（#7A7066 は淡色面で 4.2〜4.4:1。#6E655C で 5.0:1 以上） */
.tint-sky, .tint-leaf, .tint-sun, .tint-sakura, .notice, .badge-muted, .queue-pill { --ink-soft: #6E655C; }

/* ---------- 入力 ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 15px; font-weight: 600; }
.field .hint { font-size: 14px; color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 17px; line-height: 1.5; color: var(--ink);
  appearance: none; -webkit-appearance: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--focus); outline: 3px solid var(--sky-soft); outline-offset: 0; }
.textarea { min-height: 150px; resize: vertical; }
.select-wrap { position: relative; }
.select-wrap .ic { position: absolute; right: 16px; top: 50%; transform: translateY(-50%) rotate(90deg); color: var(--ink-soft); pointer-events: none; }
.select { padding-right: 48px; }

/* 選択肢チップ（関係など） */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 48px; padding: 0 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"], .chip.is-on { background: var(--sakura-soft); border-color: var(--accent); color: var(--ink); }

/* ドロップ枠 */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 160px; padding: 24px; text-align: center;
  background: var(--surface); border: 1.5px dashed #D9D1C6; border-radius: var(--radius);
  color: var(--ink-soft); cursor: pointer;
}
.drop .ic { width: 36px; height: 36px; color: var(--sky); }
.drop:hover { border-color: var(--sky); background: var(--sky-soft); }

/* トグル */
.toggle { position: relative; width: 56px; height: 32px; flex: 0 0 auto; border: 0; padding: 0; background: #D9D1C6; border-radius: 999px; cursor: pointer; transition: background 0.2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.15); transition: transform 0.2s; }
.toggle[aria-checked="true"] { background: var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(24px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ---------- 写真 ---------- */
.photo { width: 100%; object-fit: cover; border-radius: var(--radius); background: var(--line); }
.photo-4x3 { aspect-ratio: 4 / 3; }
.photo-3x2 { aspect-ratio: 3 / 2; }
.photo-1x1 { aspect-ratio: 1 / 1; }
.photo-3x4 { aspect-ratio: 3 / 4; }

.portrait {
  width: 148px; height: 148px; border-radius: 50%; object-fit: cover; object-position: 50% 28%;
  border: 4px solid var(--surface); box-shadow: var(--shadow);
}
.portrait-sm { width: 64px; height: 64px; border-width: 2px; }

/* 遺影の額（10/26）。縦長 4:5 を白い縁と細い線で囲む。丸くしない・角は小さく（アイコンに見せない） */
.ihai {
  display: block; flex-shrink: 0; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow);
}
.ihai img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: 2px; background: var(--line); }
.ihai-lg { width: 232px; margin: 0 auto; padding: 10px; }
.ihai-md { width: 156px; margin: 0 auto; }
.ihai-sm { width: 64px; padding: 4px; border-radius: 4px; }
.ihai-xs { width: 32px; padding: 2px; border-radius: 3px; box-shadow: none; }
.ihai-sm img, .ihai-xs img { border-radius: 1px; }

/* 故人のお名前「故 髙橋 文子 様」。明朝、折れるのは姓と名のあいだだけ */
.deceased-name { font-family: var(--font-serif); font-weight: 500; letter-spacing: 0.1em; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.deceased-name .ko, .deceased-name .sama { font-size: max(0.6em, 12px); letter-spacing: 0; color: var(--ink-soft); }
.deceased-name .ko { margin-right: 0.6em; }
.deceased-name .sama { margin-left: 0.4em; }

/* 故人の見出し（故人ページの上）。遺影の額 → お名前 → 細い線 → 生年・享年・没日 */
.deceased { padding: 12px 20px 0; text-align: center; }
.deceased .ihai + .deceased-name { margin-top: 20px; }
.deceased-lg .deceased-name { font-size: 32px; }
.deceased .rule { display: block; width: 40px; height: 1px; margin: 12px auto; background: var(--sun); }
.deceased .years { font-size: 15px; color: var(--ink-soft); letter-spacing: 0.04em; line-height: 1.7; }
.deceased .years .line { display: block; }
.deceased .years .nb { white-space: nowrap; }
.deceased-noportrait { padding-top: 28px; }
@media (max-width: 359px) {
  .ihai-lg { width: 208px; }
  .deceased-lg .deceased-name { font-size: 28px; }
  .deceased .years { font-size: 14px; letter-spacing: 0.02em; }
}

/* ---------- 進捗の点 ---------- */
.dots { display: flex; justify-content: center; gap: 8px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: block; transition: background 0.3s; }
.dots i.is-done { background: var(--sakura); }
.dots i.is-now { background: var(--accent); width: 24px; border-radius: 4px; }

/* ---------- 下部固定 ---------- */
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(251, 250, 248, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.sticky-bar .inner { max-width: 440px; margin: 0 auto; }

/* ---------- タブバー（アプリ風） ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar .inner { display: flex; width: 100%; max-width: 480px; }
.tab {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; padding: 8px 4px 6px; color: var(--ink-soft); font-size: 11px; font-weight: 600;
  text-decoration: none; border: 0; background: none;
}
.tab .ic { width: 26px; height: 26px; }
.tab.is-on { color: var(--ink); }
.tab.is-on .ic { color: var(--accent); }
.tab:hover { text-decoration: none; }

/* ---------- 投稿カード ---------- */
.post { padding: 18px 18px 20px; }
.post + .post { margin-top: 16px; }
.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: 0.02em;
}
.post-who { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.post-who .name { font-weight: 600; font-size: 16px; }
.post-who .rel { font-size: 14px; color: var(--ink-soft); }
.post-when { margin-left: auto; font-size: 13px; color: var(--ink-soft); white-space: nowrap; align-self: flex-start; padding-top: 2px; }
.post-text { font-size: 16.5px; }
.post .photo { margin-top: 14px; }
.post-video { position: relative; margin-top: 14px; }
.post-video .play {
  position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%;
  background: rgba(251, 250, 248, 0.9); display: flex; align-items: center; justify-content: center;
  color: var(--ink); box-shadow: var(--shadow);
}
.post-video .play .ic { width: 32px; height: 32px; margin-left: 3px; }
.post-video .len { position: absolute; right: 12px; bottom: 12px; font-size: 13px; color: #fff; background: rgba(60,52,46,0.65); padding: 2px 8px; border-radius: 8px; }

/* ---------- 項目行（設定・一覧） ---------- */
.row { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.row + .row { border-top: 1px solid var(--line); }
.row .grow { flex: 1 1 auto; min-width: 0; }
.row .ttl { font-weight: 600; }
.row .sub { font-size: 14px; color: var(--ink-soft); }

/* ---------- バッジ ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; line-height: 1.4;
  background: var(--leaf-soft); color: #5F6E57;
}
.badge-sakura { background: var(--sakura-soft); color: var(--accent-ink); }
.badge-sky { background: var(--sky-soft); color: #4F7072; }
.badge-sun { background: var(--sun-soft); color: #7A5F2E; }
.badge-muted { background: #F1EDE6; color: var(--ink-soft); }

/* ---------- 通知（状態） ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius); }
.notice .ic { width: 24px; height: 24px; margin-top: 2px; }
.notice-sun { background: var(--sun-soft); }
.notice-sakura { background: var(--sakura-soft); }

/* 進捗バー（アップロード中） */
.bar { height: 8px; border-radius: 4px; background: #EFEAE3; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; background: var(--accent); border-radius: 4px; transition: transform 0.4s ease; }

/* ---------- PC: 管理画面の骨組み ---------- */
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-nav {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.admin-nav .brand { padding: 4px 8px 20px; }
.admin-nav .brand img { width: auto; height: 34px; }
.admin-nav .hall { padding: 0 10px 18px; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.admin-nav .hall b { display: block; color: var(--ink); font-size: 15px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px;
  border-radius: 12px; color: var(--ink-soft); font-size: 15px; font-weight: 600; text-decoration: none;
}
.nav-item .ic { width: 22px; height: 22px; }
.nav-item.is-on { background: var(--sakura-soft); color: var(--ink); }
.nav-item:hover { text-decoration: none; background: #F6F3EE; }
.nav-item.is-on:hover { background: var(--sakura-soft); }
.admin-nav .spacer { flex: 1; }
.admin-main { padding: 32px 40px 60px; max-width: 1180px; width: 100%; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.admin-head h1 { font-size: 24px; font-weight: 600; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-grid .span2 { grid-column: 1 / -1; }

/* 表 */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-soft); font-size: 13px; padding: 0 12px 10px; }
.table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table td.name { font-weight: 600; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-size: 36px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 14px; color: var(--ink-soft); }

/* ---------- ストーリーボード ---------- */
.board { max-width: 1440px; margin: 0 auto; padding: 48px 32px 80px; background: var(--bg); }
.board-hero { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: center; margin-bottom: 56px; }
.board-hero img { width: 300px; }
.board-hero h1 { font-family: var(--font-serif); font-size: 34px; font-weight: 500; line-height: 1.6; letter-spacing: 0.04em; }
.br-sp { display: none; }
.board-hero p { margin-top: 16px; color: var(--ink-soft); max-width: 36em; }
.scenes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; align-items: start; }
.scene { display: flex; flex-direction: column; gap: 14px; }
.scene-cap { font-size: 15px; line-height: 1.5; }
.scene-cap .n { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; background: var(--sakura-soft); color: var(--accent-ink); font-weight: 600; font-size: 14px; margin-right: 8px; }
.scene-cap b { display: block; font-size: 17px; font-weight: 600; margin-top: 6px; }
.scene-cap span { color: var(--ink-soft); font-size: 14px; }
.phone {
  position: relative; width: 100%; border-radius: 40px;
  background: #3E3833; padding: 10px; box-shadow: 0 20px 50px rgba(92, 84, 76, 0.18);
}
.phone .scaler { position: relative; width: 100%; aspect-ratio: 375 / 812; overflow: hidden; border-radius: 32px; background: var(--bg); }
.phone iframe { position: absolute; left: 0; top: 0; width: 375px; height: 812px; border: 0; background: var(--bg); display: block; transform-origin: 0 0; }
.phone a.cover { position: absolute; inset: 0; z-index: 3; border-radius: 40px; }
.frame-wide {
  position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden;
  background: #3E3833; padding: 8px; box-shadow: 0 20px 50px rgba(92, 84, 76, 0.18);
}
.frame-wide iframe { width: 1024px; height: 640px; border: 0; background: var(--bg); transform-origin: 0 0; display: block; border-radius: 10px; }
.frame-wide a.cover { position: absolute; inset: 0; z-index: 3; }
.wide-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 56px; }
.board h2 { font-size: 22px; font-weight: 600; margin-bottom: 20px; }
.board .lead { color: var(--ink-soft); margin: -8px 0 20px; }
.open-hint { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

/* ---------- 印刷イメージ ---------- */
.print-stage { max-width: 1280px; margin: 0 auto; padding: 48px 32px 80px; display: grid; grid-template-columns: 595px 1fr; gap: 48px; align-items: start; }
.paper {
  width: 595px; height: 842px; background: #fff; box-shadow: 0 24px 60px rgba(92, 84, 76, 0.16);
  padding: 56px 48px; display: flex; flex-direction: column; align-items: center; text-align: center;
}
.paper .portrait { width: 200px; height: 200px; }
.paper h1 { font-family: var(--font-serif); font-size: 26px; font-weight: 500; line-height: 1.6; letter-spacing: 0.04em; margin-top: 28px; }
.paper .qr { width: 220px; height: 220px; margin: 28px auto 20px; }
.paper .how { font-size: 15px; color: var(--ink); max-width: 24em; }
.paper .foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.paper .foot img { height: 34px; }
.paper .foot .url { font-size: 13px; color: var(--ink-soft); letter-spacing: 0.02em; }
.card-print { width: 100%; max-width: 420px; }

/* ---------- 幅対応 ---------- */
@media (max-width: 1150px) {
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .scenes { grid-template-columns: repeat(3, 1fr); }
  .board-hero { grid-template-columns: 1fr; text-align: center; }
  .board-hero img { margin: 0 auto; }
  .board-hero p { margin-left: auto; margin-right: auto; }
}
@media (max-width: 1000px) {
  .print-stage { grid-template-columns: 1fr; justify-items: center; }
}
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .admin-nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .admin-nav .brand { padding: 0 12px 0 0; }
  .admin-nav .hall { padding: 0 12px; }
  .admin-nav .spacer { display: none; }
  .admin-main { padding: 24px 20px 60px; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .scenes { grid-template-columns: 1fr; }
  .wide-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .board { padding: 24px 16px 60px; }
  .board-hero h1 { font-size: 24px; }
  .br-sp { display: inline; }
  .paper { width: 100%; height: auto; min-height: 700px; padding: 40px 24px; }
  .print-stage { padding: 24px 16px 60px; }
}

/* ==========================================================
   10/8 改訂で足した部品: ギャラリー・写真詳細・投稿キュー・節目
   ========================================================== */

/* ---------- タブ（写真／ことば） ---------- */
.tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.tabs-btn {
  flex: 1 1 0; min-height: 52px; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 16px; font-weight: 600; color: var(--ink-soft);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs-btn .n { font-size: 14px; font-weight: 500; }
.tabs-btn[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }

/* ---------- 写真のギャラリー（3 列の正方形） ---------- */
.gallery-day { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 22px 20px 10px; font-size: 15px; font-weight: 600; }
.gallery-day .n { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.tile { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--line); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile:focus-visible { outline-offset: -3px; }
.tile-len {
  position: absolute; right: 5px; top: 5px; display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px 1px 4px; border-radius: 8px; background: rgba(60, 52, 46, 0.6);
  color: #fff; font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums;
}
.tile-len .ic { width: 12px; height: 12px; vertical-align: 0; }
.tile.is-hidden img { opacity: 0.35; }
.tile-hidden {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink); font-size: 12px; font-weight: 600;
}
.tile-hidden .ic { width: 24px; height: 24px; }
.gallery-more { padding: 16px 20px 0; text-align: center; }

/* ---------- 写真詳細 ---------- */
.photo-full { width: 100%; height: auto; background: var(--line); }
.photo-meta { padding: 18px 20px 0; }
.photo-text { margin-top: 12px; font-size: 16.5px; }
.react { display: flex; align-items: center; gap: 12px; padding: 16px 20px 4px; }
.react-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.react-btn .ic { width: 22px; height: 22px; color: var(--accent); }
.react-btn[aria-pressed="true"] { background: var(--sakura-soft); border-color: var(--sakura); }
.react-count { font-size: 15px; color: var(--ink-soft); }
.comments { padding: 20px 20px 0; }
.comments h2 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.comment { display: flex; gap: 12px; padding: 12px 0; }
.comment + .comment { border-top: 1px solid var(--line); }
.comment .avatar { width: 36px; height: 36px; font-size: 14px; }
.comment .who { font-size: 14px; font-weight: 600; line-height: 1.5; }
.comment .who span { font-weight: 500; color: var(--ink-soft); }
.comment p { font-size: 16px; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.comment-form .textarea { min-height: var(--tap); height: var(--tap); padding: 14px 16px; resize: none; }
.comment-form .btn { width: auto; flex: 0 0 auto; padding: 0 18px; }
.pager { display: flex; gap: 12px; padding: 28px 20px 40px; }
.pager .btn { flex: 1 1 0; padding: 0 12px; }
.menu {
  position: absolute; right: 12px; top: 52px; z-index: 20; min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.menu[hidden] { display: none; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 12px;
  border: 0; background: none; border-radius: 12px; font-size: 16px; text-align: left; cursor: pointer; color: var(--ink);
}
.menu-item:hover { background: #F6F3EE; text-decoration: none; }
.menu-item .ic { color: var(--ink-soft); }

/* ---------- 投稿キュー（選んだ写真・送信中） ---------- */
.queue { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.qtile { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--line); }
.qtile img { width: 100%; height: 100%; object-fit: cover; }
.qtile-remove {
  position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.qtile-remove span {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(251, 250, 248, 0.92); color: var(--ink);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(60, 52, 46, 0.2);
}
.qtile-remove .ic { width: 16px; height: 16px; }
.qtile-add {
  aspect-ratio: 1 / 1; border-radius: 12px; border: 1.5px dashed #D9D1C6; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--ink-soft); font-size: 15px; font-weight: 600; cursor: pointer;
}
.qtile-add .ic { width: 28px; height: 28px; color: var(--sky); }
.qtile-state {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px 2px 6px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.6;
  background: rgba(251, 250, 248, 0.94); color: var(--ink);
}
.qtile-state .ic { width: 16px; height: 16px; vertical-align: 0; }
.qtile.is-done .qtile-state .ic { color: #6E8A63; }
.qtile.is-waiting img { opacity: 0.5; }
.qtile.is-waiting .qtile-state { color: var(--ink-soft); padding-left: 10px; }
.qtile-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(251, 250, 248, 0.7); }
.qtile-bar i { display: block; height: 100%; background: var(--accent); width: 100%; transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; }
.qtile.is-paused .qtile-bar i { background: #D9BE8C; }
.qtile.is-done .qtile-bar, .qtile.is-waiting .qtile-bar { display: none; }
.queue-pill {
  display: flex; align-items: center; gap: 8px; margin: 0 20px 16px; padding: 8px 14px;
  border-radius: 12px; background: var(--sky-soft); font-size: 14px;
}
.queue-pill b { font-variant-numeric: tabular-nums; }
.queue-pill .bar { flex: 1 1 auto; height: 6px; background: rgba(255, 255, 255, 0.8); }
.queue-pill .bar > i { width: 100%; transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; }

/* ---------- 数字の帯（ご家族） ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 4px; }
.stat-strip div { text-align: center; line-height: 1.3; }
.stat-strip div + div { border-left: 1px solid var(--line); }
.stat-strip b { display: block; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-strip span { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }

/* ---------- 節目 ---------- */
.ios-banner {
  display: grid; grid-template-columns: 38px 1fr; gap: 10px; padding: 12px 14px;
  border-radius: 20px; background: rgba(255, 255, 255, 0.86); box-shadow: 0 6px 24px rgba(60, 52, 46, 0.14);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); font-size: 14px; line-height: 1.5;
}
.ios-banner img { width: 38px; height: 38px; border-radius: 9px; }
.ios-banner .app { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); }
.ios-banner .app b { color: var(--ink); font-weight: 600; }
.collage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; border-radius: var(--radius); overflow: hidden; }
.collage img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.collage .big { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.big-num { font-size: 30px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; margin: 0 2px; }
.info-list { display: grid; grid-template-columns: 4em 1fr; gap: 6px 12px; font-size: 16px; }
.info-list dt { color: var(--ink-soft); font-size: 15px; }
.info-list dd { margin: 0; }
.keep { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; padding: 14px; }
.keep img { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; }
.keep + .keep { margin-top: 12px; }
.keep .ttl { font-weight: 600; }
.keep .sub { font-size: 14px; color: var(--ink-soft); }
.family-only { border: 1.5px dashed #D9D1C6; border-radius: var(--radius); padding: 16px; }

/* ---------- 動き ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes bloom { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.rise { animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.bloom { animation: bloom 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .rise, .bloom { animation: none; }
  * { transition: none !important; }
}

/* ==========================================================
   改善ラウンド 1（10/8）で足した部品。app.css から移して整えた
   ========================================================== */

/* hidden 属性は、部品の display 指定より常に強くする（#14: .btn の inline-flex に負けていた） */
[hidden] { display: none !important; }

/* ---------- 知らせる（#1）: 故人ページの下・投稿完了 ---------- */
.share-card { margin: 28px 20px 0; padding: 22px 20px; text-align: center; }
.share-card .share-ttl { font-size: 18px; font-weight: 600; line-height: 1.5; }
.share-card .share-sub { margin: 6px 0 16px; font-size: 15px; color: var(--ink-soft); }
.share-acts > * + * { margin-top: 10px; }

/* ---------- 手を合わせる（#8・#9）: 故人ページ・節目。写真の「ありがとう」と同じ丸い形 ---------- */
.pray { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pray .react-btn .ic { color: var(--ink-soft); }
.pray .react-btn[aria-pressed="true"] .ic { color: var(--accent-ink); }
.pray .n { font-size: 15px; color: var(--ink-soft); }
.pray .n b { color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 2px; }
.pray .after { flex-basis: 100%; }
.page-pray { justify-content: center; margin: 0 20px 24px; text-align: center; }
.page-pray .after { margin-top: -4px; }

/* ---------- 故人ページの数（#6） ---------- */
.count .people { flex-basis: 100%; text-align: center; }

/* ---------- まだ何も届いていないページ（#12）。当日の最初の参列者が見る ---------- */
.first-card { margin: 20px 20px 18px; padding: 26px 20px 22px; text-align: center; }
.first-card .mark { width: 56px; height: 56px; margin: 0 auto 12px; }
.first-card h2 { font-size: 20px; font-weight: 600; line-height: 1.5; }
.first-card p { font-size: 15px; margin: 10px 0 18px; }
.first-card .btn { min-height: 64px; font-size: 18px; }
.first-card .lead { margin: 12px 0 0; font-size: 14px; }

/* ---------- ことばに写真が付いているとき（#18） ---------- */
.post-body { display: flex; gap: 14px; align-items: flex-start; }
.post-body .post-text { flex: 1 1 auto; min-width: 0; }
.word-thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; display: block; background: var(--line); margin-top: 2px; }
.word-thumb img { width: 56px; height: 56px; object-fit: cover; }

/* ---------- 投稿の最初: 頼み方の例（#3） ---------- */
.ask-examples { margin-top: 10px; min-height: 1.7em; font-size: 15px; color: var(--ink); transition: opacity 0.4s ease; }
.ask-examples.is-fading { opacity: 0; }

/* ---------- ご家族の画面: この 7 日間（#7） ---------- */
.week { margin: 12px 20px 0; font-size: 14px; color: var(--ink-soft); text-align: center; line-height: 1.6; }
.week b { color: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 0 2px; }
.week span { white-space: nowrap; }

/* ---------- ご家族の画面: 管理をいっしょにする人（#17）。操作カードの中で開閉 ---------- */
.op-details { padding: 0; }
.op-details > summary { list-style: none; cursor: pointer; }
.op-details > summary::-webkit-details-marker { display: none; }
.op-details > summary > .ic { transition: transform 0.2s ease; }
.op-details[open] > summary > .ic { transform: rotate(90deg); }
.op-details .inner { padding: 0 18px 18px; }
.manager-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 0; border-top: 1px solid var(--line); }
.manager-row .avatar { width: 40px; height: 40px; font-size: 15px; }
.manager-row .grow { flex: 1 1 auto; min-width: 0; line-height: 1.45; }
.manager-row .ttl { font-weight: 600; font-size: 16px; }
.manager-row .sub { font-size: 14px; color: var(--ink-soft); }
.manager-row form { margin-left: auto; flex: 0 0 auto; }
.manager-row .btn-sm { padding: 0 12px; margin-right: -12px; }
.invite-form { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.invite-form .form-ttl { font-size: 15px; font-weight: 600; }
.invite-form > * + * { margin-top: 14px; }
.invite-sent { margin-top: 16px; padding: 16px; border-radius: 12px; }
.invite-sent .tiny { margin-bottom: 4px; }

/* ---------- 投稿 Step 2: くわしく（#15） ---------- */
.rel-detail { margin-top: 10px; }

/* 「ご家族にだけ見えます」 */
.family-note { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-soft); margin-top: 6px; }
.family-note .ic { width: 18px; height: 18px; }

/* ---------- 「残す」の途中: 故人の遺影と名前（#4） ---------- */
.keeping { margin: 4px 0 20px; text-align: center; }
.keeping .portrait { width: 96px; height: 96px; margin: 0 auto; border-width: 3px; }
.keeping .nm { font-family: var(--font-serif); font-size: 21px; letter-spacing: 0.08em; margin-top: 10px; }

/* ---------- トップ「思い出あつめとは」（#11）。ご家族がはじめて読むページ ---------- */
.about { padding: 0 20px 48px; }
.about-hero { text-align: center; padding: 20px 0 8px; }
.about-hero .logo { width: 150px; height: auto; margin: 0 auto; }
.about-hero .copy { font-family: var(--font-serif); font-size: 20px; font-weight: 500; line-height: 1.9; letter-spacing: 0.06em; margin-top: 18px; }
.about-hero .intro { font-size: 16px; color: var(--ink-soft); margin-top: 14px; }
.about-sec { margin-top: 40px; }
.about-sec > h2 { font-size: 19px; font-weight: 600; line-height: 1.5; margin-bottom: 14px; }
.gets > * + * { margin-top: 12px; }
.get { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; }
.get-ic { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.get-ic .ic { width: 26px; height: 26px; color: var(--ink); }
.get .ttl { font-weight: 600; line-height: 1.5; }
.get .sub { font-size: 15px; color: var(--ink-soft); margin-top: 2px; }
.flow { list-style: none; margin: 0; padding: 0; }
.flow li { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.flow li:last-child { padding-bottom: 0; }
.flow li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 2px; background: var(--line); }
.flow .num { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--sakura-soft); color: var(--accent-ink); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.flow .ttl { font-weight: 600; line-height: 1.5; padding-top: 3px; }
.flow .sub { font-size: 15px; color: var(--ink-soft); margin-top: 2px; }
.about-note { margin-top: 28px; padding: 18px 20px; font-size: 15px; }
.about-sample { margin-top: 40px; padding: 24px 20px; text-align: center; }
.about-sample h2 { font-size: 19px; font-weight: 600; }
.about-sample p { font-size: 15px; margin: 8px 0 18px; }

/* ---------- 葬儀場 ---------- */
.recv { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.recv .link-quiet { min-height: 36px; }
.table-wrap { overflow-x: auto; }
.nav-logout { background: none; border: 0; width: 100%; text-align: left; font-family: inherit; cursor: pointer; }
@media (max-width: 700px) {
  .admin-head { flex-wrap: wrap; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .ask-examples, .op-details > summary > .ic { transition: none; }
}

/* 足元の小さいリンク（困ったら・保存期間・削除）。押せる高さは保つ */
.link-help { min-height: 40px; font-size: 14px; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.admin-grid-list { grid-template-columns: minmax(0, 1fr) 300px; }
.admin-grid-list .stats .stat:nth-child(3) { grid-column: 1 / -1; }
/* 一覧の右欄（300px）は 2 列で狭い。「11.5 人」「120 件」が数字と単位の間で折れないよう、数字を一段小さくして折り返さない */
.admin-grid-list .stats .stat .n { font-size: 30px; white-space: nowrap; }
@media (max-width: 1150px) { .admin-grid-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .admin-nav { gap: 6px 8px; }
  .admin-nav .hall { flex: 1 1 calc(100% - 170px); padding: 0; }
  .admin-nav .nav-item, .admin-nav > form { flex: 1 1 0; justify-content: center; }
  .admin-nav .nav-item { padding: 0 6px; gap: 6px; white-space: nowrap; }
}
.stat-strip-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 写真タブの中の関係のタブ（山上さんの指摘 2。.chip と同じ見た目で横に流す） */
.rel-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 20px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rel-tabs::-webkit-scrollbar { display: none; }
.rel-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: 15px; white-space: nowrap; text-decoration: none; }
.rel-tab:hover { text-decoration: none; }
.rel-tab[aria-current="true"] { background: var(--sakura-soft); border-color: var(--accent); font-weight: 600; }
.rel-tab .n { font-size: 13px; font-weight: 500; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.gallery + .gallery { margin-top: 2px; }
.gallery-empty { padding: 22px 20px; font-size: 15px; color: var(--ink-soft); }

/* ページの中の確かめ（全面点検 E2・E3。ブラウザのダイアログを使わない） */
.ask-box { margin-top: 10px; text-align: left; }
.ask-box p { font-size: 15px; line-height: 1.6; }
.ask-acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ask-acts .btn { width: auto; }
.mine-actions { margin-top: 10px; }
/* 表紙の無い動画のタイル（E11） */
.tile-noposter { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; aspect-ratio: 1 / 1; background: var(--sky-soft, #EAF2F7); color: var(--ink-soft); }
.tile-noposter .ic { width: 40px; height: 40px; }
.comment.is-hidden > div > p:not(.family-note):not(.who) { opacity: 0.6; }
.stat-strip-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ==========================================================
   全面点検 第 2 段（10/8）: 見た目
   ========================================================== */

/* 画面の上に短く出る知らせ（header の flash。common.js の toast と同じ形） */
.flash { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 50; max-width: 440px; width: calc(100% - 32px); }
.flash > p { padding: 12px 16px; font-size: 15px; }

/* ロゴの横長画像（width/height 属性の比を保つ） */
.logo-h { width: auto; height: 30px; }
.logo-h-sm { width: auto; height: 26px; }

/* ご家族が見ている、一時非公開中のページの帯 */
.paused-band { display: flex; align-items: flex-start; gap: 10px; margin: 0 20px 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--sun-soft); font-size: 15px; line-height: 1.6; --ink-soft: #6E655C; }
.paused-band .ic { width: 22px; height: 22px; margin-top: 1px; color: #7A5F2E; }
.paused-band b { font-weight: 600; }
.paused-band .sub { display: block; font-size: 14px; color: var(--ink-soft); }
.paused-band a { color: var(--accent-ink); font-weight: 600; }

/* 写真の「…」メニュー: 画面の端から離す。消す操作は線で分けて、落ち着いた赤で */
.menu { left: auto; max-width: calc(100% - 24px); min-width: 240px; }
.menu-sep { height: 1px; margin: 6px 8px; background: var(--line); }
.menu-item.is-danger { color: var(--accent-ink); }
.menu-item.is-danger .ic { color: var(--accent-ink); }
.menu .ask-box { margin: 4px; box-shadow: none; }
.menu-item .sub { display: block; font-size: 13px; color: var(--ink-soft); line-height: 1.4; }
.menu-item.has-sub { min-height: 56px; padding-top: 6px; padding-bottom: 6px; }

/* 写真の前後: 片方だけのときも左右の余白をそろえる（空の span を詰めない） */
.pager > span:empty { display: none; }
.pager > .btn:only-child { flex: 1 1 auto; }

/* 非表示の印（タイルの中は短く） */
.tile-hidden { font-size: 13px; text-align: center; padding: 0 4px; line-height: 1.3; }
.tile-hidden .ic { width: 22px; height: 22px; }

/* 関係のタブ: 768 以上は折り返して全部見せる（横に流すのはスマホだけ） */
@media (min-width: 600px) {
  .rel-tabs { flex-wrap: wrap; overflow-x: visible; }
}

/* ページの中の確かめ（ブラウザのダイアログの代わり） */
.ask-box { padding: 16px; border-color: var(--sakura); }
.ask-box p { color: var(--ink); }
.ask-acts .btn-primary { background: var(--accent-ink); }
.ask-acts .btn-primary:hover { background: #96492D; }
.ask-acts .btn { min-height: 48px; }

/* 「届けたものを消す」（この端末から届けたものにだけ出る） */
.mine-actions { display: flex; justify-content: flex-end; }
.mine-actions .btn-ghost { color: var(--ink-soft); padding: 0 12px; margin-right: -12px; }

/* ひとことの非表示（ご家族だけ） */
.comment > div { flex: 1 1 auto; min-width: 0; }
.comment form { margin-top: 2px; }
.comment form .btn-ghost { min-height: 40px; padding: 0 12px; margin-left: -12px; font-size: 14px; }
.comment.is-hidden .avatar { opacity: 0.6; }

/* ご家族の画面のことばのカード: 操作を右にそろえ、長い文言は折り返す */
.mini .ops-row { flex-wrap: wrap; }
.mini .ops-row .btn { white-space: normal; text-align: center; }

/* 切り替えの行（節目のお知らせ） */
.toggle-row .grow { flex: 1 1 auto; min-width: 0; }
.notify-list { margin-top: 12px; }
.notify-list .toggle-row { padding: 10px 0; }
.notify-list .toggle-row + .toggle-row { border-top: 1px solid var(--line); }
.notify-list .cap { font-size: 14px; color: var(--ink-soft); margin-bottom: 2px; }
.next-toggle { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* エラーの画面 */
.error-page { padding-top: 48px; }
.error-page h1 { font-size: 22px; }
.error-page .sub { font-size: 16px; margin-top: 12px; }
.error-page .actions { max-width: 320px; margin-left: auto; margin-right: auto; }

/* ---------- 管理画面（葬儀場・運営）: 狭い幅で横にはみ出さない ---------- */
.admin > * { min-width: 0; }
.admin-head > div { min-width: 0; }
.admin-head .btn { flex: 0 0 auto; }
@media (max-width: 700px) {
  .admin-nav .brand img { height: 28px; }
  .admin-nav .hall { flex: 1 1 140px; min-width: 0; font-size: 13px; }
  .admin-nav .nav-item, .admin-nav > form { flex: 1 1 auto; }
  .admin-nav .nav-item { min-height: 44px; font-size: 14px; }
  .admin-main { padding: 20px 16px 48px; }
  .form-card, .issued { padding: 20px; }
}
.admin-sec { padding: 24px; }
.admin-sec + .admin-sec { margin-top: 24px; }
.admin-sec h2 { font-size: 17px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-sec h2 .note { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.admin-sec .empty { font-size: 15px; color: var(--ink-soft); }
.stats-6 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; padding: 24px; }
.stats-6 .stat .n { font-size: 30px; }
@media (max-width: 900px) { .stats-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.table th.num, .table td.num { text-align: right; white-space: nowrap; }
.table td.soft { color: var(--ink-soft); }
.table td.act { text-align: right; white-space: nowrap; width: 1%; }
.table td.act .btn { width: auto; }
.table .state { display: inline-block; }
.forms-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.forms-2 h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.forms-2 form > * + * { margin-top: 12px; }
.forms-2 .btn { width: auto; }
@media (max-width: 900px) { .forms-2 { grid-template-columns: minmax(0, 1fr); } }
.hidden-list { list-style: none; margin: 0; padding: 0; }
.hidden-list li { padding: 12px 0; font-size: 15px; }
.hidden-list li + li { border-top: 1px solid var(--line); }
.hidden-list .meta { display: block; font-size: 13px; color: var(--ink-soft); }
.admin-error { color: var(--accent-ink); font-size: 14px; }
.pager-simple { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 16px; }
.login-logo { margin-bottom: 24px; }
.cell-sub { display: block; font-weight: 400; }
@media (max-width: 1150px) { .admin-grid { grid-template-columns: minmax(0, 1fr); } }
.admin-grid > * { min-width: 0; }
.stats-6 + .admin-sec { margin-top: 24px; }
.table td.soft { white-space: nowrap; }
.admin-sec h2 .note { white-space: nowrap; }
.mine-actions { flex-wrap: wrap; }
.mine-actions .ask-box { flex: 1 1 100%; }
.mini .ops-row { align-items: center; }
.mini .ops-row > form:has(.ask-box), .mini .ask-box { flex: 1 1 100%; }
.btn-ghost.is-danger { color: var(--accent-ink); }

/* 確認待ち（F80）とこのページの設定（F81・F82）。素組み。仕上げはデザイナー */
.approval-row { display: block; cursor: pointer; }
.approval-row > input[type="checkbox"] { width: 22px; height: 22px; float: right; margin: 2px 0 0 10px; }
.approval-thumbs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; align-items: center; }
.approval-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.approval-acts { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }
.settings-form > * + * { margin-top: 16px; }
.settings-form fieldset { border: 0; padding: 0; margin: 0; }
.settings-form legend { font-weight: 600; margin-bottom: 6px; }
.settings-form .radio { display: flex; gap: 8px; align-items: center; min-height: 40px; font-size: 16px; }

/* ==========================================================
   PoC 追加（10/9）の見た目: 成果の数字・確認待ち・このページの設定・お墓・ご家族への紹介
   ========================================================== */

/* ---------- 成果の数字（運営） ---------- */
.head-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.head-acts .btn { width: auto; }
.kpi-dl-note { margin: -14px 0 18px; font-size: 13px; color: var(--ink-soft); }
.kpi-goals { padding: 24px; margin-bottom: 24px; }
.kpi-goals h2 { font-size: 17px; font-weight: 600; margin-bottom: 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.kpi-goals h2 .note { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.goals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.goal { padding: 18px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.goal-cap { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.goal-n { font-size: 16px; line-height: 1.3; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.goal-n b { font-size: 40px; font-weight: 600; font-variant-numeric: tabular-nums; }
.goal-t { flex-basis: 100%; font-size: 13px; color: var(--ink-soft); }
.goal-sub { font-size: 13px; color: var(--ink-soft); }
.goal-bar { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border: 0; border-radius: 5px; background: #EFEAE3; overflow: hidden; }
.goal-bar::-webkit-progress-bar { background: #EFEAE3; border-radius: 5px; }
.goal-bar::-webkit-progress-value { background: #D9BE8C; border-radius: 5px; }
.goal-bar::-moz-progress-bar { background: #D9BE8C; border-radius: 5px; }
.goal-bar.is-met::-webkit-progress-value { background: #8FA486; }
.goal-bar.is-met::-moz-progress-bar { background: #8FA486; }
@media (max-width: 700px) { .goals { grid-template-columns: minmax(0, 1fr); } .goal-n b { font-size: 34px; } }

/* 基準値との比較の札。達した＝塗り＋チェック、届かない＝点線の枠＋白抜きの丸（色に頼らない） */
.reach { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.reach .ic { width: 16px; height: 16px; vertical-align: 0; }
.reach.is-met { background: var(--leaf-soft); color: #4F6047; border: 1.5px solid #A0AC98; }
.reach.is-short { background: transparent; color: #7A5F2E; border: 1.5px dashed #C9AE78; }
.reach.is-short i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; flex: 0 0 auto; }
.reach.is-none { color: var(--ink-soft); font-weight: 500; padding-left: 0; }
.reach-cell { white-space: nowrap; }

.kpi-table td { vertical-align: top; }
.kpi-table td.num b { font-size: 17px; font-variant-numeric: tabular-nums; }
.kpi-label { display: block; font-weight: 600; }
.kpi-def { display: block; font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin-top: 2px; max-width: 34em; }
.kpi-sub { display: block; font-size: 13px; color: var(--ink-soft); }
.kpi-note { margin-top: 14px; font-size: 13px; color: var(--ink-soft); }
.months-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.months-form h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.months-form h3 .note { font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-left: 6px; }
.months-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.months-fields .btn { width: auto; min-height: var(--tap); }
@media (max-width: 900px) { .months-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .months-fields .btn { grid-column: 1 / -1; justify-self: start; } }

/* ---------- ご家族の画面: このページの設定 ---------- */
.settings-form .hint { text-align: left; margin-top: 0; font-size: 14px; color: var(--ink-soft); }
.settings-form > * + * { margin-top: 0; }
.set-group { border: 0; margin: 0; padding: 18px 0; border-top: 1px solid var(--line); min-width: 0; }
.set-group:first-child { border-top: 0; padding-top: 4px; }
.set-group > legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; font-size: 15px; font-weight: 600; }
.set-group > legend + * { clear: both; }
.set-group > * + * { margin-top: 12px; }
.set-group[disabled] .choice { opacity: 0.6; cursor: default; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.choice + .choice { margin-top: 8px; }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--btn-fill); }
.choice b { display: block; font-size: 16px; font-weight: 600; line-height: 1.5; }
.choice .sub { display: block; font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--sakura-soft); --ink-soft: #6E655C; }
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit .input { max-width: 160px; }
.settings-form .btn { margin-top: 8px; }

/* ---------- ご家族の画面: 確認待ち ---------- */
.approval-lead { font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }
.approval-row { display: block; position: relative; padding-right: 56px; cursor: pointer; }
.approval-row + .approval-row { margin-top: 12px; }
.approval-row > input[type="checkbox"] { position: absolute; right: 16px; top: 16px; float: none; width: 26px; height: 26px; margin: 0; accent-color: var(--btn-fill); }
.approval-row .post-when { margin-left: 0; }
.approval-row .post-head { flex-wrap: wrap; row-gap: 0; }
.approval-row:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.approval-thumbs img { width: 64px; height: 64px; border-radius: 10px; }
.approval-acts { position: sticky; bottom: 0; z-index: 4; margin: 16px -20px 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); background: rgba(251, 250, 248, 0.94); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.approval-acts .btn + .btn { margin-top: 8px; }
.approval-acts .hint { margin-top: 6px; font-size: 13px; color: var(--ink-soft); text-align: center; }

/* 届けた本人の端末に見える「確認待ち」 */
.pending-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--sun-soft); font-size: 14px; line-height: 1.6; color: #6E655C; }
.pending-note .ic { width: 18px; height: 18px; margin-top: 2px; color: #7A5F2E; }
.pending-note b { color: var(--ink); font-weight: 600; }
.tile-pending { inset: auto 6px 6px auto; display: inline-flex; flex-direction: row; padding: 2px 8px; border-radius: 999px; background: rgba(251, 250, 248, 0.94); color: var(--ink); font-size: 12px; font-weight: 600; }

/* ---------- 葬儀・お墓のご案内（故人ページ・節目のページの下部。10/24）。弔事として静かに: 飾らず、線と余白だけ。
   住所・電話は行ごと押せる枠（高さ 64px・文字 16px 以上）に「地図を開く」「電話をかける」を文字で添える ---------- */
.guide { margin: 28px 20px 0; padding: 4px 20px 8px; box-shadow: none; }
.guide-ttl { font-family: var(--font-serif); font-size: 18px; font-weight: 500; letter-spacing: 0.08em; line-height: 1.5; padding: 18px 0 12px; border-bottom: 1px solid var(--line); }
.guide-block { padding: 18px 0 20px; }
.guide-block + .guide-block { border-top: 1px solid var(--line); }
.guide-sub { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--ink-soft); letter-spacing: 0.04em; }
.guide-name { margin-top: 6px; font-size: 18px; font-weight: 500; line-height: 1.6; }
.guide-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.guide-act {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.guide-act:hover { text-decoration: none; background: #F6F3EE; border-color: #E2DBD1; }
.guide-act-ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; background: var(--sky-soft); }
.guide-act-ic .ic { width: 22px; height: 22px; vertical-align: 0; }
.guide-act-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.guide-act-txt b { font-size: 17px; font-weight: 500; line-height: 1.5; font-variant-numeric: tabular-nums; }
.guide-act-txt > span { font-size: 16px; line-height: 1.5; color: var(--accent-ink); }
.guide-act > .ic { color: var(--ink-soft); width: 20px; height: 20px; }
.guide-list { margin: 14px 0 0; display: grid; gap: 6px; font-size: 16px; }
.guide-list > div { display: grid; grid-template-columns: 4em minmax(0, 1fr); gap: 12px; }
.guide-list dt { color: var(--ink-soft); }
.guide-list dd { margin: 0; }
.guide-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--bg); font-size: 16px; line-height: 1.8; }

/* ---------- 葬儀場の発行画面: 任意の項目 ---------- */
.optional-fields { border-top: 1px solid var(--line); padding-top: 6px; }
.optional-fields > summary { list-style: none; cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; min-height: 56px; padding: 6px 0; }
.optional-fields > summary::-webkit-details-marker { display: none; }
.optional-fields > summary b { font-weight: 600; }
.optional-fields > summary > span:first-child { font-size: 15px; }
.opt-hint { flex: 1 1 100%; order: 3; font-size: 13px; color: var(--ink-soft); }
.optional-fields > summary > .ic { margin-left: auto; color: var(--ink-soft); transition: transform 0.2s ease; }
.optional-fields[open] > summary > .ic { transform: rotate(90deg); }
.optional-fields > .form-grid { margin-top: 10px; }
.issue-acts { margin-top: 26px; }
@media (prefers-reduced-motion: reduce) { .optional-fields > summary > .ic { transition: none; } }
/* 部品の指定（.settings-form fieldset・ページの .ops .hint）より強く */
.settings-form fieldset.set-group { border: 0; border-top: 1px solid var(--line); padding: 18px 0; margin: 0; }
.settings-form fieldset.set-group:first-child { border-top: 0; padding-top: 4px; }
.ops .settings-form .hint { text-align: left; margin-top: 0; }
.settings-form fieldset.set-group > legend { margin-bottom: 10px; }
.ops .settings-form .choice + .hint, .ops .settings-form .set-group .hint { margin-top: 8px; }
.pending-note b { display: block; }
.kpi-table { min-width: 560px; }
.kpi-table td.num .kpi-sub { white-space: normal; }
.optional-fields > summary > span:first-child { flex: 1 1 0; min-width: 0; }

/* 葬儀場の発行完了: 右に件数の枠があるとき（1151〜1500px 前後）カードが狭くなり、ボタンがはみ出していた。
   カードの幅で QR を小さく、さらに狭ければ QR の下にボタンを並べる */
.issued { container-type: inline-size; }
.next-acts .btn { min-width: 0; }
@container (max-width: 620px) {
  .issued .issued-body { grid-template-columns: 160px minmax(0, 1fr); gap: 20px; }
  .issued .issued-body .qr { width: 160px; height: 160px; padding: 8px; }
}
@container (max-width: 520px) {
  .issued .issued-body { grid-template-columns: minmax(0, 1fr); }
  .issued .issued-body .qr { width: 200px; height: 200px; margin: 0 auto; }
}

/* ==========================================================
   その場で体験できるデモ（10/10。docs/04_設計/06 C3）
   ========================================================== */

/* ---------- 届くのを待つ画面（タブレット。相手と一緒に見る） ---------- */
.live { max-width: 1280px; margin: 0 auto; padding: 40px 48px 32px; min-height: 100dvh; display: flex; flex-direction: column; }
.live-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.live-head .portrait { width: 120px; height: 120px; border-width: 4px; }
.live-head .ihai { width: 104px; }
.live-name { font-family: var(--font-serif); font-size: 40px; font-weight: 500; letter-spacing: 0.1em; line-height: 1.3; }
.live-sub { margin-top: 6px; font-size: 18px; color: var(--ink-soft); }
.live-count { font-size: 20px; color: var(--ink-soft); text-align: right; line-height: 1.4; white-space: nowrap; }
.live-count b { display: block; font-size: 64px; font-weight: 500; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; margin-top: 32px; align-content: start; }
.live-tile { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 14px; background: var(--line); }
.live-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 非表示: 伊藤さんだけが使う控えめな操作。いつも見えるが、小さく薄く */
.live-tile .hide-btn {
  position: absolute; right: 8px; bottom: 8px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 18px;
  background: rgba(251, 250, 248, 0.78); color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer;
  opacity: 0.7; transition: opacity 0.2s ease;
}
.live-tile .hide-btn:hover, .live-tile .hide-btn:focus-visible { opacity: 1; color: var(--ink); }
/* 新しく届いたもの: 上からやわらかく浮かび、桃色の細い縁がしばらく残って消える（強い演出はしない） */
.live-tile.is-new { animation: live-in 1.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.live-tile.is-new::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 3px var(--sakura); animation: live-ring 6s ease 0.8s both; pointer-events: none; }
@keyframes live-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes live-ring { from { opacity: 1; } to { opacity: 0; } }
.live-empty { margin: 72px auto 0; text-align: center; color: var(--ink-soft); font-size: 22px; }
.live-empty img { width: 56px; height: 56px; margin: 0 auto 12px; }
.live-foot { margin-top: auto; padding-top: 32px; display: flex; justify-content: center; }
.live-foot img { opacity: 0.85; }
@media (prefers-reduced-motion: reduce) { .live-tile.is-new, .live-tile.is-new::after { animation: none; } }
/* 縦向き（820 前後）: 人数を名前の下に。4 列 */
@media (max-width: 900px) {
  .live { padding: 32px 32px 28px; }
  .live-head { grid-template-columns: auto minmax(0, 1fr); gap: 20px 24px; }
  .live-head .portrait { width: 104px; height: 104px; } .live-head .ihai { width: 92px; }
  .live-name { font-size: 34px; }
  .live-count { grid-column: 1 / -1; text-align: left; display: flex; align-items: baseline; gap: 8px; }
  .live-count b { display: inline; font-size: 52px; }
  .live-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 600px) {
  .live { padding: 20px 16px; }
  .live-name { font-size: 26px; }
  .live-sub { font-size: 15px; }
  .live-head .portrait { width: 72px; height: 72px; } .live-head .ihai { width: 64px; padding: 4px; }
  .live-count { font-size: 16px; }
  .live-count b { font-size: 40px; }
  .live-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
}

/* ---------- 伊藤さん用の操作（体験の準備） ---------- */
.demo-ops .sub b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.demo-steps { list-style: none; margin: 24px 0 0; padding: 0; }
.demo-steps > li { display: flex; gap: 14px; padding: 20px 0; border-top: 1px solid var(--line); }
.demo-steps > li:first-child { border-top: 0; padding-top: 4px; }
.demo-steps .num { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--sakura-soft); color: var(--accent-ink); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.demo-steps .step-body { flex: 1 1 auto; min-width: 0; }
.demo-steps h2 { font-size: 17px; font-weight: 600; line-height: 1.5; padding-top: 3px; }
.demo-steps .step-body > p { margin-top: 4px; font-size: 15px; color: var(--ink-soft); }
.demo-steps .btn { margin-top: 14px; }
.demo-qr { width: 100%; max-width: 280px; aspect-ratio: 1 / 1; margin: 16px auto 0; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.demo-qr svg { width: 100%; height: 100%; display: block; }
.demo-url { margin-top: 8px; text-align: center; font-size: 13px; color: var(--ink-soft); word-break: break-all; }
.demo-secret { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--sun-soft); font-size: 14px; color: #6E655C; }
.demo-secret .ic { width: 18px; height: 18px; margin-top: 2px; color: #7A5F2E; }

/* ---------- 運営: 体験用のページ ---------- */
.demo-links { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 16px 20px; margin: 0; }
.demo-links dt { font-size: 14px; font-weight: 600; color: var(--ink-soft); padding-top: 12px; }
.demo-links dd { margin: 0; min-width: 0; }
.demo-links .url { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px; font-size: 15px; }
.demo-links .url a { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-links .url .btn { flex: 0 0 auto; width: auto; min-height: 40px; }
.demo-links .hint { margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.demo-links .empty { padding-top: 10px; font-size: 15px; color: var(--ink-soft); }
.demo-key-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-key-form .btn { width: auto; }
.demo-key-form .hint { font-size: 13px; color: var(--ink-soft); }
.demo-key-form .ask-box { flex: 1 1 100%; }
@media (max-width: 700px) { .demo-links { grid-template-columns: minmax(0, 1fr); gap: 4px; } .demo-links dd + dt { margin-top: 12px; } .demo-links dt { padding-top: 0; } }

/* 非表示のボタンは目印のアイコンだけ（文字は読み上げ用に残す。live.js が「非表示」の文字を入れる） */
.live-tile .hide-btn { width: 36px; min-height: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 0; color: transparent; background: rgba(251, 250, 248, 0.72); opacity: 0.6; display: flex; align-items: center; justify-content: center; }
.live-tile .hide-btn::before { content: ""; width: 18px; height: 18px; background: var(--ink); -webkit-mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"%3E%3Cpath d="M53.92%2C34.62A8%2C8%2C0%2C1%2C0%2C42.08%2C45.38L61.32%2C66.55C25%2C88.84%2C9.38%2C123.2%2C8.69%2C124.76a8%2C8%2C0%2C0%2C0%2C0%2C6.5c.35.79%2C8.82%2C19.57%2C27.65%2C38.4C61.43%2C194.74%2C93.12%2C208%2C128%2C208a127.11%2C127.11%2C0%2C0%2C0%2C52.07-10.83l22%2C24.21a8%2C8%2C0%2C1%2C0%2C11.84-10.76Zm47.33%2C75.84%2C41.67%2C45.85a32%2C32%2C0%2C0%2C1-41.67-45.85ZM128%2C192c-30.78%2C0-57.67-11.19-79.93-33.25A133.16%2C133.16%2C0%2C0%2C1%2C25%2C128c4.69-8.79%2C19.66-33.39%2C47.35-49.38l18%2C19.75a48%2C48%2C0%2C0%2C0%2C63.66%2C70l14.73%2C16.2A112%2C112%2C0%2C0%2C1%2C128%2C192Zm6-95.43a8%2C8%2C0%2C0%2C1%2C3-15.72%2C48.16%2C48.16%2C0%2C0%2C1%2C38.77%2C42.64%2C8%2C8%2C0%2C0%2C1-7.22%2C8.71%2C6.39%2C6.39%2C0%2C0%2C1-.75%2C0%2C8%2C8%2C0%2C0%2C1-8-7.26A32.09%2C32.09%2C0%2C0%2C0%2C134%2C96.57Zm113.28%2C34.69c-.42.94-10.55%2C23.37-33.36%2C43.8a8%2C8%2C0%2C1%2C1-10.67-11.92A132.77%2C132.77%2C0%2C0%2C0%2C231.05%2C128a133.15%2C133.15%2C0%2C0%2C0-23.12-30.77C185.67%2C75.19%2C158.78%2C64%2C128%2C64a118.37%2C118.37%2C0%2C0%2C0-19.36%2C1.57A8%2C8%2C0%2C1%2C1%2C106%2C49.79%2C134%2C134%2C0%2C0%2C1%2C128%2C48c34.88%2C0%2C66.57%2C13.26%2C91.66%2C38.35%2C18.83%2C18.83%2C27.3%2C37.62%2C27.65%2C38.41A8%2C8%2C0%2C0%2C1%2C247.31%2C131.26Z"/%3E%3C/svg%3E') center / contain no-repeat; mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"%3E%3Cpath d="M53.92%2C34.62A8%2C8%2C0%2C1%2C0%2C42.08%2C45.38L61.32%2C66.55C25%2C88.84%2C9.38%2C123.2%2C8.69%2C124.76a8%2C8%2C0%2C0%2C0%2C0%2C6.5c.35.79%2C8.82%2C19.57%2C27.65%2C38.4C61.43%2C194.74%2C93.12%2C208%2C128%2C208a127.11%2C127.11%2C0%2C0%2C0%2C52.07-10.83l22%2C24.21a8%2C8%2C0%2C1%2C0%2C11.84-10.76Zm47.33%2C75.84%2C41.67%2C45.85a32%2C32%2C0%2C0%2C1-41.67-45.85ZM128%2C192c-30.78%2C0-57.67-11.19-79.93-33.25A133.16%2C133.16%2C0%2C0%2C1%2C25%2C128c4.69-8.79%2C19.66-33.39%2C47.35-49.38l18%2C19.75a48%2C48%2C0%2C0%2C0%2C63.66%2C70l14.73%2C16.2A112%2C112%2C0%2C0%2C1%2C128%2C192Zm6-95.43a8%2C8%2C0%2C0%2C1%2C3-15.72%2C48.16%2C48.16%2C0%2C0%2C1%2C38.77%2C42.64%2C8%2C8%2C0%2C0%2C1-7.22%2C8.71%2C6.39%2C6.39%2C0%2C0%2C1-.75%2C0%2C8%2C8%2C0%2C0%2C1-8-7.26A32.09%2C32.09%2C0%2C0%2C0%2C134%2C96.57Zm113.28%2C34.69c-.42.94-10.55%2C23.37-33.36%2C43.8a8%2C8%2C0%2C1%2C1-10.67-11.92A132.77%2C132.77%2C0%2C0%2C0%2C231.05%2C128a133.15%2C133.15%2C0%2C0%2C0-23.12-30.77C185.67%2C75.19%2C158.78%2C64%2C128%2C64a118.37%2C118.37%2C0%2C0%2C0-19.36%2C1.57A8%2C8%2C0%2C1%2C1%2C106%2C49.79%2C134%2C134%2C0%2C0%2C1%2C128%2C48c34.88%2C0%2C66.57%2C13.26%2C91.66%2C38.35%2C18.83%2C18.83%2C27.3%2C37.62%2C27.65%2C38.41A8%2C8%2C0%2C0%2C1%2C247.31%2C131.26Z"/%3E%3C/svg%3E') center / contain no-repeat; }
.live-tile .hide-btn:hover, .live-tile .hide-btn:focus-visible { opacity: 1; }

/* 待つ画面のことばだけの投稿（QA MEDIUM-2。素組み） */
.live-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 16px; }
.live-word { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.live-word .hide-btn { position: static; opacity: 1; margin-top: 8px; }
/* 体験用のページの帯（QA MEDIUM-3） */
.demo-band { margin: 0; padding: 8px 16px; font-size: 13px; text-align: center; background: var(--sun-soft, #FBF3E6); color: var(--ink); }
/* 見本のページの帯（裁定 20261011 §1-1）。sky-soft の面に ink の文字（6.56:1）。リンクも ink の下線（accent-ink は sky-soft の上で 4.31:1 で足りない） */
.sample-band { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 12px; margin: 0; padding: 10px 16px; font-size: 15px; line-height: 1.6; text-align: center; background: var(--sky-soft); color: var(--ink); }
.sample-band a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* 住所（葬儀・お墓のご案内）。空白の所で折り（「天\n神」「4-\n5-6」を防ぐ）、枠より長い塊だけ途中で折る */
.guide-addr { word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance; }
/* スマホの幅（〜400px）では枠の内側を詰め、住所の塊（「福岡県福岡市中央区天神」ほど）が 1 行に入るように */
@media (max-width: 400px) {
  .guide { padding-left: 16px; padding-right: 16px; }
  .guide-act { gap: 10px; padding: 10px 10px 10px 10px; }
  .guide-act-ic { width: 36px; height: 36px; }
  .guide-act-ic .ic { width: 20px; height: 20px; }
  .guide-act > .ic { width: 18px; height: 18px; }
}

/* ご家族の画面: お墓を載せるかどうか（欄のあと、保存の前に置く。10/24） */
.vis-group { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }
.vis-ttl { font-size: 16px; font-weight: 600; margin-bottom: 10px; }

/* ===== 人生のアルバムと、写真を整える（2026-11-04。画面案 docs/03_デザイン/20261104_人生のアルバム/ の mock.css を写した。色は上の変数だけ） ===== */
[data-album-view][hidden], .al-step[hidden] { display: none !important; }

/* 届ける: 紙の写真の入口（写真の見本は置かず、カメラのしるし） */
.paper-card { margin-top: 28px; padding: 18px 18px 16px; }
.paper-head { display: flex; align-items: center; gap: 12px; }
.paper-head .paper-ic { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; background: var(--surface); color: var(--accent-ink); }
.paper-head .paper-ic .ic { width: 24px; height: 24px; }
.paper-head h2 { font-size: 16px; font-weight: 600; line-height: 1.55; }
.paper-card > p { margin: 12px 0 14px; font-size: 15px; line-height: 1.7; }
.paper-card .tips { margin: 10px 0 0; font-size: 14px; color: var(--ink-soft); text-align: center; line-height: 1.65; }

/* 届ける: 何枚目か */
.count-of { margin-bottom: 4px; font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* 届ける: どの方か（お顔の枠） */
.face-stage { position: relative; margin-top: 18px; border-radius: 12px; overflow: hidden; background: var(--line); }
.face-stage > img { width: 100%; height: auto; }
.face { position: absolute; padding: 0; border: 2px solid rgba(255, 255, 255, 0.95); border-radius: 10px; background: transparent; box-shadow: 0 0 0 1px rgba(46, 43, 40, 0.35); cursor: pointer; }
.face::before { content: ""; position: absolute; inset: -14px; } /* 押せる範囲を広げる（44px 以上） */
.face[aria-pressed="true"] { border-color: var(--accent); border-width: 3px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9); }
.face-label { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; padding: 2px 10px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.face[aria-pressed="false"] .face-label { display: none; }
.privacy { display: flex; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.privacy .ic { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; }

/* 届ける: 写真ごとの問い。.decades は管理の画面の年代のボタン */
.when-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.when-thumb { position: relative; width: 112px; flex: 0 0 auto; border-radius: 10px; overflow: hidden; background: var(--line); }
.when-thumb img { width: 100%; height: auto; }
.when-thumb i { position: absolute; border: 2px solid var(--accent); border-radius: 6px; }
.when-head .count-of { margin: 0; }
.decades { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.decades .chip { justify-content: center; padding: 0 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.decades .chip[aria-pressed="true"] { font-weight: 600; }
.decades .chip-wide { grid-column: span 2; }
.al-note { min-height: 120px; }

/* 整えています（元の写真の上に、整えた写真が静かに重なる） */
.fade-stage { position: relative; margin-top: 18px; border-radius: 12px; overflow: hidden; background: var(--line); }
.fade-stage img { width: 100%; height: auto; }
.fade-stage .fade-after { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; transition: opacity 2.4s ease; }
.fade-stage.is-done .fade-after { opacity: 1; }
.tidy-state { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--ink-soft); }
.tidy-bar { flex: 0 0 96px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.tidy-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0.04); transition: transform 20s cubic-bezier(0.2, 0.6, 0.3, 1); }
.tidy-bar.is-going i { transform: scaleX(0.9); }
.tidy-bar.is-full i { transform: scaleX(1); transition-duration: 0.6s; }
.keep-note { margin-top: 16px; padding: 12px 16px; align-items: center; }
.keep-note .ic { color: #4F7072; margin-top: 0; }
.keep-note p { font-size: 15px; }
.tidy-failed { margin-top: 16px; }
.tidy-failed p { font-size: 15px; }

/* 前と後を見比べる（なぞる） */
.compare { position: relative; margin-top: 18px; border-radius: 12px; overflow: hidden; background: var(--line); user-select: none; -webkit-user-select: none; touch-action: pan-y; --pos: 50%; }
.compare .cmp-after { width: 100%; height: auto; }
.compare .cmp-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .cmp-before img { width: 100%; height: 100%; object-fit: cover; }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 0 0 1px rgba(46, 43, 40, 0.18); pointer-events: none; }
.cmp-line i { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow), 0 1px 4px rgba(46, 43, 40, 0.2); }
.cmp-line .ic { width: 16px; height: 16px; }
.cmp-line .flip { transform: scaleX(-1); }
.cmp-tag { position: absolute; top: 8px; padding: 0 8px; border-radius: 6px; background: rgba(251, 250, 248, 0.92); color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.8; pointer-events: none; }
.cmp-tag-l { left: 8px; }
.cmp-tag-r { right: 8px; }
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare.cmp-full { margin-top: 0; border-radius: 0; }
.single-photo { background: var(--line); }
.single-photo img { width: 100%; height: auto; }

/* 故人ページ: 人生のアルバム */
.life-lead { padding: 4px 20px 4px; }
.seg { display: flex; margin-top: 14px; padding: 3px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.seg-btn { flex: 1 1 0; min-height: 44px; border: 0; border-radius: 11px; background: none; font: inherit; font-size: 15px; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.seg-btn[aria-checked="true"] { background: var(--sakura-soft); color: var(--ink); font-weight: 600; }
.life-jump { padding-top: 12px; }
.life-edge { padding: 14px 20px 0; font-family: var(--font-serif); font-size: 14px; letter-spacing: .06em; color: var(--ink-soft); text-align: center; }
.life-edge-end { padding: 22px 20px 6px; }
.life-dec { padding-top: 6px; scroll-margin-top: 12px; }
.life-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; padding: 18px 20px 10px; }
.life-head::before { content: ""; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); flex: 0 0 auto; }
.life-head h3 { font-family: var(--font-serif); font-size: 22px; font-weight: 500; letter-spacing: .06em; line-height: 1.3; white-space: nowrap; }
.life-head .yrs { font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.life-head .n { margin-left: auto; font-size: 14px; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.life-unknown { margin-top: 20px; border-top: 1px solid var(--line); }
.life-unknown .life-head h3 { font-family: var(--font-sans); font-size: 17px; font-weight: 600; letter-spacing: 0; }
/* 6 列の格子に、1 枚目を大きく。枚数で並べ方を変えて、すき間を作らない */
.life-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.life-grid > .tile { grid-column: span 2; }
.life-grid.is-lead > .tile:first-child { grid-column: span 4; grid-row: span 2; }
.life-grid.n1 > .tile { grid-column: span 6; aspect-ratio: 4 / 3; }
.life-grid.n2 > .tile, .life-grid.n4 > .tile { grid-column: span 3; }
.life-grid.n5 > .tile:nth-child(4), .life-grid.n5 > .tile:nth-child(5) { grid-column: span 3; }
.life-grid > .tile[hidden] { display: none; }
.tile-more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(46, 43, 40, 0.45); color: #fff; font-size: 15px; font-weight: 600; }
.life-word { margin: 12px 20px 0; padding: 0 0 0 14px; border-left: 2px solid var(--sun); }
.life-word p { font-size: 15px; line-height: 1.75; }
.life-word cite { display: block; margin-top: 4px; font-size: 14px; font-style: normal; color: var(--ink-soft); }
.life-word cite span { margin-left: 8px; }
.life-note { padding: 18px 20px 0; font-size: 14px; color: var(--ink-soft); text-align: center; }

/* ご家族: 管理の画面の行と、人生のアルバムの画面 */
.op-new > .ic:first-child { color: var(--accent-ink); }
.op-new .nb, .pick-opt .nb { display: inline-block; white-space: nowrap; }
.fam-h1 { margin-top: 4px; font-size: 21px; font-weight: 600; line-height: 1.5; }
.fam-lead { margin-top: 8px; font-size: 15px; color: var(--ink-soft); line-height: 1.7; }
.fam-lead + .hint { margin-top: 10px; font-size: 14px; color: var(--ink-soft); line-height: 1.7; }
.fam-list { padding: 26px 0 0; }
.fam-list h2, .fam-list .hint { padding: 0 20px; }
.fam-list h2, .fam-sec h2 { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.fam-list .hint, .fam-sec .hint { margin-top: 10px; font-size: 14px; color: var(--ink-soft); line-height: 1.65; }
.fam-list .life-grid { margin-top: 12px; }
.fam-empty { padding: 24px 20px 0; font-size: 15px; color: var(--ink-soft); }
.tile-ask, .tile-flag { position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 1px 8px; border-radius: 6px; background: rgba(251, 250, 248, 0.94); color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.55; }
.tile-ask { background: var(--btn-fill); color: var(--btn-text); }
.fam-band { display: flex; align-items: center; gap: 6px; margin: 0; padding: 10px 20px; background: var(--sky-soft); font-size: 14px; color: #6E655C; }
.fam-band .ic { width: 16px; height: 16px; flex: 0 0 auto; }
.fam-sec { padding: 22px 20px 0; }
.pick-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pick-opt { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.pick-opt img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--line); }
.pick-opt input { position: absolute; top: 16px; left: 16px; width: 22px; height: 22px; margin: 0; accent-color: var(--btn-fill); }
.pick-opt .pick-txt b { display: block; font-size: 16px; font-weight: 600; line-height: 1.5; }
.pick-opt .pick-txt .sub { display: block; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.pick-opt:has(input:checked) { border-color: var(--accent); background: var(--sakura-soft); --ink-soft: #6E655C; }
.pick-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.src { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; line-height: 1.6; }
.src .ic { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; color: var(--ink-soft); }
.src b { font-weight: 600; white-space: nowrap; }
.fam-sec .decades { margin-top: 12px; }
.fam-word { padding: 12px 14px; }
.fam-word p { font-size: 15px; line-height: 1.75; }
#famWordText { white-space: pre-line; }
.fam-word .who { margin-top: 4px; font-size: 14px; color: var(--ink-soft); }
.fam-word .ops-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.fam-acts { padding: 24px 20px 40px; }
.fam-acts > * + * { margin-top: 10px; }
.fam-saved { text-align: center; font-size: 15px; color: var(--ink-soft); }
.fam-restore-act { margin-top: 12px; }
.fam-restore-msg { margin-top: 10px; font-size: 15px; color: var(--ink-soft); white-space: pre-line; }
.fam-restore-msg.is-going::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; animation: fam-pulse 1.6s ease-in-out infinite; }
@keyframes fam-pulse { 50% { opacity: 0.3; } }
.fam-auto { margin-top: 6px; }
.fam-loading { padding: 40px 20px; text-align: center; color: var(--ink-soft); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .fade-stage .fade-after, .tidy-bar i { transition: none; }
  .fam-restore-msg.is-going::before { animation: none; }
}
