/* 利用者の画面の見た目(仕様書 B2・B8)。試作 app/mock/yoyaku.html の見た目をそのまま移した。
   色は変数にまとめてある(ブランドの色は未定。試作の緑のまま)。
   試作から変えた所: 押す所の高さを 48px 以上に(タブ 44px・近い空き 40px → 48px)、説明の文は 16px に。
   足した所: 入力欄・案内の帯・アカウントの欄・読み込み中/通信失敗の表示。 */
:root {
  --bg: #f6f5f2; --card: #ffffff; --ink: #1d1d1f; --sub: #6b6b70; --line: #e4e2dc;
  --accent: #1f6f5c; --accent-ink: #ffffff; --accent-soft: #e3f1ec;
  --warn: #b4441f; --warn-soft: #fbe9e2; --sat: #2a5db0; --sun: #c0392b;
  --radius: 14px; --tap: 48px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414; --card: #1f1f21; --ink: #f2f2f2; --sub: #a2a2a8; --line: #333336;
    --accent: #4fb89c; --accent-ink: #0d1f1a; --accent-soft: #1d3530;
    --warn: #ff8a65; --warn-soft: #3a2420; --sat: #7fa7f0; --sun: #f08074;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif; -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
.wrap { max-width: 520px; margin: 0 auto; padding: 0 16px 140px; }
header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 18px 0 10px; }
header h1 { font-size: 20px; margin: 0; letter-spacing: .02em; white-space: nowrap; }
header .who { color: var(--sub); font-size: 14px; overflow-wrap: anywhere; text-align: right; }

