/* 配色・寸法はデジタル庁デザインシステムに合わせる
   キーカラー Blue 900 / 文字 Solid Gray 900・700 / 線 Solid Gray 420・200 / エラー Red 800 / フォーカス Yellow 300 */
:root {
  color-scheme: light;
  --blue-50: #e8f1fe; --blue-100: #d9e6ff; --blue-200: #c5d7fb; --blue-900: #0017c1; --blue-1000: #00118f; --blue-1200: #000060;
  --red-50: #fdeeee; --red-800: #ec0000; --red-900: #ce0000; --red-1000: #b10000;
  --gray-50: #f2f2f2; --gray-100: #e6e6e6; --gray-200: #cccccc; --gray-420: #949494; --gray-536: #767676;
  --gray-600: #666666; --gray-700: #4d4d4d; --gray-800: #333333; --gray-900: #1a1a1a;
  --yellow-300: #ffd43d;

  --bg: #ffffff; --fg: var(--gray-900); --sub: var(--gray-700); --muted: var(--gray-536);
  --line: var(--gray-200); --line-strong: var(--gray-420); --field: var(--gray-600);
  --soft: var(--gray-50); --past: #f8f8f8; --off: #f0f0f0;
  --accent: var(--blue-900); --accent-hover: var(--blue-1000); --accent-press: var(--blue-1200); --accent-soft: var(--blue-50);
  --danger: var(--red-900); --now: var(--red-800);
  --radius: 8px;
  --hour: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.7 "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-text-size-adjust: 100%; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
html:has(dialog[open]) { overflow: hidden; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }

/* ボタン（主：塗り / 副：枠線 / 文字だけ） */
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; cursor: pointer;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--accent);
  background: var(--bg); color: var(--accent); font-weight: 700; line-height: 1.2;
  transition: background-color .12s, color .12s, border-color .12s; }
