:root {
  /* アンティグア × マヤ織物（ウイピル）パレット */
  --terracotta: #c8543b;   /* コロニアルの壁 */
  --terracotta-d: #a8402b;
  --teal: #1d7a73;         /* 深い緑青 */
  --teal-d: #145c57;
  --gold: #e8a93c;         /* 黄金 */
  --magenta: #c0397a;      /* 織物のアクセント */
  --cream: #fbf4e8;        /* 生成り */
  --ink: #2a211c;
  --muted: #8a7d72;
  --line: #ece0cf;
  --ok: #2f9e6e;
  --danger: #c8543b;
  --shadow: 0 10px 30px rgba(60,40,25,.16);
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #2a4b48 0%, #18302e 55%, #101f1e 100%);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}

/* スマホ枠（PCで見ても端末風に中央表示） */
.phone {
  position: relative;
  width: 100%; max-width: 412px;
  height: 100vh; max-height: 880px;
  background: var(--cream);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  border-radius: 28px;
}
@media (max-width: 440px) { .phone { border-radius: 0; max-height: none; } }

.screen { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen::-webkit-scrollbar { width: 0; }

.hidden { display: none !important; }

/* ---------- 共通パーツ ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(251,244,232,.92); backdrop-filter: blur(8px);
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: .3px; }
.topbar .sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.pad { padding: 16px 18px 28px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--muted); margin: 22px 4px 10px; text-transform: uppercase; letter-spacing: .6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: none; cursor: pointer;
  padding: 15px 18px; border-radius: 14px; font-size: 16px; font-weight: 700;
  background: var(--terracotta); color: #fff; transition: transform .08s ease, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn:hover { filter: brightness(1.05); }
.btn.secondary { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.teal { background: var(--teal); }
.btn.gold { background: var(--gold); color: #4a3408; }
.btn.ghost { background: transparent; color: var(--terracotta); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { width: auto; padding: 9px 14px; font-size: 13px; border-radius: 10px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #5b4f45; }
.field input, .field select {
  width: 100%; padding: 13px 14px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--teal); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.error { color: var(--danger); font-size: 13px; margin: 4px 0 0; min-height: 16px; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 4px 14px rgba(80,55,30,.06); margin-bottom: 14px;
}
.card-body { padding: 14px 16px; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge.cafe { background: #f3e4d2; color: #8a5a22; }
.badge.food { background: #f6dde6; color: var(--magenta); }
.badge.stay { background: #d9efed; color: var(--teal-d); }
.badge.exp  { background: #fbeccb; color: #8a6310; }

.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.price { font-weight: 800; font-size: 17px; }
.thumb { width: 100%; height: 130px; display:flex; align-items:center; justify-content:center; font-size: 52px; }

/* ---------- 認証画面 ---------- */
.auth-hero {
  height: 230px; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px; color: #fff;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.45) 100%),
    linear-gradient(135deg, var(--magenta), var(--terracotta) 45%, var(--gold));
  position: relative; overflow: hidden;
}
.auth-hero .volcano { position:absolute; bottom:-2px; left:0; right:0; font-size: 90px; text-align:center; opacity:.25; }
.auth-hero h1 { margin: 0; font-size: 34px; letter-spacing: 1px; }
.auth-hero p { margin: 6px 0 0; font-size: 14px; opacity: .95; }
.weave { height: 8px; background: repeating-linear-gradient(90deg, var(--magenta) 0 10px, var(--gold) 10px 20px, var(--teal) 20px 30px, var(--terracotta) 30px 40px); }
.auth-tabs { display: flex; gap: 8px; margin: 18px 0 6px; }
.auth-tabs button { flex:1; padding: 10px; border: none; background: transparent; font-size: 15px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.auth-tabs button.active { color: var(--terracotta); border-color: var(--terracotta); }

/* ---------- カレンダー ---------- */
.cal { background:#fff; border:1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.cal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 10px; }
.cal-head button { border:none; background:#f3ece0; width:34px; height:34px; border-radius:10px; font-size:16px; cursor:pointer; }
.cal-grid { display:grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
.cal-dow { text-align:center; font-size:11px; color:var(--muted); font-weight:700; padding-bottom:4px; }
.cal-cell { aspect-ratio: 1; border-radius: 11px; border:1px solid transparent; background:#faf4ea; display:flex; flex-direction:column; align-items:center; justify-content:center; cursor:pointer; position:relative; }
.cal-cell.empty { background:transparent; cursor:default; }
.cal-cell.past { opacity:.32; cursor:not-allowed; }
.cal-cell.sel { background: var(--teal); color:#fff; }
.cal-cell .d { font-size:14px; font-weight:700; }
.cal-cell .slots { font-size:9px; margin-top:2px; }
.cal-cell .dot { width:5px;height:5px;border-radius:50%;background:var(--gold); position:absolute; bottom:6px; }
.cal-cell.sel .dot { background:#fff; }
.cal-cell.full { opacity:.4; }

/* ---------- アルバム ---------- */
.album-grid { display:grid; grid-template-columns: repeat(3,1fr); gap:4px; }
.album-grid .ph { aspect-ratio:1; background:#eee; border-radius:8px; object-fit:cover; width:100%; cursor:pointer; }
.empty-state { text-align:center; padding: 50px 24px; color: var(--muted); }
.empty-state .big { font-size: 52px; }

/* ---------- ステップ / モーダル ---------- */
.sheet-back { position:absolute; inset:0; background:rgba(30,20,12,.5); z-index:20; display:flex; align-items:flex-end; }
.sheet { background:var(--cream); width:100%; border-radius:22px 22px 0 0; padding: 20px 18px 26px; max-height: 88%; overflow-y:auto; animation: up .25s ease; }
@keyframes up { from { transform: translateY(40px); opacity:.6 } to { transform:none; opacity:1 } }
.sheet h2 { margin: 4px 0 14px; font-size: 20px; }
.sheet .grab { width:42px; height:4px; background:#d8c9b6; border-radius:2px; margin: 0 auto 14px; }

.pay-row { display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px dashed var(--line); }
.pay-total { display:flex; justify-content:space-between; padding:14px 0 4px; font-size:18px; font-weight:800; }

.toast { position:absolute; left:50%; bottom:96px; transform:translateX(-50%); background:var(--ink); color:#fff; padding:11px 18px; border-radius:999px; font-size:14px; z-index:50; box-shadow:var(--shadow); animation: up .2s ease; }

.stamp { display:grid; grid-template-columns: repeat(5,1fr); gap:8px; margin: 8px 0 4px; }
.stamp .s { aspect-ratio:1; border-radius:50%; border:2px dashed var(--line); display:flex; align-items:center; justify-content:center; font-size:22px; background:#fff; }
.stamp .s.on { border:none; background: radial-gradient(circle at 30% 30%, var(--gold), var(--terracotta)); color:#fff; box-shadow:0 4px 10px rgba(200,84,59,.4); }

.list-item { display:flex; align-items:center; gap:14px; padding:13px 0; border-bottom:1px solid var(--line); }
.ava { width:48px;height:48px;border-radius:14px; display:flex;align-items:center;justify-content:center;font-size:24px; background:#f3ece0; flex:none; }

/* ---------- 下部タブ ---------- */
.tabbar { display:flex; background:#fff; border-top:1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tab { flex:1; border:none; background:transparent; display:flex; flex-direction:column; align-items:center; gap:2px; padding:7px 0; font-size:11px; color:var(--muted); font-weight:600; cursor:pointer; }
.tab .tab-ico { font-size:21px; filter: grayscale(.4); }
.tab.active { color: var(--terracotta); }
.tab.active .tab-ico { filter:none; transform: translateY(-1px); }

.fab-note { font-size:12px; color:var(--muted); text-align:center; padding: 6px 18px 0; }

/* ---------- 音声ガイド ---------- */
.langseg { display:flex; gap:6px; margin-top:12px; background:#f0e6d6; padding:4px; border-radius:12px; }
.langseg button { flex:1; border:none; background:transparent; padding:8px 4px; border-radius:9px; font-size:13px; font-weight:700; color:var(--muted); cursor:pointer; }
.langseg button.on { background:#fff; color:var(--terracotta); box-shadow:0 2px 6px rgba(80,55,30,.12); }
.route { position:relative; }
.route-item { display:flex; gap:12px; align-items:stretch; }
.route-item > .route-num {
  position:relative; flex:none; width:28px; height:28px; border-radius:50%;
  background:var(--teal); color:#fff; font-size:14px; font-weight:800;
  display:flex; align-items:center; justify-content:center; margin-top:14px;
}
.route-item:not(:last-child) > .route-num::after {
  content:""; position:absolute; top:34px; bottom:-14px; width:2px; left:50%;
  transform:translateX(-50%); background:var(--line);
}

/* 言語ラベル */
.field-label{ display:block; font-size:13px; font-weight:700; margin-bottom:8px; color:#5b4f45; }

/* 6タブ用に少し詰める */
.tabbar .tab{ font-size:10px; }
.tabbar .tab .tab-ico{ font-size:19px; }

/* 再生プレイヤー（読み上げ文を前面に） */
.player h2{ font-size:18px; }
.player-text{ margin:16px 0; max-height:340px; overflow-y:auto; font-size:21px; line-height:2; color:#9a8d80; padding:4px 2px; }
.player-text .sent{ transition:color .2s, background .2s; border-radius:6px; }
.player-text .sent.active{ color:var(--ink); font-weight:800; background:#fbeccb; box-shadow:0 0 0 4px #fbeccb; }
.player-ctl{ display:flex; gap:10px; }
.player-ctl .btn{ flex:1; }

/* マップ */
.mapbox{ width:100%; height:230px; border-radius:16px; overflow:hidden; border:1px solid var(--line); background:#eee; }
.mapbox iframe{ width:100%; height:100%; border:0; display:block; }

/* 企業向けページ：箇条書き */
ul.clean2{ list-style:none; }
ul.clean2 li{ font-size:15px; line-height:1.7; padding-left:22px; position:relative; color:#43382f; margin-bottom:4px; }
ul.clean2 li::before{ content:"✓"; color:var(--teal); font-weight:800; position:absolute; left:0; }

/* プロフィール：国チップ */
.chips{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{ display:inline-flex; align-items:center; gap:6px; background:#f3e4d2; color:#7a5320; font-size:14px; font-weight:700; padding:7px 12px; border-radius:999px; cursor:pointer; }
.chip b{ color:#b06a2a; font-size:12px; }
.field select{ width:100%; padding:13px 14px; font-size:16px; border:1.5px solid var(--line); border-radius:12px; background:#fff; color:var(--ink); }
.field select:focus{ outline:none; border-color:var(--teal); }

/* アミーゴカード プレビュー */
.cardprev{ border-radius:16px; overflow:hidden; background:#f3ece0; min-height:120px; }

/* アバター */
.avatar{ border-radius:50%; background-size:cover; background-position:center; flex:none; display:flex; align-items:center; justify-content:center; }
.avatar.ph{ background:#f3e4d2; color:#8a5a22; font-weight:800; }

/* 7タブ用にさらに詰める */
.tabbar .tab{ font-size:9.5px; padding:7px 0; }
.tabbar .tab .tab-ico{ font-size:18px; }
.tabbar .tab .tab-label{ white-space:nowrap; }

/* なかま：チャット */
.chat-screen{ display:flex; flex-direction:column; height:100%; }
.chat-top{ display:flex; align-items:center; gap:10px; }
.chat-back{ border:none; background:#f3ece0; width:34px; height:34px; border-radius:10px; font-size:20px; cursor:pointer; flex:none; }
.chat-body{ flex:1; overflow-y:auto; padding:16px 14px; display:flex; flex-direction:column; gap:10px; background:#f6efe2; }
.msg{ display:flex; gap:8px; align-items:flex-end; max-width:86%; }
.msg.me{ align-self:flex-end; flex-direction:row; justify-content:flex-end; }
.msg .bubble{ background:#fff; border:1px solid var(--line); padding:9px 13px; border-radius:16px; border-bottom-left-radius:5px; }
.msg.me .bubble{ background:var(--teal); color:#fff; border:none; border-radius:16px; border-bottom-right-radius:5px; }
.msg .who{ font-size:11px; font-weight:800; color:var(--magenta); margin-bottom:3px; }
.msg .txt{ font-size:15px; line-height:1.45; word-break:break-word; }
.loc-chip{ display:inline-block; margin-top:7px; font-size:12px; font-weight:700; background:rgba(255,255,255,.25); color:inherit; padding:5px 10px; border-radius:999px; text-decoration:none; border:1px solid rgba(255,255,255,.5); }
.msg:not(.me) .loc-chip{ background:#f3e4d2; color:#8a5a22; border-color:transparent; }
.chat-bar{ display:flex; gap:8px; align-items:center; padding:10px 12px calc(10px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:#fff; }
.chat-bar input{ flex:1; padding:11px 14px; border:1.5px solid var(--line); border-radius:999px; font-size:15px; }
.chat-bar input:focus{ outline:none; border-color:var(--teal); }

/* 5プラットフォーム投稿 */
.plat-grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:8px; }
.plat{ border:none; cursor:pointer; color:#fff; border-radius:14px; padding:12px 4px; display:flex; flex-direction:column; align-items:center; gap:5px; font-size:10px; font-weight:700; }
.plat span:first-child{ font-size:22px; }
.plat:active{ transform:scale(.96); }

/* ---------- 組織図（紹介エンジン） ---------- */
.orgtree{ list-style:none; margin:0; padding-left:16px; }
.orgtree li{ margin:4px 0; position:relative; }
.orgnode{ display:inline-block; padding:3px 9px; border-radius:8px; font-size:13px; font-weight:600; }
.orgnode.n-amber{ background:#faeeda; color:#854f0b; }
.orgnode.n-teal{ background:#e1f5ee; color:#0f6e56; }
.orgnode.n-purple{ background:#eeedfe; color:#534ab7; }

/* ログイン手段（Google／メール）— SMSが届かない人の入口 */
.or-divider{ display:flex; align-items:center; text-align:center; color:#9a8f80; font-size:12px; margin:18px 0 14px; }
.or-divider::before, .or-divider::after{ content:""; flex:1; height:1px; background:#e6ddd0; }
.or-divider span{ padding:0 12px; }
.btn-google{ background:#fff; color:#222; border:1px solid #dcdcdc; }
.btn-google:active{ background:#f5f5f5; }
