:root {
  --navy: #082956;
  --navy-d: #04182F;
  --orange: #F97A14;
  --orange-d: #D9660A;
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --ok: #16a34a;
  --warn: #dc2626;
  --plan: #2563eb;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
  font-size: 16px;
}
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* ---- generic ---- */
button { font: inherit; cursor: pointer; }
.btn {
  background: var(--navy); color: #fff; border: 0; border-radius: 10px;
  padding: 12px 16px; font-weight: 600; width: 100%;
}
.btn:active { background: var(--navy-d); }
.btn.sec { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.ghost { background: transparent; color: var(--muted); border: 0; width: auto; padding: 8px; }
.btn.danger { background: var(--warn); }
.btn.sm { width: auto; padding: 8px 12px; font-size: 14px; border-radius: 8px; }
input, textarea, select {
  font: inherit; width: 100%; padding: 12px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--navy); }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; font-weight: 600; }
.field { margin-bottom: 4px; }

/* ---- centered auth screens ---- */
.center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 28px 22px; width: 100%; max-width: 380px;
}
.brand { text-align: center; margin-bottom: 18px; }
.brand .logo { font-size: 30px; }
.brand h1 { font-size: 20px; margin: 6px 0 2px; }
.brand p { color: var(--muted); font-size: 13px; margin: 0; }
.err { color: var(--warn); font-size: 13px; margin-top: 10px; min-height: 18px; text-align: center; }

