:root {
  --bg: #f6f8f7; --card: #fff; --ink: #1d2523; --muted: #66716e; --line: #d7dedb;
  --primary: #1f7a6d; --primary-ink: #fff; --ok: #1f8a3b; --ng: #b3261e; --warn: #b26a00;
  --pickup: #2563b8; --dropoff: #c2560c; --soft: #e8f2ef;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-height: 48px; }
textarea { min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 3px solid #9fd3c9; border-color: var(--primary); }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; }
.loading, .muted { color: var(--muted); }
.small { font-size: 14px; }
.warn-text { color: var(--ng); font-weight: bold; }
.big-text { font-size: 20px; line-height: 1.6; }

/* 上の帯 */
.top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 5; }
.top .brand { display: flex; align-items: center; gap: 8px; font-weight: bold; flex: 1; }
.top .brand img { width: 30px; height: 30px; border-radius: 7px; background: #fff; }
.top .link { color: #fff; }
.sync { flex-basis: 100%; background: #fff3cd; color: #6b4a00; border-radius: 8px; padding: 4px 10px; font-size: 14px; font-weight: bold; }
.link { background: none; border: 0; padding: 8px 4px; color: var(--primary); text-decoration: underline; cursor: pointer; min-height: 44px; }

/* 大きいボタン */
.big { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 76px; margin: 12px 0;
  border: 0; border-radius: 16px; font-size: 24px; font-weight: bold; cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.15); padding: 10px 14px; }
.big small { font-size: 15px; font-weight: normal; opacity: .9; margin-top: 2px; }
.big:active { transform: translateY(1px); box-shadow: none; }
.big.primary { background: var(--primary); color: #fff; }
.big.secondary { background: var(--soft); color: var(--primary); border: 2px solid var(--primary); }
.big.ok { background: var(--ok); color: #fff; min-height: 96px; font-size: 30px; }
.big.warn { background: #fff3cd; color: #6b4a00; border: 2px solid #e0a800; }
.big.pickup { background: var(--pickup); color: #fff; min-height: 120px; font-size: 32px; }
.big.dropoff { background: var(--dropoff); color: #fff; min-height: 120px; font-size: 32px; }
.big.arr { background: #fff; color: var(--ink); border: 3px solid var(--line); min-height: 96px; font-size: 21px; }
.big.arr.suggest { border-color: var(--primary); }
.big.arr.chosen { background: var(--primary); color: #fff; border-color: var(--primary); }
.big.arrive { background: var(--ink); color: #fff; margin: 0; min-height: 64px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two .big { margin: 6px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; cursor: pointer; font-weight: bold; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.danger { color: var(--ng); border-color: #e7b6b2; }
.btn.wide { width: 100%; margin: 10px 0; min-height: 54px; }
.btn.ng { color: var(--ng); border-color: #e7b6b2; background: #fff; }
.btn.sm { min-height: 36px; padding: 4px 10px; font-size: 15px; }

/* 画面 */
.screen { padding: 12px 16px 24px; }
.step-head { padding: 8px 16px 0; }
.step-head h1 { margin: 4px 0 0; font-size: 26px; }
.dots { display: flex; gap: 6px; margin: 4px 0; }
.dots span { width: 26px; height: 6px; border-radius: 3px; background: var(--line); }
.dots span.on { background: var(--primary); }
.q { font-size: 26px; font-weight: bold; text-align: center; margin: 28px 0 12px; }
.q.small { font-size: 19px; margin: 12px 0; text-align: left; }
.opening .greet { text-align: center; font-size: 24px; font-weight: bold; margin: 32px 0 20px; line-height: 1.6; }
.opening .greet p { margin: 0; }
.notice { background: #fff3cd; border: 2px solid #e0a800; border-radius: 12px; padding: 14px 14px 14px 34px; font-weight: bold; }
.notice li { margin: 6px 0; }
.inspect { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 12px 42px; font-size: 19px; }
.inspect li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.inspect li:last-child { border: 0; }

/* 選ぶ */
.pick { display: grid; gap: 10px; }
.pick-btn { min-height: 64px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: 22px; font-weight: bold; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 8px 18px; }
.pick-btn.last { border-color: var(--primary); background: var(--soft); }
.pick-btn small { font-size: 14px; color: var(--primary); }
.pick-edit { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 19px; }
.add-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.add-form input { flex: 1 1 160px; }

/* ホーム */
.home { padding: 6px 16px 30px; }
.hello { font-size: 18px; font-weight: bold; margin: 10px 0 0; }
.sec { font-size: 18px; margin: 22px 0 8px; border-left: 5px solid var(--primary); padding-left: 8px; }
.trip-card, .a-trip { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; cursor: pointer; }
.tc-top { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-weight: bold; }
.tc-riders { color: var(--muted); font-size: 15px; margin-top: 4px; }
.tc-report { font-size: 15px; margin-top: 4px; background: #fffbe6; padding: 4px 8px; border-radius: 6px; }
.tc-report.alert { background: #fde8e6; color: var(--ng); font-weight: bold; }
.kind { color: #fff; border-radius: 6px; padding: 0 8px; }
.kind.pickup { background: var(--pickup); }
.kind.dropoff { background: var(--dropoff); }
.tag-run, .tag-pend { font-style: normal; font-size: 13px; border-radius: 6px; padding: 0 6px; }
.tag-run { background: #fff3cd; color: #6b4a00; }
.tag-pend { background: #fde8e6; color: var(--ng); }
.home-links { display: grid; gap: 10px; margin-top: 24px; }

/* 送迎中 */
.ride-head { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); padding: 4px 16px 8px; }
.ride-info { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-weight: bold; font-size: 18px; }
.ride-info .link { padding: 4px; min-height: 0; font-weight: bold; }
.hint { background: var(--soft); border-radius: 10px; padding: 8px 12px; margin: 4px 0 10px; font-weight: bold; }
.mic { width: 100%; min-height: 110px; border: 0; border-radius: 20px; background: var(--primary); color: #fff; font-size: 22px; font-weight: bold;
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.mic b { font-size: 42px; line-height: 1.1; }
.mic.on { background: var(--ng); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .75; } }
.live { min-height: 30px; margin: 8px 2px; font-size: 18px; }
.heard { font-weight: bold; }
.say-form { display: flex; gap: 8px; }
.say-form input { flex: 1; font-size: 18px; }
.choices .choice { background: #fff3cd; border: 2px solid #e0a800; border-radius: 12px; padding: 10px; margin: 10px 0; }
.choice p { margin: 0 0 8px; font-weight: bold; }
.choice-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.stops { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; }
.stop { display: grid; grid-template-columns: 28px 78px 1fr 26px 44px; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.stop:last-child { border: 0; }
.stop .no { color: var(--muted); text-align: center; }
.stop .time { font-size: 20px; font-weight: bold; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 44px; cursor: pointer; }
.stop .nm { font-size: 20px; font-weight: bold; }
.stop .unreg { font-size: 12px; color: var(--warn); margin-left: 6px; font-weight: normal; }
.stop .del { border: 0; background: none; font-size: 26px; color: var(--ng); min-height: 44px; cursor: pointer; }
.tap-pick { margin: 14px 0; }
.tap-pick summary { font-weight: bold; padding: 10px 0; cursor: pointer; color: var(--primary); }
.rider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.rbtn { min-height: 52px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 17px; font-weight: bold; cursor: pointer; }
.bottom-space { height: 90px; }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + var(--safe-b)); background: rgba(246,248,247,.96); border-top: 1px solid var(--line); z-index: 6; }
.bottom-bar .big { max-width: 608px; margin: 0 auto; }

/* 報告 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.chip { min-height: 44px; padding: 6px 14px; border: 2px solid var(--line); border-radius: 22px; background: #fff; cursor: pointer; font-weight: bold; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.report { margin-top: 8px; }
.report textarea { margin-bottom: 6px; }
.field { display: block; margin: 10px 0; }
.field-label { display: block; font-weight: bold; font-size: 15px; margin-bottom: 4px; }
.field small { display: block; color: var(--muted); margin-top: 4px; }

.done { text-align: center; padding-top: 30px; }
.done-mark { width: 96px; height: 96px; line-height: 96px; margin: 0 auto; border-radius: 50%; background: var(--ok); color: #fff; font-size: 56px; font-weight: bold; }
.done h1 { margin: 12px 0; }
.done p { margin: 4px 0; font-size: 18px; }

/* ログイン */
.login { text-align: center; padding-top: 40px; }
.login .logo { width: 88px; height: 88px; border-radius: 20px; }
.login form { text-align: left; margin-top: 18px; }
.big-input { font-size: 22px; }

/* ダイアログ・通知 */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + var(--safe-b)); }
.modal h2 { margin: 0 0 8px; font-size: 21px; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; position: sticky; bottom: 0; background: #fff; padding-top: 8px; }
.modal-btns .btn { flex: 1; min-height: 54px; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 18px; } }
.stack p { margin: 6px 0; }
.detail-stops { padding-left: 24px; }
#toasts { position: fixed; left: 0; right: 0; bottom: 90px; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 30; pointer-events: none; padding: 0 16px; }
.toast { background: #1d2523; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: bold; max-width: 600px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.toast.err { background: var(--ng); }
.toast.warn { background: #6b4a00; }

/* 管理画面 */
body:has(.admin) #app { max-width: 1100px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px 0; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 50px; z-index: 4; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: bold; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; cursor: pointer; min-height: 44px; }
.tabs button.on { color: var(--primary); border-color: var(--primary); }
.admin-body { padding: 12px 16px 40px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.toolbar .field { margin: 0; min-width: 140px; }
.toolbar h2 { margin: 0; flex: 1; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 12px 0; }
.panel h2 { font-size: 19px; margin: 4px 0 8px; }
.date-head { margin: 18px 0 4px; font-size: 17px; }
.a-trip { cursor: default; }
.a-btns { display: flex; gap: 8px; margin-top: 6px; }
.checks { font-weight: normal; color: var(--muted); font-size: 14px; }
.mtable { width: 100%; border-collapse: collapse; }
.mtable td, .mtable th { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: middle; }
.mtable tr.off td { color: var(--muted); text-decoration: line-through; }
.mtable tr.off td.ops { text-decoration: none; }
.mtable .ops { text-align: right; white-space: nowrap; }
.mtable.small { font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.chk-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0; }
.chk { display: flex; align-items: center; gap: 6px; font-weight: bold; }
.chk input { width: 24px; height: 24px; min-height: 0; }
.edit-stop { display: grid; grid-template-columns: 24px 110px 1fr 48px; gap: 6px; align-items: center; margin: 4px 0; }
.audit { max-height: 420px; overflow: auto; }
.vlog-hist { background: var(--soft); border-radius: 10px; padding: 6px 12px; }
.vlog-hist p { margin: 4px 0; font-weight: bold; }
