/* 色・文字の値は docs/design/README.md の写し。値を変えるときは docs/design を先に直す。 */
:root {
  /* Figma のスタイル名のまま */
  --p-20: #254d52;
  --p-47: #55959d;
  --p-80: #e2e9eb;
  --s-60: #7aced9;
  --accent: #3bb6c7; /* S-60 の濃い方。しおりのリボンと差し色 */
  --s-95: #c3eff9;
  --n-100: #ffffff;
  --n-96: #f5f5f5;
  --n-95: #f1f1f1;
  --n-90: #e6e6e6;
  --n-80: #cccccc;
  --n-70: #b3b3b3;
  --n-50: #808080;
  --n-30: #4e4e4e;
  --n-20: #333333;
  --n-0: #000000;
  --error: #b3261e;
  /* 文の中の記入欄のマーカー（入力・選択する欄） */
  --marker-bg: #fff3a6;
  --marker-line: #ead400;
  /* 文の中の自動で入る欄（ほかの場所で入れた値が入る欄。11/17） */
  --auto-bg: #e3f4f6;
  --auto-text: #333333;
  /* 使い方 */
  --bg: var(--n-96);
  --text: var(--n-20);
  --muted: var(--n-30);
  --card-shadow: 0 1px 3px rgb(0 0 0 / 12%);
  /* 押せない状態のボタン・入力欄の見本の字・使わない条・カレンダー（11/18。docs/design/README.md） */
  --disabled-text: #6b7280;
  --disabled-line: #d1d5db;
  --placeholder: #9ca3af;
  --unused-heading: #4b5563;
  --unused-text: #374151;
  --visit-bg: #d9eff2;
  /* 字と地の比を 4.5:1 以上にする色（11/19夜。docs/design/README.md の「ボタン」「文字」） */
  --primary: #3f7f87; /* 主ボタンの地・副ボタンの枠線と字（白い字との比 4.57:1） */
  --primary-press: #346a71; /* 押したときの地（同じ色合いで少し濃く） */
  --teal-text: #2f6e76; /* 白・#F5F5F5 の地に置くティールの字（白との比 5.8:1） */
  --cal-text: #666666; /* カレンダーの灰色の日の字（地 #F5F5F5 との比 5.3:1） */
}
/* キーボードで動かしたときの枠（ティールの濃い方） */
:where(button, a[href], summary, input, select, textarea):focus-visible { outline: 2px solid var(--teal-text); outline-offset: 2px; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  line-height: 1.7;
}
main { max-width: 720px; margin: 0 auto; padding: 32px 16px; }
h1::after, h2::after { content: ""; display: block; width: 40px; height: 3px; margin-top: 6px; background: var(--accent); }
.muted { color: var(--muted); font-size: 0.9rem; }