/* member pick */
.member-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.member-tile {
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 16px 10px; text-align: center; font-weight: 600;
}
.member-tile .av {
  width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; margin: 0 auto 8px;
}
.member-tile.admin .av { background: #b45309; }
.member-tile .tag { font-size: 11px; color: #b45309; display: block; }

/* ---- header + nav ---- */
header {
  background: var(--navy); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
header .who { font-weight: 700; font-size: 15px; }
header .who small { font-weight: 400; opacity: .85; display: block; font-size: 11px; }
header .hbtn { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 8px; padding: 8px 10px; font-size: 13px; }

main { flex: 1; padding: 14px 14px 90px; }

nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 720px; margin: 0 auto;
  background: #fff; border-top: 1px solid var(--line); display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs button {
  flex: 1; background: none; border: 0; padding: 10px 4px; color: var(--muted);
  font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
nav.tabs button .ic { font-size: 20px; }
nav.tabs button.active { color: var(--navy); font-weight: 700; }

/* ---- calendar ---- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { font-size: 18px; margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.cal-dow.sun { color: #dc2626; } .cal-dow.sat { color: #2563eb; }
.cal-cell {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; min-height: 56px;
  padding: 4px; position: relative; text-align: left; color: var(--ink);
}
.cal-cell.empty { background: transparent; border: 0; }
.cal-cell.today { border-color: var(--orange); border-width: 2px; }
.cal-cell .d { font-size: 13px; font-weight: 600; }
.cal-cell.sun .d { color: #dc2626; } .cal-cell.sat .d { color: #2563eb; }
.cal-cell .cnt {
  position: absolute; bottom: 4px; right: 4px; background: var(--navy); color: #fff;
  border-radius: 10px; font-size: 11px; padding: 1px 6px; font-weight: 700;
}
.cal-cell .dots { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 2px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--plan); }
.dot.done { background: var(--ok); } .dot.cancel { background: var(--warn); }

/* ---- cards / lists ---- */
.card { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; }
.job-card { border-left: 4px solid var(--plan); }
.job-card.done { border-left-color: var(--ok); }
.job-card.cancel { border-left-color: var(--warn); opacity: .75; }
.job-card h3 { margin: 0 0 4px; font-size: 16px; }
.job-card .meta { font-size: 13px; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge.plan { background: #dbeafe; color: var(--plan); }
.badge.done { background: #dcfce7; color: var(--ok); }
.badge.cancel { background: #fee2e2; color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { background: #f1f5f9; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.section-title { font-size: 13px; color: var(--muted); font-weight: 700; margin: 16px 0 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.empty-note { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }

/* ---- chat ---- */
.chat-wrap { display: flex; flex-direction: column; }
.msg { margin-bottom: 12px; max-width: 84%; }
.msg.me { margin-left: auto; }
.msg .bubble { background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.msg.me .bubble { background: #d1fae5; }
.msg .name { font-size: 12px; color: var(--muted); margin-bottom: 2px; font-weight: 600; }
.msg.me .name { text-align: right; }
.msg .time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.msg .att { margin-top: 6px; }
.msg .att img { max-width: 100%; border-radius: 8px; display: block; }
.msg .att a { font-size: 13px; color: var(--navy); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; padding: 6px 0; }
.composer {
  position: fixed; bottom: 56px; left: 0; right: 0; max-width: 720px; margin: 0 auto;
  background: #fff; border-top: 1px solid var(--line); padding: 8px;
  display: flex; gap: 8px; align-items: flex-end; padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.composer textarea { resize: none; max-height: 100px; min-height: 42px; border-radius: 18px; padding: 10px 14px; }
.composer .iconbtn {
  background: #f1f5f9; border: 0; border-radius: 50%; width: 42px; height: 42px; font-size: 20px; flex: 0 0 auto;
}
.composer .send { background: var(--navy); color: #fff; }
.attach-preview { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 8px 6px; }
.attach-preview .pv { font-size: 12px; background: #e2e8f0; border-radius: 6px; padding: 4px 8px; }

/* ---- modal ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal {
  background: #fff; border-radius: 16px 16px 0 0; width: 100%; max-width: 720px;
  padding: 18px; max-height: 92vh; overflow-y: auto;
}
@media (min-width: 600px) { .modal-bg { align-items: center; } .modal { border-radius: 16px; max-width: 480px; } }
.modal h2 { margin: 0 0 10px; font-size: 18px; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.pin-input { letter-spacing: 8px; text-align: center; font-size: 22px; }
.muted { color: var(--muted); font-size: 13px; }
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.spin { text-align: center; color: var(--muted); padding: 24px; }

/* ===== v2 additions ===== */
/* sub tabs */
.subtabs { display: flex; gap: 6px; margin-bottom: 12px; }
.subtabs button { flex: 1; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 8px; color: var(--muted); font-weight: 600; }
.subtabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* checklist */
.check-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-item input { width: 22px; height: 22px; flex: 0 0 auto; }
.check-item.done label { text-decoration: line-through; color: var(--muted); }
.check-item label { margin: 0; font-weight: 400; color: var(--ink); font-size: 15px; }

/* site cards */
.site-card { border-left: 4px solid var(--navy); }
.site-card .cust { font-size: 13px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 4px 10px; font-size: 14px; margin-top: 6px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* shift grid */
.shift-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
table.shift { border-collapse: collapse; font-size: 13px; min-width: 100%; }
table.shift th, table.shift td { border: 1px solid var(--line); text-align: center; padding: 0; }
table.shift thead th { background: #f8fafc; padding: 4px 6px; white-space: nowrap; position: sticky; top: 0; }
table.shift th.namecol, table.shift td.namecol {
  position: sticky; left: 0; background: #fff; z-index: 2; text-align: left; padding: 6px 8px;
  white-space: nowrap; font-weight: 600; min-width: 84px; box-shadow: 1px 0 0 var(--line);
}
table.shift thead th.namecol { z-index: 3; background: #f8fafc; }
table.shift th.sun, table.shift td.sun { background: #fef2f2; } table.shift th.sat, table.shift td.sat { background: #eff6ff; }
.scell { width: 34px; height: 40px; display: flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; }
.scell.work { color: var(--ok); } .scell.off { color: var(--warn); } .scell.paid { color: var(--plan); }
.shift-legend { display: flex; gap: 12px; margin: 10px 2px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.shift-legend b { font-weight: 700; }

/* dm list */
.dm-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.dm-item .av { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }
.dm-item.admin .av { background: #b45309; }
.dm-item .info { flex: 1; min-width: 0; }
.dm-item .info .nm { font-weight: 600; }
.dm-item .info .pv { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkbtn { color: var(--navy); background: none; border: 0; padding: 0; font-weight: 600; }

/* ===== v3: sheet-sync tags ===== */
.chip.checkin, .badge.checkin { background: #fef3c7; color: #b45309; font-weight: 700; }
.chip.auto { background: #e0f2fe; color: #0369a1; }

/* ===== v4: capacity + linen chips ===== */
.chip.cap { background: #ecfccb; color: #4d7c0f; font-weight: 700; }
.chip.linen { background: #eef2ff; color: #3730a3; }
.chip.linen b { color: #1e1b4b; }

/* ===== v5: linen prep table (施設×6種) ===== */
.lp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 8px; }
table.lp { border-collapse: collapse; width: 100%; font-size: 13px; }
table.lp th, table.lp td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.lp thead th { position: sticky; top: 0; background: #f1f5f9; color: var(--muted); font-size: 11px; font-weight: 700; }
table.lp th.fac { position: sticky; left: 0; background: #fff; text-align: left; font-weight: 600; box-shadow: 1px 0 0 var(--line); max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
table.lp thead th.fac { z-index: 2; background: #f1f5f9; }
table.lp tbody tr:nth-child(even) td { background: #fafcfd; }
table.lp tbody tr:nth-child(even) th.fac { background: #fafcfd; }
table.lp td.none { color: #cbd5e1; }
table.lp .lp-key { font-size: 11px; }
table.lp tfoot th, table.lp tfoot td { font-weight: 700; border-top: 2px solid var(--navy); background: #ecfeff; color: var(--navy-d); }
table.lp tfoot th.fac { background: #ecfeff; }

/* ===== 復元(2026-07-19): 今日追加した機能のCSS ===== */
/* 現場フォーム: リネン入力 */
.linen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-bottom: 12px; }
.lin-row { display: flex; align-items: center; gap: 6px; }
.lin-row span { flex: 1; font-size: 12px; color: var(--muted); }
.lin-row input { width: 68px; text-align: center; }
/* 定員・リネン まとめて入力 */
.lb-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 8px; }
.lb-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12px; }
.lb-table th, .lb-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lb-table thead th { background: var(--bg); color: var(--muted); font-weight: 700; font-size: 11px; position: sticky; top: 0; z-index: 2; }
.lb-table th.lb-name { position: sticky; left: 0; z-index: 3; background: var(--card); text-align: left; font-weight: 700; color: var(--ink); max-width: 120px; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--line); }
.lb-table thead th.lb-name { z-index: 4; background: var(--bg); }
.lb-table tbody tr:last-child th, .lb-table tbody tr:last-child td { border-bottom: none; }
.lb-in { width: 54px; text-align: center; padding: 6px 4px; font-size: 14px; border: 1.5px solid var(--line); border-radius: 6px; }
.lb-in:focus { border-color: var(--navy); outline: none; }
.chip.lb-tab { cursor: pointer; border: 1.5px solid var(--line); background: var(--card); }
.chip.lb-tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
/* 契約終了フロー */
.btn.danger { background: var(--warn); color: #fff; }
.btn.danger:active { background: #b91c1c; }
/* 配送プラン */
.dlv-nav { display: flex; align-items: center; gap: 6px; }
.dlv-nav input[type=date] { width: auto; padding: 6px 8px; font-size: 13px; border: 1.5px solid var(--line); border-radius: 8px; }
.dlv-sum { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--ok); border-radius: 12px; padding: 12px 14px; margin: 10px 0; box-shadow: var(--shadow); }
.dlv-sum.ng { border-left-color: var(--warn); }
.dlv-sum-main { font-size: 15px; }
.dlv-sum-main b { font-size: 22px; color: var(--navy); }
.dlv-sum-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dlv-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.dlv-stop { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 6px; }
.dlv-info { flex: 1; min-width: 0; }
.dlv-name { font-size: 14px; font-weight: 700; }
.dlv-sel { flex: 0 0 auto; width: auto; max-width: 42%; padding: 7px 6px; font-size: 12px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }

/* ===== v14: 清掃完了/チェック完了 の2フラグ表示 ===== */
/* 対応施設カードの背景色（状態ごとに変化） */
.job-card.st-clean { border-left-color: var(--plan); background: #eff6ff; }
.job-card.st-check { border-left-color: var(--ok); background: #f0fdf4; }
.statecell { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
/* バッジ配色 */
.badge.pending { background: #e2e8f0; color: #475569; }
.badge.clean { background: #dbeafe; color: #1d4ed8; }
/* カレンダーのドット: 未対応=グレー / 清掃=青 / チェック=緑 */
.dot { background: #cbd5e1; }
.dot.clean { background: var(--plan); }

/* ===== v15: 対応施設カードの完了ボタン行 ===== */
.card-acts { display: flex; gap: 8px; margin-top: 10px; }
.card-acts .btn.sm { flex: 1; }

/* ===== v16: 全完了の日は薄緑 / 日次リストのグループ見出し ===== */
.cal-cell.alldone { background: #dcfce7; }
.cal-cell.alldone.today { background: #dcfce7; }
.section-title.daygrp { font-size: 14px; color: var(--ink); margin: 18px 2px 8px; padding-bottom: 5px; border-bottom: 2px solid var(--line); }
.section-title.daygrp:first-of-type { margin-top: 8px; }

/* ===== v17: 配送ルート表示 ===== */
.rt-card .rt-list { list-style: none; margin: 4px 0 0; padding: 0; }
.rt-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.rt-item:first-child { border-top: 0; }
.rt-no { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.rt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rt-body .meta { font-size: 12px; }
.rt-at { text-align: right; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rt-at .meta { font-weight: 400; }
.rt-nav { text-decoration: none; font-size: 18px; flex: 0 0 auto; }
.rt-total { margin-top: 8px; font-weight: 700; font-size: 14px; }

/* ===== v18: 配送ルートのモードタグ ===== */
.rt-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.rt-tag.early { background: #fef3c7; color: #b45309; }
.rt-tag.both { background: #dbeafe; color: #1d4ed8; }
.rt-tag.pickup { background: #e2e8f0; color: #475569; }

/* ===== v20: 配送ルートの手動並べ替えボタン ===== */
.rt-move { display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; }
.rt-move button { background: #f1f5f9; border: 1px solid var(--line); border-radius: 5px; width: 28px; height: 20px; font-size: 10px; line-height: 1; color: var(--navy); padding: 0; cursor: pointer; }
.rt-move button:active { background: #e2e8f0; }
.rt-move button:disabled { opacity: .3; }

/* ===== v21: 直近3日カード / 担当・チェック一覧 ===== */
.up-card { cursor: pointer; border-left: 4px solid var(--orange); margin-top: 14px; }
.up-card:active { background: #f8fafc; }
.up-days { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.up-day { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--line); }
.up-day:first-child { border-top: 0; }
.up-d { flex: 1; }
.up-n { font-variant-numeric: tabular-nums; font-weight: 600; }
.up-p { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 58px; text-align: right; }
.up-row { padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.up-row:last-child { border-bottom: 0; }
.up-row:active { background: #f8fafc; }
.up-rn { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }

/* ===== v22: 直近3日=独立カード / 担当者の手入力 ===== */
.up-card.alldone { background: #f0fdf4; border-left-color: var(--ok); }
.wk-grid { display: flex; gap: 10px; }
.wk-grid label { flex: 1; margin: 0 0 8px; }
.wk-grid input { margin-top: 4px; }
@media (max-width: 420px) { .wk-grid { flex-direction: column; gap: 0; } }

/* ===== v23: 日次カードの担当者行 ===== */
.job-card .wk-line { margin-top: 2px; }
.job-card .wk-line b { color: var(--ink); }

/* ===== v24: 直近3日一覧で担当者を直接入力 ===== */
.up-row .up-rn { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wk-inline { display: flex; gap: 8px; margin-top: 6px; }
.wk-inline label { flex: 1; margin: 0; font-size: 11px; color: var(--muted); font-weight: 600; }
.wk-inline input { margin-top: 3px; padding: 8px 10px; font-size: 14px; }
.wk-in.saved { border-color: var(--ok); background: #f0fdf4; }
.wk-in.err { border-color: var(--warn); background: #fef2f2; }
@media (max-width: 430px) { .wk-inline { flex-direction: column; gap: 6px; } }

/* ===== v25: 日次カードの担当チップ（清掃/最終チェック担当） ===== */
.chip.wk-clean { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.chip.wk-check { background: #dcfce7; color: #15803d; font-weight: 600; }

/* ===== v26: 担当者まとめ保存バー ===== */
.wk-savebar { position: sticky; bottom: 0; background: #fff; padding: 10px 0 4px; margin-top: 12px; border-top: 1px solid var(--line); }

/* ===== v29: カレンダーの共有予定 ===== */
.cal-ev { display: block; font-size: 9px; line-height: 1.25; color: var(--orange-d); background: #fff7ed;
  border-radius: 3px; padding: 1px 3px; margin-top: 2px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ev-row { padding: 8px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ev-row:last-child { border-bottom: 0; }
.ev-row:active { background: #fff7ed; }
.ev-main { display: flex; align-items: baseline; gap: 8px; }
.ev-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--orange-d); font-size: 13px; flex: 0 0 auto; }
.ev-time.allday { color: var(--muted); font-weight: 600; font-size: 12px; }
.ev-title { font-weight: 600; }
.ev-by { font-size: 11px; }

/* ===== v30: カレンダーのマスは予定の有無でサイズが変わらない ===== */
/* 高さを固定し、予定ラベルは絶対配置でレイアウトに影響させない */
.cal-cell { height: 56px; min-height: 0; overflow: hidden; }
.cal-ev {
  position: absolute; left: 3px; right: 3px; top: 19px; margin-top: 0;
  max-width: none; display: block;
}

/* ===== v31: 日付=左上固定 / 予定タイトル=中央（重なり解消） ===== */
.cal-cell .d { position: absolute; top: 3px; left: 5px; line-height: 1; }
.cal-ev {
  position: absolute; left: 3px; right: 3px; top: 50%; transform: translateY(-50%);
  margin: 0; text-align: center;
}

/* ===== v32: 言語切替セレクタ ===== */
.lang-sel { font: inherit; font-size: 12px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); max-width: 130px; }
header .lang-sel { border-color: rgba(255,255,255,.5); }

/* ===== v34: ヘッダーのログアウトを1行に（言語セレクタ追加で窮屈になった対策） ===== */
header .hbtn { white-space: nowrap; flex: 0 0 auto; }
header .who { min-width: 0; flex: 1; }
header .who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header .lang-sel { max-width: 96px; }


/* ===== v36: 勤怠・報酬 ===== */
.punch-card { border-left: 4px solid var(--navy); }
.punch-status { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.punch-status.notyet { background: #e2e8f0; color: #475569; }
.punch-status.working { background: #dbeafe; color: #1d4ed8; }
.punch-status.done { background: #dcfce7; color: #15803d; }
.punch-btns { display: flex; gap: 8px; margin: 10px 0 8px; }
.punch-btns .btn { flex: 1; }
.punch-sum { font-size: 13px; }
.att-table { font-size: 13px; }
.att-hd, .att-rw { display: grid; grid-template-columns: 1.4fr 0.8fr 1fr 1fr; gap: 6px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.att-hd { font-size: 11px; color: var(--muted); font-weight: 700; }
.att-rw { cursor: pointer; } .att-rw:active { background: #f8fafc; }
.att-rw .an { font-weight: 600; }
.att-rw:last-child { border-bottom: 0; }
.att-drw { border-bottom: 1px solid var(--line); padding: 8px 0; }
.att-edit { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-top: 4px; }
.att-edit label { font-size: 11px; color: var(--muted); margin: 0; }
.att-edit input { padding: 6px 8px; }

/* ===== v39: 現場検索・エリア絞り込み ===== */
.site-search { display: flex; gap: 8px; margin-top: 12px; }
.site-q { flex: 1; min-width: 0; padding: 10px 12px; font-size: 15px; }
.site-area { flex: 0 0 auto; max-width: 40%; padding: 10px 8px; font-size: 14px; }
.site-count { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 14px; }

/* ===== v40: 経費（レシート手入力・月次集計） ===== */
.exp-monthbar { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.exp-ym { flex: 1; padding: 8px 10px; font-size: 15px; text-align: center; }
.exp-total { text-align: center; padding: 16px; }
.exp-total-lbl { font-size: 13px; color: var(--muted); }
.exp-total-amt { font-size: 30px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; margin: 2px 0; }
.exp-total-cnt { font-size: 12px; color: var(--muted); }
.exp-bars { display: flex; flex-direction: column; gap: 8px; }
.exp-bar-row { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 8px; font-size: 12.5px; }
.exp-bar-name { display: flex; align-items: center; gap: 5px; color: var(--ink); }
.exp-bar-name i { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.exp-bar-track { background: var(--bg); border-radius: 999px; height: 9px; overflow: hidden; }
.exp-bar-fill { display: block; height: 100%; border-radius: 999px; }
.exp-bar-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.exp-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; cursor: pointer; }
.exp-item:active { background: #f8fafc; }
.exp-item-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.exp-cat { color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.exp-item-payee { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-cam { font-size: 13px; }
.exp-item-sub { grid-column: 1; font-size: 12px; color: var(--muted); }
.exp-item-amt { grid-column: 2; grid-row: 1 / span 2; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.exp-viewimg { display: inline-block; margin: 4px 0 8px; color: var(--navy); font-size: 13px; font-weight: 600; }

/* ===== v42: 直近3日 担当一覧テーブル ===== */
.up-sec { margin-top: 16px; }
.up-sec-hd { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 14px; }
.up-sec.alldone .up-sec-hd { color: #15803d; }
.up-tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
.up-tbl { border-collapse: collapse; width: 100%; min-width: 540px; font-size: 12.5px; }
.up-tbl th { background: var(--panel); color: var(--muted); font-weight: 700; padding: 8px 6px; border-bottom: 2px solid var(--line); white-space: nowrap; text-align: left; }
.up-tbl td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.up-tbl tbody tr:last-child td { border-bottom: none; }
.up-tbl .c-site { position: sticky; left: 0; background: var(--card); min-width: 118px; max-width: 150px; z-index: 1; }
.up-tbl th.c-site { z-index: 2; }
.up-site { font-weight: 700; text-align: left; font-size: 13px; line-height: 1.3; padding: 0; }
.up-badges { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 3px; }
.up-tbl .wk-in { width: 100%; min-width: 82px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; background: var(--card); color: var(--ink); }
.up-tbl .wk-in.saved { border-color: #22a06b; background: #f0fdf4; }
.up-tbl .wk-in.err { border-color: #dc2626; background: #fef2f2; }
.up-empty { color: var(--muted); text-align: center; padding: 14px; }
.chip.checkin.sm { font-size: 10px; padding: 1px 5px; margin-left: 4px; }

/* ===== v43: 直近3日 ブロック→表＋施設ブロック入力 ===== */
.mut { color: var(--muted); }
.up-cellv { font-size: 12.5px; white-space: nowrap; }
.up-blk { border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; overflow: hidden; }
.up-blk-hd { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--panel); border: none; padding: 11px 14px; font-size: 14px; text-align: left; cursor: pointer; color: var(--ink); }
.up-blk-hd:active { background: #eef2f7; }
.up-blk-nm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.up-blk-ar { transition: transform .15s; color: var(--muted); flex: 0 0 auto; }
.up-blk-hd.open .up-blk-ar { transform: rotate(180deg); }
.up-blk-body { padding: 10px 14px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.up-blk-body label { font-size: 11px; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 3px; margin: 0; }
.up-blk-body .wk-in { padding: 8px 10px; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); width: 100%; }
.up-blk-body .wk-in.saved { border-color: var(--ok); background: #f0fdf4; }
.up-blk-body .wk-in.err { border-color: var(--warn); background: #fef2f2; }
.up-blk-body .up-open { grid-column: 1 / -1; justify-self: start; font-size: 12px; }
@media (max-width: 430px) { .up-blk-body { grid-template-columns: 1fr; } }

/* ===== v44: 配送 2台対応（車両バー・トグル・A⇄B） ===== */
.dlv-carbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 2px; }
.dlv-carbar .dlv-dep { margin: 0; font-size: 13px; color: var(--muted); }
.dlv-carbar .dlv-dep input { width: auto; display: inline-block; padding: 6px 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: var(--card); color: var(--ink); padding: 7px 12px; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--navy); color: #fff; font-weight: 700; }
.rt-swap { border: 1px solid var(--line); background: var(--panel); color: var(--navy); border-radius: 6px; font-size: 11px; font-weight: 700; padding: 3px 6px; cursor: pointer; white-space: nowrap; }
.rt-swap:active { background: #e2e8f0; }

/* ===== v45: 名前+PIN ログインフォーム ===== */
.login-form { display: flex; flex-direction: column; gap: 4px; text-align: left; margin-top: 6px; }
.login-form .lf-lb { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 8px; }
.login-form .lf-in { width: 100%; padding: 12px 14px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.login-form .pin-input { letter-spacing: 4px; }
.login-form .err { min-height: 16px; }
