/* =========================================================
   SHEield — style.css
   モバイル優先（390px で設計 → 広い画面では中央1カラム）
   ========================================================= */

:root{
  --purple-primary:#6A51C9;
  --purple-vivid:#8236EA;
  --purple-light:#BA89DD;
  --lavender-pale:#F3F0FB;
  --bg:#F5F6FA;
  --surface:#FFFFFF;
  --sos-red:#E13145;
  --safe-green-bg:#E8F6EC;  --safe-green-text:#1B7A3D;
  --info-blue-bg:#E8EFFB;   --info-blue-text:#2455A4;
  --warn-amber-bg:#FDF6E3;  --warn-amber-text:#9A6B04;
  --text:#1A1A2E; --text-muted:#6B7280; --border:#E5E7EB;

  --r-card:14px; --r-btn:8px;
  --shadow:0 1px 3px rgba(0,0,0,.06);
  --pad:16px;
  --font:"Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html[lang="bn"] body{ font-family:"Noto Sans Bengali", var(--font); }
html[lang="ja"] body{ font-family:"Noto Sans JP", var(--font); }

*,*::before,*::after{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  background:var(--bg); color:var(--text);
  font-family:var(--font); font-size:15px; line-height:1.6;
  -webkit-font-smoothing:antialiased; min-height:100dvh;
}
h1,h2,h3{ font-weight:600; margin:0; }
p{ margin:0; }
button,input,select,textarea{ font-family:inherit; font-size:16px; color:inherit; }
:focus-visible{ outline:2px solid var(--purple-primary); outline-offset:2px; border-radius:6px; }
[hidden]{ display:none !important; }
.muted{ color:var(--text-muted); }
.small{ font-size:13px; }
.right{ text-align:right; margin:6px 0 14px; }
.pad{ padding:var(--pad) var(--pad) 120px; max-width:520px; margin:0 auto; }

/* ---------- 起動オーバーレイ ---------- */
.boot{ position:fixed; inset:0; z-index:100; background:var(--bg);
  display:grid; place-content:center; justify-items:center; gap:14px; padding:24px; }
.boot-mark{ color:var(--purple-vivid); animation:beat 1.5s ease-in-out infinite; }
@keyframes beat{ 0%,100%{transform:scale(1);opacity:.75} 50%{transform:scale(1.12);opacity:1} }
.boot-text{ color:var(--text-muted); font-size:13px; }
.boot-error{ color:var(--sos-red); font-size:12px; white-space:pre-wrap;
  max-width:90vw; text-align:left; background:var(--surface);
  border:1px solid var(--border); border-radius:var(--r-card); padding:14px; }

/* ---------- 通信状態 ---------- */
.offline-bar{ position:fixed; top:0; left:0; right:0; z-index:95;
  background:var(--warn-amber-bg); color:var(--warn-amber-text);
  font-size:12.5px; text-align:center; padding:6px 12px; border-bottom:1px solid #F0E2BE; }

/* ---------- 共通パーツ ---------- */
.card{ background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-card); box-shadow:var(--shadow); padding:20px; margin-bottom:14px; }
.card-h{ font-size:15px; margin-bottom:10px; }
.sec-h{ font-size:16px; margin:20px 0 10px; }

.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px;
  width:100%; min-height:46px; padding:11px 18px; border:1px solid transparent;
  border-radius:var(--r-btn); font-size:15px; font-weight:600; cursor:pointer;
  transition:filter .15s ease, background .15s ease; margin-top:10px; }
