/* =============================================================
   スタッフ用画面（車両ステータス）の見た目
   スマホ1列（広い画面でも中央に1列）。
   ============================================================= */

.wrap { max-width: 440px; margin: 0 auto; }
.wrap[hidden] { display: none; }

/* ---- 読み込み中・お知らせ ---- */
.boot[hidden] { display: none; }
.boot { min-height: calc(100vh - 60px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--muted); font-weight: 700; }
.boot .login-btn { padding: 0 28px; }
.env:not(:empty) { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; vertical-align: 2px; }
.ts:empty { display: none; }
#store-pick { font: inherit; font-weight: 700; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.toast[hidden] { display: none; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--surface);
  font-size: 13px; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.app { display: flex; flex-direction: column; gap: 14px; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.top h1 { font-family: var(--f-display); font-weight: 900; font-size: 22px; margin: 0; letter-spacing: .02em; }
.date { font-family: var(--f-mono); color: var(--muted); font-size: 13px; }
.me { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--muted); }
.me b { color: var(--ink); }
.me .link { margin-left: auto; font-size: 13px; color: var(--muted); }

/* ---- ログイン ---- */
.login[hidden] { display: none; }
.login { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 22px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { margin: 0; font-family: var(--f-display); font-weight: 900; font-size: 15px; color: var(--muted); letter-spacing: .06em; }
.login-card h1 { font-family: var(--f-display); font-weight: 900; font-size: 26px; margin: -8px 0 0; }
.login-card form[hidden] { display: none; }
.login-btn { min-height: 50px; border: 0; border-radius: 999px; background: var(--ink); color: var(--surface); font-size: 16px; font-weight: 700; cursor: pointer; }
.login-sent { margin: 0; font-size: 14px; font-weight: 700; }
#l-code { font-family: var(--f-mono); font-size: 24px; letter-spacing: .3em; text-align: center; }
.login-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }

