/* =============================================
   Profile Banner（新訪客引導）
   ============================================= */
.profile-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #fff5f0 0%, #ffe8de 100%);
  border: 1px solid #ffc8ad;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #c24a00;
}
.profile-banner-btn {
  flex-shrink: 0;
  background: #ff4500;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.profile-banner-btn:hover { background: #e03c00; }

/* ── N：找回提示列 ──────────────────────────────────── */
.find-profile-hint {
  margin: -8px 0 10px;
  text-align: right;
  font-size: 11px;
  color: #aaa;
}
.banner-find-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: #ff7040;
  text-decoration: underline;
  cursor: pointer;
}
.banner-find-link:hover { color: #e03c00; }

/* ── N：找回 Modal body / 錯誤訊息 ─────────────────── */
.find-profile-body {
  padding: 4px 20px 20px;
}
.find-profile-error {
  font-size: 12px;
  color: #d9534f;
  margin: -6px 0 10px;
  line-height: 1.5;
}

/* =============================================
   Profile Chip（回訪者識別條）
   ============================================= */
.profile-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0fff4;
  border: 1px solid #b2dfca;
  border-radius: 20px;
  padding: 5px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #2e7d52;
  width: fit-content;
}
.chip-check { font-size: 13px; }
.chip-name  { font-weight: 700; }
.chip-label { opacity: 0.75; }
.chip-edit-btn {
  margin-left: 4px;
  background: none;
  border: 1px solid #b2dfca;
  border-radius: 12px;
  padding: 2px 9px;
  font-size: 11px;
  color: #2e7d52;
  cursor: pointer;
  font-weight: 600;
  transition: background .15s;
}
.chip-edit-btn:hover { background: #d4f0e0; }

/* =============================================
   Profile Modal
   ============================================= */
.profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.profile-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.profile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 700;
  font-size: 15px;
  color: #222;
}
.modal-close {
  background: none;
  border: none;
  font-size: 16px;
  color: #999;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { color: #333; background: #f0f0f0; }

/* Step indicator */
.profile-step-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 14px 20px;
}
.profile-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e8e8e8;
  border: 2px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  transition: all .2s;
  flex-shrink: 0;
}
.profile-step-dot.active {
  background: #ff4500;
  border-color: #ff4500;
  color: #fff;
}
.profile-step-dot.done {
  background: #28a745;
  border-color: #28a745;
  color: #fff;
}
.profile-step-line {
  flex: 1;
  height: 2px;
  background: #e8e8e8;
  max-width: 60px;
}

