/* 駐車場予約 管理画面（docs/mockups の Front* に合わせる） */
:root {
  --navy: #1F3A5F; --navy-dark: #142842; --bg: #F4F2ED; --ink: #1C1F24; --sub: #4A4F57; --sub2: #5A5F66;
  --line: #E4E0D8; --line2: #CFC9BE; --gray: #ECE9E3; --err: #B42318; --err-bg: #FDECEA;
  --orange: #C2692B; --brown: #9A4312; --bar: #C9D6E6; --bar-ink: #10243D; --soft: #E3EAF3;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--navy); } a:hover { color: var(--navy-dark); }
button, input, select { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ヘッダー */
.top { height: 72px; padding: 0 32px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; }
.top-l { display: flex; align-items: center; gap: 28px; }
.brand { font-size: 20px; font-weight: 700; }
.nav { display: flex; gap: 4px; }
.nav a { height: 40px; padding: 0 18px; border-radius: 8px; color: #fff; font-size: 14px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.nav a.on { background: #fff; color: var(--navy); font-weight: 700; }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--orange); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.top-r { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.env { color: #D5DEEA; }
.today { font-weight: 700; }
.logout button { height: 34px; padding: 0 14px; border: 1.5px solid #8FA3BD; border-radius: 8px; background: transparent; color: #fff; font-size: 13px; }

.main { padding: 24px 32px; display: flex; gap: 24px; align-items: flex-start; }
.card { background: #fff; border-radius: 14px; padding: 18px; }
.muted { color: var(--sub2); }

/* ボタン */
.btn { height: 40px; padding: 0 16px; border-radius: 8px; font-size: 14px; border: 1.5px solid var(--line2); background: #fff; color: var(--ink); }
.btn-primary { border: none; background: var(--navy); color: #fff; }
.btn-outline { border: 1.5px solid var(--navy); color: var(--navy); font-weight: 700; background: #fff; }
.btn-lg { height: 48px; border-radius: 10px; font-size: 15px; font-weight: 700; }
.btn-danger { border: none; background: var(--brown); color: #fff; }
.btn-ghost-danger { border: 1.5px solid var(--line2); color: var(--brown); background: #fff; }
.btn-ghost-danger.armed { border-color: var(--err); background: var(--err); color: #fff; font-weight: 700; }
.icon-btn { width: 40px; height: 40px; border: 1.5px solid var(--line2); border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; }
.icon-btn.plain { border: none; background: transparent; }
.icon-btn[disabled] { cursor: default; opacity: .35; }
.link-btn { border: none; background: transparent; color: var(--navy); font-size: 13px; font-weight: 700; text-decoration: underline; height: 36px; padding: 0 12px; }

/* 入力欄・エラー（ボタンは常に押せる → 押したら赤字ポップアップ＋該当欄を赤枠・赤字） */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--sub); }
.field input, .field select { height: 44px; border: 1.5px solid var(--line2); border-radius: 8px; padding: 0 12px; font-size: 15px; background: #fff; color: var(--ink); }
.field.bad > span { color: var(--err); font-weight: 700; }
.field.bad input, .field.bad select, select.bad { border-color: var(--err); color: var(--err); background: var(--err-bg); }
.alert { border-radius: 10px; padding: 10px 14px; background: var(--err-bg); border: 1.5px solid var(--err); font-size: 13px; font-weight: 500; color: var(--err); white-space: pre-line; }
.alert .lines { margin-top: 6px; font-weight: 400; }
.notice { border-radius: 8px; padding: 10px 14px; background: var(--soft); color: var(--navy); font-size: 13px; font-weight: 500; }

/* 画面上の赤字ポップアップ（ダイアログ外のエラー） */
.err-pop { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 60; min-width: 360px; max-width: 640px; display: flex; gap: 12px; align-items: flex-start; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.err-pop button { border: none; background: transparent; color: var(--err); font-size: 18px; line-height: 1; padding: 0 2px; }

/* ダイアログ */
.overlay { position: fixed; inset: 0; background: rgba(20,24,30,.5); display: flex; align-items: center; justify-content: center; z-index: 50; }
.dialog { width: 560px; max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.dialog.wide { width: 560px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg-title { font-size: 20px; font-weight: 700; }
.dlg-foot { display: flex; gap: 10px; padding-top: 4px; }
.dlg-foot .grow { flex-grow: 1; }
.row-box { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 10px; background: var(--bg); }
.row-box .lbl { font-size: 14px; color: var(--sub); width: 104px; white-space: nowrap; }
.row-box .ctl { display: flex; align-items: center; gap: 10px; }
.row-box .val { min-width: 128px; text-align: center; font-size: 16px; font-weight: 700; }
.step-btn { white-space: nowrap; height: 40px; padding: 0 12px; border-radius: 8px; border: 1.5px solid var(--line2); background: #fff; font-size: 13px; color: var(--ink); }
.big-nights { font-size: 24px; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ログイン */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 400px; background: #fff; border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.login-card h1 { margin: 0; font-size: 22px; color: var(--navy); }

/* 週間台帳 */
.side { width: 280px; display: flex; flex-direction: column; gap: 16px; flex-shrink: 0; }
.side .num { font-size: 28px; font-weight: 700; }
.side .num small { font-size: 15px; color: var(--sub2); font-weight: 400; }
.side h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.side .pending { border: 1.5px solid #E2B48F; }
.side .li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #EEEAE3; font-size: 13px; }
.side .empty { font-size: 13px; color: var(--sub2); padding: 4px 0; }
.slot-chip { width: 40px; height: 32px; border-radius: 6px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.board { flex-grow: 1; min-width: 0; background: #fff; border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.board-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 6px; }
.week-nav { display: flex; align-items: center; gap: 10px; }
.week-title { font-size: 16px; font-weight: 700; }
.wk { display: grid; grid-template-columns: 96px repeat(7, minmax(0, 1fr)); gap: 4px; }
.dh { text-align: center; display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-radius: 8px; color: var(--sub); }
.dh .d { font-size: 14px; font-weight: 700; }
.dh .w { font-size: 12px; }
.dh.sat { color: #2F5B8C; } .dh.sun { color: #A8401F; }
.dh.today { background: var(--navy); color: #fff; }
.lab { grid-row: 1; grid-column: 1; height: 44px; display: flex; flex-direction: column; justify-content: center; padding-left: 10px; border-radius: 6px; background: var(--bg); }
.lab b { font-size: 16px; }
.lab small { font-size: 10px; color: var(--sub); }
.lab.off { background: var(--gray); }
.cell { grid-row: 1; height: 44px; border-radius: 6px; background: #fff; border: 1px solid var(--line); }
.cell.we { background: #FBF6F4; }
.cell.today { border-color: #9FB2CA; border-width: 1.5px; }
.cell.off { background: var(--gray); }
.cell.stop { background: repeating-linear-gradient(135deg, #F3E7DD 0 6px, #FBF4EF 6px 12px); border-color: #E2C7B0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--brown); }
.bar { grid-row: 1; height: 44px; border-radius: 6px; padding: 0 10px; display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; font-size: 13px; text-align: left; border: 2px solid transparent; background: var(--bar); color: var(--bar-ink); z-index: 1; }
.bar:hover { border-color: var(--navy); }
.bar.past { background: var(--line); color: var(--sub); }
.bar b { font-weight: 700; }
.bar small { font-size: 11px; }
.bar.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bar.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.rem { padding-top: 8px; border-top: 1px solid var(--line); }
.rem .t { font-size: 12px; color: var(--sub); display: flex; align-items: center; padding-left: 10px; }
.rem .v { height: 34px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; background: var(--bg); }
.rem .v.full { background: var(--navy); color: #fff; }
.legend { font-size: 12px; color: var(--sub2); display: flex; gap: 16px; padding-top: 4px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }

/* 設定 */
.status { flex-grow: 1; background: #fff; border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.status-head { display: flex; justify-content: space-between; align-items: center; }
.status-head h2, .caps h2 { margin: 0; font-size: 18px; }
.srow { display: grid; grid-template-columns: 70px 170px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 50px; padding: 6px 14px; border-radius: 10px; background: var(--bg); }
.srow.off { background: var(--gray); }
.srow.has-stop { background: #FBF4EF; }
.srow .no { font-size: 18px; font-weight: 700; }
.srow .kind { font-size: 13px; color: var(--sub); }
.srow .st { font-size: 13px; font-weight: 700; color: var(--navy); }
.srow .st.warn { color: var(--brown); }
.srow .st.fixed { color: var(--sub2); }
.right-col { width: 470px; display: flex; flex-direction: column; gap: 16px; flex-shrink: 0; }
.caps { background: #fff; border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.cap { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.cap-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cap-top b { font-size: 15px; }
.cap-mid { display: flex; align-items: center; justify-content: space-between; }
.cap-val { min-width: 56px; text-align: center; font-size: 20px; font-weight: 700; }
.cap-val small { font-size: 13px; font-weight: 400; }
.cap-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--sub2); }
.add-btn { height: 44px; border: 1.5px dashed var(--navy); border-radius: 10px; background: #fff; color: var(--navy); font-size: 14px; }
.steps { display: flex; align-items: center; gap: 8px; }
.steps .s { white-space: nowrap; display: flex; align-items: center; gap: 6px; flex-grow: 1; font-size: 13px; color: var(--sub2); }
.steps .s i { width: 24px; height: 24px; border-radius: 12px; font-size: 12px; font-weight: 700; font-style: normal; display: flex; align-items: center; justify-content: center; background: var(--line); color: var(--sub2); flex-shrink: 0; }
.steps .s.done i, .steps .s.cur i { background: var(--navy); color: #fff; }
.steps .s.cur { color: var(--ink); font-weight: 700; }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pick { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; text-align: left; color: var(--ink); }
.pick .box { width: 22px; height: 22px; border-radius: 5px; border: 2px solid #B5B0A6; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pick .box svg { visibility: hidden; }
.pick.on { background: var(--soft); border-color: var(--navy); }
.pick.on .box { background: var(--navy); border-color: var(--navy); }
.pick.on .box svg { visibility: visible; }
.pick b { font-size: 17px; }
.pick .rl { font-size: 14px; color: #7A3510; font-weight: 700; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head b { font-size: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.cal .dw { font-size: 12px; color: var(--sub); }
.cal .dw.sun { color: #A8401F; } .cal .dw.sat { color: #2F5B8C; }
.cal button { height: 42px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: transparent; color: var(--ink); }
.cal button.sun { color: #A8401F; } .cal button.sat { color: #2F5B8C; }
.cal button.past { color: #B5B0A6; }
.cal button.in { background: #DCE4EE; font-weight: 700; }
.cal button.edge { background: var(--navy); color: #fff; font-weight: 700; }
.cal button .dot { width: 6px; height: 6px; border-radius: 3px; background: transparent; }
.cal button .dot.on { background: var(--orange); }
.cal button.edge .dot.on { background: #fff; }
.cal-note { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); }
.cal-note i { width: 8px; height: 8px; border-radius: 4px; background: var(--orange); }
.sum-box { padding: 12px 14px; border-radius: 10px; background: var(--bg); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 0; text-align: center; }
.done b { font-size: 22px; }
.done p { margin: 0; font-size: 14px; color: var(--sub); line-height: 1.7; }
.placeholder { flex-grow: 1; background: #fff; border-radius: 14px; padding: 40px; text-align: center; color: var(--sub); line-height: 1.8; }
/* 欄以外（枠の選択・期間・解除一覧）の赤枠 */
[data-f].bad:not(.field) { outline: 2px solid var(--err); outline-offset: 4px; border-radius: 10px; }
.sum-box.bad { color: var(--err); background: var(--err-bg); }
/* 検証環境の目印（本番には出ない）：オレンジの札＋画面上端のしま */
.env-badge { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 15px; background: #C2692B; color: #fff; font-size: 13px; font-weight: 700; }
body.is-stg { border-top: 6px solid #C2692B; }
/* 1泊（1マス）のバー：名前と泊数を2段に。名前は1行に収まらなければ「…」 */
.bar.n1 { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding: 0 6px; line-height: 1.15; }
.bar.n1 b { font-size: 12px; max-width: 100%; line-height: 1.1; }
.bar.n1 b span { display: block; overflow: hidden; text-overflow: ellipsis; }
.bar.n1 small { line-height: 1; }
.bar.n1 small { font-size: 10px; }
/* 承認 */
.ap-card { border: 1.5px solid #E2B48F; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; background: #fff; }
.ap-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 0.9fr); gap: 16px; align-items: start; }
.ap-name { font-size: 20px; font-weight: 700; }
.ap-contact { font-size: 14px; color: var(--sub); margin-top: 2px; word-break: break-all; }
.ap-contact b { color: var(--ink); font-size: 15px; }
.ap-stay { display: flex; flex-direction: column; gap: 4px; background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.ap-stay div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.ap-stay span { color: var(--sub2); }
.ap-full { font-size: 14px; font-weight: 700; color: var(--err); background: var(--err-bg); border-radius: 10px; padding: 10px 12px; }
.ap-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ap-actions .btn { font-size: 15px; }
.ap-actions .btn-primary { flex-grow: 1; }
.ap-actions .btn-primary.armed { background: #0F2A4A; outline: 3px solid #9FB2CA; }
.ap-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin: 8px 0; }
.ap-week div { text-align: center; background: var(--bg); border-radius: 6px; padding: 4px 0; font-size: 11px; color: var(--sub); }
.ap-week div.today { background: var(--navy); color: #fff; }
.ap-week b { display: block; font-size: 15px; color: inherit; }
.ap-week div:not(.today) b { color: var(--ink); }
/* メール控え */
.ob-list { display: flex; flex-direction: column; gap: 4px; }
.ob-row { display: grid; grid-template-columns: 74px 76px minmax(0, 1fr); gap: 2px 8px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--bg); font-size: 13px; }
.ob-row.on { background: var(--soft); outline: 1.5px solid var(--navy); }
.ob-row .ob-s { grid-column: 1 / -1; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-row .ob-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-k { font-weight: 700; } .k-confirmed { color: var(--navy); } .k-declined { color: var(--err); } .k-receipt { color: var(--brown); } .k-notify { color: var(--sub); }
.ob-meta { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.ob-meta span { display: inline-block; width: 60px; color: var(--sub2); }
.ob-tabs { font-size: 13px; color: var(--sub); margin-top: 6px; }
.ob-html { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: 10px; background: #F4F2ED; }
.ob-text { white-space: pre-wrap; font-family: inherit; font-size: 13px; background: var(--bg); border-radius: 10px; padding: 12px; margin: 0; }
/* お客様の受付の開閉 */
.bs-card { gap: 10px; }
.bs-state { font-size: 20px; font-weight: 700; }
.bs-card.is-open .bs-state { color: var(--navy); }
.bs-card.is-closed .bs-state { color: var(--brown); }
.bs-card #btnBooking.armed { background: var(--err); border-color: var(--err); color: #fff; font-weight: 700; }
.bs-card.is-closed #btnBooking.armed { background: var(--navy); border-color: var(--navy); }

/* ---------- 週の見出しから日付を選ぶ（見えない標準の日付欄を重ねる） ---------- */
.week-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 8px; }
.week-pick:hover span { text-decoration: underline; text-underline-offset: 4px; }
.week-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; cursor: pointer; font-size: 16px; }
.week-pick .pick-ico { display: none; color: var(--navy); flex-shrink: 0; }
.week-pick.bad { outline: 2px solid var(--err); outline-offset: 4px; color: var(--err); }
.btn-link { display: flex; align-items: center; text-decoration: none; white-space: nowrap; }
.board-act { display: flex; align-items: center; gap: 12px; }
.board-act .btn, .week-nav .btn { white-space: nowrap; }
.hint-touch { display: none; }
.wt-short { display: none; }
.eb-short, .d-short { display: none; }
.btn-link.is-current { color: var(--sub2); background: var(--bg); border-color: var(--line); }
.legend-hint { font-size: 12px; padding-top: 2px; order: 1; }
.ob-hint-top { display: none; }
.li-rest { display: none; font-size: 12px; color: var(--sub2); padding-top: 4px; }

/* ---------- 指で操作する端末（iPad など）：押すところを 44px 以上に ---------- */
@media (pointer: coarse) {
  .btn, .step-btn, .nav a, .add-btn, .link-btn, select.btn { min-height: 44px; }
  .btn:not(.btn-lg), .step-btn { height: 44px; }
  .link-btn { height: 44px !important; }
  .icon-btn { width: 44px; height: 44px; }
  .logout button { height: 44px; }
  .go-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
  .cal button { height: 44px; }
  .week-pick { min-height: 44px; padding: 0 10px; background: var(--bg); }
  .week-pick .pick-ico { display: block; }
  .bar:hover { border-color: transparent; }
  .hint-mouse { display: none; }
  .hint-touch { display: inline; }
}

/* ---------- 1179px 以下（iPad の縦・横 1024）：横にはみ出さないよう並べ直す。1180px 以上（PC）は今のまま ---------- */
@media (max-width: 1179px) {
  /* ヘッダーは必ず1段（左に名前とタブ、右端に札・日付・［ログアウト］） */
  .top { height: auto; min-height: 64px; padding: 10px 16px; flex-wrap: nowrap; gap: 8px 16px; }
  .top-l { gap: 16px; flex-wrap: nowrap; min-width: 0; }
  .top-r { gap: 12px; flex-wrap: nowrap; flex-shrink: 0; }
  .nav { flex-wrap: nowrap; }
  .nav a { padding: 0 14px; white-space: nowrap; }
  .env-badge, .today, .logout button { white-space: nowrap; }
  .main { padding: 16px; gap: 16px; }
  .err-pop { top: 76px; min-width: 0; width: calc(100% - 32px); }
  .board { padding: 16px; }
  .board-head { flex-wrap: wrap; gap: 10px 12px; }
  .week-nav { flex-wrap: wrap; }
  .week-title { white-space: nowrap; }
  .board-head { flex-wrap: nowrap; }
  .week-nav { flex-wrap: nowrap; min-width: 0; gap: 8px; }
  .wk { grid-template-columns: 76px repeat(7, minmax(0, 1fr)); }
  .lab { padding-left: 8px; }
  .lab small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bar { padding: 0 6px; gap: 4px; }
  .legend { flex-wrap: wrap; gap: 6px 14px; }
  /* 台帳・承認の左（右）の欄は細く。名前と日付・泊数は途中で折らず、入らなければ次の行へ */
  .side { width: 220px; }
  .side .li { flex-wrap: wrap; row-gap: 0; }
  .side .li > span { white-space: nowrap; }
  .side .li > span.muted { margin-left: auto; }
  .rem .t { flex-direction: column; align-items: flex-start; justify-content: center; line-height: 1.3; }
  /* 設定：右の列は下へ */
  .m-settings { flex-direction: column; align-items: stretch; }
  .right-col { width: auto; }
  .srow { grid-template-columns: 56px 150px minmax(0, 1fr); }
  /* 承認 */
  .ap-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ap-grid > .ap-slot { grid-column: 1 / -1; }
  /* メール控え */
  .m-outbox > .board:first-child { max-width: none !important; width: 360px; flex-shrink: 0; }
  .dialog { max-width: calc(100vw - 32px); }
}

/* ---------- 899px 以下（iPad 縦）：台帳の左の欄を上に横一列で小さくまとめる ---------- */
@media (max-width: 899px) {
  .m-ledger { flex-direction: column; align-items: stretch; }
  .side-sum { width: auto; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .side-sum .card { padding: 10px 12px; border-radius: 12px; display: flex; flex-direction: column; gap: 2px; }
  .side-sum .num { font-size: 22px; white-space: nowrap; }
  .side-sum .num small { font-size: 13px; }
  .side-sum h3 { font-size: 13px; gap: 6px; }
  .side-sum .li { padding: 3px 0; font-size: 12px; }
  .side-sum .li .slot-chip { width: 32px; height: 24px; font-size: 12px; }
  .side-sum .li-more { display: none; }
  .side-sum .li-rest { display: block; }
  .side-sum .empty { font-size: 12px; }
  .wt-long { display: none; }
  .wt-short { display: inline; }
  /* 本番以外（札・［メール控え］が出る）は、札を「検証」・日付を「10/8（木）」に短くして1段に収める */
  .top--full .eb-long, .top--full .d-long { display: none; }
  .top--full .eb-short, .top--full .d-short { display: inline; }
  .top--full { gap: 8px 12px; }
  .top--full .top-l { gap: 12px; }
  .top--full .top-r { gap: 10px; }
  .top--full .nav a { padding: 0 12px; }
  /* 承認：右の欄は下へ */
  .m-approval { flex-direction: column; align-items: stretch; }
  .m-approval > .side { width: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; }
  /* メール控え：一覧の下に本文 */
  .m-outbox { flex-direction: column; align-items: stretch; }
  .ob-hint-side { display: none; }
  .ob-hint-top { display: inline; }
  .m-outbox > .board:first-child { width: auto; }
}

/* ---------- 受付画面（2026-11-19）：画面いっぱいに表を出す ---------- */
body:has(main.desk) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.desk { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 12px; }
.desk-strip { display: flex; gap: 6px; overflow-x: auto; flex-shrink: 0; padding-bottom: 2px; }
.ds { flex: 0 0 auto; min-width: 58px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; padding: 4px 6px; text-align: center; font-size: 12px; color: var(--sub2); display: flex; flex-direction: column; align-items: center; position: relative; }
.ds b { font-size: 18px; color: var(--ink); line-height: 1.2; }
.ds i { font-style: normal; font-weight: 700; color: #2E7D4F; }
.ds i.full { color: var(--err); }
.ds.sel { border-color: var(--navy); background: var(--soft); }
.ds.sat .w { color: #2459A6; } .ds.sun .w { color: var(--err); }
.ds-other input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.desk-flash { flex-shrink: 0; }
.desk-grid { flex: 1; min-height: 0; display: grid; background: #fff; border-radius: 12px; padding: 4px 8px 6px; }
.desk-grid .gh { padding: 6px 10px 8px; border-bottom: 1.5px solid var(--line); }
.desk-grid .gh.day { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 16px; border-left: 1px solid var(--line); gap: 6px; }
.desk-grid .gh.today { background: var(--soft); border-radius: 8px 8px 0 0; }
.desk-grid .gh small { font-size: 12px; color: var(--sub2); font-weight: 500; margin-right: 4px; }
.desk-grid .gh .r { font-size: 13px; color: var(--sub2); font-weight: 500; white-space: nowrap; }
.desk-grid .gh .r b { font-size: 22px; color: #2E7D4F; margin-left: 3px; }
.desk-grid .gh .r b.full { color: var(--err); }
.desk-grid .lab { grid-column: 1; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--navy); font-size: 18px; border-bottom: 1px solid var(--line); }
.desk-grid .cell { border: none; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: transparent; display: flex; align-items: center; padding: 0 12px; font-size: 15px; min-height: 0; font-family: inherit; text-align: left; }
.desk-grid .cell.free { color: #2E7D4F; font-weight: 700; cursor: pointer; }
.desk-grid .cell.free:hover, .desk-grid .cell.free:active { background: #EEF6F0; }
.desk-grid .cell.stop { background: var(--gray); color: var(--sub2); font-size: 13px; }
.desk-grid .bar { z-index: 1; margin: 4px; border-radius: 8px; background: var(--bar); color: var(--bar-ink); display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 17px; overflow: hidden; white-space: nowrap; text-decoration: none; min-height: 0; }
.desk-grid .bar small { font-size: 12px; color: var(--sub); }
.desk-grid .bar .arr-r { margin-left: auto; }
.desk-grid .bar.cl { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.desk-grid .bar.cr { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.desk-grid .bar.pend { background: #FBEFE4; color: var(--orange); border: 1.5px dashed var(--orange); }
.desk-grid .bar.pend small { color: var(--orange); }
.desk-grid .appr { margin-left: auto; border: none; background: var(--orange); color: #fff; border-radius: 8px; height: 32px; padding: 0 14px; font-weight: 700; font-size: 14px; font-family: inherit; }
.moved { font-size: 11px; color: #fff; background: var(--navy); border-radius: 4px; padding: 1px 6px; }
.desk-dlg { width: 460px; }
.desk-dlg .field input { font-size: 20px; height: 52px; }
.desk-step { display: flex; align-items: center; justify-content: space-between; background: var(--bg); border-radius: 12px; padding: 6px; text-align: center; }
.desk-step button { width: 60px; height: 48px; border-radius: 10px; border: 1.5px solid var(--line2); background: #fff; font-size: 24px; }
.desk-step b { font-size: 24px; display: block; }
.desk-step small { font-size: 13px; color: var(--sub2); }
.desk-info { font-size: 14px; color: var(--sub); text-align: center; min-height: 1.4em; }
.desk-info.err { color: var(--err); font-weight: 700; }
.dev-mark { font-size: 12px; border: 1.5px solid #8FA3BD; border-radius: 8px; padding: 4px 10px; color: #D5DEEA; white-space: nowrap; }
.dev-mark--here { color: var(--navy); border-color: var(--navy); padding: 1px 6px; }
.dev-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.dev-add { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.remember input { width: 20px; height: 20px; }
.remember-note { font-size: 12px; color: var(--sub2); line-height: 1.6; margin: 0; }
/* 週間台帳の承認待ち（番号を押さえている申し込み） */
.bar.pend-bar { background: #FBEFE4; color: var(--orange); border: 1.5px dashed var(--orange); text-decoration: none; }
/* 受付画面：週間台帳の .cell/.lab/.bar の決まった高さ・角丸を打ち消す */
.desk-grid .lab, .desk-grid .cell, .desk-grid .bar { height: auto; }
.desk-grid .lab { border-radius: 0; background: transparent; padding: 0; flex-direction: row; }
.desk-grid .cell { border-radius: 0; border-top: none; border-right: none; }
.desk-grid .bar { border-width: 0; }
.desk-grid .bar.pend { border-width: 1.5px; }

/* 受付画面の下：名札を印刷（2026-11-26） */
.desk-print{margin:12px 0 0;font-size:14px;color:var(--sub);display:flex;gap:16px;align-items:baseline;flex-wrap:wrap}
.desk-print a{font-weight:700}
.np-print{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--sub);padding:0 4px}
.np-print span{flex:1}
.np-print a{display:inline-flex;align-items:center;justify-content:center;min-width:64px;height:40px;border:1px solid var(--line2);background:#fff;border-radius:3px;font-weight:700;text-decoration:none}

/* ==========================================================================
   2026-11-27 見た目の直し（AI感をなくす）：カード・大きな角丸・ピル型をやめ、白地を線と余白・文字の強弱で整理。
   押せるもの（予約の帯・空きのマス・ボタン）だけ、角を少しだけ丸める（3px）。まず上の帯と週間台帳から
   ========================================================================== */
.top { height: 56px; }
.nav { gap: 26px; align-self: stretch; }
.nav a { height: auto; padding: 2px 0 0; border-radius: 0; color: #C9D3E0; border-bottom: 2px solid transparent; }
.nav a.on { background: transparent; color: #fff; border-bottom-color: #fff; }
.nav a:hover { color: #fff; }
.top-l { align-self: stretch; }
.brand { font-size: 17px; letter-spacing: .04em; }
.logout button { border-radius: 3px; }
.dev-mark { border-radius: 3px; }

body.p-ledger { background: #fff; }
.p-ledger .main { padding: 0; gap: 0; align-items: stretch; max-width: 1440px; margin: 0 auto; }
.p-ledger .side { width: 250px; padding: 26px 22px 28px 28px; border-right: 1px solid var(--line); gap: 26px; }
.p-ledger .sec h3 { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--sub2); letter-spacing: .06em; display: flex; justify-content: space-between; align-items: baseline; }
.p-ledger .sec h3 .go-link { font-size: 13px; font-weight: 700; letter-spacing: 0; text-decoration: none; }
.p-ledger .sec .num { font-size: 34px; font-weight: 700; line-height: 1; }
.p-ledger .sec .num small { font-size: 14px; color: var(--sub2); font-weight: 400; margin-left: 4px; }
.p-ledger .sec .li { display: flex; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: none; border-top: 1px solid var(--line); font-size: 13px; }
.p-ledger .sec .li .no { font-weight: 700; color: var(--navy); width: 24px; flex-shrink: 0; }
.p-ledger .sec .li .nm { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-ledger .sec .li .s { color: var(--sub2); white-space: nowrap; }
.p-ledger .sec .empty { font-size: 13px; color: var(--sub2); padding: 2px 0; }
.p-ledger .pend-n { color: var(--orange); font-weight: 700; }
.p-ledger .sec-pms h3 { color: var(--orange); font-weight: 700; }
.done-btn { border: none; background: none; color: var(--navy); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 0 2px; }

.p-ledger .board { background: transparent; border-radius: 0; padding: 22px 28px 28px; gap: 10px; }
.p-ledger .week-nav { gap: 12px; }
.p-ledger .week-title { font-size: 20px; letter-spacing: .02em; }
.p-ledger .arrow { width: 28px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 26px; line-height: 1; color: var(--sub); text-decoration: none; }
.p-ledger .txt-link { font-size: 14px; color: var(--navy); text-underline-offset: 3px; }
.p-ledger .txt-link.is-current { color: var(--sub2); text-decoration: none; }
.p-ledger .btn { border-radius: 3px; }
.notice-line { min-height: 24px; font-size: 14px; color: var(--navy); font-weight: 500; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.notice-line.err { color: var(--err); font-weight: 700; }
.undo-btn { border: none; background: none; color: var(--navy); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 0; }

/* 台帳：罫線の表（マスの間に隙間を作らない） */
.p-ledger .lg { border-top: 1px solid var(--line2); }
.p-ledger .wk { gap: 0; grid-template-columns: 80px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.p-ledger .wk.head { border-bottom-color: var(--line2); }
.p-ledger .dh { flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 6px; padding: 10px 10px 8px; border-radius: 0; border-left: 1px solid var(--line); }
.p-ledger .dh .d { font-size: 15px; color: var(--ink); }
.p-ledger .dh.sat .w, .p-ledger .dh.sat .d { color: #2F5B8C; }
.p-ledger .dh.sun .w, .p-ledger .dh.sun .d { color: #A8401F; }
.p-ledger .dh.today { background: transparent; color: var(--navy); box-shadow: inset 0 -3px 0 var(--navy); }
.p-ledger .dh.today .d { color: var(--navy); }
.p-ledger .lab { height: 48px; padding-left: 2px; border-radius: 0; background: transparent; }
.p-ledger .lab b { font-size: 17px; }
.p-ledger .lab small { font-size: 11px; color: var(--sub2); }
.p-ledger .lab.off { background: transparent; }
.p-ledger .lab.off b { color: var(--sub2); font-weight: 500; }
.p-ledger .cell { height: 48px; border-radius: 0; border: none; border-left: 1px solid var(--line); position: relative; }
.p-ledger .cell.we { background: #FCFBF8; }
.p-ledger .cell.today { background: #F7F9FC; }
.p-ledger .cell.off { background: var(--gray); }
.p-ledger .cell.stop { background: repeating-linear-gradient(135deg, #F3E9E0 0 5px, #fff 5px 10px); border-color: var(--line); }
.p-ledger .cell.free { cursor: pointer; }
.p-ledger .cell.free:hover, .p-ledger .cell.free:focus-visible { background: var(--soft); outline: none; }
.p-ledger .cell.free:hover::after, .p-ledger .cell.free:focus-visible::after { content: '＋'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--navy); font-size: 16px; }
body.dragging .cell.free:hover::after { content: none; }
.p-ledger .cell.tgt-ok, .p-ledger .cell.tgt-ng { z-index: 2; --c: var(--navy); background: rgba(31,58,95,.10); box-shadow: inset 0 2px 0 var(--c), inset 0 -2px 0 var(--c); }
.p-ledger .cell.tgt-ng { --c: var(--err); background: rgba(180,35,24,.10); }
.p-ledger .cell.tgt-first { box-shadow: inset 0 2px 0 var(--c), inset 0 -2px 0 var(--c), inset 2px 0 0 var(--c); }
.p-ledger .cell.tgt-last { box-shadow: inset 0 2px 0 var(--c), inset 0 -2px 0 var(--c), inset -2px 0 0 var(--c); }
.p-ledger .cell.tgt-first.tgt-last { box-shadow: inset 0 0 0 2px var(--c); }

/* 予約の帯（押せる・つかめる） */
.p-ledger .bar { height: 40px; margin: 4px 3px; border-radius: 3px; border: none; border-left: 3px solid var(--navy); background: #D5DFEC; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-y; font-family: inherit; }
.p-ledger .bar small { color: #4B5D74; }
.p-ledger .bar.can { cursor: grab; }
.p-ledger .bar:hover { border-color: var(--navy); background: #C8D5E6; }
.p-ledger .bar.past { background: var(--gray); color: var(--sub2); border-left-color: var(--line2); cursor: pointer; }
.p-ledger .bar.cl { margin-left: 0; border-left-width: 0; }
.p-ledger .bar.cr { margin-right: 0; }
.p-ledger .bar .arr-r { margin-left: auto; }
.p-ledger .bar.pend-bar { background: #fff; color: var(--orange); border: 1px dashed var(--orange); border-left: 3px solid var(--orange); }
.p-ledger .bar.pend-bar small { color: var(--orange); }
.p-ledger .bar.lifting { opacity: .3; }
.pmsmark { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--orange); white-space: nowrap; }
.p-ledger .bar .pmsmark + .arr-r { margin-left: 6px; }
.p-ledger .bar.pms { border-left-color: var(--orange); }
@media (pointer: coarse) { .p-ledger .week-pick { background: transparent; padding: 0 4px; border-radius: 0; } .p-ledger .week-pick .pick-ico { display: none; } .p-ledger .week-pick span { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 6px; } }
.drag-ghost { position: fixed; z-index: 40; pointer-events: none; height: 40px; border-radius: 3px; padding: 0 12px; display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 13px; background: #fff; color: var(--ink); box-shadow: 0 3px 10px rgba(0,0,0,.12); border-left: 3px solid var(--navy); }
.drag-ghost.ng { border-left-color: var(--err); }
.drag-ghost .to { font-weight: 700; color: var(--navy); }
.drag-ghost.ng .to { color: var(--err); }
.drag-ghost small { color: var(--sub2); }

.p-ledger .rem { padding-top: 0; border-top: 1px solid var(--line2); border-bottom: none; }
.p-ledger .rem .t { font-size: 12px; color: var(--sub2); padding-left: 2px; }
.p-ledger .rem .t span { display: none; }
.p-ledger .rem .v { height: 40px; border-radius: 0; background: transparent; justify-content: flex-start; padding-left: 10px; font-size: 15px; border-left: 1px solid var(--line); }
.p-ledger .rem .v.full { background: transparent; color: var(--err); }
.p-ledger .legend-hint { font-size: 12px; color: var(--sub2); padding-top: 6px; }

/* ダイアログ（台帳） */
.p-ledger .dialog { border-radius: 4px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.p-ledger .dlg-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.p-ledger .row-box { border-radius: 0; background: transparent; border-bottom: 1px solid var(--line); padding: 10px 2px; }
.p-ledger .step-btn, .p-ledger .btn-lg, .p-ledger .field input, .p-ledger .field select, .p-ledger select.btn { border-radius: 3px; }
.p-ledger .desk-step { background: transparent; border-radius: 0; padding: 4px 0; }
.p-ledger .desk-step button { border-radius: 3px; }
.p-ledger .alert { border-radius: 0; border: none; border-left: 3px solid var(--err); }
.pms-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--orange); font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; }
.hist { font-size: 13px; color: var(--sub); border-top: 1px solid var(--line); padding-top: 8px; }
.hist summary { cursor: pointer; color: var(--navy); font-weight: 700; padding: 4px 0; }
.hist ol { list-style: none; margin: 6px 0 0; padding: 0; max-height: 180px; overflow: auto; }
.hist li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 0 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.hist li .w { grid-column: 2; font-size: 12px; color: var(--sub2); }
.hist li .t { color: var(--sub2); }
.hist li.empty { display: block; color: var(--sub2); }

/* PMS の書き直しの知らせ（どの画面でも） */
.pms-dlg { width: 460px; border-radius: 4px; }
.pms-dlg .dlg-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pms-list { margin: 0; padding: 0; list-style: none; }
.pms-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.pms-list .to { font-weight: 700; font-size: 18px; color: var(--navy); white-space: nowrap; }
.pms-text { margin: 0; font-size: 14px; line-height: 1.75; color: var(--sub); }
.pms-dlg .btn-lg { border-radius: 3px; }
.pms-later { font-weight: 400; color: var(--sub2); }

@media (max-width: 1179px) {
  .p-ledger .main { padding: 0; }
  .p-ledger .side { width: 210px; padding: 20px 14px 20px 16px; }
  .p-ledger .board { padding: 16px; }
  .p-ledger .wk { grid-template-columns: 64px repeat(7, minmax(0, 1fr)); }
  .p-ledger .dh { flex-direction: column; gap: 0; padding: 8px 6px 6px; }
  .p-ledger .bar { padding: 0 6px; gap: 4px; }
}
@media (max-width: 899px) {
  .p-ledger .m-ledger { flex-direction: column; }
  .p-ledger .side-sum { width: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 20px; border-right: none; border-bottom: 1px solid var(--line); padding: 14px 16px; }
  .p-ledger .side-sum .num { font-size: 24px; }
}
@media (pointer: coarse) {
  .p-ledger .bar:hover { background: #D5DFEC; }
  .done-btn, .undo-btn { min-height: 44px; }
}

/* 停まっている車は番号を変えない（2026-11-27） */
.p-ledger .ed-note { font-size: 13px; color: var(--sub); padding: 0 4px; text-align: right; }
.p-ledger #edSlot:disabled { opacity: .6; cursor: default; }

/* 名札に出る名字（2026-11-28） */
.np-line { font-size: 13px; color: var(--sub); margin-top: -4px; min-height: 18px; line-height: 1.5; }
.np-line b { color: var(--ink); font-size: 15px; }
.np-line .warn { display: block; color: #b4530a; }

/* 受付：今日に戻る（2026-11-29） */
.ds-today { flex: 0 0 auto; align-self: stretch; margin-left: 6px; padding: 0 14px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: none; color: var(--navy); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; white-space: nowrap; }
.ds-today:hover { color: var(--ink); }
.ds-today:disabled { color: var(--sub); font-weight: 400; text-decoration: none; cursor: default; }