/* ---- 上部の集計：1段目 全車種｜未対応｜本日洗車、2段目 貸渡可｜貸渡中｜整備車検 ---- */
.summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.sum {
  grid-column: span 2; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 14px; text-align: left; cursor: pointer; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.sum span { font-size: 14px; font-weight: 700; line-height: 1.3; }
.sum b { font-family: var(--f-display); font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sum .unit { font-family: var(--f-body); font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.sum[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sum.all b, .sum.todo b { color: var(--crit); }
.sum.ready b { color: var(--ok); }
.sum.rent b, .sum.maint b { color: var(--muted); }
.sum.wash b { color: var(--accent); }

/* ---- 本日洗車リストを作る（開閉式の表） ---- */
.wash-make[hidden] { display: none; }
.wash-make { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.wm-h {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; width: 100%; text-align: left;
  background: none; border: 0; padding: 12px 14px; color: var(--ink); cursor: pointer;
}
.wm-t { font-family: var(--f-display); font-weight: 900; font-size: 16px; }
.wm-h .grp-i { margin-left: auto; }
.wm-who { flex-basis: 100%; font-size: 12px; font-weight: 700; color: var(--muted); }
.wm-b { border-top: 1px solid var(--line); padding: 4px 0 12px; display: flex; flex-direction: column; gap: 12px; }
.wm-scroll { overflow-x: auto; }
.wm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wm-table th { font-size: 11px; color: var(--muted); text-align: left; font-weight: 700; padding: 8px 6px; white-space: nowrap; }
.wm-table td { padding: 0 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.wm-table td label { display: block; padding: 10px 0; cursor: pointer; }
.wm-table td small { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.wm-table td:last-child { font-size: 12px; font-weight: 700; white-space: nowrap; }
.wm-table tr.on { background: var(--accent-soft); }
.wm-c { width: 1%; text-align: center; padding-left: 14px !important; }
.wm-ck { width: 24px; height: 24px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.wm-foot { padding: 0 14px; }
.wm-save { width: 100%; min-height: 46px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.wm-save:disabled { opacity: .35; cursor: not-allowed; }
.wc-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; max-height: 40vh; overflow-y: auto; }
.wc-new { margin-left: 8px; padding: 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.dlg p.wc-gone { color: var(--crit); font-weight: 700; }
.wm-log { padding: 0 14px; }
.wm-log h3 { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.wm-log ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.wm-time { font-family: var(--f-mono); color: var(--muted); margin-right: 8px; }

/* ---- 本日洗車の車（車種ごとの一覧とは別） ---- */
.wash[hidden] { display: none; }
.wash { display: flex; flex-direction: column; gap: 10px; }
.wash-h { display: flex; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--accent); padding: 6px 2px 8px; }
.wash-t { font-family: var(--f-display); font-weight: 900; font-size: 17px; color: var(--accent); }
.wash-h small { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---- 車種グループ ---- */
.list { display: flex; flex-direction: column; gap: 20px; }
.grp { display: flex; flex-direction: column; gap: 10px; }
.grp-b { display: flex; flex-direction: column; gap: 12px; }
.grp-h {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 2px solid var(--ink); padding: 6px 2px 8px; color: var(--ink); cursor: pointer;
}
.grp-n { font-family: var(--f-display); font-weight: 900; font-size: 17px; display: flex; align-items: baseline; gap: 8px; }
.grp-n small { font-family: var(--f-body); font-size: 13px; font-weight: 500; color: var(--muted); }
.grp-c { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; font-weight: 700; margin-left: auto; }
.g-todo { color: var(--crit); } .g-ready { color: var(--ok); } .g-rent, .g-maint { color: var(--muted); }
.grp-i { font-size: 11px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 24px; }

/* ---- 車の枠：状態は枠線の色、期限は背景色 ---- */
.car { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.car.todo  { border: 2px solid var(--crit); }
.car.ready { border: 2px solid var(--ok); }
.car.over  { border: 2px solid var(--over); }
.car.rent, .car.maint { border: 2px solid var(--idle); }
.car.legal-soon  { background: var(--soon-bg); }
.car.shaken-over { background: var(--shaken-bg); }
.car.moving { position: relative; z-index: 2; }

.head { display: flex; gap: 12px; align-items: center; }
.thumb { width: 104px; height: 78px; max-width: 30%; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--idle-soft); }
.htext { flex: 1; min-width: 0; }
.name { font-family: var(--f-display); font-weight: 700; font-size: 17px; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.cno-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cno { font-size: 20px; font-weight: 900; letter-spacing: .02em; }
.plate { font-size: 13px; color: var(--muted); margin-top: 2px; }
.num { font-family: var(--f-mono); font-weight: 600; color: var(--ink); }
.num.none { font-family: var(--f-body); font-weight: 500; color: var(--muted); }

/* 号車の横：車検・6ヶ月点検の残り日数（タップで車両情報） */
.info-link {
  font-size: 12px; font-weight: 700; line-height: 1.45; white-space: nowrap; color: var(--ink);
  background: none; border: 0; padding: 2px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.info-link.soon { color: var(--crit); }

/* 4つの作業ボタン：スマホで押しやすい縦長。4つ揃うまで押したものは赤系、揃ったら緑 */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.step {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 146px;
  padding: 10px 4px; line-height: 1.3; text-align: center; cursor: pointer;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 10px;
}
.step .l { font-weight: 700; font-size: 14px; }
.step .ck { font-size: 20px; font-weight: 700; line-height: 1; }
.step .t { font-size: 12px; font-family: var(--f-mono); }
.step.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.car.todo .step.done { background: var(--crit-soft); color: var(--crit); border-color: var(--crit); }
.car.ready .step { border-color: var(--ok); }
.step:disabled { cursor: not-allowed; background: var(--idle-soft); color: var(--idle); border-color: var(--line); }
@media (prefers-reduced-motion: no-preference) { .step { transition: background .15s, color .15s; } }

/* 枠の中のひとこと */
.msg { font-size: 14px; font-weight: 700; border-radius: 8px; padding: 9px 12px; }
.msg.ready { background: var(--ok-soft); color: var(--ok); }
.msg.over { background: var(--over-soft); color: var(--over); }
.msg.rent, .msg.maint { background: var(--idle-soft); color: var(--muted); }

/* 整備・車検中の詳細 */
.mbox { background: var(--idle-soft); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.mtype { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-weight: 900; font-size: 15px; }
.tag { font-family: var(--f-body); font-size: 11px; font-weight: 700; background: var(--muted); color: var(--surface); border-radius: 999px; padding: 1px 8px; letter-spacing: .04em; }
.mbox dl { margin: 0; display: grid; grid-template-columns: 5em 1fr; gap: 4px 8px; font-size: 14px; }
.mbox dt { color: var(--muted); }
.mbox dd { margin: 0; font-weight: 500; }
.mlink { align-self: flex-start; background: none; border: 0; padding: 8px 0; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* 下の段：1ヶ月点検ボタン ＋ 在庫車／貸渡中 */
.rentsw { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed var(--line); }
.m1-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 50px; padding: 4px 22px;
  border: 0; border-radius: 999px; background: var(--m1); color: var(--surface); line-height: 1.25; cursor: pointer;
}
.m1-btn.soon { background: var(--crit); }
.m1-t { font-size: 15px; font-weight: 900; }
.m1-d { font-size: 12px; font-weight: 700; opacity: .9; }
.m1-btn:disabled { color: var(--idle); background: var(--idle-soft); cursor: not-allowed; }
.rs-seg { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.rs-opt { font-size: 15px; font-weight: 700; border: 0; border-radius: 999px; padding: 10px 16px; min-height: 44px; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.rs-opt[aria-pressed="true"] { cursor: default; }
.rs-opt.off[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.rs-opt.on[aria-pressed="true"] { background: var(--muted); color: var(--surface); }

/* ---- 貸渡・整備のポップアップ ---- */
.dfield { display: flex; flex-direction: column; gap: 4px; }
.drow { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.fields .drow label { flex-direction: row; align-items: center; }
.dlg .m-switch { font-size: 12px; font-weight: 500; padding: 0; border: 0; border-radius: 0; background: none; color: var(--accent); text-decoration: underline; }
.dlg .done-link { padding: 6px; border: 0; background: none; color: var(--accent); text-decoration: underline; }

/* ---- チェックリストのポップアップ ---- */
.cl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cl-prog { font-family: var(--f-display); font-weight: 900; font-size: 18px; font-variant-numeric: tabular-nums; color: var(--crit); }
.cl-prog.all { color: var(--ok); }
.cl-list { display: flex; flex-direction: column; gap: 6px; margin: 0 -4px; padding: 0 4px; }
.cl-row { flex-shrink: 0; display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; min-height: 52px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.cl-row:has(input:checked) { background: var(--ok-soft); border-color: var(--ok); }
.cl-row:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.cl-row:has(input[data-auto]), .cl-row input[data-auto] { cursor: default; }
.cl-row > input { width: 24px; height: 24px; flex-shrink: 0; margin: 2px 0 0; accent-color: var(--ok); cursor: pointer; }
.cl-row b { display: block; font-size: 15px; line-height: 1.4; }
.cl-row small { display: block; font-size: 12px; color: var(--muted); line-height: 1.5; }
.pt { display: inline-block; font-size: 11px; font-weight: 700; color: var(--surface); background: var(--muted); border-radius: 4px; padding: 1px 6px; margin-right: 6px; vertical-align: 2px; }
.opt { display: inline-block; font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-left: 6px; vertical-align: 2px; }
.num-in { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 700; }
.num-in input { font: inherit; font-size: 16px; width: 9em; padding: 6px 8px; border: 1px solid var(--ink); border-radius: 8px; background: var(--surface); color: var(--ink); }
.dlg .cl-done { font-weight: 700; color: var(--ok); font-size: 14px; }

/* 写真：撮影場所ごとの枠 */
.ph { flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; margin-top: 4px; padding: 12px; border: 1px dashed var(--muted); border-radius: 10px; }
.ph-h { font-weight: 700; font-size: 14px; }
.ph-h span { color: var(--crit); margin-left: 6px; }
.ph-h span.ok { color: var(--ok); }
.ph-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ph-item { position: relative; aspect-ratio: 4/3; }
.ph-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.ph-item.busy img { opacity: .45; } /* 送信中 */
.ph-lb { position: absolute; left: 4px; bottom: 4px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .6); border-radius: 4px; padding: 1px 6px; line-height: 1.4; }
.ph-by { display: block; font-weight: 500; font-size: 10px; } /* 撮った人 */
.dlg .ph-del { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 16px; line-height: 28px; }
.ph-add { aspect-ratio: 4/3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; background: var(--surface); border: 2px dashed var(--line); border-radius: 8px; }
.ph-add span { font-size: 24px; line-height: 1; }
.ph-add.req { border-color: var(--crit); color: var(--crit); background: var(--crit-soft); font-size: 13px; }

/* ---- 車両情報のポップアップ ---- */
.info-body { display: flex; flex-direction: column; gap: 16px; }
.info-photo { width: 100%; border-radius: 10px; aspect-ratio: 4/3; object-fit: cover; }

/* ---- チェックした人の名前（チェック項目の横） ---- */
.cl-by:not(:empty) { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 11px; font-weight: 700; vertical-align: 1px; }