@media (hover: hover) { button:hover { background: var(--accent-soft); } }
button:active { background: var(--blue-100); }
button:disabled { color: var(--gray-420); border-color: var(--gray-200); background: var(--bg); cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (hover: hover) { button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; } }
button.primary:active { background: var(--accent-press); border-color: var(--accent-press); }
button.primary:disabled { background: var(--gray-200); border-color: var(--gray-200); color: #fff; text-decoration: none; }
button.link { border-color: transparent; background: none; padding: 0 8px; text-decoration: underline; text-underline-offset: 3px; }
button.link.danger { color: var(--danger); }
button.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger-fill:active { background: var(--red-1000); }
:focus-visible { outline: 2px solid var(--blue-900); outline-offset: 2px; }
/* 入力欄は外枠ではなく、枠線を青く太くして示す */
input:focus-visible, select:focus-visible { outline: none; border-color: var(--blue-900) !important; box-shadow: 0 0 0 1px var(--blue-900); }
h2[tabindex="-1"]:focus { outline: none; box-shadow: none; }

/* ログイン */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.login-card { width: 100%; max-width: 340px; display: grid; gap: 16px; text-align: center; margin-bottom: 8vh; }
.login-card .hero { width: 100%; height: auto; display: block; margin: 0 auto 4px; }
.login-card h1 { margin: 0; font-size: 24px; line-height: 1.4; }
.login-card .sub { margin: -12px 0 8px; color: var(--sub); font-size: 14px; }
.login-card .pass { display: grid; gap: 8px; text-align: left; font-size: 16px; font-weight: 700; }
.login-card input { height: 56px; padding: 0 16px; border: 1px solid var(--field); border-radius: var(--radius); background: var(--bg); font-size: 16px; text-align: center; letter-spacing: .2em; }
button.big { min-height: 56px; font-size: 16px; }
dialog .error:empty { display: none; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 14px; line-height: 1.5; }

/* ヘッダー */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line);
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  display: grid; gap: 8px; }
.top .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.range { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { border: 0; background: none; color: var(--accent); width: 44px; height: 44px; min-height: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.icon-btn.plain { color: var(--sub); }
button.new { display: inline-flex; align-items: center; gap: 4px; padding: 0 16px 0 12px; }
.nav { display: flex; }
.nav button { min-width: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border-color: var(--field); color: var(--fg); font-weight: 400; border-radius: 0; }
.nav button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.nav button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.nav button + button { margin-left: -1px; }
.nav #today { padding: 0 16px; }
.nav button:disabled { color: var(--gray-536); border-color: var(--field); background: var(--soft); }
.seg { display: flex; }
.seg button { min-width: 52px; padding: 0 12px; border-color: var(--field); color: var(--fg); font-weight: 400; border-radius: 0; }
.seg button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.seg button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.seg button + button { margin-left: -1px; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; position: relative; }

main { padding: 0 0 max(24px, env(safe-area-inset-bottom)); }
main.slide-l { animation: slideL .18s ease-out; }
main.slide-r { animation: slideR .18s ease-out; }
@keyframes slideL { from { transform: translateX(24px); opacity: .4; } }
@keyframes slideR { from { transform: translateX(-24px); opacity: .4; } }

/* 時間軸（日・週） */
.day { --hour: 64px; }
.grid { display: grid; position: relative; padding: 12px env(safe-area-inset-right) 0 env(safe-area-inset-left); touch-action: pan-y; }
.days-head { display: grid; position: sticky; top: var(--head-h, 0); z-index: 3; background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.day .days-head { display: none; }
.days-head div { text-align: center; padding: 6px 0; font-size: 12px; line-height: 1.3; color: var(--sub); cursor: pointer; }
.days-head div b { display: block; margin: 2px auto 0; width: 32px; height: 32px; line-height: 32px; font-size: 16px; color: var(--fg); border-radius: 999px; }
.days-head .is-today b { color: #fff; background: var(--accent); }
.sun { color: var(--danger) !important; } .sat { color: var(--accent) !important; }
.hours { position: relative; }
.hours .h { height: var(--hour); font-size: 12px; line-height: 1; color: var(--sub); text-align: right; padding-right: 6px; transform: translateY(-6px); }
.col { position: relative; border-left: 1px solid var(--line); }
.col .slot { height: calc(var(--hour) / 2); border-bottom: 1px dashed var(--gray-100); cursor: pointer; transition: background-color .1s; }
.col .slot:nth-child(2n) { border-bottom: 1px solid var(--line); }
.col .slot.past { background: var(--past); cursor: default; }
.col .slot:not(.past):active { background: var(--accent-soft); }
@media (hover: hover) { .col .slot:not(.past):hover { background: var(--accent-soft); } }
.ev { position: absolute; left: 4px; right: 4px; min-height: 22px; border-radius: 6px; padding: 4px 8px; overflow: hidden;
  background: var(--blue-100); border-left: 4px solid var(--accent); color: var(--fg); font-size: 14px; line-height: 1.4; cursor: pointer; z-index: 1; }
.ev b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { display: block; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.short { display: flex; align-items: center; gap: 8px; padding-top: 0; padding-bottom: 0; }
.ev.short b, .ev.short span { display: inline; }
.ev:active { background: var(--blue-200); }
.ev.past { background: var(--gray-50); border-left-color: var(--gray-420); color: var(--sub); }
.ev.past span { color: var(--muted); }
.ev.flash { animation: flash 1.2s ease-out 2; }
@keyframes flash { 50% { background: var(--blue-200); box-shadow: 0 0 0 3px var(--blue-900); } }
.week .ev { padding: 2px 3px; font-size: 12px; letter-spacing: 0; left: 2px; right: 2px; border-left-width: 3px; }
.week .ev.short { display: block; padding-top: 2px; }
.week .ev.short span { display: none; }
.now-line { position: absolute; left: -1px; right: 0; height: 3px; margin-top: -1px; background: var(--now); z-index: 2; pointer-events: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.now-line::before { content: ""; position: absolute; left: -6px; top: -5px; width: 13px; height: 13px; border-radius: 50%; background: var(--now); box-shadow: 0 0 0 2px #fff; }
.empty { position: sticky; top: calc(var(--head-h, 0px) + 8px); z-index: 4; box-shadow: 0 2px 8px rgba(0,0,0,.08); margin: 12px 16px 0; padding: 12px 16px; border-radius: var(--radius); background: var(--soft); font-size: 14px; line-height: 1.6; color: var(--sub); }

/* 月 */
.month { display: grid; grid-template-columns: repeat(7, 1fr); }
.month .wd { text-align: center; font-size: 12px; color: var(--sub); padding: 6px 0; border-bottom: 1px solid var(--line); }
.month .cell { min-height: 88px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 3px; cursor: pointer; overflow: hidden; }
.month .cell:nth-child(7n) { border-right: 0; }
.month .cell:active { background: var(--accent-soft); }
.month .cell.other .num { color: var(--gray-536); font-weight: 400; }
.month .cell.past-day { background: var(--past); }
.month .num { display: inline-block; font-size: 14px; font-weight: 700; min-width: 26px; height: 26px; line-height: 26px; text-align: center; }
.month .cell.today .num { color: #fff; background: var(--accent); border-radius: 999px; }
.month .pill { font-size: 12px; line-height: 1.4; margin-top: 2px; padding: 1px 4px; border-radius: 4px; background: var(--blue-100); border-left: 2px solid var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .month .pill .t { display: none; } }
.month .more { font-size: 12px; color: var(--sub); padding-left: 2px; }

/* ダイアログ */
dialog { border: 0; border-radius: 12px; padding: 24px 20px; width: min(440px, calc(100vw - 32px)); background: var(--bg); color: var(--fg);
  max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
dialog::backdrop { background: rgba(26,26,26,.5); animation: fadeIn .2s ease-out; }
dialog[open] { animation: popIn .16s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.98); } }
@media (prefers-reduced-motion: reduce) { dialog[open], dialog::backdrop, main.slide-l, main.slide-r { animation: none !important; } }
dialog h2 { margin: 0 0 4px; font-size: 20px; line-height: 1.4; }
dialog form, .detail { display: grid; gap: 16px; }
dialog label, .field { display: grid; gap: 8px; font-size: 16px; font-weight: 700; }
dialog label small { font-size: 14px; font-weight: 400; color: var(--sub); }
dialog input:not([type=date]), dialog select { height: 48px; padding: 0 12px; border: 1px solid var(--field); border-radius: var(--radius); background: var(--bg);
  font-size: 16px; font-weight: 400; width: 100%; color: var(--fg); -webkit-appearance: none; appearance: none; }
dialog input::placeholder { color: var(--muted); }
@media (hover: hover) { dialog input:hover, dialog select:hover { border-color: var(--gray-900); } }
dialog select { padding-right: 32px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 20px; }

/* 日付：前後の日ボタン＋表示（透明な日付欄を重ねてタップでカレンダーを開く） */
.daterow { display: flex; gap: 8px; }
.stepper { width: 48px; min-width: 48px; height: 48px; padding: 0; border-color: var(--field); color: var(--fg); display: inline-flex; align-items: center; justify-content: center; }
.datebox { position: relative; flex: 1; min-width: 0; height: 48px; border: 1px solid var(--field); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; font-weight: 400; color: var(--fg); }
.datebox svg { color: var(--sub); flex: none; }
.datebox input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-appearance: none; appearance: none; font-size: 16px; }
.datebox:focus-within { border-color: var(--blue-900); box-shadow: 0 0 0 1px var(--blue-900); }

.time { display: flex; align-items: center; gap: 8px; }
.time select { flex: 1; width: auto; min-width: 0; text-align: center; text-align-last: center; }
.time .colon { font-weight: 700; }
.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.chips button { min-height: 44px; padding: 0 4px; border-color: var(--field); color: var(--fg); font-weight: 400; font-size: 14px; white-space: nowrap; }
.chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.summary { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--blue-1000); font-size: 16px; font-weight: 700; line-height: 1.5; }
.summary.warn { background: var(--red-50); color: var(--danger); }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.actions button { min-height: 48px; padding: 0 20px; }
.actions.split { justify-content: space-between; align-items: center; }
.actions.split .link { margin-left: -8px; }
.detail .actions button { flex: 1; }

.detail p { margin: 0; }
.detail .when { font-size: 16px; font-weight: 700; }
.confirm { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 12px; }
.confirm p { font-weight: 700; }

/* スマホでは予約フォームを下から出す */
@media (max-width: 600px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: 0; position: fixed; inset: auto 0 var(--kb, 0px) 0;
    border-radius: 16px 16px 0 0; padding: 20px 16px max(16px, env(safe-area-inset-bottom));
    max-height: calc(var(--vvh, 100dvh) - 16px); }
  dialog.sheet .actions { position: sticky; bottom: calc(-1 * max(16px, env(safe-area-inset-bottom))); background: var(--bg);
    margin: 0 -16px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  dialog.sheet .actions button { flex: 1; }
  dialog.sheet[open] { animation: sheetUp .24s cubic-bezier(.2,.8,.2,1); }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  #detail .actions { position: static; margin: 0; padding: 0; border: 0; }
}

.toast { position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content; bottom: calc(24px + env(safe-area-inset-bottom));
  background: var(--gray-900); color: #fff; padding: 12px 20px; border-radius: var(--radius); font-size: 14px; line-height: 1.5; opacity: 0; transition: opacity .2s;
  pointer-events: none; z-index: 20; text-align: center; transform: translateY(8px); transition: opacity .2s, transform .2s; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--danger); }

/* 使い方 */
.nw { white-space: nowrap; }
@media (max-width: 340px) { .nw { white-space: normal; } }
.guide { width: 100%; font-size: 16px; line-height: 1.7; text-wrap: pretty; line-break: strict; }
.guide h3 { font-size: 18px; line-height: 1.5; margin: 0 0 4px; }
.guide * + h3 { margin-top: 32px; }
.guide p { margin: 0 0 8px; }
.guide .lead { color: var(--sub); }
.guide b { font-weight: 700; white-space: nowrap; }
.way { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.way-head { font-weight: 700; }
.steps { list-style: none; counter-reset: s; margin: 12px 0 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; margin-bottom: 10px; }
.steps li:last-child { margin-bottom: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 24px; text-align: center; }
.guide .hint { font-size: 14px; line-height: 1.6; color: var(--sub); margin: 12px 0 0; }
.figure { display: block; width: calc(100% - 34px); max-width: 320px; margin: 8px 0 0 34px; }
.nb { white-space: nowrap; }
.fig-card { fill: var(--bg); stroke: var(--gray-420); }
.fig-title { font-size: 15px; font-weight: 700; fill: var(--fg); }
.fig-sub { font-size: 12px; fill: var(--sub); }
.fig-line { stroke: var(--line); }
.fig-chip { fill: var(--blue-50); stroke: var(--accent); }
.fig-chip-text { font-size: 12px; font-weight: 700; fill: var(--accent); }
.btn-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius); background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; }
.btn-link:active { background: var(--accent-press); }
.calid { font-size: 14px; background: var(--soft); border-radius: var(--radius); padding: 8px 12px; word-break: break-all; user-select: all; margin-top: 8px; }
.guide .note { color: var(--sub); margin-top: 20px; }
.guide details.more { margin-top: 12px; font-size: 14px; color: var(--sub); }
.guide details.more summary { cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.guide details.more p { margin: 8px 0 0; }
.guide .rules-list { margin: 8px 0 0; padding-left: 1.3em; }
.guide .rules-list li { margin: 4px 0; }
/* 使い方：3ページを左右スワイプで切り替える。各ページは1画面に収める */
#help { width: min(520px, calc(100vw - 16px)); height: min(720px, calc(100dvh - 16px)); max-height: none; padding: 0; overflow: hidden; }
#help[open] { display: flex; flex-direction: column; }
.help-head { flex: none; padding: 4px 4px 4px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.help-head h2 { margin: 0; font-size: 18px; }
.hpages { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.hpages::-webkit-scrollbar { display: none; }
.hpage { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; overflow-y: auto; padding: 12px 16px 10px; }
.hin { transform-origin: top left; }
.hpage.guide { font-size: 15px; line-height: 1.6; }
.hpage h3 { margin: 0 0 2px; font-size: 18px; }
.hpage .lead { font-size: 14px; margin: 0 0 4px; }
.hpage .way { padding: 10px 12px; margin-top: 8px; }
.hpage .steps { margin-top: 8px; }
.hpage .steps li { margin-bottom: 8px; padding-left: 32px; }
.steps .sub { display: block; font-size: .86em; color: var(--gray-600, #666); margin-top: 1px; }
.hpage .hint { margin-top: 8px; font-size: 13px; line-height: 1.55; }
.hpage .figure { margin: 4px 0 0 32px; width: calc(100% - 32px); max-width: 280px; }
.hpage details.more { margin-top: 6px; }
.copyrow { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.copyrow .calid { flex: 1; min-width: 0; margin: 0; font-size: 12px; padding: 6px 10px; }
.copy-btn { flex: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--blue-900); background: #fff; border: 1px solid var(--blue-900); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.copy-btn.done { background: var(--blue-900); color: #fff; }
.rules { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.rules li { display: grid; grid-template-columns: 5.2em 1fr; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.rules .rk { color: var(--accent); white-space: nowrap; }
.hpage .note { margin-top: 16px; }
.help-foot { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.help-foot .primary { justify-self: end; min-width: 112px; min-height: 44px; }
.plain-btn { justify-self: start; min-height: 44px; border-color: transparent; background: none; color: var(--accent); font-weight: 700; padding: 0 8px; }
.plain-btn.off { visibility: hidden; }
.dots { display: flex; gap: 4px; }
.dots button { width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; }
.dots button::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gray-200); transition: width .2s, background .2s; }
.dots button[aria-selected="true"]::after { width: 20px; border-radius: 4px; background: var(--accent); }

/* パソコン：ヘッダーを1行にし、横に広がりすぎないようにする */
@media (min-width: 900px) {
  #app { max-width: 1120px; margin: 0 auto; }
  .top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; }
  .top .row { display: contents; }
  .nav { order: 1; } .range { order: 2; flex: 1; } .seg { order: 3; } .top-actions { order: 4; }
  .day .grid, .day .empty { max-width: 760px; margin-left: auto; margin-right: auto; }
  .day .grid { padding-right: 20px; }
  .month .cell { min-height: 110px; }
}

/* 幅の狭い iPhone（SE など）ではヘッダーのボタンを詰める */
@media (max-width: 360px) {
  .nav #today { padding: 0 10px; }
  .seg button { min-width: 44px; padding: 0 8px; }
  .range { font-size: 18px; }
  button.new { padding: 0 12px 0 8px; }
}
/* 読み込みが遅いとき */
main.loading { opacity: .5; transition: opacity .2s; pointer-events: none; }
.datebox span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) { .week .ev span { display: none; } }
@media (max-width: 360px) { .datebox svg { display: none; } .datebox { justify-content: center; } }

/* 予約フォーム：見出しを左に置いて1画面に収める */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#bookForm { gap: 12px; }
#bookForm .row { grid-template-columns: 3em minmax(0, 1fr); align-items: center; column-gap: 8px; font-size: 15px; }
#bookForm .field.row > .lbl { align-self: center; }
#bookForm input:not([type=date]), #bookForm select, #bookForm .datebox, #bookForm .stepper { height: 44px; }
#bookForm .stepper { width: 44px; min-width: 44px; }
#bookForm .chips { gap: 4px; }
#bookForm .chips button { min-height: 44px; font-size: 13px; padding: 0 2px; }
#bookForm .summary { padding: 8px 12px; font-size: 15px; }
#bookForm .rowhint { margin: -6px 0 0 calc(3em + 8px); font-size: 13px; color: var(--sub); line-height: 1.5; }
#bookForm .actions button { min-height: 44px; }
@media (max-width: 600px) { dialog.sheet#sheet { padding-top: 16px; } }
@media (max-width: 360px) {
  #bookForm .row { grid-template-columns: 2.6em minmax(0, 1fr); font-size: 14px; }
  #bookForm .rowhint { margin-left: calc(2.6em + 8px); }
  #bookForm .chips button { font-size: 12px; }
  #bookForm .time { gap: 4px; }
}
.detail .dnote { font-size: 14px; color: var(--sub); line-height: 1.6; }
.detail .actions.split { gap: 8px; }
.detail .actions.split button { flex: 1; padding: 0 8px; }
.plain-btn { white-space: nowrap; }
@media (max-width: 360px) { .help-foot .primary { min-width: 88px; } }
@media (max-height: 600px) { .hpage .figure { display: none; } }

/* 使い方の手描き風イラスト */
.ill { display: block; height: auto; }
.way-row { display: grid; grid-template-columns: 1fr 64px; gap: 8px; align-items: center; }
.ill-tap { width: 64px; }
.ill-cal { width: 100%; max-width: 330px; margin-top: 6px; }
.page-top { display: grid; grid-template-columns: 1fr 88px; gap: 8px; align-items: center; }
.ill-ov { width: 88px; }
.ill-room { width: 100%; max-width: 240px; margin: 4px auto 0; }
@media (max-height: 600px) { .ill-room { display: none; } }

.warn-em { font-style: normal; color: var(--red-900); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ホーム画面への追加 */
.a2hs-bar { position: fixed; z-index: 20; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 12px; background: #fff; border: 1px solid var(--line-strong);
  border-radius: 16px; box-shadow: 0 6px 24px rgba(0, 0, 0, .16); }
.a2hs-bar[hidden] { display: none !important; }
.a2hs-bar img { flex: none; width: 40px; height: 40px; border-radius: 9px; }
.a2hs-bar p { flex: 1; min-width: 0; margin: 0; font-size: 14px; line-height: 1.45; color: var(--gray-800); }
.a2hs-bar .primary { flex: none; padding: 8px 12px; font-size: 14px; min-height: 0; }
.a2hs-bar .icon-btn { flex: none; width: 36px; height: 36px; }
.a2hs { width: min(440px, calc(100vw - 32px)); border: none; border-radius: 16px; padding: 20px 20px 16px; }
.a2hs h2 { margin: 0 0 4px; font-size: 18px; }
.a2hs h2:focus { outline: none; }
.a2hs .hint { margin: 12px 0 0; font-size: 14px; color: var(--sub); }
.a2hs .actions { margin-top: 16px; display: flex; justify-content: flex-end; }
.a2hs [data-os][hidden] { display: none; }
.ios-share { width: 20px; height: 20px; vertical-align: -4px; margin: 0 3px; color: var(--blue-900); }
@media (max-width: 360px) {
  .a2hs-bar { gap: 6px; padding-left: 12px; }
  .a2hs-bar img { display: none; }
  .a2hs-bar p { font-size: 13px; }
  .a2hs-bar .primary { padding: 8px 10px; }
}
.a2hs-bar p b, .a2hs-bar p span { display: block; }
.a2hs-bar p b { color: var(--gray-900); }
@media (max-width: 360px) { .a2hs-bar p span { font-size: 12px; } }
.rules .rsub { display: block; font-size: .82em; color: var(--gray-600); margin-top: 2px; }

/* 土日祝はうっすらグレー、過ぎた時間は斜線で区別する */
.col.off .slot { background: var(--off); }
.col .slot.past, .col.off .slot.past { background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(0, 0, 0, .045) 5px 6px), var(--bg); }
.col.off .slot.past { background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(0, 0, 0, .05) 5px 6px), var(--off); }
.month .cell.off { background: var(--off); }
.month .cell.past-day { background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(0, 0, 0, .045) 5px 6px), var(--bg); }
.month .cell.off.past-day { background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(0, 0, 0, .05) 5px 6px), var(--off); }
.month .hname { display: block; font-size: 10px; line-height: 1.2; color: var(--danger); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
