/* 内見ナビ — デモアプリ群と同じライトテーマ（白基調・青系グラデ） */
:root {
  --bg: #f2f6fb;
  --card: #ffffff;
  --text: #1c2b3a;
  --sub: #64748b;
  --line: #dbe4ef;
  --accent: #3b76f6;
  --accent2: #06a6c9;
  --grad: linear-gradient(135deg, #3b76f6, #06a6c9);
  --danger: #dc2626;
  --ok: #16a34a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  padding-bottom: 40px;
}

/* ヘッダー */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
}
.brand {
  font-weight: 800; font-size: 18px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tabs { display: flex; gap: 6px; }
.tab {
  border: 1px solid var(--line); background: var(--card); color: var(--sub);
  padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
}
.tab.active { background: var(--grad); color: #fff; border-color: transparent; }

.view { max-width: 560px; margin: 0 auto; padding: 14px; }

/* ルート画面 */
.route-summary { display: flex; align-items: center; gap: 10px; padding: 4px 2px 12px; flex-wrap: wrap; }
.route-summary .count { font-size: 13px; color: var(--sub); font-weight: 600; }
.route-summary .next-label { font-size: 14px; font-weight: 700; }
.route-list { display: flex; flex-direction: column; gap: 10px; }
.route-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  display: flex; align-items: center; gap: 12px; padding: 14px;
  box-shadow: 0 1px 3px rgba(28, 43, 58, 0.05);
}
.route-card.next { border: 2px solid var(--accent); }
.route-card.done { opacity: 0.55; }
.route-order {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.route-card.done .route-order { background: var(--ok); }
.route-main { flex: 1; min-width: 0; cursor: pointer; }
.route-name { font-weight: 700; font-size: 16px; }
.badge-next {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 2px;
}
.route-addr { color: var(--sub); font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }
.map-btn {
  flex-shrink: 0; text-align: center; text-decoration: none;
  background: var(--card); border: 1.5px solid var(--accent); color: var(--accent);
  border-radius: 12px; padding: 8px 12px; font-size: 14px; font-weight: 700; line-height: 1.2;
}
.map-btn span { font-size: 10px; font-weight: 600; }

/* 物件カード */
.back-btn { background: none; border: none; color: var(--accent); font-size: 15px; font-weight: 600; padding: 4px 0 12px; }
.d-name { font-size: 22px; font-weight: 800; }
.d-addr { color: var(--sub); font-size: 14px; margin: 4px 0 12px; }
.d-sec {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-top: 12px;
}
.d-sec h2 { font-size: 15px; margin-bottom: 8px; }
.d-line { font-size: 15px; line-height: 1.6; }
.d-line.dim { color: var(--sub); }
.d-line.pre { white-space: pre-wrap; }
.d-photo { width: 100%; border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--line); }
.reveal-btn {
  display: block; width: 100%; margin-top: 10px; padding: 14px;
  border: 1.5px dashed var(--accent); border-radius: 12px;
  background: #eef4ff; color: var(--accent); font-size: 15px; font-weight: 700;
}
.key-num {
  margin-top: 10px; padding: 16px; text-align: center;
  background: var(--grad); color: #fff; border-radius: 12px;
  font-size: 40px; font-weight: 800; letter-spacing: 8px;
}
.tel-btn {
  display: block; text-align: center; padding: 12px; border-radius: 12px;
  border: 1.5px solid var(--accent); color: var(--accent);
  font-weight: 700; text-decoration: none;
}

/* 退出チェック */
.checkout .check-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 4px;
  border-bottom: 1px solid var(--line); font-size: 15px;
}
.checkout .check-item input { width: 22px; height: 22px; accent-color: var(--accent); }
.checkout .primary-btn { margin-top: 14px; }

/* ボタン共通 */
.primary-btn {
  display: block; border: none; border-radius: 12px; padding: 13px 18px;
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 700;
  text-align: center; text-decoration: none; cursor: pointer;
}
.primary-btn:disabled { opacity: 0.4; cursor: default; }
.primary-btn.wide { width: 100%; margin-top: 10px; }
.primary-btn.small { padding: 9px 14px; font-size: 14px; display: inline-block; }
.ghost-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--sub);
  border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.ghost-btn.small { padding: 8px 12px; font-size: 13px; }