/* Modal body */
#profile-modal-body {
  padding: 4px 20px 20px;
}
.modal-step-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin: 12px 0 16px;
}
.modal-step-desc {
  font-size: 12px;
  color: #888;
  margin: -8px 0 14px;
}
.modal-field {
  margin-bottom: 14px;
}
.modal-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.modal-field input[type="text"],
.modal-field input[type="email"],
.modal-field input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
}
.modal-field input:focus { border-color: #ff4500; }

/* Profile-specific button group */
.pf-btn-group {
  display: flex;
  gap: 8px;
}
.pf-btn {
  flex: 1;
  padding: 8px 4px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all .15s;
}
.pf-btn.active {
  border-color: #ff4500;
  background: #fff5f0;
  color: #ff4500;
}
.pf-btn:hover:not(.active) { border-color: #aaa; }

/* Checkbox group */
.pf-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pf-checkbox {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.pf-checkbox:has(input:checked) {
  border-color: #ff4500;
  background: #fff5f0;
  color: #ff4500;
}
.pf-checkbox input { cursor: pointer; accent-color: #ff4500; }

/* Modal nav buttons */
.modal-nav {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal-btn-cancel,
.modal-btn-back {
  flex: 1;
  padding: 10px;
  border: 1.5px solid #ddd;
  border-radius: 9px;
  background: #fff;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.modal-btn-cancel:hover,
.modal-btn-back:hover { background: #f5f5f5; }
.modal-btn-next,
.modal-btn-submit {
  flex: 1.6;
  padding: 10px;
  border: none;
  border-radius: 9px;
  background: #ff4500;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.modal-btn-next:hover,
.modal-btn-submit:hover { background: #e03c00; }
.modal-btn-submit:disabled {
  background: #ffb89a;
  cursor: not-allowed;
}

/* =============================================
   Watch Sync Block（結果頁同步手錶區）
   ============================================= */
.watch-sync-block {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
  color: #e0e0e0;
}
.watch-sync-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #ef9f27;
  margin-bottom: 8px;
}
.watch-icon { font-size: 18px; }
.watch-sync-desc {
  font-size: 12px;
  color: #aaa;
  line-height: 1.6;
  margin: 0 0 12px;
}
.watch-sync-btn {
  width: 100%;
  padding: 10px;
  background: #ef9f27;
  border: none;
  border-radius: 9px;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.watch-sync-btn:hover { background: #d98f1f; }
.watch-sync-btn:disabled { background: #8a7040; color: #ccc; cursor: not-allowed; }

.watch-sync-result {
  margin-top: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(239,159,39,0.4);
  border-radius: 9px;
}
.plan-code-label {
  font-size: 11px;
  color: #aaa;
  margin-bottom: 4px;
}
.plan-code-display {
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 20px;
  font-weight: 800;
  color: #ef9f27;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.plan-code-hint {
  font-size: 11px;
  color: #888;
  line-height: 1.5;
}

/* ── L：計畫代碼列（代碼 + 複製按鈕） ───────────────── */
.plan-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.plan-code-copy-btn {
  padding: 4px 12px;
  background: #ef9f27;
  border: none;
  border-radius: 6px;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.plan-code-copy-btn:hover { background: #d98f1f; }

/* ── L：4步驟引導列表 ────────────────────────────── */
.watch-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.watch-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.watch-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #ef9f27;
  color: #1a1a1a;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.watch-step-text {
  font-size: 12px;
  color: #ccc;
  line-height: 1.55;
}
.watch-step-text b { color: #ef9f27; }

/* ── M：登出按鈕（淡灰色小字，推到左側） ──────────── */
.drawer-logout-btn {
  background: none;
  border: none;
  padding: 0;
  margin-right: auto;
  font-size: 11px;
  color: #bbb;
  text-decoration: underline;
  cursor: pointer;
  line-height: 1.4;
  text-align: left;
  align-self: center;
}
.drawer-logout-btn:hover { color: #999; }

/* =============================================
   Toast 通知
   ============================================= */
.pp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 10px 20px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  z-index: 2000;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: toastIn .25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* =============================================
   Profile Drawer（側邊編輯面板）
   ============================================= */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1100;
}
.profile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 96vw);
  background: #fff;
  z-index: 1101;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.profile-drawer.open {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 700;
  font-size: 15px;
  color: #222;
  flex-shrink: 0;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 20px;
  -webkit-overflow-scrolling: touch;
}
.drawer-footer {
  display: flex;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

/* Fueling ID row */
.drawer-fid-row {
  background: #f8f8f8;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.drawer-fid-label {
  font-size: 11px;
  color: #888;
  margin-bottom: 2px;
}
.drawer-fid-value {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}
.drawer-fid-text {
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 15px;
  font-weight: 700;
  color: #ff4500;
  letter-spacing: 1px;
}
.fid-copy-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 7px;
  padding: 3px 10px;
  font-size: 11px;
  color: #555;
  cursor: pointer;
  font-weight: 600;
  transition: all .15s;
}
.fid-copy-btn:hover { background: #f0f0f0; border-color: #aaa; }

/* Drawer field (reuse .modal-field, .pf-btn-group, .pf-btn styles) */
.drawer-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 16px 0 10px;
}

/* Drawer save/cancel buttons */
.drawer-btn-cancel {
  flex: 1;
  padding: 11px;
  border: 1.5px solid #ddd;
  border-radius: 9px;
  background: #fff;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.drawer-btn-cancel:hover { background: #f5f5f5; }
.drawer-btn-save {
  flex: 1.6;
  padding: 11px;
  border: none;
  border-radius: 9px;
  background: #ff4500;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.drawer-btn-save:hover     { background: #e03c00; }
.drawer-btn-save:disabled  { background: #ffb89a; cursor: not-allowed; }

/* =============================================
   Drift Banner（資料修改提示）
   ============================================= */
.profile-drift-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 9px;
  padding: 9px 13px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #6d4c00;
}
.profile-drift-banner.visible { display: flex; }
.drift-text { flex: 1; line-height: 1.4; }
.drift-reload-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid #f0c040;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #6d4c00;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.drift-reload-btn:hover { background: #fff3cd; }
