/* =========================================================
   すきまライド（仮） 見た目
   パークの色は body のクラス（park-sea / park-land）で切り替える
   ========================================================= */

/* ---- 色の名前（パークで変わらないもの） ---- */
:root {
  --acc: #F2B705;        /* 黄色（予定を追加・決定ボタン） */
  --ink: #18202E;        /* 文字の色 */
  --sub: #545C6B;        /* うすい文字 */
  --line: #E3DFD6;       /* カードの枠線 */
  --btn-line: #C9C3B6;   /* ボタンの枠線 */
  --ok: #3E9B6E;         /* 枠の始まりに間に合う（緑） */
  --mid: #3BA3C9;        /* 枠の途中で着く（水色） */
  --edge: #E08A2E;       /* ギリギリ（オレンジ） */
  --no: #B5B0A6;         /* 間に合わない（グレー） */
}

/* ---- シー（紺） ---- */
body.park-sea {
  --p: #2F5A8F;          /* メイン色 */
  --pale: #E3EBF5;       /* うすいメイン色 */
  --dark: #24476F;       /* 濃いメイン色（文字用） */
  --bg: #F2F5F9;         /* 背景 */
}

/* ---- ランド（コーラル） ---- */
body.park-land {
  --p: #E36B62;
  --pale: #FDE7E4;
  --dark: #B4453D;
  --bg: #FEF6F4;
}

/* ---- 全体 ---- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  color: var(--ink);
  background: #DDD9D0;            /* PCで見たときの外側 */
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--p); text-decoration: none; }

/* アプリの本体（スマホの幅。PCでは真ん中に表示） */
#app {
  position: relative;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}

/* ---- 画面の切り替え ---- */
.screen { display: none; min-height: 100vh; flex-direction: column; }
.screen.is-active { display: flex; }

