.member-title { font-size: 16px; font-weight: 700; flex: 1; text-align: center; }
.btn-back, .btn-text {
  background: none; border: none; font-size: 14px; cursor: pointer;
  color: var(--accent); padding: 8px 4px; text-decoration: none;
}
.btn-text { color: var(--muted); }
.loading-box { text-align: center; padding: 48px 20px; color: var(--muted); }
.spinner {
  display: inline-block; width: 20px; height: 20px; vertical-align: middle;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.profile-card {
  display: flex; align-items: flex-start; gap: 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 24px;
}
.profile-card.profile-editable { flex-wrap: wrap; }
.profile-form-inline { flex: 1; min-width: 200px; }
.member-completeness-wrap { width: 100%; margin-bottom: 14px; }
.member-completeness-bar { height: 6px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.member-completeness-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.member-completeness-label { font-size: 12px; color: var(--muted); margin: 6px 0 8px; }
.member-check-list { display: flex; flex-wrap: wrap; gap: 6px; }
.member-check { font-size: 11px; padding: 4px 8px; border-radius: 999px; background: #f3f4f6; }
.member-check.ok { color: #15803d; background: #ecfdf5; }
.member-check.miss { color: #9ca3af; }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.profile-avatar.placeholder {
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
}
.profile-info h2 { font-size: 18px; font-weight: 700; }
.profile-edit-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 20px;
}
.profile-form { display: flex; flex-direction: column; gap: 12px; }
.profile-form .field { display: flex; flex-direction: column; gap: 6px; }
.profile-form .field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.profile-form .input { width: 100%; }
.input-readonly {
  background: #f9fafb; color: var(--muted); cursor: not-allowed;
}
.field-hint { font-size: 11px; line-height: 1.4; }
.field-hint-warn { color: #b45309; }
.member-birthday-row {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px;
}
.member-birthday-row .input { min-width: 0; padding-left: 8px; padding-right: 8px; }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.member-passport-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px;
}
.mp-stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; text-align: center;
}
.mp-num { display: block; font-size: 18px; font-weight: 700; }
.mp-lbl { font-size: 12px; color: var(--muted); }

.apt-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.apt-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.apt-body { font-size: 13px; color: var(--muted); margin-top: 6px; }
.apt-status {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
  background: #f3f4f6; color: var(--muted);
}
.apt-status.status-confirmed { background: #ecfdf5; color: #059669; }
.apt-status.status-pending_deposit { background: #fff7ed; color: #c2410c; }
.apt-status.status-cancelled { background: #fef2f2; color: #b91c1c; }
.empty-msg { text-align: center; padding: 24px; }
.empty-msg a { color: var(--accent); }

.section-note { font-size: 12px; margin: -6px 0 12px; }
.apt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.btn-sm {
  padding: 8px 12px; font-size: 12px; font-weight: 600; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.btn-sm.btn-danger { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.btn-sm.btn-line-contact {
  background: #06c755; color: #fff; border-color: #06c755; text-decoration: none;
}
.btn-sm.btn-google-cal { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.apt-hint { font-size: 11px; line-height: 1.4; }

.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.modal-panel {
  position: relative; max-width: 400px; margin: 8vh auto; background: #fff;
  border-radius: 16px; padding: 20px; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
}
.modal-panel h3 { font-size: 18px; margin-bottom: 8px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1; margin-top: 0; }
.cal-toolbar.compact { margin-bottom: 8px; }
.cal-weekdays.compact { margin-bottom: 4px; }
#rsSlotList { margin-top: 12px; }

.login-panel.compact { padding: 24px 0; }

/* ── 會員應用：票券／儲值金／點數／評價 ── */
.member-section { margin: 8px 0 20px; }
.member-passport-stats { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }

.member-acc {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 10px; overflow: hidden;
}
.member-acc > summary {
  cursor: pointer; padding: 14px 16px; font-size: 14px; font-weight: 700;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.member-acc > summary::-webkit-details-marker { display: none; }
.member-acc > summary::after { content: "▾"; color: var(--muted); font-size: 12px; }
.member-acc[open] > summary::after { content: "▴"; }
.acc-body { padding: 0 16px 12px; }
.list-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px;
}
.list-row:first-child { border-top: none; }
.list-row .muted { font-size: 12px; }
.ticket-qty { font-weight: 700; white-space: nowrap; }
.amt-pos { color: #059669; font-weight: 700; white-space: nowrap; }
.amt-neg { color: #b91c1c; font-weight: 700; white-space: nowrap; }

.survey-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.survey-top { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.survey-top .muted { font-size: 12px; }
.star-row { display: flex; gap: 4px; margin-bottom: 8px; }
.star-btn {
  background: none; border: none; cursor: pointer; font-size: 26px; line-height: 1;
  color: #f59e0b; padding: 0 2px;
}
.survey-comment { width: 100%; margin-bottom: 8px; resize: vertical; }
.survey-submit { margin-top: 0; }
.survey-msg { font-size: 12px; margin-top: 6px; }
.survey-done { color: #059669; font-weight: 700; text-align: center; padding: 8px 0; }

/* Loyalty guest center */
.loyalty-section { margin: 16px 0; display: grid; gap: 14px; }
.loyalty-guest-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px;
}
.loyalty-guest-card.loyalty-disabled { opacity: .92; }
.loyalty-membership-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ly-accent, #64748b) 12%, #fff) 0%, var(--card) 56%);
}
.loyalty-guest-head { margin-bottom: 10px; }
.loyalty-guest-head .section-title { margin: 0; }
.loyalty-guest-empty { margin: 0; font-size: 13px; }
.loyalty-level-hero { margin-bottom: 12px; }
.loyalty-level-pill {
  display: inline-flex; align-items: center; gap: 4px; color: #fff;
  font-weight: 700; font-size: 14px; padding: 7px 14px; border-radius: 999px;
}
.loyalty-meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 2px;
}
.loyalty-meta-cell {
  background: rgba(255,255,255,.72); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
}
.loyalty-meta-cell span { display: block; font-size: 11px; margin-bottom: 2px; }
.loyalty-meta-cell strong { font-size: 14px; }
.loyalty-sub { font-size: 13px; margin: 14px 0 8px; font-weight: 700; }
.loyalty-benefit-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.loyalty-benefit-chip {
  display: inline-flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 8px 10px; font-size: 13px; font-weight: 600;
}
.loyalty-benefit-chip em {
  font-style: normal; font-weight: 500; font-size: 11px; color: #6b7280;
}
.loyalty-progress {
  height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 6px 0;
}
.loyalty-progress-bar {
  height: 100%; background: var(--ly-accent, #64748b); border-radius: 999px;
  transition: width .25s ease;
}
.loyalty-progress-label { margin: 0; font-size: 12px; }
.loyalty-points-hero {
  display: flex; align-items: baseline; gap: 6px;
  padding: 12px 14px; border-radius: 14px; margin: 4px 0 8px;
  background: #f8fafc; border: 1px solid var(--line);
}
.loyalty-points-hero strong { font-size: 28px; line-height: 1; letter-spacing: -0.02em; }
.loyalty-points-hero span { font-size: 13px; color: #6b7280; font-weight: 600; }
.loyalty-ticket-list, .loyalty-mini-list { display: grid; gap: 8px; }
.loyalty-ticket-card, .loyalty-mini-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff;
}
.loyalty-ticket-card strong, .loyalty-mini-row span { display: block; font-size: 13px; }
.loyalty-ticket-card .muted { display: block; font-size: 11px; margin-top: 2px; }
.loyalty-ticket-card.is-used,
.loyalty-ticket-card.is-expired { opacity: .72; }
.loyalty-mini-row strong { font-size: 13px; }
.loyalty-mini-row strong.is-plus { color: #059669; }
.loyalty-mini-row strong.is-minus { color: #dc2626; }
.loyalty-ach-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.loyalty-ach-item {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; gap: 4px; opacity: .5; font-size: 12px;
  background: #fff;
}
.loyalty-ach-item.is-unlocked {
  opacity: 1; background: #f8fafc; border-color: #d1d5db;
}
.loyalty-ach-icon { font-size: 22px; }
.loyalty-ach-item strong { font-size: 13px; }
@media (prefers-color-scheme: dark) {
  .loyalty-membership-card {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--ly-accent, #64748b) 22%, transparent) 0%, var(--card) 60%);
  }
  .loyalty-meta-cell,
  .loyalty-benefit-chip,
  .loyalty-ticket-card,
  .loyalty-mini-row,
  .loyalty-ach-item,
  .loyalty-points-hero { background: rgba(255,255,255,.04); }
  .loyalty-ach-item.is-unlocked { background: rgba(255,255,255,.07); }
}