/* ---- 作成画面の見本（/create）。docs/design に沿う。画面の作り直しまではしていない ---- */
main.wide { max-width: 880px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.notice { background: var(--n-96); border-radius: 4px; padding: 8px 12px; font-size: 0.9rem; }
.removed { border: 1px solid var(--n-80); border-left: 4px solid var(--n-50); border-radius: 4px; padding: 8px 12px; margin: 12px 0; }
.removed p, .removed ul { margin: 4px 0; }
button { font: inherit; cursor: pointer; }
button.link { background: none; border: none; color: var(--p-20); padding: 0; text-decoration: underline; }
.tiles { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tiles > li { display: flex; } /* 同じ行のタイルの高さをそろえ、札をいつも下端に置く（11/18） */
.tile { position: relative; width: 100%; flex: 1; min-height: 84px; text-align: left; background: var(--n-100); border: 1px solid var(--n-70); border-radius: 4px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.tile.done { border: 2px solid var(--accent); padding: 9px 11px; }
.tile.done::after { content: ""; position: absolute; top: -2px; right: 12px; width: 14px; height: 24px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
/* しおり（右上の印）の下に見出しの字が入らないよう、右に場所を空ける（11/18夜2） */
.tile.done .tile-label { padding-right: 22px; }
.tile-label { font-weight: 600; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: auto; font-size: 14px; } /* タイルの札は14px（正本その2の末尾「字の大きさ」。11/22） */
.status { color: var(--muted); margin-right: 4px; }
.badge { display: inline-block; font-size: 14px; border: 1px solid var(--n-80); border-radius: 4px; padding: 0 6px; margin-left: 6px; font-weight: normal; color: var(--muted); }
.badge.top { background: var(--p-20); border-color: var(--p-20); color: var(--n-100); }
.badge.mid { background: var(--p-80); border-color: var(--p-80); color: var(--p-20); }
.badge.required { border-color: var(--n-70); color: var(--text); }
.clause { background: var(--n-100); border-radius: 4px; box-shadow: var(--card-shadow); padding: 16px; margin: 12px 0; }
.clause h3 { margin: 0 0 4px; font-size: 1.05rem; }
fieldset { border: none; padding: 0; margin: 8px 0; }
legend { font-weight: 600; margin-bottom: 4px; }
.option { display: flex; gap: 12px; align-items: flex-start; background: var(--n-100); border: 1px solid var(--n-70); border-radius: 4px; padding: 16px 20px; margin: 6px 0; font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; }
.option.on { border: 2px solid var(--accent); padding: 15px 19px; }
.option input { margin-top: 6px; }
/* 一緒には選べない選択肢：今の選択では使わない条と同じ見せ方（灰色の面・鍵・理由） */
/* 〔選択を外す〕：選んでいる選択肢（.option.on）のすぐ前に置き、負の余白でその枠の右上に重ねる（11/18） */
.deselect { display: block; position: relative; z-index: 1; height: 24px; margin: 14px 10px -38px auto; background: var(--n-100); border: 1px solid var(--n-70); border-radius: 4px; color: var(--teal-text); font-size: 14px; line-height: 1; padding: 0 8px; cursor: pointer; }
.deselect + .option.on { padding-top: 36px; }
/* 甲・乙のメモ（条を選ぶ画面。右下に固定。600px未満は画面の下の細い帯）。下のボタンに重ならないよう、画面の下に余白を取る */
.with-party-memo { padding-bottom: 56px; }
/* 右下に置くのは、本文の列（880px）の右の余白に収まる幅のときだけ（本文やカレンダーに重ならない幅に抑える。11/21夜3の指示26。No.36） */
.party-memo { position: fixed; right: 16px; bottom: 16px; z-index: 20; max-width: calc((100vw - 848px) / 2 - 24px); margin: 0; background: var(--n-100); border: 1px solid var(--n-70); border-radius: 4px; padding: 6px 12px; font-size: 14px; box-shadow: 0 1px 4px rgb(0 0 0 / 0.12); }
/* 帯があるときは、ページの一番下（画面の下のリンクを含む）にも帯の高さ分の余白をとる（11/20 の指示10） */
body:has(.party-memo) { padding-bottom: 64px; }
@media (max-width: 599px) {
  body:has(.party-memo) { padding-bottom: 40px; }
  .party-memo { left: 0; right: 0; bottom: 0; max-width: none; border-width: 1px 0 0; border-radius: 0; padding: 4px 16px; text-align: center; box-shadow: none; }
  .with-party-memo { padding-bottom: 40px; }
}
/* 右の余白が狭い幅（600〜1359px。1168px など）は、画面の下の細い帯にする（右下の枠がカレンダーのマスに重なっていた。11/21夜3の指示26。No.36） */
@media (min-width: 600px) and (max-width: 1359px) {
  .party-memo { left: 0; right: 0; bottom: 0; max-width: none; border-width: 1px 0 0; border-radius: 0; padding: 6px 16px; text-align: center; box-shadow: none; }
}
.option.locked { background: var(--n-90); border-color: var(--n-90); color: var(--muted); }
/* 送った後、〔直して送り直す〕を押す前（変えられない形）：選択肢の枠と文を薄くし、押せないことを指の形でも示す（11/18夜2） */
fieldset.locked-after-send:disabled .option, fieldset.locked-after-send:disabled :is(.choice, .field):not(.option *) { opacity: 0.6; }
fieldset.locked-after-send:disabled, fieldset.locked-after-send:disabled * { cursor: not-allowed; }
/* 〔選択を外す〕も押せない形にする（送った後、〔直して送り直す〕を押す前。11/21夜3の指示22。No.30） */
fieldset:disabled .deselect, .deselect:disabled { color: var(--disabled-text); border-color: var(--disabled-line); background: var(--n-90); opacity: 0.6; cursor: not-allowed; }
/* 最初に送った後の、あなたの氏名・住所・父母の選択と子どもの情報（変えられない形。⑲㉓。11/21夜3の指示1） */
fieldset.party:disabled :is(.field, .choice), fieldset.locked-fields:disabled :is(.field, .choice, .consent) { opacity: 0.6; }
fieldset.party:disabled *, fieldset.locked-fields:disabled * { cursor: not-allowed; }
.locked-reason { display: block; margin-top: 4px; font-family: system-ui, sans-serif; font-size: 14px; }
.locked-reason::before { content: ""; display: inline-block; width: 12px; height: 14px; margin-right: 6px; vertical-align: -1px; background: var(--n-50); clip-path: path("M3 6V4a3 3 0 0 1 6 0v2h2v8H1V6h2Zm1.5 0h3V4a1.5 1.5 0 0 0-3 0v2Z"); }
.child-choice { border-top: 1px solid var(--n-90); padding-top: 8px; }
.app-label { display: block; font-family: system-ui, sans-serif; font-size: 0.75rem; color: var(--muted); }
.letter { margin-right: 0.5em; }
details { margin-top: 8px; font-size: 0.9rem; }
.pager { display: flex; justify-content: space-between; gap: 8px; margin-top: 24px; }
.pager button { min-height: 44px; background: var(--primary); border: none; border-radius: 4px; color: var(--n-100); font-size: 14px; padding: 0 16px; }
.pager button:not(:disabled):active, .pager a.button:active, .copy-button.primary:active { background: var(--primary-press); border-color: var(--primary-press); }
button.secondary:not(:disabled):active { background: var(--p-80); border-color: var(--primary-press); color: var(--primary-press); }
/* 〔← 前の条〕〔次の条 →〕：1行目に向きと「前の条」「次の条」、2行目に条の名前を小さく（11/20夜2の指示11） */
.pager button.pager-step { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 12px; max-width: 48%; text-align: left; }
.pager button.pager-step .pager-dir { font-weight: 700; white-space: nowrap; }
.pager button.pager-step .pager-name { font-size: 12px; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.pager button.pager-step:last-child:not(:first-child) { text-align: right; align-items: flex-end; }
.pager button:disabled { background: var(--n-90); color: var(--disabled-text); border: 1px solid var(--disabled-line); cursor: default; }

/* 入力（子どもの情報・離婚した日・財産の一覧）。見本の仮の見た目 */
.field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.field > span { min-width: 7em; }
.field input, .field select, .children select { font: inherit; padding: 4px 8px; border: 1px solid var(--n-80); border-radius: 4px; background: var(--n-100); }
.child { border: 1px solid var(--n-95); border-radius: 4px; padding: 8px 12px; margin: 12px 0; }
.child > legend { padding: 0 4px; }
.consent { background: var(--n-96); border-radius: 4px; padding: 8px 12px; margin: 8px 0; font-size: 0.9rem; }
.consent p { margin: 0 0 6px; }
.consent label { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; cursor: pointer; }
.consent label:not(:last-child) { margin-bottom: 16px; }
.choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.choice > legend { float: left; font-weight: normal; margin: 0 8px 0 0; min-width: 7em; }
.choice[disabled] { opacity: 0.5; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--n-80); border-radius: 999px; padding: 2px 12px; cursor: pointer; }
.chip.on { border-color: var(--accent); background: var(--n-100); }
.chip input { margin: 0; }
.items, .confirm { margin: 8px 0; }
@media (max-width: 480px) { .field > span, .choice > legend { min-width: 100%; } }

/* 今の選択では使わない条（灰色のタイル）と、その説明 */
.tile.unused { background: var(--n-90); border: none; color: var(--unused-heading); }
.tile.unused .tile-label::before { content: ""; display: inline-block; width: 12px; height: 14px; margin-right: 6px; vertical-align: -1px; background: var(--n-50); clip-path: path("M3 6V4a3 3 0 0 1 6 0v2h2v8H1V6h2Zm1.5 0h3V4a1.5 1.5 0 0 0-3 0v2Z"); }
.tile.unused .tile-label { font-weight: normal; }
.tile-reason { font-size: 14px; line-height: 1.5; color: var(--unused-text); }
.hidden-note { border: 1px dashed var(--n-70); border-radius: 4px; padding: 8px 12px; margin: 12px 0; background: var(--n-100); }
.hidden-note p { margin: 4px 0; }
/* 前の答えで使わない項・選択肢（灰色の面に鍵と理由。元の位置に残す。引継ぎメモ3-5。11/20夜2） */
.unused-item { background: var(--n-90); }
.unused-item h3 { color: var(--unused-heading); font-weight: normal; }
.unused-item .hidden-note { background: var(--n-96); }
.locked-title::before { content: ""; display: inline-block; width: 12px; height: 14px; margin-right: 6px; vertical-align: -1px; background: var(--n-50); clip-path: path("M3 6V4a3 3 0 0 1 6 0v2h2v8H1V6h2Zm1.5 0h3V4a1.5 1.5 0 0 0-3 0v2Z"); }
.option.unused-option { color: var(--unused-text); cursor: not-allowed; }
.warn { color: var(--error); font-size: 14px; width: 100%; }
.wide-field { flex-direction: column; align-items: stretch; }
.wide-field textarea { font: inherit; padding: 4px 8px; border: 1px solid var(--n-80); border-radius: 4px; width: 100%; }

/* 文の【】の欄（docs/decisions/0006） */
.slot { white-space: nowrap; }
.slot-input { font: inherit; font-weight: 700; color: var(--text); padding: 1px 4px; margin: 0 2px; border: none; border-bottom: 2px solid var(--marker-line); border-radius: 0; background: var(--marker-bg); max-width: 100%; }
.slot-input.num { width: 56px; text-align: right; } /* 時刻・月日など（11/18。56px） */
.slot-input.num.money { width: 8em; }
select.slot-input { min-height: 36px; min-width: 64px; padding: 0 10px; margin: 0 4px; }
input.slot-input:not(.num) { max-width: calc(100% - 4em); }
/* 欄と、その後ろの字（「時から」など）はひとまとまりで折り返す。月日の範囲の欄は、まとまりの間で折り返せる */
.slot-unit { white-space: nowrap; }
.slot-range { white-space: normal; }
.slot-value { background: var(--marker-bg); border-bottom: 2px solid var(--marker-line); font-weight: 700; color: var(--text); padding: 0 2px; }
/* 自動で入る欄：薄い水色・下線なし・太字にしない。押しても何も起きない（ボタン・リンクにしない） */
.slot-auto { background: var(--auto-bg); border: none; font-weight: normal; color: var(--auto-text); padding: 0 2px; cursor: default; }
/* 条を選ぶ前の案内（全体像の上）と、条ごとの画面の上の帯（11/17） */
.create-guide { background: var(--n-100); border-left: 3px solid var(--accent); border-radius: 4px; padding: 8px 12px; margin: 0 0 16px; }
.create-guide p { margin: 4px 0; }
.article-band { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 8px 0 0; padding: 6px 12px; background: var(--n-100); border-radius: 4px; font-size: 0.9rem; }
.article-band .band-position, .article-band .band-chosen { font-weight: 600; }
.article-band .band-note { color: var(--muted); font-size: 14px; }
.article-band .band-bar { display: flex; gap: 3px; width: 100%; height: 8px; }
.article-band .band-bar span { flex: 1; background: var(--n-90); }
.article-band .band-bar span.done { background: var(--accent); }
.article-band .band-bar span.current { background: var(--p-20); }
/* 〔リンクをコピーする〕（⑲。アイコン付きのボタン） */
.copy-button { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }
.copy-button svg { flex: none; }
.filled { display: block; margin-top: 6px; padding: 6px 8px; border-left: 3px solid var(--n-80); background: var(--n-100); font-size: 0.95rem; }
.filled-label { font-family: system-ui, sans-serif; color: var(--muted); font-size: 14px; }
/* 項の頭の定義の一文（選んだ選択肢の上。11/21） */
.filled.definition { margin: 4px 0 8px; }
/* 期間を変える欄（第7条の①。11/21） */
.period-input .period-heading { font-weight: 700; margin: 0; }
.period-input .muted { margin: 2px 0 6px; }
.filled .warn { display: inline; margin-left: 8px; font-family: system-ui, sans-serif; }
.block { display: block; font-family: system-ui, sans-serif; }

/* カレンダーの見本（引継ぎメモ4-10）。マスに字を入れ、色だけに頼らない。明るい色の上は濃い文字 */
.cal { margin: 4px 0 12px 28px; padding: 8px 0 0; border-top: 1px dashed var(--n-80); }
.cal-grid { display: grid; gap: 3px; font-size: 0.75rem; text-align: center; line-height: 1.3; }
.cal-grid.weeks { grid-template-columns: 3em repeat(7, minmax(0, 1fr)); }
.cal-grid.month { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { color: var(--muted); }
.cal-row { color: var(--muted); text-align: left; align-self: center; }
.cal-cell { border-radius: 3px; padding: 3px 0; font-weight: 700; font-size: 14px; } /* 「甲」「乙」は14px（11/22） */
.cal-cell.kou { background: var(--s-60); color: var(--p-20); }
.cal-cell.otsu { background: var(--n-100); color: var(--n-20); border: 1px solid var(--n-70); padding: 2px 0; }
.cal-day { position: relative; background: var(--n-96); color: var(--cal-text); border-radius: 3px; padding: 3px 0; min-height: 36px; }
.cal-day.visit { background: var(--visit-bg); color: var(--n-20); font-weight: 700; }
.cal-day small { display: block; font-size: 12px; font-weight: 400; line-height: 1.2; }
.cal-day small span { display: inline-block; white-space: nowrap; } /* 狭い幅では「10時〜」「17時」の2行にする */
.cal-who { display: block; font-size: 14px; font-weight: 700; } /* 親子交流を行う親の字（色だけに頼らない） */
.cal-stay { display: block; margin-top: 2px; background: var(--p-20); color: var(--n-100); font-size: 0.6rem; border-radius: 2px; }
.cal-title, .cal-note { margin: 4px 0; font-size: 14px; color: var(--muted); }

/* 作成前の確認（⑦）・健康の同意（⑥）・用語の説明（⑧） */
.precheck { background: var(--n-100); border-radius: 4px; box-shadow: var(--card-shadow); padding: 16px; }
.precheck .check { display: flex; align-items: center; gap: 8px; margin: 12px 0; cursor: pointer; }
.consent ul { margin: 0 0 6px; padding-left: 1.4em; }
.consent-heading { font-weight: 600; }
button.secondary { min-height: 44px; margin-top: 8px; background: var(--n-100); border: 1px solid var(--primary); border-radius: 4px; color: var(--primary); font-size: 14px; padding: 0 16px; }
/* 〔← 全体に戻る〕：副ボタンの形（白地にティールの枠と字、高さ44px、角丸4px。11/21 の指示3） */
button.secondary.back-button { margin: 0 0 8px; height: 44px; }
button.gloss { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin: 0 2px; padding: 0; border: 1px solid var(--primary); border-radius: 50%; background: var(--n-100); color: var(--p-20); font-size: 14px; vertical-align: 0.1em; }
.gloss-text { display: block; margin: 4px 0; padding: 6px 10px; background: var(--p-80); color: var(--p-20); border-radius: 4px; font-size: 14px; }

/* 完成前のプレビュー（⑬）：透かしを重ね、印刷では出さない */
.unfinished { position: relative; overflow: hidden; } /* 傾けた透かしで、スマートフォンの幅から横にはみ出さないように */
.unfinished::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--watermark); background-repeat: repeat; background-size: 320px 200px;
}
.unfinished-note .note-line { display: inline-block; }
.unfinished-note { color: #b3261e; font-weight: 700; border: 1px solid #b3261e; border-radius: 4px; padding: 6px 10px; text-align: center; }
@media print { .unfinished { display: none; } }

/* ---- 相手の画面（/partner。画面の文言の①②③）。docs/design に沿う ---- */
.card { background: var(--n-100); border-radius: 4px; box-shadow: var(--card-shadow); padding: 16px; margin: 16px 0; }
.author-message { border-left: 3px solid var(--accent); padding-left: 12px; }
.pager.two { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pager.two button.secondary { margin-top: 0; }
/* 保存の状態（指示5。11/18）：条の画面の帯の下の1行（高さを固める）、全体の画面の書面の名前の下、〔← 前の条〕〔次の条 →〕の上の文 */
/* 幅が狭くて〔もう一度保存する〕が入らないときだけ、ボタンを次の行に送る（文とボタンを切らない） */
.save-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 28px; margin: 4px 0 0; font-size: 14px; line-height: 28px; color: #4b5563; text-align: left; }
.save-status .save-ok { color: var(--teal-text); font-weight: 700; }
.save-status button.secondary.small { min-height: 28px; height: 28px; margin: 0; padding: 0 8px; font-size: 14px; }
.importance-legend { margin: 0 0 6px; font-size: 14px; color: #4b5563; }
.save-top { margin: 0 0 8px; font-size: 14px; color: #4b5563; }
.save-note { margin: 24px 0 12px; font-size: 14px; color: #4b5563; }
.save-note + .pager { margin-top: 0; }
.tile.partial { border: 2px dashed var(--accent); padding: 9px 11px; }
.article-band .band-bar span.partial { background: var(--s-95); }
.article-band .band-partial { font-weight: 600; color: var(--p-20); }
.check { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; cursor: pointer; }
.check + .check { margin-top: 16px; }
.check input { margin-top: 4px; }
fieldset.choices { border: none; padding: 0; margin: 12px 0; }
fieldset.choices legend { padding: 0; margin-bottom: 4px; }
fieldset.choices.sub { margin: 4px 0 8px 28px; padding-left: 12px; border-left: 2px solid var(--n-95); }
textarea.other-text { font: inherit; width: 100%; padding: 4px 8px; border: 1px solid var(--n-80); border-radius: 4px; margin-left: 0; }
.field { margin: 12px 0; }
.field label { display: block; font-weight: 600; }
.field input[type="tel"], .field input[inputmode="numeric"] { font: inherit; padding: 4px 8px; border: 1px solid var(--n-80); border-radius: 4px; width: 100%; max-width: 320px; }
.error { color: var(--error); }
.doc-text h3 { font-size: 1rem; margin: 16px 0 4px; }
.doc-text h3::after { display: none; }
/* 書面の全文（相手の確認・プレビュー・体験版）：書面の PDF と同じ形（doc-format.ts。11/21）。番号のない段落は1行目だけ1字下げ、項は番号の後ろに2行目をそろえる */
.doc-para { margin: 0; text-indent: 1em; }
.doc-item { display: flex; margin: 0; }
.doc-item-no { flex: none; white-space: pre; }
.doc-item-text { flex: 1; min-width: 0; }
.doc-closing { margin-top: 16px; }
.doc-party { display: grid; grid-template-columns: 2em 3em 1fr; margin: 8px 0 0; }
.doc-party dt { grid-row: span 2; }
.doc-party dd { display: contents; }
.doc-party dd > span:last-child { overflow-wrap: anywhere; }
/* 押印欄（住所・氏名の2行のすぐ下。書面の PDF の押印欄と同じく、枠の中に「甲の押印欄　押印前」。正本⑮・No.14） */
.doc-seal { display: flex; align-items: center; justify-content: center; margin: 6px 0 0 2em; max-width: 22em; min-height: 4.5em; padding: 4px 8px; border: 1px solid var(--n-80); text-align: center; color: var(--muted); }
.supplement { background: var(--n-96); border-radius: 4px; padding: 4px 12px; margin: 8px 0; font-size: 0.9rem; color: var(--muted); }
.reasons { margin: 8px 0; }
.sample-type { margin-right: 8px; color: var(--p-20); }
.sample-type[aria-current="page"] { font-weight: 700; }

/* ---- 確認ページ・紙の照合（/verify。画面の文言の⑱） ---- */
.number-input { font: inherit; letter-spacing: 0.05em; padding: 4px 8px; border: 1px solid var(--n-80); border-radius: 4px; width: 100%; max-width: 360px; }
.result { border-top: 1px solid var(--n-95); margin-top: 12px; padding-top: 8px; }
.result p { margin: 4px 0; }
/* PDFの表示：1ページ目の上端から、ページ全体が見える高さ（A4の縦横比＋表示の道具の帯。11/20 の指示5）。src には pdfViewSrc で #page=1&view=Fit を付ける */
iframe.original-pdf { display: block; width: 100%; height: auto; aspect-ratio: 210 / 320; max-height: 90vh; border: 1px solid var(--n-90); border-radius: 4px; background: var(--n-96); }

/* ログイン・メールアドレスの変更・原本の書面（⑰） */
button.link { background: none; border: none; padding: 0; font: inherit; color: var(--p-20); text-decoration: underline; cursor: pointer; }
.account-nav { display: flex; gap: 16px; margin: 12px 0; }
/* ㉚ お支払いの記録の行（日付・品目・金額。狭い幅では折り返す） */
.payment-line { display: flex; flex-wrap: wrap; gap: 0 1em; font-size: 1rem; }
/* 押印記録書の PDF を保存するリンク（ボタンの見た目） */
.pager a.button { display: inline-flex; align-items: center; min-height: 44px; background: var(--primary); border-radius: 4px; color: var(--n-100); font-size: 14px; padding: 0 16px; text-decoration: none; }
/* リンクの形の副ボタン（〔共同養育計画書を更新する〕など。白地＋枠線・高さ44px。11/20） */
.pager a.button.secondary { background: var(--n-100); border: 1px solid var(--primary); color: var(--primary); }
.pager a.button.secondary:active { background: var(--p-80); border-color: var(--primary-press); color: var(--primary-press); }

/* リンクの色：ブラウザ標準の青を使わず、アプリのティールの字にそろえる（利用規約・メールアドレスの変更・プライバシーポリシーなど。11/20夜2の指示12） */
:where(a[href]:not(.button)) { color: var(--teal-text); }
:where(a[href]:not(.button)):visited { color: var(--teal-text); }

/* ---- 全ページの上部（ログインしているときの〔ログアウト〕。右上。⑰ 11/21夜） ---- */
.site-header { display: flex; justify-content: flex-end; padding: 8px 16px 0; }
.site-header button.link { min-height: 36px; padding-block: 6px; margin-block: 0; }

/* ---- 全ページの下部のリンクと、特商法表記の表 ---- */
.site-footer { max-width: 720px; margin: 0 auto; padding: 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; border-top: 1px solid var(--n-90); }
.site-footer a { color: var(--muted); }
.legal-table { margin: 0; }
.legal-table > div { display: grid; grid-template-columns: 10em 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--n-90); }
.legal-table dt { font-weight: bold; }
.legal-table dd { margin: 0; }
@media (max-width: 480px) { .legal-table > div { grid-template-columns: 1fr; gap: 0; } }
/* ⑫ 原本10年保管の紙の照合ができる期間（標準1年／保管10年の棒の長さ） */
/* ④ 完成の画面の保存のボタン（2通のときは書面ごと。保存したボタンの横に「保存しました」） */
.save-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.save-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.save-list .saved { font-weight: 700; color: var(--n-20); }
.storage-bars { display: grid; gap: 4px; margin: 8px 0; }
.storage-bars .bar-row { display: flex; align-items: center; gap: 6px; }
.storage-bars .bar { display: block; height: 8px; border-radius: 4px; background: var(--p-47); }
.storage-bars .bar.short { flex: 0 0 10%; }
.storage-bars .bar.long { flex: 1 1 auto; }
.storage-bars .bar-label { flex: none; font-size: 0.8rem; color: var(--n-20); }
.price-lines { list-style: none; padding: 0; }

/* ---- 幅402pxでの並び・押しやすさ（11/18。docs/design/README.md の「入力欄」「幅による並び」） ---- */
/* 入力欄・選ぶ欄の字は 16px 以上（iPhone の Safari で、押したときに画面が拡大されないように）。文の中の黄色の欄も含む */
input, select, textarea { font-size: max(16px, 1em) !important; }
::placeholder { color: var(--placeholder); opacity: 1; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select { min-height: 44px; }
.trial .card input[type="text"] { height: 44px; }
/* チェック欄：四角は 20×20px。文字まで含めて押せる（label で囲む） */
input[type="checkbox"] { width: 20px; height: 20px; margin: 4px 0 0; flex: none; }
/* 注意の箇条書き（③・⑤・⑦・⑥など） */
.card > ul:not(.tiles) > li, .precheck > ul > li, .consent ul > li { line-height: 1.7; }
.card > ul:not(.tiles) > li + li, .precheck > ul > li + li, .consent ul > li + li { margin-top: 12px; }
/* 押せない状態の副ボタン */
button.secondary:disabled { background: var(--n-96); color: var(--disabled-text); border-color: var(--disabled-line); cursor: default; }
/* ボタンを左寄せで並べる（⑲の送った後・⑰の原本の書面）。間は 12px */
.pager.actions { justify-content: flex-start; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.pager.actions button.secondary { margin-top: 0; }
/* ⑲ 招待のリンク：長いアドレスも枠の中で折り返す */
.invite-link .invite-url { overflow-wrap: anywhere; word-break: break-all; font-size: 14px; color: var(--muted); }
.copy-button.primary { min-height: 44px; margin-top: 8px; background: var(--primary); border: 1px solid var(--primary); border-radius: 4px; color: var(--n-100); font-size: 14px; padding: 0 16px; }
/* ㉑ 〔確認コードを送る〕の下 24px に「届かないときは」。上下 8px の押せる余白 */
details.seal-help { margin-top: 24px; }
details.seal-help > summary { padding: 8px 0; cursor: pointer; }
@media (max-width: 639px) {
  .tiles { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 599px) {
  /* ラベルを上・入力欄を下に積む。ラベルの下 8px、入力欄は幅 100%・高さ 44px */
  .field { flex-direction: column; align-items: stretch; gap: 8px; }
  .field > label, .field > span { min-width: 0; }
  .field input:not([type="checkbox"]):not([type="radio"]), .field select, .number-input { width: 100%; max-width: none; }
  /* 原本の書面のボタンは縦に積んで幅 100%、間 10px */
  .pager.stack { flex-direction: column; align-items: stretch; gap: 10px; }
  .pager.stack > button, .pager.stack > a.button { width: 100%; justify-content: center; }
  /* 選択肢の枠は 14px 16px */
  .option { padding: 14px 16px; }
  .option.on { padding: 13px 15px; }
  /* カレンダーの左の字下げをやめ、マスの幅を広げる */
  .cal { margin-left: 0; }
}

/* ---- 押せる物の高さを 36px 以上にする（11/19夜。字の大きさは変えない） ---- */
/* 見た目の行の間を広げないよう、内側の余白で押せる範囲を広げ、同じだけの負の外側の余白で並びを元に戻す。
   文の中のリンク（inline）は、上下の余白が行の高さに効かないので、押せる範囲だけが広がる */
:is(main, .trial) a[href]:not(.button) { padding-block: 8px; margin-block: -8px; }
button.link { padding-block: 5px; margin-block: -5px; }
/* 当事者の情報の〔答える〕など、行に1つだけ置く文字のボタン：押せる高さを36px以上にする（11/20 の指示9） */
.consent button.link { min-height: 36px; padding-block: 6px; margin-block: -6px; }
details > summary { padding-block: 6px; margin-block: -6px; }
/* 画面の下のリンク3つ：行の高さ 36px にそろえ、間を詰める */
/* 2行に折り返したときの行の間は12px以上（11/20夜2の指示19） */
.site-footer { padding: 10px 16px; gap: 12px 16px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 36px; padding-block: 0; margin-block: 0; }
/* 〔選択を外す〕「〇〇とは」：見た目の枠はそのまま、透明な縁で押せる範囲を広げる（縁の内側に枠線を描く） */
.deselect { height: 36px; margin: 8px 4px -44px auto; border: 6px solid transparent; border-radius: 10px; background: var(--n-100) padding-box; box-shadow: inset 0 0 0 1px var(--n-70); padding: 0 8px; }
button.gloss { width: 36px; height: 36px; margin: -8px -6px; border: 8px solid transparent; background: var(--n-100) padding-box; box-shadow: inset 0 0 0 1px var(--primary); }
/* チェック欄・選ぶ欄：文字まで含めた押せる範囲を上下に広げ、外側の余白を同じだけ減らす */
:where(label:has(> input:is([type="checkbox"], [type="radio"])):not(.option, .chip)) { padding-block: 7px; margin-block: -7px; }
.check { padding-block: 6px; margin: 2px 0; }
.check + .check { margin-top: 10px; }
.precheck .check { margin: 6px 0; }
.consent label { padding-block: 6px; margin: 2px 0; }
.consent label:not(:last-child) { margin-bottom: 10px; }
.chip { min-height: 36px; }
/* 文の中の小さな欄（時刻・月日・金額）は、幅の狭い画面でも横いっぱいに伸ばさない（「〇月〇日」をひとかたまりにする。11/20夜2の指示15） */
.field .slot input.slot-input.num { width: 56px; max-width: 56px; }
.field .slot input.slot-input.num.money { width: 8em; max-width: 8em; }
.slot-date { display: inline-block; white-space: nowrap; margin-right: 4px; }
/* ⑤⑫ お申し込みの最終確認：見出しごとに線と余白で区切る（文は変えない。11/20夜2の指示16） */
.purchase-confirm :is(.consent-heading, h3, .consent) { border-top: 1px solid var(--n-90); padding-top: 16px; margin-top: 20px; }
.purchase-confirm .labeled-line { margin: 8px 0; }

/* ---- iPhone の Safari（11/21夜の指示1・2・7-2） ---- */
/* 文字の大きさを端末に勝手に変えさせない。入力欄の字は 16px 以上（max() を読めない端末でも 16px） */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input, select, textarea { font-size: 16px; font-size: max(16px, 1em) !important; }
/* 横にはみ出す物があると、Safari は画面全体を縮めて表示し、入力欄を押したときに拡大する。
   長い選択肢のプルダウン（「【　時／登校（登園）時】」など）は欄の幅を画面に収め、欄を含むまとまりは必要なら折り返す */
select.slot-input { max-width: 100%; text-overflow: ellipsis; }
.slot:has(select), .slot-unit:has(select) { white-space: normal; }
/* 選んでいない選択肢の長い【　】の字（「【　時／登校（登園）時】」など）も、【　】の中では折り返せるようにする（後ろの字とは離さない） */
.slot-unit .slot-value, .slot-unit .slot-auto { white-space: normal; }
.option > span, .field > span, .field > label { min-width: 0; overflow-wrap: anywhere; }
.cal, .cal-grid { max-width: 100%; }
/* 月・日の欄は数字2けたが入る幅（期間を変える欄・文の中の欄とも） */
.slot-date input.slot-input.num, .field .slot.slot-date input.slot-input.num { width: 3em; max-width: 3em; padding-inline: 4px; text-align: center; }
/* 文の中の【　】の入力欄・日付の欄：見た目の大きさは変えず、押せる高さを 36px 以上にする（No.38）。
   上に透明の枠（背景は枠の内側だけに塗る）を足して押せる範囲を上に広げ、同じだけ上の余白を負にして行の高さも変えない。
   欄の行（.field の中）は、もとから高さ 44px 以上なので変えない */
input.slot-input:not(.field input) { border-top: 8px solid transparent; margin-top: -8px; background-clip: padding-box; }
/* キーボードを出している間（指で操作する端末で入力欄を使っている間）は、下に固定の甲・乙の帯を隠す（㉓） */
@media (pointer: coarse) {
  body:has(:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus) .party-memo { display: none; }
}
/* 用語の説明の「？」：見た目は直径20pxの丸のまま、押せる範囲を四角の 40px にする（丸の角も押せる） */
button.gloss { position: relative; }
button.gloss::after { content: ""; position: absolute; inset: -10px; }
.field-example { margin: 4px 0 0; }

/* 体験版（No.132）だけの見た目。ほかは globals.css（作成画面と同じ。docs/design） */
.trial { max-width: 880px; margin: 0 auto; padding: 16px 16px 32px; }
.trial h1 { font-size: 20px; line-height: 1.5; }
.trial h2 { font-size: 16px; }
.trial-banner { background: var(--p-80); color: var(--p-20); border-radius: 4px; padding: 8px 12px; font-size: 0.9rem; font-weight: 600; margin: 0 0 16px; }
.trial .card { background: var(--n-100); border-radius: 4px; box-shadow: var(--card-shadow); padding: 12px 16px; margin: 16px 0; }
.trial .card input[type="text"] { display: block; width: 100%; max-width: 360px; height: 40px; margin-top: 4px; padding: 6px 10px; font: inherit; border: 1px solid var(--n-70); border-radius: 4px; }
.trial .tile.closed { cursor: default; background: var(--n-100); border: 1px dashed var(--n-70); color: var(--muted); }
.trial .tile .badge { display: inline-block; border: 1px solid var(--n-70); border-radius: 4px; padding: 0 6px; }
/* 「体験版で選べます」の札：ティールの地に白い字（選べる条を見つけやすく。11/20夜2の指示18） */
.trial .tile .badge.top { background: #3f7f87; border-color: #3f7f87; color: #fff; font-weight: 700; }
.trial-preview h3, .trial-preview h4 { margin: 12px 0 4px; }
.trial-preview h3::after, .trial-preview h4::after { display: none; }
.trial-preview p { margin: 4px 0; font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; }
.trial a.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 4px; background: var(--primary); color: var(--n-100); font-size: 14px; text-decoration: none; }
/* 印刷はできない（画面の閲覧だけ） */
@media print { body * { display: none !important; } }
/* 最初の案内（書面の作成者は利用者ご自身・すべてを選ぶ必要はない） */
.trial .card.intro { border-left: 4px solid var(--p-47); }
.trial .card.intro p { margin: 4px 0; }
/* 開ける条の中の、選べない項・今の選択では使わない項 */
.trial .closed-item { border: 1px dashed var(--n-70); background: var(--n-100); }
.trial .closed-item.unused { color: var(--muted); }
.trial .closed-item .tile-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.trial .closed-item .badge { display: inline-block; border: 1px solid var(--n-70); border-radius: 4px; padding: 0 6px; }
/* 甲・乙の帯（画面の下に固定）が一番下のボタンに重ならないよう、本文の下に帯の高さ分の余白をとる（画面の高さが低いときも。11/20夜2の指示13） */
.trial .with-party-memo { padding-bottom: 80px; }
.trial:has(.party-memo) { padding-bottom: 80px; }
/* 販促のページの iframe に、中身と同じ高さで入っているとき（lib/trial-embed.ts。11/21夜の指示34）：
   枠の下端は画面の下とは限らないので、親のページから知らせてもらった「見えている所の下」に甲・乙の帯を置く */
html.shiori-embedded .party-memo { bottom: calc(16px + var(--shiori-hidden-below, 0px)); }
@media (max-width: 599px) {
  html.shiori-embedded .party-memo { bottom: var(--shiori-hidden-below, 0px); }
}
/* プレビューの上の、入力していない欄の数（11/21 の指示7） */
.warn-note { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--error); background: var(--n-100); }