.btn:active{ transform:translateY(1px); }
.btn[disabled]{ opacity:.5; cursor:not-allowed; }
.btn-primary{ background:var(--purple-primary); color:#fff; }
.btn-primary:hover{ filter:brightness(1.08); }
.btn-outline,.btn-ghost{ background:var(--surface); border-color:var(--border); color:var(--text); }
.btn-outline:hover{ border-color:var(--purple-primary); color:var(--purple-primary); }
.btn-ghost{ border-color:transparent; }
.btn-sm{ min-height:40px; padding:8px 14px; font-size:14px; width:auto; }
.btn-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
.linkbtn{ background:none; border:none; color:var(--purple-primary);
  font-size:14px; font-weight:500; cursor:pointer; padding:8px 4px; min-height:44px; }
.linkbtn.danger{ color:var(--sos-red); width:100%; }

.field{ display:block; margin-bottom:14px; }
.label{ display:block; font-size:13px; color:var(--text-muted); margin-bottom:6px; }
.field input,.field select,.field textarea{
  width:100%; min-height:46px; padding:11px 13px; background:var(--surface);
  border:1px solid var(--border); border-radius:var(--r-btn); }
.field textarea{ min-height:88px; }
.field input:focus,.field select:focus,.field textarea:focus{
  outline:none; border-color:var(--purple-primary); box-shadow:0 0 0 3px rgba(106,81,201,.15); }
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.check{ display:flex; align-items:center; gap:10px; min-height:44px; font-size:14px; }
.check input{ width:20px; height:20px; accent-color:var(--purple-primary); }

.seg{ display:flex; width:100%; border:1px solid var(--border);
  border-radius:var(--r-btn); overflow:hidden; background:var(--surface); margin-bottom:16px; }
.seg-half{ flex:1; min-height:44px; border:none; background:var(--surface);
  color:var(--text-muted); font-size:14px; font-weight:600; cursor:pointer; }
.seg-half.is-on{ background:var(--purple-primary); color:#fff; }
.seg-mode{ max-width:520px; margin:12px auto 0; width:calc(100% - 32px); }

.avatar{ display:grid; place-items:center; border-radius:50%;
  background:var(--lavender-pale); color:var(--purple-primary); font-weight:600; flex:none; }
.avatar.sm{ width:32px; height:32px; font-size:12px; }
.avatar.lg{ width:48px; height:48px; font-size:15px; }
.avatar.xl{ width:78px; height:78px; font-size:24px; background:#fff; }
.match-row{ display:flex; gap:12px; align-items:center; margin-bottom:12px; }

.alert{ border-radius:var(--r-card); padding:12px 14px; margin-bottom:12px; font-size:14px; }
.alert b{ display:block; }
.alert i{ font-style:normal; color:var(--text-muted); font-size:13px; }
.alert-green{ background:var(--safe-green-bg); } .alert-green b{ color:var(--safe-green-text); }
.alert-blue{ background:var(--info-blue-bg); }  .alert-blue b{ color:var(--info-blue-text); }
.alert-amber{ background:var(--warn-amber-bg); } .alert-amber b{ color:var(--warn-amber-text); }
.alert-red{ background:#FDECEE; } .alert-red b{ color:var(--sos-red); }

.list{ display:grid; gap:12px; }
.empty{ text-align:center; color:var(--text-muted); font-size:13.5px;
  padding:28px 16px; border:1px dashed var(--border); border-radius:var(--r-card); background:var(--surface); }
.kv{ display:grid; grid-template-columns:auto 1fr; gap:8px 16px; margin:14px 0 0; font-size:14px; }
.kv dt{ color:var(--text-muted); font-size:13px; }
.kv dd{ margin:0; text-align:right; font-weight:500; }
.uid{ color:#9CA3AF; font-size:10.5px; text-align:center; margin-top:16px; word-break:break-all; }

.statusbadge{ display:inline-block; font-size:12.5px; font-weight:600; padding:5px 12px;
  border-radius:999px; margin-bottom:10px; background:var(--border); color:var(--text-muted); }
.statusbadge[data-state="pending"]{ background:var(--warn-amber-bg); color:var(--warn-amber-text); }
.statusbadge[data-state="approved"]{ background:var(--safe-green-bg); color:var(--safe-green-text); }
.statusbadge[data-state="rejected"]{ background:#FDECEE; color:var(--sos-red); }

/* ---------- ランディング ---------- */
.site-head{ display:flex; align-items:center; justify-content:space-between;
  padding:12px var(--pad); background:var(--surface); border-bottom:1px solid var(--border); }
.site-head-actions{ display:flex; gap:8px; align-items:center; }
.lang-select{ min-height:40px; border:1px solid var(--border);
  border-radius:var(--r-btn); background:var(--surface); padding:6px 8px; font-size:14px; }
.wordmark{ display:flex; align-items:center; gap:8px; }
.logo-mark{ color:var(--purple-vivid); display:grid; place-items:center; }
.wordmark-text{ font-weight:700; font-size:18px; letter-spacing:-.01em; display:block; }
.tagline{ display:block; font-size:12px; color:var(--text-muted); font-weight:400; line-height:1.2; }

.lp{ max-width:1040px; margin:0 auto; padding:0 var(--pad) 40px; }
.lp-hero{ padding:32px 0 8px; display:grid; gap:28px; }
.pill{ display:inline-block; background:var(--lavender-pale); color:var(--purple-primary);
  font-size:12.5px; font-weight:600; padding:5px 12px; border-radius:999px; }
.lp-title{ font-size:34px; line-height:1.2; margin:14px 0 12px; letter-spacing:-.02em; }
.lp-title em{ font-style:normal; color:var(--purple-vivid); }
.lp-lede{ color:var(--text-muted); font-size:15px; }
.lp-cta{ display:grid; gap:10px; margin-top:20px; }
.lp-checks{ list-style:none; padding:0; margin:20px 0 0; display:grid; gap:8px; font-size:14px; }
.lp-checks li{ display:flex; gap:8px; align-items:center; }
.tick{ color:var(--safe-green-text); font-weight:700; }

.lp-shot{ background:var(--surface); border:1px solid var(--border); border-radius:20px;
  box-shadow:0 8px 30px rgba(26,26,46,.08); padding:14px; }
.shot-bar{ display:flex; gap:5px; margin-bottom:10px; }
.shot-bar span{ width:8px; height:8px; border-radius:50%; background:var(--border); }
.shot-map{ position:relative; height:150px; border-radius:12px;
  background:linear-gradient(135deg,#EDEBF7,#E4EAF6); overflow:hidden; }
.shot-pin{ position:absolute; left:46%; top:44%; width:12px; height:12px; border-radius:50%;
  background:var(--sos-red); box-shadow:0 0 0 6px rgba(225,49,69,.18); }
.shot-dot{ position:absolute; width:9px; height:9px; border-radius:50%; background:var(--purple-primary); }
.shot-dot.d1{ left:22%; top:26% } .shot-dot.d2{ left:71%; top:33% } .shot-dot.d3{ left:60%; top:70% }
.shot-row{ display:flex; align-items:center; gap:10px; padding:10px 4px; border-bottom:1px solid var(--border); }
.shot-av{ width:34px; height:34px; border-radius:50%; background:var(--lavender-pale); flex:none; }
.shot-lines{ flex:1 }
.shot-lines b{ display:block; height:8px; width:52%; background:var(--border); border-radius:4px; }
.shot-lines i{ display:block; height:7px; width:34%; background:#F1F2F6; border-radius:4px; margin-top:6px; }
.shot-star{ font-size:12px; color:var(--purple-primary); font-weight:600; }

.lp-sec{ padding:32px 0; }
.lp-h2{ font-size:22px; margin-bottom:18px; letter-spacing:-.01em; }
.grid-3{ display:grid; gap:12px; }
.feat h3{ font-size:15px; margin:10px 0 6px; }
.feat p{ color:var(--text-muted); font-size:13.5px; }
.chip-ico{ display:grid; place-items:center; width:40px; height:40px; border-radius:12px;
  background:var(--lavender-pale); color:var(--purple-primary); font-size:18px; }
.lp-2col{ display:grid; gap:16px; }
.deflist dt{ font-weight:600; margin-top:14px; }
.deflist dd{ margin:2px 0 0; color:var(--text-muted); font-size:14px; }
.steps{ list-style:none; padding:0; margin:0; display:grid; gap:18px; }
.steps li{ display:flex; gap:14px; }
.steps b{ font-size:14.5px; } .steps p{ color:var(--text-muted); font-size:13.5px; }
.step-n{ flex:none; width:28px; height:28px; border-radius:50%; display:grid; place-items:center;
  background:var(--purple-primary); color:#fff; font-size:13px; font-weight:600; }
.meter{ height:8px; border-radius:999px; background:var(--lavender-pale); overflow:hidden; margin:12px 0; }
.meter i{ display:block; height:100%; background:var(--purple-primary); }
.routes{ list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.routes li{ display:flex; gap:10px; align-items:center; font-size:13.5px;
  padding:9px 12px; border-radius:10px; }
.routes b{ font-size:12px; }
.r-safe{ background:var(--safe-green-bg); } .r-safe b{ color:var(--safe-green-text); }
.r-caution{ background:var(--warn-amber-bg); } .r-caution b{ color:var(--warn-amber-text); }
.r-avoid{ background:#FDECEE; } .r-avoid b{ color:var(--sos-red); }
.lp-foot{ border-top:1px solid var(--border); padding-top:20px; display:grid; gap:6px; }

/* ---------- 認証画面 ---------- */
.auth-screen{ min-height:100dvh; display:grid; place-items:center; padding:24px var(--pad); }
.auth-card{ width:100%; max-width:420px; }
.auth-logo{ color:var(--purple-vivid); display:grid; place-items:center; margin-bottom:10px; }
.auth-title{ font-size:22px; text-align:center; }
.auth-sub{ color:var(--text-muted); font-size:14px; text-align:center; margin:6px 0 20px; }
.auth-alt{ text-align:center; font-size:14px; color:var(--text-muted); margin-top:14px; }

/* ---------- アプリ骨格 ---------- */
.app{ min-height:100dvh; padding-bottom:96px; }
.app-head{ position:sticky; top:0; z-index:30; display:flex; align-items:center;
  justify-content:space-between; gap:12px; padding:10px var(--pad);
  background:var(--surface); border-bottom:1px solid var(--border); }
.head-profile{ display:flex; align-items:center; gap:6px; min-height:44px; padding:0 8px;
  background:none; border:none; color:var(--purple-primary); font-size:14px; font-weight:600; cursor:pointer; }
.app-main{ padding-top:4px; }
.bar{ display:flex; align-items:center; gap:10px; padding:12px var(--pad);
  background:var(--surface); border-bottom:1px solid var(--border); }
.bar-title{ font-weight:600; font-size:16px; }
.backbtn{ width:44px; height:44px; border:none; background:none; font-size:20px;
  color:var(--text); cursor:pointer; }
.backbtn.light{ color:#fff; position:absolute; left:4px; top:4px; }
.rowlink{ display:flex; width:100%; align-items:center; justify-content:space-between;
  min-height:48px; background:none; border:none; border-top:1px solid var(--border);
  font-size:14.5px; color:var(--text); cursor:pointer; padding:0; text-align:left; }
.rowlink i{ font-style:normal; color:var(--text-muted); }

/* ---------- 地図 ---------- */
.map-wrap{ position:relative; height:280px; background:#E7E9F2; }
.map,.map-offline{ position:absolute; inset:0; }
.map-offline{ background:linear-gradient(135deg,#EDEBF7,#E4EAF6); display:grid; place-items:center; }
#map-svg,#trip-svg{ width:100%; height:100%; }
.map-offline-tag{ position:absolute; right:10px; top:10px; background:var(--warn-amber-bg);
  color:var(--warn-amber-text); font-size:11.5px; font-weight:600; padding:3px 9px; border-radius:999px; }
.map-info{ position:absolute; left:12px; top:12px; margin:0; padding:10px 14px; max-width:70%; }

/* ---------- ドライバーカード ---------- */
.drow{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r-card);
  box-shadow:var(--shadow); padding:14px; }
.drow-top{ display:flex; gap:12px; align-items:center; }
.drow-name{ color:var(--purple-primary); font-weight:600; font-size:15px; }
.drow-veh{ color:var(--text-muted); font-size:13px; }
.drow-star{ margin-left:auto; text-align:right; font-size:13px; font-weight:600; }
.drow-meta{ color:var(--text-muted); font-size:12.5px; margin-top:2px; }
.drow-actions{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-top:12px; }
.drow-actions .btn{ margin-top:0; width:100%; }

.risk-line{ display:flex; gap:8px; align-items:center; font-size:13px;
  padding:9px 12px; border-radius:10px; margin-top:4px; }
.risk-line b{ font-size:12px; }

/* ---------- チャット ---------- */
.chat-log{ padding:16px var(--pad) 12px; display:grid; gap:10px;
  max-width:520px; margin:0 auto; min-height:40vh; }
.bubble{ max-width:78%; padding:10px 13px; border-radius:14px; font-size:14px; }
.bubble.me{ background:var(--purple-primary); color:#fff; justify-self:end; border-bottom-right-radius:4px; }
.bubble.them{ background:var(--surface); border:1px solid var(--border); justify-self:start; border-bottom-left-radius:4px; }
.bubble time{ display:block; font-size:11px; opacity:.7; margin-top:4px; }
.chat-input{ position:fixed; left:0; right:0; bottom:78px; z-index:25;
  display:flex; gap:8px; padding:10px var(--pad);
  background:var(--surface); border-top:1px solid var(--border); }
.chat-input.flat{ position:static; border:none; padding:0; background:none; margin-top:10px; }
.chat-input input{ flex:1; min-height:44px; padding:10px 13px;
  border:1px solid var(--border); border-radius:var(--r-btn); }
.sendbtn{ width:46px; height:46px; flex:none; border:none; border-radius:var(--r-btn);
  background:var(--purple-primary); color:#fff; font-size:16px; cursor:pointer; }
.ai-log{ display:grid; gap:8px; max-height:240px; overflow-y:auto; margin-top:10px; }
.ai-msg{ padding:9px 12px; border-radius:12px; font-size:13.5px; white-space:pre-wrap; }
.ai-msg.me{ background:var(--lavender-pale); }
.ai-msg.ai{ background:#F7F8FB; border:1px solid var(--border); }

/* ---------- プロフィール ---------- */
.prof-banner{ position:relative; background:var(--purple-primary); color:#fff;
  padding:36px 16px 26px; text-align:center; }
.prof-banner h2{ font-size:19px; margin-top:10px; }
.prof-banner p{ font-size:13.5px; opacity:.9; }

/* ---------- ドライバー画面 ---------- */
.online-card{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.switch{ width:52px; height:30px; flex:none; border-radius:999px; border:none;
  background:var(--border); cursor:pointer; position:relative; padding:0; }
.switch i{ position:absolute; top:3px; left:3px; width:24px; height:24px; border-radius:50%;
  background:#fff; transition:left .18s ease; }
.switch[aria-checked="true"]{ background:var(--safe-green-text); }
.switch[aria-checked="true"] i{ left:25px; }
.stat3{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:14px 0 4px; text-align:center; }
.stat3 b{ display:block; font-size:20px; color:var(--purple-primary); }
.stat3 span{ font-size:12px; color:var(--text-muted); }

/* ---------- 評価 ---------- */
.stars{ display:flex; gap:6px; justify-content:center; margin:6px 0 14px; }
.star{ background:none; border:none; cursor:pointer; font-size:30px; line-height:1;
  color:var(--border); min-width:44px; min-height:44px; }
.star.on{ color:var(--purple-primary); }

/* ---------- 下部ナビ ---------- */
.bottomnav{ position:fixed; left:0; right:0; bottom:0; z-index:40; display:flex;
  background:var(--surface); border-top:1px solid var(--border);
  padding-bottom:env(safe-area-inset-bottom); }
.navbtn{ flex:1; min-height:56px; background:none; border:none; cursor:pointer;
  display:grid; gap:2px; justify-items:center; align-content:center;
  color:var(--text-muted); font-size:10px; padding:6px 2px; }
.navbtn .ico{ font-size:17px; color:var(--purple-primary); line-height:1; }
.navbtn.is-on{ color:var(--purple-primary); font-weight:600; }
.sosbtn{ position:relative; }
.sos-circle{ position:absolute; top:-18px; left:50%; transform:translateX(-50%);
  width:56px; height:56px; border-radius:50%; background:var(--sos-red); color:#fff;
  display:grid; place-items:center; box-shadow:0 4px 14px rgba(225,49,69,.4);
  border:3px solid var(--surface); }
.sos-label{ margin-top:26px; color:var(--sos-red); font-weight:700; font-size:10px; }

/* ---------- モーダル ---------- */
.modal{ position:fixed; inset:0; z-index:70; display:grid; place-items:end center;
  background:rgba(26,26,46,.5); }
.sheet{ position:relative; width:100%; max-width:480px; background:var(--surface);
  border-radius:18px 18px 0 0; padding:22px 18px calc(22px + env(safe-area-inset-bottom));
  animation:rise .2s ease both; max-height:88dvh; overflow-y:auto; }
@keyframes rise{ from{ transform:translateY(16px); opacity:0 } to{ transform:none; opacity:1 } }
.sheet.center{ text-align:center; }
.xbtn{ position:absolute; right:8px; top:8px; width:40px; height:40px;
  border:none; background:none; font-size:22px; color:var(--text-muted); cursor:pointer; }
.modal-title{ font-size:18px; margin-bottom:4px; }
.modal-title.danger{ color:var(--sos-red); }
.optrow{ display:flex; align-items:center; gap:12px; width:100%; text-align:left;
  min-height:64px; margin-top:10px; padding:12px 14px; cursor:pointer;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r-card); }
.optrow b{ display:block; font-size:14.5px; }
.optrow i{ font-style:normal; color:var(--text-muted); font-size:13px; }
.opt-ico{ width:40px; height:40px; flex:none; border-radius:50%; display:grid; place-items:center; font-size:17px; }
.opt-ico.red{ background:#FDECEE; color:var(--sos-red); }
.opt-ico.amber{ background:var(--warn-amber-bg); color:var(--warn-amber-text); }
.opt-ico.grey{ background:#F1F2F6; color:var(--text-muted); }
.drop{ display:grid; place-items:center; min-height:78px; margin:10px 0 6px; cursor:pointer;
  border:1.5px dashed var(--purple-light); border-radius:var(--r-card);
  background:var(--lavender-pale); color:var(--purple-primary); font-size:13.5px; padding:12px; text-align:center; }
.drop.filled{ border-style:solid; border-color:var(--safe-green-text);
  background:var(--safe-green-bg); color:var(--safe-green-text); }

/* ---------- トースト（右下） ---------- */
.toast{ position:fixed; right:16px; bottom:96px; z-index:90; max-width:88vw;
  background:var(--text); color:#fff; font-size:13.5px; padding:11px 16px;
  border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.22); animation:rise .18s ease both; }
.toast.err{ background:var(--sos-red); }
.toast.ok{ background:var(--safe-green-text); }

/* ---------- 広い画面 ---------- */
@media (min-width:760px){
  .lp-hero{ grid-template-columns:1.05fr .95fr; align-items:center; }
  .lp-title{ font-size:44px; }
  .lp-cta{ grid-template-columns:auto auto; justify-content:start; }
  .lp-cta .btn{ width:auto; padding:12px 26px; }
  .grid-3{ grid-template-columns:repeat(3,1fr); }
  .lp-2col{ grid-template-columns:1fr 1fr; align-items:start; }
  .map-wrap{ height:340px; }
  .chat-input{ max-width:520px; left:50%; transform:translateX(-50%); }
}

/* ---------- 動きを減らす設定を尊重 ---------- */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important; }
}