/* 月と残り枠 */
.months { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.month { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-align: left; cursor: pointer; min-height: var(--tap); }
.month[aria-pressed="true"] { border-color: var(--accent); }
.month .m { font-weight: 700; }
.month .left { font-size: 26px; font-weight: 800; line-height: 1.2; }
.month .left small { font-size: 14px; font-weight: 600; color: var(--sub); }
.bar { height: 6px; background: var(--line); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.month .state { font-size: 14px; color: var(--sub); }
.month.info { grid-column: 1 / -1; cursor: default; }
.month.info .state { font-size: 16px; color: var(--ink); }

section { margin-top: 22px; }
section > h2 { font-size: 15px; margin: 0 0 8px; color: var(--sub); font-weight: 700; }

/* いつもの時間 */
.usual { display: flex; gap: 8px; flex-wrap: wrap; }
.usual button { min-height: var(--tap); padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--accent); background: var(--card); color: var(--accent); font-weight: 700; cursor: pointer; }
.usual button:disabled { opacity: .4; cursor: not-allowed; }
.usual .hint { flex-basis: 100%; font-size: 16px; color: var(--sub); }

/* 日付の帯 */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.day { flex: 0 0 64px; min-height: 80px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); text-align: center; padding: 6px 0; cursor: pointer; scroll-snap-align: start; position: relative; }
.day .dw { font-size: 13px; color: var(--sub); }
.day .dd { font-size: 20px; font-weight: 800; line-height: 1.3; }
.day .cnt { font-size: 13px; color: var(--sub); }
.day.sat .dw, .day.sat .dd { color: var(--sat); }
.day.sun .dw, .day.sun .dd { color: var(--sun); }
.day.full { opacity: .45; }
.day[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.day .badge { position: absolute; top: -6px; right: -4px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; border-radius: 999px; min-width: 20px; height: 20px; line-height: 20px; padding: 0 5px; }

/* 時刻 */
.daytitle { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0 8px; margin: 14px 0 6px; }
.daytitle b { font-size: 18px; }
.daytitle span { font-size: 13px; color: var(--sub); }
.band { margin-top: 10px; }
.band h3 { font-size: 13px; color: var(--sub); margin: 0 0 6px; font-weight: 700; }
.times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.time { min-height: var(--tap); border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700; font-variant-numeric: tabular-nums; }
.time small { display: block; font-size: 11px; font-weight: 500; color: var(--sub); line-height: 1.2; }
.time[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.time[aria-pressed="true"] small { color: var(--accent-ink); }
.time:disabled { opacity: .35; cursor: not-allowed; }
.empty { background: var(--card); border-radius: var(--radius); padding: 16px; color: var(--sub); text-align: center; }
.empty .ghost { margin-top: 10px; }

/* 下のバー */
.tray { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.tray .in { max-width: 520px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.tray .sum { flex: 1; font-size: 14px; line-height: 1.4; min-width: 0; }
.tray .sum b { font-size: 17px; }
.primary { min-height: 52px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 16px; cursor: pointer; }
.primary:disabled { opacity: .4; cursor: not-allowed; }
.ghost { min-height: var(--tap); padding: 0 14px; white-space: nowrap; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700; }
.ghost:disabled { opacity: .4; cursor: not-allowed; }
a.ghost, a.primary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
a.primary { color: var(--accent-ink); }
.danger { min-height: 52px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--warn); color: #fff; font-weight: 800; cursor: pointer; }
.danger:disabled { opacity: .5; cursor: not-allowed; }

/* タブ */
.tabs { display: flex; gap: 6px; margin-top: 4px; }
.tabs button { flex: 1; min-height: var(--tap); border: 0; border-bottom: 3px solid transparent; background: none; font-weight: 700; color: var(--sub); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }

/* 一覧 */
.list { display: grid; gap: 10px; }
.item { background: var(--card); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.item .when { font-weight: 800; font-size: 17px; }
.item .dl { font-size: 16px; color: var(--sub); grid-column: 1; }
.item .dl.soon { color: var(--warn); font-weight: 700; }
.item .act { grid-row: 1 / span 2; grid-column: 2; }
.monthhead { font-size: 14px; color: var(--sub); font-weight: 700; margin: 18px 0 4px; }
.listfoot { margin-top: 18px; }
.listfoot .ghost { width: 100%; }

/* シート */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet-bg.open { display: flex; }
.sheet { background: var(--card); width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 20px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; }
.sheet h2 { margin: 0 0 12px; font-size: 19px; }
.rows { display: grid; gap: 8px; margin-bottom: 14px; }
.row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; }
.row .w { font-weight: 800; }
.row .s { font-size: 16px; color: var(--sub); grid-column: 1; }
.row .s.warn { color: var(--warn); font-weight: 700; }
.row .r { grid-row: 1 / span 2; grid-column: 2; font-size: 14px; white-space: nowrap; }
.row.ok .r { color: var(--accent); font-weight: 800; }
.row.ng { border-color: var(--warn); background: var(--warn-soft); }
.row.ng .r { color: var(--warn); font-weight: 800; }
.row.pend .r { color: var(--sub); font-weight: 800; }
.alts { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.alts button { min-height: var(--tap); padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--accent); background: var(--card); color: var(--accent); font-weight: 700; cursor: pointer; }
.alts button:disabled { opacity: .4; cursor: not-allowed; }
.change { display: flex; justify-content: space-between; background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; font-weight: 700; margin-bottom: 14px; }
.btns { display: flex; gap: 10px; }
.btns > * { flex: 1; }
.btns > .primary, .btns > .danger { flex: 2; white-space: nowrap; }
.change + .change { margin-top: -6px; }
.note { font-size: 16px; color: var(--sub); margin: 0 0 14px; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: s 0.8s linear infinite; vertical-align: -3px; }
@keyframes s { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 16px; z-index: 20; max-width: calc(100% - 32px); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 案内の帯(受付の停止・通信の失敗など) */
.banner { background: var(--warn-soft); color: var(--ink); border: 1.5px solid var(--warn); border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-size: 16px; }
.banner b { color: var(--warn); }
.banner .ghost { margin-top: 8px; }
/* 管理者が取り消した予約のお知らせ(C18) */
.notice { background: var(--card); color: var(--ink); border: 1.5px solid var(--warn); border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-size: 16px; }
.notice b { color: var(--warn); }
.notice .ghost { margin-top: 8px; }

/* 入力欄(ログイン・招待・アカウント) */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.card h2 { font-size: 17px; margin: 0 0 10px; }
.field { display: grid; gap: 4px; margin-bottom: 14px; }
.field label { font-weight: 700; }
.field input { min-height: var(--tap); width: 100%; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font-size: 16px; }
.field input[readonly] { color: var(--sub); }
.field .help { font-size: 16px; color: var(--sub); }
.msg { font-size: 16px; margin: 0 0 14px; }
.msg.err { color: var(--warn); font-weight: 700; }
.msg.ok { color: var(--accent); font-weight: 700; }
.wide { width: 100%; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.kv dt { color: var(--sub); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.lead { margin: 0 0 14px; }
