:root {
  /* 医院のメインカラー（オレンジ）。白地の文字に使うオレンジは読みやすい濃さにする */
  --bg: #fff7ef; --card: #ffffff; --text: #1a1a1a; --muted: #555; --line: #f0d9c2;
  --orange: #f39800; --orange-text: #1a1a1a; --accent: #b85300; --tint: #fff1e0;
  --ok: #b85300; --ng: #9a9a9a; --err: #b3261e; --notice: #fff1e0;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.7 "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN W4", -apple-system, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif; }
.bar { display: block; background: #fff; border-bottom: 4px solid var(--orange); padding: 12px 0 6px; }
.bar .in { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.bar .brand { display: block; }
.bar .brand img { display: block; width: 100%; height: auto; }
.bar .sub { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.bar .sub span { font-size: 15px; font-weight: bold; color: var(--accent); letter-spacing: .3em; }
.bar .logout { margin: 0; }
.bar .link { background: none; border: 0; color: var(--accent); text-decoration: underline; font-size: 15px; padding: 0; cursor: pointer; width: auto; }
main { max-width: 560px; margin: 0 auto; padding: 16px; background: var(--card); min-height: 60vh; }
footer { max-width: 560px; margin: 0 auto; padding: 16px; text-align: center; color: var(--muted); font-size: 15px; }
h1 { font-size: 21px; margin: 8px 0 16px; padding-left: 10px; border-left: 5px solid var(--orange); }
a { color: var(--accent); }
.tel { font-size: 20px; font-weight: bold; }
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: bold; }
label small, .small { font-weight: normal; font-size: 14px; color: var(--muted); }
input, textarea, select { font-size: 18px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; width: 100%; font-weight: normal; background: #fff; color: var(--text); font-family: inherit; }
/* チェック欄は文字の左横に大きく並べ、枠で囲んで押せる範囲を分かりやすくする（修正要望 No.16） */
label.check { flex-direction: row; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
label.check input { width: 1.5em; height: 1.5em; margin: 0; flex: none; accent-color: var(--orange); }
fieldset.bd { border: 0; padding: 0; margin: 0; font-weight: bold; }
fieldset.bd legend { padding: 0; margin-bottom: 4px; }
/* 生年月日は「西暦 [    ] 年 [  ] 月 [  ] 日」を1行に並べる（狭い画面でも折り返さない） */
fieldset.bd .bd-row { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; font-weight: normal; white-space: nowrap; }
fieldset.bd label { display: flex; flex-direction: row; align-items: center; gap: 4px; font-weight: normal; }
fieldset.bd input { width: 2.8em; text-align: center; padding: 10px 2px; }
fieldset.bd .bd-y input { width: 4em; }
button, .button { display: block; text-align: center; font-size: 18px; padding: 12px; border-radius: 8px; border: 2px solid var(--orange); background: #fff; color: var(--text); text-decoration: none; cursor: pointer; width: 100%; font-family: inherit; }
.primary { background: var(--orange); color: var(--orange-text); font-weight: bold; }
.links { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.menu { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.error { color: var(--err); font-weight: bold; }
.info { background: var(--tint); padding: 10px; border-radius: 6px; }
.notice { background: var(--notice); border-left: 4px solid var(--orange); padding: 10px 12px; border-radius: 6px; margin: 16px 0; }
.notice p { margin: 4px 0; }
dl.fixed { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; }
dl.fixed dt { color: var(--muted, #555); }
dl.fixed dd { margin: 0; font-weight: bold; }
dl.fixed .done { white-space: nowrap; font-weight: normal; }
.checks .nw { white-space: nowrap; }
.notice .title { font-weight: bold; }
.pre { white-space: pre-wrap; }
.hello { font-size: 19px; }
.crumb { color: var(--muted); font-size: 15px; margin: 0 0 4px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { flex-direction: row; align-items: center; gap: 10px; font-weight: normal; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.choice input[type=radio], .choice input[type=checkbox] { width: 22px; height: 22px; }
.days, .slots, .appts { list-style: none; padding: 0; margin: 0; }
.days li, .slots li, .appts li { border-bottom: 1px solid var(--line); }
.days li > *, .slots li > a, .slots li > span:first-child { padding: 12px 4px; }
.days a, .slots a { display: flex; justify-content: space-between; text-decoration: none; color: var(--text); }
.days li, .slots li { display: flex; justify-content: space-between; align-items: center; }
.days li > a, .slots li > a { width: 100%; }
.days .w0 .d { color: #c0392b; } .days .w6 .d { color: #2c5aa0; }
.st.ok { color: var(--ok); font-weight: bold; } .st.ng, .st.off { color: var(--ng); }
.st.tel { color: var(--ng); font-size: inherit; font-weight: normal; } /* 「空きなし」と同じ見た目（灰色＝ネットでは予約できない。押すと説明ページ。事務長 11/10） */
.slots .t { font-size: 19px; font-weight: bold; }
.appts li { padding: 12px 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.daynav { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin: 8px 0; font-size: 15px; white-space: nowrap; }
.daynav a, .daynav span { padding: 6px 2px; }
.daynav .off { visibility: hidden; }
.summary { display: grid; grid-template-columns: 5em 1fr; gap: 6px 10px; background: var(--tint); padding: 12px; border-radius: 6px; }
.summary dt { color: var(--muted); } .summary dd { margin: 0; font-weight: bold; }
.summary .code { font-size: 26px; letter-spacing: 2px; }
.mine { background: var(--tint); border: 2px solid var(--orange); border-radius: 8px; padding: 8px 12px; margin: 12px 0 16px; }
.mine h2 { font-size: 18px; margin: 4px 0 6px; }
.mine .appts .d, .mine .appts .t { font-size: 18px; font-weight: bold; }
.button.small, button.small { display: inline-block; width: auto; font-size: 15px; padding: 6px 14px; margin-left: auto; }
button.again { line-height: 1.5; flex: none; }
.slots a.wait { color: var(--text); }
.slots .cw { margin-left: auto; font-size: 14px; border: 1px solid var(--orange); border-radius: 6px; padding: 2px 8px; color: var(--accent); }
form.inline { display: inline; margin-left: auto; }
fieldset.choice { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
fieldset.choice label.radio { display: flex; flex-direction: row; gap: 8px; align-items: flex-start; font-weight: normal; margin: 8px 0; }
/* 予約の変更の最終確認: 上に今の予約（赤系）、矢印、下に新しい予約（青系） */
.change { display: flex; flex-direction: column; align-items: center; margin: 8px 0 16px; }
.change .box { width: 100%; text-align: center; border-radius: 10px; padding: 12px 10px; border: 2px solid; }
.change .box p { margin: 2px 0; }
.change .from { background: #fbe4d8; border-color: #e8a487; }
.change .to { background: #dce6f5; border-color: #8fa9d6; }
.change .label { font-weight: bold; text-decoration: underline; text-underline-offset: 4px; }
.change .when { font-size: 22px; font-weight: bold; }
.change .from .when { color: #8a2b0e; }
.reason { font-size: 16px; color: var(--text); }
.reason strong { color: #8a2b0e; font-weight: bold; }
.change .to .when { color: #1d3f7a; }
.change .detail { font-size: 15px; }
.change .note { font-size: 14px; color: var(--muted); }
.change .arrow { width: 0; height: 0; margin: 10px 0; border-left: 22px solid transparent; border-right: 22px solid transparent; border-top: 26px solid #8a8a8a; }
.ask { font-size: 19px; font-weight: bold; text-align: center; margin: 8px 0 0; }
.pair { display: flex; gap: 12px; }
.pair > * { flex: 1; }
details.memo summary { cursor: pointer; color: var(--accent); }
details.memo label { margin-top: 8px; }
.center { text-align: center; }

/* キャンセル待ちの時間をまとめて選ぶ */
fieldset.times { border: 1px solid #ddd; border-radius: 8px; padding: 8px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 12px; }
fieldset.times legend { padding: 0 4px; font-weight: bold; }
fieldset.times label { display: flex; align-items: center; gap: 6px; padding: 6px 0; font-size: 1.05em; }
fieldset.times label.disabled { color: #888; }
fieldset.times input { width: 1.3em; height: 1.3em; }

/* 時間の選択画面: 満員の時間にその場でキャンセル待ちのチェック（旧WEB版と同じ。事務長 10/28） */
.slots label.cw { flex-direction: row; align-items: center; gap: 6px; margin-left: 12px; font-weight: normal; font-size: 15px; border: 1px solid var(--orange); border-radius: 6px; padding: 4px 10px; color: var(--accent); white-space: nowrap; }
.slots label.cw input { width: 1.3em; height: 1.3em; margin: 0; }
.slots label.cw.done { color: var(--muted); border-color: var(--line); }
.slots li > .st { margin-left: auto; }
.slots + .small { margin-top: 12px; }
/* キャンセル待ちの確認・一覧 */
.ask.left { text-align: left; }
.summary.wide { display: block; }
.summary.wide .when { font-weight: bold; font-size: 19px; margin: 0 0 4px; }
.summary .times { margin: 0; padding-left: 1.2em; font-size: 19px; font-weight: bold; }
.caution { color: var(--text); font-size: 15px; }
.caution p { margin: 0 0 12px; }
.caution strong { color: var(--accent); font-weight: bold; }
.caution a { white-space: nowrap; }
.waitline { font-size: 18px; font-weight: bold; margin: 12px 0 4px; } /* ご予約の日時と同じ大きさ・太字（No.43） */
.waitline a { margin-left: 6px; font-weight: bold; }
.waitline br + a { margin-left: 0; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { border-bottom: 1px solid var(--line); }
.checks label { flex-direction: row; align-items: flex-start; gap: 10px; padding: 12px 4px; font-weight: normal; }
.checks label input { width: 1.4em; height: 1.4em; margin-top: 4px; flex: none; }
.checks .d, .checks .t { font-weight: bold; font-size: 18px; }
/* キャンセル待ち一覧: いま空いている時間はその場で予約できる（修正要望 No.18） */
.checks li { display: flex; align-items: center; gap: 8px; }
.checks li label { flex: 1; }
.checks .open { color: var(--accent); font-weight: bold; font-size: 15px; }
.nowrap { white-space: nowrap; }
figure.card { margin: 4px 0 8px; max-width: 343px; }
figure.card img { display: block; width: 100%; height: auto; }
figure.card figcaption { font-size: 14px; color: var(--muted); margin-top: 4px; }
ul.nonet { margin: 0 0 4px; padding-left: 1.4em; }
.about h2 { font-size: 17px; margin: 22px 0 6px; padding-bottom: 2px; border-bottom: 2px solid var(--line); }
.about ul { margin: 0; padding-left: 1.2em; }
.about li { margin: 0 0 6px; }
.about ol { margin: 4px 0 0; padding-left: 1.4em; }
.about ol li { margin: 0 0 4px; }
/* メールの設定（S60 を2つに分けた形, 11/6） */
.mailset h2 { font-size: 18px; margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.mailset h2::before { content: ""; display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: var(--orange); margin-right: 8px; }
.current { background: var(--tint); border-radius: 6px; padding: 10px 12px; margin: 12px 0; }
.current span { display: block; font-size: 14px; color: var(--muted); }
.current strong { display: block; word-break: break-all; min-height: 1.6em; }
label.pick { flex-direction: row; align-items: center; gap: 8px; font-weight: normal; }
label.pick span { white-space: nowrap; }
label.pick span::before { content: "▶"; color: var(--orange); font-size: .8em; margin-right: 4px; }
label.pick select { width: auto; flex: 1; min-width: 0; }
label.pick[hidden] { display: none; }
/* トップ画面の「そのほかのご案内」（事務長 11/6） */
section.links { margin-top: 28px; }
section.links h2 { font-size: 17px; margin: 0; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
section.links ul { list-style: none; margin: 0; padding: 0; }
section.links li { border-bottom: 1px solid #ddd; }
section.links a { display: flex; align-items: center; gap: 14px; padding: 16px 4px; color: var(--text); text-decoration: none; }
section.links .ic { width: 48px; height: 48px; flex: none; }
section.links .tx { flex: 1; min-width: 0; }
section.links .tx strong { display: block; font-size: 18px; margin-bottom: 2px; }
section.links .tx span { display: block; font-size: 14px; color: var(--muted); line-height: 1.6; }
section.links .go { color: var(--accent); font-size: 18px; flex: none; }

.mask{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:1.1em;letter-spacing:.02em}
.appts li .note{display:block;font-size:.9em;color:#7a3b00;margin-top:.2em}
/* 入力エラーの文: 文字の色は今のまま、薄い赤の枠と左の太い線、頭に「！」（色が分かりにくい方にも形で伝える。事務長 11/10） */
p.error, div.error { background: #fdecea; border: 1px solid #f1b5ae; border-left: 6px solid var(--err); border-radius: 6px; padding: 10px 12px; }
p.error::before { content: "！"; margin-right: 2px; }