/* ---- ヘッダー（色の帯） ---- */
.band {
  background: var(--p);
  color: #FFFFFF;
  padding: calc(20px + env(safe-area-inset-top)) 20px 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.band.is-small { padding: calc(16px + env(safe-area-inset-top)) 12px 14px; gap: 10px; }
.app-name { font-size: 22px; font-weight: 700; letter-spacing: 0.02em; }
.app-name small { font-size: 12px; font-weight: 500; margin-left: 6px; opacity: 0.9; }
.band-row { display: flex; align-items: center; gap: 4px; }
.band-title { margin: 0; font-size: 19px; font-weight: 700; }
.back {
  width: 44px; height: 44px; border: 0; background: none;
  display: flex; align-items: center; justify-content: center;
}

/* パーク切り替え */
.park-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: rgba(255,255,255,0.18); border-radius: 12px; padding: 4px;
}
.park-switch button {
  height: 38px; border: 0; border-radius: 9px; background: none;
  font-size: 15px; font-weight: 500; color: #FFFFFF;
}
.park-switch button.is-on { background: #FFFFFF; color: var(--dark); font-weight: 700; }

/* ---- 中身の余白 ---- */
.body { flex: 1; padding: 16px 20px 0; display: flex; flex-direction: column; gap: 14px; }

/* ---- 今いる場所のカード ---- */
.here {
  background: #FFFFFF; border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
}
.here-icon {
  width: 40px; height: 40px; border-radius: 20px; flex-shrink: 0;
  background: var(--pale); display: flex; align-items: center; justify-content: center;
}
.here-text { flex: 1; min-width: 0; }
.here-label { font-size: 12px; color: var(--sub); }
.here-name { font-size: 16px; font-weight: 700; }
.btn-small {
  height: 36px; padding: 0 12px; border-radius: 18px;
  border: 1px solid var(--btn-line); background: #FFFFFF; font-size: 13px;
}

/* ---- ホーム：今日の予定 ---- */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.calc-pill {
  height: 30px; padding: 0 10px; border-radius: 15px;
  border: 1px solid var(--btn-line); background: #FFFFFF;
  font-size: 12px; color: var(--dark);
  display: flex; align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0;
}
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl-row { display: flex; gap: 12px; align-items: flex-start; }
.tl-time { width: 48px; font-size: 13px; font-weight: 700; padding-top: 14px; flex-shrink: 0; }
.tl-now { display: flex; gap: 12px; }
.tl-now .tl-time { padding-top: 0; color: var(--dark); }
.tl-now span { font-size: 14px; color: var(--sub); }

.gap-card {
  margin-left: 60px; border-radius: 16px; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--pale); border: 1.5px solid var(--p); color: var(--dark);
  width: calc(100% - 60px); text-align: left;
}
.gap-card.is-after { background: #FFFFFF; border-style: dashed; padding: 10px 16px; }
.gap-small { font-size: 12px; }
.gap-big { font-size: 20px; font-weight: 700; }
.gap-count { font-size: 13px; margin-top: 2px; }
.gap-card.is-after .gap-big { font-size: 15px; }

.plan-card {
  flex: 1; background: #FFFFFF; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px;
}
.plan-top { display: flex; align-items: center; gap: 8px; }
.plan-when { font-size: 12px; color: var(--sub); }
.plan-name { font-size: 15px; font-weight: 700; margin-top: 4px; }
.label {
  font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 8px;
  color: var(--dark); background: var(--pale);
}
.label.is-show { color: #6B5100; background: #FDF0C4; }

/* 黄色の大きいボタン */
.btn-acc {
  height: 48px; border-radius: 24px; border: 0; width: 100%;
  background: var(--acc); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.btn-outline {
  height: 48px; border-radius: 24px; width: 100%;
  border: 1.5px solid var(--p); background: #FFFFFF; color: var(--dark);
  font-size: 15px; font-weight: 700;
}

.foot {
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  text-align: center; font-size: 11px; color: var(--sub);
  display: flex; flex-direction: column; gap: 4px;
}

/* ---- ボタン（チップ） ---- */
.chip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-label { font-size: 12px; font-weight: 700; color: var(--sub); width: 52px; }
.chip {
  height: 36px; padding: 0 12px; border-radius: 18px; min-width: 56px;
  border: 1px solid var(--btn-line); background: #FFFFFF; font-size: 13px;
}
.chip.is-on { border: 0; background: var(--p); color: #FFFFFF; font-weight: 700; }
/* 系統タグを選んだとき（うすいメイン色） */
.chip.is-tag.is-on { border: 1.5px solid var(--p); background: var(--pale); color: var(--dark); }
.note { font-size: 11px; color: var(--sub); }

/* ---- 予定の登録 ---- */
.form-label { font-size: 13px; font-weight: 700; color: var(--sub); }
.field {
  height: 52px; border-radius: 12px; border: 1px solid var(--btn-line);
  background: #FFFFFF; padding: 0 14px; font: inherit; font-size: 15px; color: var(--ink);
  width: 100%;
}
.field.is-time { font-size: 18px; font-weight: 700; text-align: center; }
.kind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind-btn {
  height: 76px; border-radius: 14px; border: 1px solid var(--btn-line); background: #FFFFFF;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.kind-btn b { font-size: 16px; }
.kind-btn span { font-size: 12px; }
.kind-btn.is-on { border: 2px solid var(--p); background: var(--pale); color: var(--dark); }
.help { font-size: 12px; color: var(--sub); line-height: 1.6; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack-lg { display: flex; flex-direction: column; gap: 18px; }
.time-range { display: flex; align-items: center; gap: 10px; }
.time-range .field { flex: 1; min-width: 0; }

/* ---- 提案一覧 ---- */
.next-box {
  margin: 0 8px; background: var(--pale); color: var(--dark);
  border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
}
.next-box div:first-child { font-size: 12px; }
.next-box div { font-size: 14px; font-weight: 700; }
.filters { padding: 14px 20px 6px; display: flex; flex-direction: column; gap: 10px; }
.result { padding: 8px 20px 0; display: flex; flex-direction: column; gap: 20px; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group-head { display: flex; align-items: center; gap: 8px; }
.group-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.group-head .count { font-size: 13px; color: var(--sub); }
.dot { width: 12px; height: 12px; border-radius: 6px; }
.dot.is-edge { border-radius: 3px; }
.ride-card {
  background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; display: flex; gap: 12px; text-align: left; width: 100%;
}
.ride-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ride-name { font-size: 15px; font-weight: 700; }
.ride-sub { font-size: 12px; color: var(--sub); }
.ride-arrive { text-align: right; flex-shrink: 0; }
.ride-arrive small { display: block; font-size: 11px; color: var(--sub); }
.ride-arrive b { font-size: 18px; }
.ride-card.is-ok  { box-shadow: inset 4px 0 0 var(--ok); }   .ride-card.is-ok  b { color: var(--ok); }
.ride-card.is-mid { box-shadow: inset 4px 0 0 var(--mid); }  .ride-card.is-mid b { color: var(--mid); }
.ride-card.is-edge{ box-shadow: inset 4px 0 0 var(--edge); } .ride-card.is-edge b { color: var(--edge); }
.ride-card.is-no {
  background: #EDEAE3; border: 0; padding: 10px 14px; color: var(--sub);
  justify-content: space-between; font-size: 14px;
}
.ride-card.is-no span:last-child { white-space: nowrap; flex-shrink: 0; }
.group.is-no h2 { color: var(--sub); }

/* ---- 予定なし ---- */
.free-box {
  margin: 0 20px; background: var(--pale); border: 1.5px solid var(--p); color: var(--dark);
  border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 16px;
}
.free-box h2 { margin: 0; font-size: 17px; font-weight: 700; }
.big-chip {
  height: 44px; padding: 0 16px; border-radius: 22px;
  border: 1px solid var(--p); background: #FFFFFF; color: var(--dark); font-size: 15px;
}
.big-chip.is-on { border: 0; background: var(--p); color: #FFFFFF; font-weight: 700; }
.limit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.limit-btn {
  height: 44px; border-radius: 12px; border: 1px solid var(--p);
  background: #FFFFFF; color: var(--dark); font-size: 14px;
}
.limit-btn.is-on { border: 0; background: var(--p); color: #FFFFFF; font-weight: 700; }
.free-card {
  background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
}
.free-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.free-wait { text-align: right; flex-shrink: 0; }
.free-wait small { display: block; font-size: 11px; color: var(--sub); }
.free-wait b { font-size: 18px; }
.free-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--sub); }

/* ---- 下から出てくる画面（地図・計算の設定） ---- */
.sheet-wrap { display: none; position: fixed; inset: 0; z-index: 10; }
.sheet-wrap.is-open { display: block; }
.sheet-shade { position: absolute; inset: 0; background: rgba(24,32,46,0.35); }
.sheet {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 430px; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
}
.grip { width: 40px; height: 5px; border-radius: 3px; background: var(--btn-line); align-self: center; }
.sheet h2 { margin: 0; font-size: 17px; font-weight: 700; }
.map-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.map-head h1 { margin: 0; font-size: 18px; font-weight: 700; }
.map-from { font-size: 12px; color: var(--sub); margin-top: 4px; }
.map-box {
  position: relative; height: 300px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: #EEEAE0;
}
.map-nums {
  background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px;
  display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 10px;
}
.map-nums small { display: block; font-size: 12px; color: var(--sub); }
.map-nums b { font-size: 16px; }

/* ---- 予定の登録：下のボタン ---- */
.form-foot {
  padding: 16px 20px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
}
.btn-big { height: 52px; border-radius: 26px; font-size: 16px; }
.btn-danger {
  height: 48px; border-radius: 24px; width: 100%;
  border: 1.5px solid #C4473A; background: #FFFFFF; color: #C4473A;
  font-size: 15px; font-weight: 700;
}
.form-error {
  background: #FBE9E7; color: #A33A2F; border-radius: 12px;
  padding: 10px 14px; font-size: 13px; line-height: 1.6;
}

/* ---- ホーム：予定カード（押すと直す画面） ---- */
button.plan-card {
  display: flex; align-items: center; gap: 8px; text-align: left; width: 100%;
}
.plan-main { flex: 1; min-width: 0; }
.rode-btn {
  height: 32px; padding: 0 12px; border-radius: 16px; flex-shrink: 0;
  border: 1.5px solid var(--p); background: #FFFFFF; color: var(--dark);
  font-size: 13px; font-weight: 700;
}
.rode-done {
  height: 32px; padding: 0 10px; border-radius: 16px; flex-shrink: 0;
  background: var(--pale); color: var(--dark); font-size: 13px; font-weight: 700;
  display: flex; align-items: center;
}
.tl-row.is-done { opacity: 0.45; }
.tl-row .plan-wrap { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.plan-wrap .plan-card { border: 0; padding: 0; background: none; }

/* ---- 今いる場所の一覧 ---- */
.place-list { display: flex; flex-direction: column; gap: 8px; }
.place-area { font-size: 12px; font-weight: 700; color: var(--sub); margin-top: 6px; }
.place-btn {
  min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: #FFFFFF;
  text-align: left; padding: 10px 14px; font-size: 14px; width: 100%;
}
.place-btn.is-on { border: 2px solid var(--p); background: var(--pale); color: var(--dark); font-weight: 700; }

/* ---- 確認の小窓 ---- */
.dialog-wrap { display: none; position: fixed; inset: 0; z-index: 20; }
.dialog-wrap.is-open { display: flex; align-items: center; justify-content: center; }
.dialog-shade { position: absolute; inset: 0; background: rgba(24,32,46,0.45); }
.dialog {
  position: relative; width: calc(100% - 48px); max-width: 360px;
  background: var(--bg); border-radius: 18px; padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.dialog-text { margin: 0; font-size: 15px; line-height: 1.7; white-space: pre-line; }
.dialog-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-btns .btn-acc, .dialog-btns .btn-outline { height: 46px; }
.dialog-btns .is-danger { background: #C4473A; color: #FFFFFF; }

/* 下から出てくる画面の中身が縮まないように */
.sheet > * { flex-shrink: 0; }

/* ---- 提案一覧：時間が決まっていないもの・メッセージ ---- */
.ride-card.is-unknown { box-shadow: inset 4px 0 0 var(--btn-line); }
.ride-card.is-unknown .ride-arrive b { font-size: 15px; }
.sg-empty { font-size: 14px; color: var(--sub); padding: 8px 0; }
.sg-error {
  background: #FFFFFF; border: 1.5px solid var(--p); color: var(--dark);
  border-radius: 14px; padding: 14px 16px; font-size: 14px; font-weight: 700;
}

.dpa-mark { display: inline-block; vertical-align: 2px; margin-left: 4px; white-space: nowrap; }

/* ---- 地図（ペアの人の createMap の見た目を、決めたデザインに合わせる） ---- */
.map-box .leaflet-container { width: 100%; height: 100%; font: inherit; }
/* 今いる場所：メイン色の丸 */
.map-box .rm-me { background: var(--p) !important; box-shadow: 0 0 0 2px var(--p), 0 2px 6px rgba(0,0,0,.35) !important; }
/* 行き先：濃いメイン色のピン */
.map-box .rm-dest { background: var(--dark) !important; }
/* 道：メイン色の点線（丸い点） */
.map-box path.leaflet-interactive, .map-box svg path { stroke-linecap: round; }
.map-box svg path[stroke-width="6"] { stroke-dasharray: 1 11; stroke-width: 6; }
/* GPSの誤差の円もメイン色に */
.map-box svg path[stroke="#2563eb"] { stroke: var(--p); fill: var(--p); }

button.free-card { text-align: left; width: 100%; }
