/* 患者さんの予約画面（LINEミニアプリ）。打ち合わせ資料の画面①〜⑨の見た目に合わせる */
:root {
  --green: #1E6B4A;
  --green-dark: #165238;
  --green-soft: #E6F0EA;
  --bg: #F4F6F3;
  --card: #FFFFFF;
  --text: #1D2B24;
  --muted: #55625B;
  --line: #D9E0DC;
  --border: #B9C4BE;
  --gray: #ECEFED;
  --gray-text: #5F6964;
  --danger: #B3261E;
  --danger-soft: #FCE8E6;
  --warn-bg: #FFF4D6;
  --warn-text: #6B4A00;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'BIZ UDPGothic', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Noto Sans CJK JP', 'Yu Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--green); }
button { font-family: inherit; }
:focus-visible { outline: 3px solid #F2B705; outline-offset: 2px; }
[data-focus]:focus, [data-focus]:focus-visible { outline: none; }
h1, h2, h3 { margin: 0; line-height: 1.35; }
[hidden] { display: none !important; }

.boot { min-height: 70vh; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 16px; }
.screen { min-height: 100vh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; background: var(--bg); }

/* 上 */
.head {
  position: sticky; top: 0; z-index: 5;
  height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 8px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.head h1 { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--text); cursor: pointer; flex: none; border-radius: 10px; }
.back svg { width: 24px; height: 24px; }
.back.hidden { visibility: hidden; }

.steps { list-style: none; margin: 0; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.steps .dot { width: 26px; height: 26px; border-radius: 999px; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.steps li.done { color: var(--green); }
.steps li.done .dot { border-color: var(--green); }
.steps li.now { color: var(--green); font-weight: 700; }
.steps li.now .dot { background: var(--green); border-color: var(--green); color: #fff; }

main.body { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.title { font-size: 20px; font-weight: 700; }
.lead { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.card { background: var(--card); border-radius: 12px; padding: 14px; }
.card.line { border: 1px solid var(--line); }

/* 下（次へ） */
.foot {
  position: sticky; bottom: 0; z-index: 5;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.foot .sel { display: flex; flex-direction: column; min-width: 0; }
.foot .sel small { font-size: 12px; color: var(--muted); }
.foot .sel strong { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn {
  min-height: 52px; padding: 0 28px; border-radius: 999px; border: 0;
  background: var(--green); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; flex: none;
}
.btn:hover { background: var(--green-dark); }
.btn[disabled], .btn.off { background: #D3DAD6; color: #4E5853; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--card); color: var(--green); border: 1.5px solid var(--green); }
.btn.danger { background: var(--danger); }
.btn.small { min-height: 44px; padding: 0 18px; font-size: 15px; }
.linkbtn { background: none; border: 0; color: var(--green); font-size: 15px; font-weight: 700; padding: 10px 8px; min-height: 44px; cursor: pointer; text-decoration: underline; white-space: nowrap; flex: none; }
.warn { background: var(--warn-bg); color: var(--warn-text); border-radius: 12px; padding: 12px 14px; font-size: 15px; }

/* お知らせ */
.notice { background: var(--warn-bg); color: var(--warn-text); border-radius: 12px; padding: 12px 14px; font-size: 15px; white-space: pre-wrap; }
.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #F3C1BC; border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 700; }
.ok { background: var(--green-soft); color: var(--green-dark); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.friend { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--card); border: 1.5px solid #06C755; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.friend .btn { background: #06C755; min-height: 40px; padding: 0 14px; font-size: 14px; }

/* メニュー */
.menus { display: flex; flex-direction: column; gap: 10px; }
.menu {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 72px; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); cursor: pointer;
}
.menu:hover, .menu:focus-visible { border-color: var(--green); }
.menu .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.menu strong { font-size: 17px; }
.menu small { font-size: 13px; color: var(--muted); line-height: 1.5; }
.menu small.when, p.when { color: #8A5300; }
p.when { font-size: 14px; margin: 0 0 8px; }
.menu .chev { color: var(--muted); flex: none; }
.next-res { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--card); border: 1.5px solid var(--green); border-radius: 12px; padding: 12px 14px; }
.next-res span { font-size: 14px; }

/* 日時 */
.chosen-menu { min-height: 48px; background: var(--card); border-radius: 12px; padding: 0 8px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; }
.chosen-menu span { color: var(--muted); }
.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chip {
  min-height: 48px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--card); color: var(--text);
  font-size: 16px; font-weight: 700; cursor: pointer; padding: 6px 10px;
}
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.month { font-size: 15px; font-weight: 700; margin-bottom: -6px; }
.dates { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.date {
  height: 64px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 0;
}
.date span { font-size: 12px; color: var(--muted); }
.date strong { font-size: 18px; }
.date.sun span, .date.hol span { color: #B3261E; }
.date.sat span { color: #2457A6; }
.date[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.date[aria-pressed="true"] span { color: #fff; }
.date.closed, .date.full { background: var(--gray); border-color: var(--gray); color: var(--gray-text); cursor: default; }
.date.closed strong, .date.full strong { font-size: 14px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.legend i.o { border: 1.5px solid var(--green); background: #fff; }
.legend i.x { background: var(--gray); }
.sess h3 { font-size: 16px; margin-bottom: 8px; }
.sess h3 small { font-size: 14px; color: var(--green); margin-left: 6px; }
.times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.time {
  height: 44px; border-radius: 10px; border: 1.5px solid var(--green); background: var(--card); color: var(--text);
  font-size: 16px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; padding: 0;
}
.time[aria-pressed="true"] { background: var(--green); color: #fff; }
.time:disabled { border: 0; background: var(--gray); color: var(--gray-text); font-weight: 400; font-size: 15px; cursor: default; }
.none { margin: 0; padding: 14px; border-radius: 10px; background: var(--gray); font-size: 14px; color: #3E4A44; line-height: 1.6; }

/* 入力 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.req { font-size: 12px; color: #fff; background: var(--danger); border-radius: 4px; padding: 0 6px; font-weight: 700; }
.opt { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 6px; font-weight: 400; }
.field .hint { font-size: 13px; color: var(--muted); }
.field .err { font-size: 14px; color: var(--danger); font-weight: 700; }
input[type=text], input[type=tel], input[type=number], select, textarea {
  width: 100%; min-height: 52px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: #fff;
  font: inherit; font-size: 17px; color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(30, 107, 74, .2); }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--danger); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff; color: var(--text);
  font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.tag[aria-pressed="true"], .tag.on { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); font-weight: 700; }
.tag[aria-pressed="true"]::before, .tag.on::before { content: '✓'; }
.ymd { display: grid; grid-template-columns: 2.2fr 1fr 1fr; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--border); cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--green); flex: none; margin-top: 2px; }
.check.on { border-color: var(--green); background: var(--green-soft); }
.qsec { display: flex; flex-direction: column; gap: 16px; }

/* 確認 */
.dl { margin: 0; display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 10px 12px; background: var(--card); border-radius: 12px; padding: 16px; }
.dl dt { color: var(--muted); font-size: 14px; }
.dl dd { margin: 0; font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.rule { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 0; }
.rule strong { color: var(--text); }

/* 完了・マイページ */
.complete { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 24px 8px 8px; }
.complete .mark { width: 72px; height: 72px; border-radius: 999px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.complete .mark svg { width: 40px; height: 40px; }
.complete h2 { font-size: 22px; }
.complete .when { font-size: 20px; font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.list li { display: flex; gap: 8px; align-items: flex-start; }
.list li::before { content: '・'; color: var(--green); font-weight: 700; }
.resv { background: var(--card); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; border: 1.5px solid var(--line); }
.resv .when { font-size: 20px; font-weight: 700; }
.resv .what { color: var(--muted); font-size: 15px; }
.resv .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ask { border: 1.5px solid var(--danger); border-radius: 12px; padding: 14px; background: var(--danger-soft); display: flex; flex-direction: column; gap: 10px; }
.history { background: var(--card); border-radius: 12px; padding: 12px 16px; }
.history li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.history li:last-child { border-bottom: 0; }
.history ul { list-style: none; margin: 0; padding: 0; }
.tel { font-weight: 700; font-size: 18px; }
.fine { font-size: 13px; color: var(--muted); }
.center { text-align: center; }
.spin { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
@media (max-width: 360px) {
  .times { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .date strong { font-size: 16px; }
  .btn { padding: 0 20px; }
}