.ghost-btn.danger { color: var(--danger); border-color: #f3c4c4; }
main > .ghost-btn { margin-top: 16px; width: 100%; }

/* 物件管理 */
.edit-head { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.edit-list { display: flex; flex-direction: column; gap: 10px; }
.edit-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
}
.edit-order { display: flex; flex-direction: column; gap: 4px; }
.order-btn {
  border: 1px solid var(--line); background: var(--bg); border-radius: 6px;
  width: 28px; height: 22px; font-size: 10px; color: var(--sub); cursor: pointer;
}
.order-btn:disabled { opacity: 0.3; }
.edit-main { flex: 1; min-width: 0; }
.edit-name { font-weight: 700; font-size: 14px; }
.edit-sub { color: var(--sub); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }

/* 取り込み */
.import-area {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-bottom: 12px;
}
.import-area .hint { font-size: 13px; color: var(--sub); margin-bottom: 8px; }
.import-area textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  font-size: 13px; font-family: inherit;
}
.row-btns { display: flex; gap: 8px; margin-top: 10px; }

/* フォーム（モーダル） */
.modal {
  position: fixed; inset: 0; z-index: 20; background: rgba(28, 43, 58, 0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px 14px; overflow-y: auto;
}
.modal-card {
  background: var(--card); border-radius: 16px; padding: 18px;
  width: 100%; max-width: 520px;
}
.modal-card h2 { font-size: 18px; margin-bottom: 12px; }
.modal-card label { display: block; font-size: 13px; font-weight: 600; color: var(--sub); margin-top: 10px; }
.modal-card input[type="text"], .modal-card input[type="tel"], .modal-card textarea {
  width: 100%; margin-top: 4px; padding: 11px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; font-family: inherit;
}
.modal-card fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 12px; margin-top: 14px; }
.modal-card legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.photo-label input[type="file"] { display: block; margin-top: 6px; font-size: 13px; }
.photo-state { display: block; font-size: 12px; color: var(--ok); margin-top: 4px; font-weight: 600; }
.modal-card .row-btns { margin-top: 16px; }
.modal-card .row-btns .primary-btn { flex: 1; }

/* 物件資料 */
.doc-btn {
  display: block; width: 100%; margin-top: 10px; padding: 13px;
  border: 1.5px solid var(--accent); border-radius: 12px;
  background: var(--card); color: var(--accent); font-size: 15px; font-weight: 700; cursor: pointer;
}
.ad-badge {
  display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px;
  background: #fff4e0; color: #b45309; border: 1px solid #f3d9a4;
  font-size: 12px; font-weight: 700; vertical-align: 1px;
}
.doc-viewer {
  position: fixed; inset: 0; z-index: 40; background: rgba(28, 43, 58, 0.92);
  display: flex; flex-direction: column;
}
.doc-close {
  align-self: flex-end; margin: 10px 14px; padding: 9px 16px;
  border: none; border-radius: 999px; background: #fff; color: var(--text);
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.doc-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 0 8px 12px; }
.doc-img { display: block; width: 100%; border-radius: 8px; background: #fff; }
.doc-frame { display: block; width: 100%; height: 100%; border: none; border-radius: 8px; background: #fff; }

/* その他 */
.empty {
  text-align: center; color: var(--sub); font-size: 14px; line-height: 1.8;
  padding: 40px 0;
}
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; z-index: 30;
  max-width: 90vw;
}

/* ---- 公開版のみ：ログイン画面 ---- */
.login-wrap {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; width: 100%; max-width: 380px; text-align: center;
}
.login-card h1 {
  font-size: 22px; font-weight: 800; margin-bottom: 6px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-card p { font-size: 13px; color: var(--sub); margin-bottom: 16px; }
.login-card input {
  width: 100%; padding: 13px; font-size: 16px; text-align: center;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px;
}
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 6px; }
.sync-info { text-align: center; color: var(--sub); font-size: 12px; padding: 14px 0 4px; }
