* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  margin: 0; background: #f2f5f8; color: #1a2733;
  font-family: "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif;
  padding-bottom: 70px;
}
header.mbar {
  position: sticky; top: 0; z-index: 1000;
  background: #0f6cbd; color: #fff; display: flex; align-items: center;
  padding: 0 12px; height: 50px; gap: 10px;
}
header.mbar .title { font-weight: bold; font-size: 17px; flex: 1; }
header.mbar a { color: #fff; text-decoration: none; font-size: 15px; padding: 6px; }
main { padding: 12px; max-width: 760px; margin: 0 auto; }
.notice {
  background: #fff7df; border: 1px solid #e8c96a; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 14px;
}
.notice b { color: #8a6100; }
.notice.slim {
  padding: 5px 10px; font-size: 12px; margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card { background: #fff; border: 1px solid #dbe3ea; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.flash { background: #e6f4e6; border: 1px solid #7bbf7b; color: #205020; padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; }
.error { background: #fdecec; border: 1px solid #e08a8a; color: #8a2020; padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: #0f6cbd; color: #fff; border: none; border-radius: 8px;
  padding: 12px 16px; font-size: 15px; cursor: pointer; text-decoration: none;
}
.btn.secondary { background: #64707c; }
.btn.danger { background: #c43b3b; }
.btn.green { background: #1d8a3c; }
.btn.orange { background: #e07f00; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.block { display: flex; width: 100%; margin-bottom: 10px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.btn-grid .btn { width: 100%; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  border: 1px solid #b8c4cf; border-radius: 8px; padding: 11px 12px; font-size: 16px;
  font-family: inherit; width: 100%; background: #fff;
}
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-weight: bold; margin-bottom: 4px; font-size: 14px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; }
.badge.gray { background: #e3e8ed; color: #444; }
.badge.blue { background: #d7e9fb; color: #0c5aa0; }
.badge.green { background: #dcf2dc; color: #1d6b1d; }
.badge.red { background: #fbdddd; color: #a02020; }
.badge.orange { background: #ffe8cc; color: #a05a00; }
.muted { color: #7b8794; font-size: 13px; }

/* 配送先リスト */
.dl-row {
  background: #fff; border: 1px solid #dbe3ea; border-radius: 10px;
  margin-bottom: 8px; display: flex; align-items: stretch; overflow: hidden;
}
.dl-row.done { opacity: .55; }
.dl-row.cancel { opacity: .55; background: #f0f0f0; }
.dl-row .updown { display: flex; flex-direction: column; border-right: 1px solid #eef2f6; }
.dl-row .updown button {
  flex: 1; border: none; background: #f7fafc; width: 44px; font-size: 16px; color: #0f6cbd; cursor: pointer;
}
.dl-row .updown button:first-child { border-bottom: 1px solid #eef2f6; }
.dl-row .info { flex: 1; padding: 9px 12px; text-decoration: none; color: #1a2733; min-width: 0; }
.dl-row .info .nm { font-weight: bold; font-size: 15px; }
.dl-row .info .ad { font-size: 13px; color: #5a6772; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-row .seq-badge {
  display: inline-block; min-width: 22px; text-align: center; background: #0f6cbd; color: #fff;
  border-radius: 11px; font-size: 12px; padding: 2px 6px; margin-right: 6px;
}
.dl-row .time-tag { color: #a05a00; background: #ffe8cc; border-radius: 6px; padding: 1px 6px; font-size: 12px; font-weight: bold; }

/* TOP画面の大きい行と行内ボタン */
.dl-row.big .info { padding: 12px 10px 10px; }
.dl-row.big .nm { font-size: 17px; }
.dl-row.big .ad { font-size: 14px; }
.dl-row.big .updown button { width: 44px; font-size: 18px; }
.dl-row .rowlink { display: block; text-decoration: none; color: #1a2733; }
.rowbtns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rowbtns .btn { padding: 8px 14px; font-size: 14px; }
/* 右側の大きい操作ボタン(ナビ・完了) */
.rowside {
  display: flex; flex-direction: column; gap: 8px; justify-content: center;
  padding: 10px 8px; border-left: 1px solid #eef2f6; min-width: 86px;
}
.rowside .btn { padding: 12px 10px; font-size: 15px; font-weight: bold; }

/* メニューの重ね画面 */
#menuOverlay {
  position: fixed; inset: 0 0 60px 0; background: rgba(0,0,0,.35); z-index: 1500;
}
.menu-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 2px solid #0f6cbd; border-radius: 14px 14px 0 0;
  padding: 6px 0; box-shadow: 0 -4px 16px rgba(0,0,0,.25);
}
.menu-item {
  display: block; padding: 14px 20px; font-size: 16px; color: #1a2733;
  text-decoration: none; border-bottom: 1px solid #eef2f6; cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }
.menu-item.office { padding-left: 44px; background: #f5f9fd; font-size: 15px; }

/* 下部メニュー */
nav.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: #fff; border-top: 1px solid #dbe3ea; display: flex; height: 60px;
}
nav.bottom a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: #5a6772; font-size: 11px; gap: 2px;
}
nav.bottom a .ic { font-size: 20px; line-height: 1; }
nav.bottom a.active { color: #0f6cbd; font-weight: bold; }

/* 地図 */
#map { width: 100%; height: calc(100vh - 175px); min-height: 300px; border-radius: 10px; border: 1px solid #dbe3ea; }
.num-marker {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
  color: #fff; font-weight: bold; font-size: 13px;
}
.num-marker > span { transform: rotate(45deg); }
.num-marker.m-red { background: #d63031; }
.num-marker.m-blue { background: #0f6cbd; }
.num-marker.m-green { background: #1d8a3c; }
.num-marker.m-orange { background: #e07f00; }
.num-marker.m-gray { background: #8a949e; }

/* 地図のマーカー名前ラベル */
.mk-label {
  background: rgba(255,255,255,.92) !important;
  border: 1px solid #b8c4cf !important;
  border-radius: 6px !important;
  padding: 1px 5px !important;
  font-size: 11px !important;
  font-weight: bold;
  color: #1a2733 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.25) !important;
  white-space: nowrap;
}
.mk-label::before { display: none !important; }

/* 左側の折りたたみ式リストパネル(配送順画面) */
#mapWrap { display: flex; align-items: stretch; }
.panel-strip {
  width: 38px; background: #0f6cbd; color: #fff; border-radius: 10px 0 0 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer; user-select: none; font-weight: bold; font-size: 14px;
  writing-mode: vertical-rl;
}
.side-panel {
  width: 240px; max-width: 68vw; background: #fff;
  border: 1px solid #dbe3ea; border-radius: 10px 0 0 10px;
  display: flex; flex-direction: column; overflow: hidden;
}
.side-panel .panel-head {
  background: #0f6cbd; color: #fff; font-weight: bold; font-size: 13px;
  padding: 9px 10px; cursor: pointer; user-select: none; white-space: nowrap;
}
.side-panel .panel-body { flex: 1; overflow-y: auto; }
.sheet-row {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 8px; border-bottom: 1px solid #eef2f6; font-size: 13px;
  background: #fff;
}
.sheet-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: bold; }
.sheet-row.done, .sheet-row.cancel { opacity: .5; }
.sheet-row .grip {
  color: #8a949e; font-size: 22px; padding: 8px 10px; margin: -8px 0; cursor: grab;
  touch-action: none; user-select: none;
}
.sheet-row { user-select: none; -webkit-user-select: none; }
.sheet-row.dragging { opacity: .9; background: #d7e9fb; box-shadow: 0 2px 10px rgba(15,108,189,.5); position: relative; z-index: 10; transform: scale(1.02); }

/* 対応記録のチップ選択 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label {
  display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 20px;
  border: 1px solid #b8c4cf; background: #fff; font-size: 14px; cursor: pointer;
  user-select: none;
}
.chips input[type=checkbox] { display: none; }
.chips label:has(input:checked) {
  background: #0f6cbd; border-color: #0f6cbd; color: #fff; font-weight: bold;
}

/* 詳細 */
dl.detail { margin: 0; }
dl.detail dt { font-size: 12px; color: #7b8794; margin-top: 10px; }
dl.detail dd { margin: 2px 0 0; font-size: 15px; white-space: pre-wrap; }
.thumb { max-width: 100%; border-radius: 8px; border: 1px solid #dbe3ea; margin-top: 6px; }
.imgview {
  position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 2000;
  display: none; align-items: center; justify-content: center; overflow: auto;
  touch-action: pinch-zoom;
}
.imgview img { max-width: none; }
.imgview .close {
  position: fixed; top: 10px; right: 10px; background: #fff; border-radius: 50%;
  width: 44px; height: 44px; font-size: 20px; border: none;
}
