:root {
  --ink: #0b1f24;
  --muted: #5c6f76;
  --accent: #1a6b5c;
  --accent-dark: #145247;
  --accent-soft: rgba(26, 107, 92, 0.10);
  --accent-tint: #eef3f1;
  --accent-border: rgba(11, 31, 36, 0.16);
  --primary-dark: #145247;
  --btn-shadow: rgba(26, 107, 92, 0.28);
  --line: #e5ece9;
  --line-strong: #d3ddd9;
  --bg: #f5f8f7;
  --card: #fff;
  --wkend: #c45c4a;
  --nav-h: 52px;
  --header-h: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Sora", "Noto Sans TC", "PingFang TC", "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
#loginScreen:not(.hidden) {
  position: fixed;
  inset: 0;
  z-index: 10001;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-transform: translateZ(0);
}
#appScreen.hidden {
  pointer-events: none !important;
}
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* 登入：fixed 全螢幕，關掉後不會佔版把後台擠下去 */
.login-screen {
  position: fixed; inset: 0; z-index: 10001;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg);
  transition: opacity .24s ease, transform .24s ease;
}
#loginScreen.hidden {
  display: none !important;
  pointer-events: none !important;
}
#loginScreen.is-hiding {
  opacity: 0; transform: translateY(-10px); pointer-events: none;
}
#loginScreen.is-restoring .login-card { opacity: .92; }
#loginScreen.is-splash-restore {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
}
.login-brand {
  display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 8px;
}
.login-brand-icon {
  width: 56px; height: 56px; border-radius: 14px; object-fit: cover;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .08);
}
.login-brand h1 { font-size: 22px; margin: 0; }
#appScreen {
  opacity: 0;
  transition: opacity .28s ease .04s;
}
#appScreen.is-visible { opacity: 1; }
.login-screen .btn,
.login-screen .btn-line,
.login-screen a {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}
.login-card { background: var(--card); border-radius: 20px; padding: 36px 28px; width: 100%; max-width: 380px; box-shadow: 0 4px 24px rgba(0,0,0,.06); }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-hint { font-size: 12px; color: var(--muted); margin-top: 16px; text-align: center; }
.login-email-msg { font-size: 12px; min-height: 18px; margin: 4px 0 10px; line-height: 1.5; }
.login-email-msg.error { color: #dc2626; }
.login-email-msg.success { color: #059669; }
.login-email-msg.info { color: #2563eb; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-divider span { flex-shrink: 0; }
.login-code-box { margin-top: 4px; }
.login-code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 6px;
}
.login-code-head .label { margin-bottom: 0; flex: 1; min-width: 0; }
.login-resend-btn {
  border: none; background: none; color: #2563eb; font-size: 13px; font-weight: 600;
  padding: 6px 4px; cursor: pointer; flex-shrink: 0; line-height: 1.3;
}
.login-resend-btn:disabled { color: var(--muted); cursor: not-allowed; }
.login-code-input { margin-bottom: 12px; letter-spacing: 4px; text-align: center; font-weight: 600; }
.login-code-box .btn { margin-top: 0; }
.privacy-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--muted); margin: 12px 0 16px; line-height: 1.5; cursor: pointer; }
.privacy-consent input { margin-top: 3px; flex-shrink: 0; accent-color: var(--accent); }
.label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: block; }
.input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 15px; margin-bottom: 14px; background: #fafafa; }
.input::placeholder,
.textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}
.btn { width: 100%; padding: 14px; background: var(--accent-dark); color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; transition: transform .12s ease, opacity .12s ease, filter .12s ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; }
.btn:active:not(:disabled):not(.is-busy), .btn.is-pressed:not(:disabled):not(.is-busy) { transform: scale(0.97); filter: brightness(0.94); }
.btn-secondary { padding: 10px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .12s ease, background .12s ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn-secondary:active:not(:disabled):not(.is-busy) { transform: scale(0.97); background: #f3f4f6; }
.text-btn { background: none; border: none; color: var(--accent-dark); font-size: 14px; font-weight: 600; cursor: pointer; }
.text-btn.danger { color: #dc2626; }
.textarea { resize: vertical; min-height: 72px; font-family: inherit; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; margin: 10px 0; cursor: pointer; }
.checkbox-label input { margin-top: 3px; }
.btn-small { width: auto; padding: 8px 14px; font-size: 13px; }

/* 手機 App Shell */
.mob-app {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  max-width: 480px; margin: 0 auto;
  background: var(--card);
  position: relative;
}
.mob-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  height: var(--header-h); border-bottom: 1px solid var(--line-strong);
  background: var(--card); position: sticky; top: 0; z-index: 50;
  flex-shrink: 0;
}
.mob-header-back {
  background: none; border: none; font-size: 28px; line-height: 1;
  color: var(--ink); cursor: pointer; padding: 0 4px; flex-shrink: 0;
}
.mob-header-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.mob-shop-avatar {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
  overflow: hidden; position: relative;
}
.mob-shop-avatar .shop-brand-avatar {
  width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block;
}
.hc-store-icon .shop-brand-avatar {
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block;
}
.mob-shop-name { font-size: 15px; font-weight: 700; color: var(--accent-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mob-shop-id { font-size: 11px; color: var(--muted); }
.mob-header-title { flex: 1; text-align: center; font-size: 17px; font-weight: 700; }
.mob-header-actions { display: flex; gap: 4px; flex-shrink: 0; }
.mob-icon-btn {
  background: none; border: none; font-size: 20px; color: var(--ink);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mob-main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px); }
body.mob-home .mob-main { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 72px); }
.page { display: none; padding: 0 12px 16px; }
.page.active { display: block; }
.page-home { padding-top: 4px; position: relative; }

/* 首頁 Lab 浮動入口（左下角，不與右側 FAB 重疊） */
.home-lab-chip {
  position: fixed;
  left: max(12px, calc(50% - 240px + 12px));
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  z-index: 87;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  border: 1.5px solid #c4b5fd;
  background: rgba(255,255,255,.96);
  color: #6d28d9;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(109,40,217,.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.mob-home .home-lab-chip { display: inline-flex; }
.home-lab-chip:active { transform: scale(0.97); }
.home-lab-ico { font-size: 15px; line-height: 1; }
.home-lab-dot {
  position: absolute;
  top: 2px; right: 2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
}

/* Lab 版本更新抽屜 */
.lab-changelog-sheet {
  position: fixed; inset: 0; z-index: 200;
  pointer-events: none; opacity: 0;
  transition: opacity .22s ease;
}
.lab-changelog-sheet.open { pointer-events: auto; opacity: 1; }
.lab-changelog-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.35);
}
.lab-changelog-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: min(78vh, 560px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,.12);
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.lab-changelog-sheet.open .lab-changelog-panel { transform: translateY(0); }
.lab-changelog-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 18px 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.lab-changelog-head h3 { margin: 0; font-size: 17px; }
.lab-changelog-sub { margin: 4px 0 0; font-size: 12px; }
.lab-changelog-close { position: static; flex-shrink: 0; }
.lab-changelog-body {
  overflow-y: auto;
  padding: 12px 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.lab-entry {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.lab-entry:first-child { padding-top: 4px; }
.lab-entry:last-child { border-bottom: none; }
.lab-entry-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.lab-entry-ver {
  font-size: 11px; font-weight: 700;
  color: #6d28d9; background: #ede9fe;
  padding: 2px 8px; border-radius: 999px;
}
.lab-entry-date { font-size: 12px; color: var(--muted); }
.lab-entry-title { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.lab-entry-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; color: #374151; }
.lab-entry-list li { margin-bottom: 4px; }
.lab-entry-list li:last-child { margin-bottom: 0; }
.lab-entry-new .lab-entry-ver { background: var(--accent-soft); color: var(--accent-dark); }
.page-sub { padding-top: 8px; }
.page-overlay {
  position: fixed; inset: 0; z-index: 130; background: var(--bg);
  padding: 0; overflow-y: auto; padding-bottom: calc(var(--safe-b) + 16px);
  max-width: 480px; margin: 0 auto; left: 0; right: 0;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate3d(0, 10px, 0);
  transition: opacity .16s ease, transform .18s cubic-bezier(.32,.72,0,1), visibility 0s linear .18s;
}
.page-overlay.active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate3d(0, 0, 0);
  transition: opacity .16s ease, transform .18s cubic-bezier(.32,.72,0,1), visibility 0s;
  z-index: 130;
  will-change: opacity, transform;
}
.overlay-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line-strong);
  position: sticky; top: 0; z-index: 2;
  padding-top: max(12px, env(safe-area-inset-top));
}
.overlay-toolbar h2 { flex: 1; font-size: 17px; font-weight: 700; text-align: center; }
.overlay-close { background: none; border: none; font-size: 28px; color: var(--muted); cursor: pointer; line-height: 1; }
.overlay-sub { padding: 8px 16px 0; font-size: 12px; }

/* 底部六欄導覽 */
.mob-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex; align-items: stretch;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--card); border-top: 1px solid var(--line-strong);
  z-index: 90;
}
.mob-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border: none; background: none; cursor: pointer;
  color: #9ca3af; font-size: 10px; font-weight: 600;
  padding: 6px 2px; position: relative;
  transition: color .15s, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.mob-nav-item:active:not(:disabled) { transform: scale(0.94); }
.mob-nav-item.active { color: var(--accent-dark); }
.mob-nav-ico { font-size: 20px; line-height: 1; }
.mob-nav-label { line-height: 1.2; }
.mob-nav-badge {
  position: absolute; top: 4px; right: calc(50% - 22px);
  min-width: 16px; height: 16px; border-radius: 8px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.mob-nav-dot {
  position: absolute; top: 6px; right: calc(50% - 18px);
  width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
}
.mob-header-pending-dot {
  position: absolute; top: -1px; right: -1px;
  width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
  border: 2px solid #fff;
}
.mob-shop-avatar { position: relative; }
.push-notify-segment { margin: 8px 0 4px; }

/* ＋號快捷選單 */
.fab-speed-menu {
  position: fixed; inset: 0; z-index: 95;
  pointer-events: none; opacity: 0;
  max-width: 480px; margin: 0 auto; left: 0; right: 0;
  transition: opacity .2s ease;
}
.fab-speed-menu.open { pointer-events: auto; opacity: 1; }
.fab-speed-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.22); }
.fab-speed-stack {
  position: absolute; right: 16px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 72px);
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.fab-speed-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 12px;
  background: var(--card); border: none; border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  font-size: 14px; font-weight: 600; color: var(--accent-dark);
  cursor: pointer; white-space: nowrap;
  transform: translateY(8px); opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}
.fab-speed-menu.open .fab-speed-item { transform: translateY(0); opacity: 1; }
.fab-speed-menu.open .fab-speed-item:nth-child(1) { transition-delay: .03s; }
.fab-speed-menu.open .fab-speed-item:nth-child(2) { transition-delay: .06s; }
.fab-speed-menu.open .fab-speed-item:nth-child(3) { transition-delay: .09s; }
.fab-speed-menu.open .fab-speed-item:nth-child(4) { transition-delay: .12s; }
.fab-speed-item:active { transform: scale(0.97); }
.fab-speed-ico { font-size: 16px; }

/* 更多：功能選單 */
.more-grid-sheet {
  position: fixed; inset: 0; z-index: 96;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none; opacity: 0;
  padding: 0;
  max-width: 480px; margin: 0 auto; left: 0; right: 0;
  transition: opacity .22s ease;
}
.more-grid-sheet.open { pointer-events: auto; opacity: 1; }
.more-grid-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.more-grid-panel {
  position: relative; z-index: 1; width: 100%;
  background: var(--card);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, .12);
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32, .72, 0, 1);
  display: flex; flex-direction: column;
  padding-bottom: calc(var(--safe-b) + 4px);
  margin-bottom: calc(var(--nav-h) + var(--safe-b));
}
.more-grid-sheet.open .more-grid-panel { transform: translateY(0); }
.more-grid-topbar {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 6px 36px 2px; flex-shrink: 0;
}
.more-grid-handle {
  width: 32px; height: 3px; border-radius: 999px;
  background: #d1d5db; flex-shrink: 0;
}
.more-grid-head { display: none; }
.more-grid-close {
  position: absolute; right: 8px; top: 2px;
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: #f3f4f6; color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.more-grid-close:active { background: #e5e7eb; }
.more-grid-body {
  flex: 0 0 auto; overflow: visible;
  padding: 4px 10px 6px;
}
.more-grid-section,
.more-grid-section-label { display: none; }
.more-grid-card {
  background: transparent;
  border-radius: 12px;
  box-shadow: none;
  border: none;
  overflow: hidden;
}
.more-grid-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 4px;
  background: transparent;
}
.more-grid-tiles.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.more-grid-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 4px; padding: 6px 2px 4px; min-height: 0;
  border: none; background: transparent; cursor: pointer; text-align: center;
  transition: opacity .12s ease;
}
.more-grid-tile:active { opacity: .65; }
.more-grid-tile-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1; flex-shrink: 0;
}
.more-grid-tile-icon.teal { background: #ccfbf1; }
.more-grid-tile-icon.pink { background: var(--accent-soft); }
.more-grid-tile-icon.green { background: #dcfce7; }
.more-grid-tile-icon.gray { background: #f3f4f6; }
.more-grid-tile-icon.orange { background: #ffedd5; }
.more-grid-tile-icon.blue { background: #dbeafe; }
.more-grid-tile-icon.purple { background: #ede9fe; }
.more-grid-tile-label {
  font-size: 10px; font-weight: 600; color: var(--ink); line-height: 1.2;
  max-width: 100%; padding: 0 1px;
}
.more-grid-tile-text {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.more-grid-tile-text strong {
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.more-grid-tile-text small {
  font-size: 12px; color: var(--muted); font-weight: 400;
}
.more-grid-tile-chevron {
  color: #c4c4c4; font-size: 20px; font-weight: 300; flex-shrink: 0;
}
.more-grid-footer {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 4px 10px 6px; flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.more-grid-foot-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 7px 8px; border-radius: 8px; border: none;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: opacity .12s ease;
}
.more-grid-foot-btn:active { opacity: .7; }
.more-grid-foot-ico { display: none; }
.more-grid-foot-btn.manual { background: #eff6ff; color: #2563eb; }
.more-grid-foot-btn.tour { background: #fdf2f8; color: var(--accent-dark); }
.more-grid-tile.hidden-feature,
.more-grid-item.hidden-feature { display: none !important; }

body.is-staff .more-grid-tile[data-more-section="owner"],
body.is-staff .more-grid-tile[data-more-section="collab"] { display: none !important; }
body:not(.is-manager) .more-grid-tile[data-more-section="owner"],
body:not(.is-manager) .more-grid-tile[data-more-section="collab"],
body:not(.is-manager) .more-grid-tile[data-more-section="booking"] { display: none !important; }

/* 舊 class 相容（若殘留） */
.more-grid-row { display: none; }
.more-grid-item { display: none; }

.pwa-install-body section { margin-bottom: 16px; }
.pwa-install-body h4 { font-size: 14px; margin: 0 0 8px; }
.pwa-install-lead { font-size: 13px; margin: 0 0 14px; line-height: 1.5; }
.pwa-install-steps { margin: 0 0 12px; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.pwa-install-download { display: block; width: 100%; text-align: center; text-decoration: none; margin-top: 4px; }
.more-grid-foot-btn.changelog { background: #f0fdf4; color: #15803d; }
.more-grid-foot-btn.install { background: #f3f4f6; color: #374151; }

/* 全屏功能頁 Overlay */
.page-feature-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  background: var(--bg);
  max-width: 480px; margin: 0 auto; left: 0; right: 0;
  overflow: hidden;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate3d(0, 10px, 0);
  transition: opacity .16s ease, transform .18s cubic-bezier(.32,.72,0,1), visibility 0s linear .18s;
}
.page-feature-overlay.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate3d(0, 0, 0);
  transition: opacity .16s ease, transform .18s cubic-bezier(.32,.72,0,1), visibility 0s;
  will-change: opacity, transform;
}
#page-settings-form.open,
#page-booking-settings.open { z-index: 135; }

.hc-overlay-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-left: max(12px, env(safe-area-inset-left));
  background: var(--card); border-bottom: 1px solid var(--line-strong);
  flex-shrink: 0; position: sticky; top: 0; z-index: 2;
}
.hc-overlay-head h2 { flex: 1; text-align: center; font-size: 17px; font-weight: 700; min-width: 0; }
.hc-overlay-head .text-btn,
.hc-overlay-head .hc-head-action,
.hc-overlay-head .hc-head-save,
.hc-overlay-head .account-save-btn {
  flex-shrink: 0; min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; z-index: 3;
}
body.admin-overlay-open .mob-header { display: none !important; }
body.admin-overlay-open .mob-nav { display: none !important; }
body.admin-overlay-open .mob-fab { display: none !important; }
body.admin-overlay-open .home-lab-chip { display: none !important; }
body.admin-overlay-open .mob-tour-pill { display: none !important; }
body.admin-overlay-open .mob-main { padding-bottom: calc(var(--safe-b) + 12px); }
.page-feature-overlay.open { z-index: 120; }
.account-sub-overlay.open { z-index: 140; }
#page-settings-form.open,
#page-booking-settings.open { z-index: 135; }

.hc-close {
  background: none; border: none; font-size: 28px; line-height: 1;
  color: var(--ink); cursor: pointer; padding: 0 4px; width: 36px;
}
.hc-head-spacer { width: 36px; flex-shrink: 0; }
.hc-head-tag {
  font-size: 11px; color: var(--muted); background: #f3f4f6;
  padding: 4px 8px; border-radius: 8px; flex-shrink: 0;
}
.hc-head-action {
  background: none; border: none; font-size: 20px; color: var(--ink);
  width: 36px; height: 36px; cursor: pointer;
}
.hc-overlay-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 16px calc(16px + var(--safe-b));
  contain: layout style;
}
.hc-overlay-body.flush {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}
.mob-main { contain: layout style; }

/* 卡片／區塊邊界 — 避免僅靠淡陰影導致框線「消失」 */
.hc-store-card,
.hc-menu-card,
.hc-integ-pill,
.account-profile-card,
.account-brand-card,
.push-designer-card,
.hc-inv-card,
.db-card,
.db-tip,
.team-invite-card,
.hc-designers-self,
.hc-designers-card,
.hc-stats-card,
.hc-export-card,
#reportsQuickStats .reports-quick-link {
  border: 1px solid var(--line);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .page-feature-overlay, .page-overlay, #loginScreen, #appScreen {
    transform: none !important;
  }
}

.hc-store-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 14px; padding: 14px;
  margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.hc-store-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
  overflow: hidden;
}
.hc-store-info { flex: 1; min-width: 0; }
.hc-store-info strong { display: block; font-size: 16px; font-weight: 700; }
.hc-store-gear {
  background: none; border: none; font-size: 18px; color: var(--muted); cursor: pointer; padding: 8px;
}
.hc-integ-strip {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.hc-integ-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--card); border-radius: 999px; padding: 6px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.hc-integ-pill .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; flex-shrink: 0;
}
.hc-integ-pill.ok { color: #047857; }
.hc-integ-pill.ok .dot { background: #10b981; }
.hc-integ-pill.warn { color: #b45309; }
.hc-integ-pill.warn .dot { background: #f59e0b; }
#settingsIntegLine { cursor: pointer; }
.line-plan-upgrade-gate {
  margin: 0 0 14px; padding: 14px;
  background: #fff7ed; border: 1px solid #fdba74; border-radius: 12px;
}
.line-plan-upgrade-title {
  margin: 0 0 6px; font-size: 15px; font-weight: 700; color: #c2410c;
}
.line-plan-upgrade-gate .btn { margin-top: 10px; }
#lineIntegrationFields.line-plan-locked {
  opacity: .55; pointer-events: none; user-select: none;
}
.hc-menu-row.line-needs-upgrade .hc-menu-text span {
  color: #b45309;
}
.line-setup-lead {
  font-size: 14px;
  line-height: 1.55;
  color: #374151;
  margin: 0 0 12px;
}
.line-setup-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.line-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.line-ext-link:active { opacity: 0.85; }
.line-setup-step {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}
.line-setup-step-soft { background: #fff; }
.line-setup-step-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.line-setup-step-head strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}
.line-setup-step-head .muted {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}
.line-setup-num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.line-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.line-setup-sub {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin: 12px 0 6px;
}
.line-field-hint {
  font-size: 12px !important;
  margin: -2px 0 10px !important;
  line-height: 1.45;
}
.line-copy-row {
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.line-copy-row .input { flex: 1; min-width: 0; }
.line-setup-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0 12px;
}
.line-setup-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #92400e;
}
.line-staff-push-btn { margin: 4px 0 8px; }
.hc-search-wrap {
  position: relative;
  display: block;
  margin-bottom: 16px;
}
.hc-search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #6b7280;
  pointer-events: none;
  line-height: 1;
}
.hc-search {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px 13px 40px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.hc-search::placeholder {
  color: #9ca3af;
  font-weight: 500;
}
.hc-search:hover {
  border-color: #9ca3af;
}
.hc-search:focus {
  border-color: #4b5563;
  box-shadow: 0 0 0 3px rgba(75, 85, 99, .14);
}
.hc-section-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin: 4px 4px 8px;
}
.hc-menu-card {
  background: var(--card); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.hc-menu-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 14px; border: none; background: none; cursor: pointer; text-align: left;
  border-bottom: 1px solid var(--line);
}
.hc-menu-row:last-child { border-bottom: none; }
.hc-menu-row:active { background: #f9fafb; }
.hc-menu-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.hc-menu-icon.teal { background: #ccfbf1; }
.hc-menu-icon.pink { background: var(--accent-soft); }
.hc-menu-icon.green { background: #dcfce7; }
.hc-menu-icon.gray { background: #f3f4f6; }
.hc-menu-icon.orange { background: #ffedd5; }
.hc-menu-icon.blue { background: #dbeafe; }
.hc-menu-icon.purple { background: #ede9fe; }
.hc-notice-sort { display: flex; flex-direction: column; gap: 2px; }
.hc-notice-move {
  border: none; background: #f3f4f6; color: #374151;
  width: 24px; height: 20px; border-radius: 4px; font-size: 11px; cursor: pointer;
}
.hc-notice-move:disabled { opacity: .35; cursor: default; }

.notice-editor-sheet {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.notice-editor-sheet.open { pointer-events: auto; opacity: 1; }
.notice-editor-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.notice-editor-panel {
  position: relative; width: 100%; max-width: 480px; max-height: 90dvh;
  background: #fff; border-radius: 16px 16px 0 0; overflow-y: auto;
  transform: translateY(100%); transition: transform .25s ease-out;
}
.notice-editor-sheet.open .notice-editor-panel { transform: translateY(0); }
.notice-editor-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid #f3f4f6;
}
.notice-editor-head h3 { font-size: 17px; }
.notice-editor-close {
  width: 32px; height: 32px; border: none; background: #f3f4f6;
  border-radius: 50%; font-size: 20px; cursor: pointer;
}
.notice-editor-form { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.notice-editor-image-wrap { margin: 8px 0 14px; }
.notice-editor-preview {
  width: 100%; max-width: 200px; height: 120px; margin-bottom: 10px;
  border-radius: 10px; overflow: hidden; background: #f9fafb;
  border: 1px dashed #d1d5db; display: flex; align-items: center; justify-content: center;
}
.notice-editor-preview img { width: 100%; height: 100%; object-fit: cover; }
.notice-editor-form .textarea { min-height: 88px; resize: vertical; }
.notice-editor-form .btn-small { margin-top: 8px; }
.hc-image-upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 20px 16px; margin-bottom: 12px;
  border: 2px dashed #d1d5db; border-radius: 12px; background: #f9fafb;
  cursor: pointer; text-align: center;
}
.hc-image-upload-zone:active { background: #f3f4f6; }
.hc-image-upload-input {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
}
.hc-image-upload-ico { font-size: 28px; line-height: 1; }
.hc-image-upload-text { font-size: 14px; font-weight: 600; color: var(--ink); }
.hc-image-upload-hint { font-size: 12px; color: var(--muted); }
.hc-svc-thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  background: #f3f4f6; border: 1px solid #f3f4f6;
}
.hc-svc-thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #9ca3af;
}
.gallery-admin-images { margin: 4px 0 12px; }
.gallery-admin-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.gallery-admin-tile {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: #f3f4f6; border: 1px solid #e5e7eb;
}
.gallery-admin-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-admin-del {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px;
  border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer;
}
.hc-menu-text { flex: 1; min-width: 0; }
.hc-menu-text strong { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.hc-menu-text span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.hc-menu-chevron { color: #d1d5db; font-size: 18px; flex-shrink: 0; }
.line-staff-push-btn { margin: 4px 0 8px; }
.hc-tip-banner {
  background: #f5f3ff; border-radius: 12px; padding: 12px 14px;
  font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 12px;
}
.hc-tip-banner .hc-tip-link {
  border: none; background: none; padding: 0; margin: 0;
  color: var(--accent-dark); font-weight: 600; font-size: inherit;
  text-decoration: underline; cursor: pointer;
}
.hc-back-cal { margin-top: 20px; width: 100%; }
.hc-quick-actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: nowrap; overflow-x: auto; }
.hc-quick-chip {
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--card); font-size: 13px; font-weight: 600; cursor: pointer;
}
.hc-quick-ico { font-size: 14px; }
.hc-stats-row { display: flex; gap: 8px; }
.hc-overlay-body .members-search:not(.hidden) { display: block; margin-bottom: 12px; }
.hc-menu-row.hidden-feature { display: none !important; }

/* 帳號／品牌列表 Hub */
.account-hub-overlay { background: #f3f4f6; }
.account-hub-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: #f3f4f6; flex-shrink: 0;
}
.account-greeting { margin: 0; font-size: 13px; color: var(--muted); }
.account-back-link {
  background: none; border: none; color: var(--accent-dark);
  font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 0;
}
.account-hub-body { padding-top: 0; }
.account-profile-card {
  background: var(--card); border-radius: 16px; padding: 16px;
  margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.account-profile-row { display: flex; align-items: center; gap: 12px; }
.account-integ-strip {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.account-integ-strip .hc-integ-pill { cursor: pointer; }
.account-avatar {
  width: 52px; height: 52px; border-radius: 50%; background: #e5e7eb;
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
  overflow: hidden;
}
.account-profile-info { flex: 1; min-width: 0; }
.account-profile-info strong { display: block; font-size: 17px; font-weight: 700; }
.account-profile-info .muted { font-size: 13px; margin-top: 2px; display: block; }
.account-quick { margin-bottom: 16px; }
.account-quick .hc-quick-chip { flex: 1; justify-content: center; min-width: 0; }
.export-slots-body { padding-top: 8px; }
.export-slots-text {
  margin-top: 12px; min-height: 260px; font-size: 14px; line-height: 1.55;
  white-space: pre-wrap; resize: vertical;
}
.account-brand-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; gap: 8px;
}
.account-brand-label { margin: 0 !important; }
.account-create-branch {
  background: none; border: none; color: var(--accent-dark);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.account-brand-card {
  background: var(--card); border-radius: 16px; padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.account-brand-title {
  font-size: 14px; font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.account-shop-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 8px;
  border: 2px solid transparent; border-radius: 12px; background: #f9fafb;
  cursor: pointer;
}
.account-shop-item:last-child { margin-bottom: 0; }
.account-shop-item.active {
  border-color: var(--accent-dark); background: #fff;
}
.account-shop-item strong { display: block; font-size: 15px; font-weight: 600; }
.account-shop-item .role { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.account-shop-check {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent-dark);
  color: #fff; font-size: 12px; display: none; align-items: center; justify-content: center; flex-shrink: 0;
}
.account-shop-item.active .account-shop-check { display: flex; }
.account-create-panel {
  margin-top: 12px; background: var(--card); border-radius: 14px; padding: 14px;
}
.account-create-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.account-version { text-align: center; font-size: 12px; margin-top: 20px; }

.account-gear-sheet {
  position: fixed; inset: 0; z-index: 125;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.account-gear-sheet.open { display: flex; }
.account-gear-backdrop {
  position: absolute; inset: 0; background: rgba(15,23,42,.35);
}
.account-gear-panel {
  position: relative; background: var(--card); border-radius: 16px;
  width: min(320px, 100%); overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
}
.account-gear-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 16px 18px; border: none; background: none; cursor: pointer;
  font-size: 16px; text-align: left; border-bottom: 1px solid var(--line);
}
.account-gear-item:last-child { border-bottom: none; }
.account-gear-item .ico { font-size: 18px; width: 24px; text-align: center; }
.account-gear-item.danger { color: #dc2626; }

.account-save-btn {
  background: none; border: none; color: var(--accent-dark);
  font-size: 22px; font-weight: 700; min-width: 44px; min-height: 44px;
  cursor: pointer; flex-shrink: 0;
}
.account-profile-form { padding-top: 8px; }
.account-birthday-row {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px;
}
.account-birthday-row .input { min-width: 0; padding-left: 8px; padding-right: 8px; }
.account-sub-overlay .hc-overlay-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.account-photo-upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 120px; height: 120px; margin: 0 auto 20px; border-radius: 50%;
  border: 2px dashed #d1d5db; background: #f9fafb; cursor: pointer;
  position: relative; overflow: hidden; color: var(--muted); font-size: 13px; gap: 4px;
}
.account-photo-upload .cam { font-size: 22px; }
.account-photo-upload img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.account-gender-row {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.account-gender-btn {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); font-size: 14px; font-weight: 600; cursor: pointer;
}
.account-gender-btn.active {
  background: var(--accent-dark); color: #fff; border-color: var(--accent-dark);
}
.account-phone-row { display: flex; gap: 8px; margin-bottom: 12px; }
.account-phone-code { width: 88px; flex-shrink: 0; }
.account-profile-email { font-size: 12px; margin-top: 8px; }
.account-delete-btn {
  display: block; width: 100%; margin-top: 24px; padding: 14px;
  background: none; border: none; color: #dc2626; font-size: 15px; cursor: pointer;
}

.push-brand-divider {
  text-align: center; margin: 8px 0 4px; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 12px; color: var(--ink);
}
.push-brand-divider::before,
.push-brand-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.push-shop-name { text-align: center; margin: 0 0 12px; font-size: 13px; }
.push-designer-card {
  background: var(--card); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.push-designer-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.push-designer-row:last-child { border-bottom: none; }
.push-designer-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}
.push-designer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.push-designer-name { flex: 1; font-size: 15px; font-weight: 600; }
.push-toggle {
  width: 48px; height: 28px; border-radius: 999px; border: none; cursor: pointer;
  background: #e5e7eb; position: relative; transition: background .2s;
}
.push-toggle.on { background: var(--accent-dark); }
.push-toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.push-toggle.on::after { transform: translateX(20px); }

/* FAB */
.mob-fab {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  right: max(16px, calc(50% - 240px + 16px));
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-dark); color: #fff; border: none;
  font-size: 32px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 16px var(--btn-shadow);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s;
}
body.fab-speed-open .mob-fab { transform: rotate(45deg); }
.mob-fab.hidden { display: none !important; }

.mob-tour-pill {
  position: fixed;
  right: 76px;
  bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  z-index: 48;
  border: 1.5px solid var(--accent-border);
  background: #fff;
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  cursor: pointer;
}
body.mob-home .mob-tour-pill { display: block; }
body:not(.mob-home) .mob-tour-pill { display: none; }

.hc-report-toolbar {
  padding: 10px 14px 6px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.hc-report-toolbar.hidden { display: none; }
.hc-report-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}
.hc-report-range-val {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 8px 10px;
  flex: 1;
  text-align: center;
}
.hc-report-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.hc-report-chip {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.hc-report-chip.active {
  border-color: var(--accent-dark);
  color: var(--accent-dark);
  background: var(--accent-soft);
}
.hc-report-filter { margin-top: 8px; }
.hc-report-filter .input { margin: 0; font-size: 13px; }
.hc-report-daily-shell { padding: 0; background: #fff; border-bottom: 1px solid var(--line); }
.hc-report-daily-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 0; gap: 12px;
}
.hc-report-date-btn {
  border: none; background: none; font-size: 15px; font-weight: 600; color: #111; cursor: pointer; padding: 0;
}
.hc-report-today-btn {
  border: 1px solid #e5e7eb; background: #fff; border-radius: 999px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; color: #374151; cursor: pointer;
}
.hc-report-daily-shell .hc-report-week-strip {
  margin: 8px 0 0 !important;
  padding: 10px 12px 12px;
  border-radius: 0;
  border-top: 1px solid var(--line);
}
.hc-cashflow-hero {
  padding: 16px 16px 12px; text-align: center; background: #fff;
  border-bottom: 1px solid var(--line);
}
.hc-cashflow-hero-label { font-size: 13px; color: #6b7280; margin: 0 0 6px; }
.hc-cashflow-hero-value { font-size: 32px; font-weight: 700; color: #111; margin: 0; line-height: 1.2; }
.hc-cashflow-hero-hint { font-size: 12px; color: #9ca3af; margin: 8px 0 0; }
.hc-cashflow-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 12px 16px; background: #fff; border-bottom: 8px solid #f3f4f6;
}
.hc-cashflow-split-item {
  background: #f9fafb; border-radius: 12px; padding: 12px 10px; text-align: center;
  display: flex; flex-direction: column; gap: 6px;
}
.hc-cashflow-split-item span { font-size: 12px; color: #6b7280; }
.hc-cashflow-split-item strong { font-size: 18px; color: #111; }
.hc-cashflow-methods { background: #fff; padding-bottom: 8px; }
.hc-cashflow-methods h3 {
  font-size: 14px; font-weight: 700; margin: 0; padding: 14px 16px 8px; color: #111;
}
.hc-cashflow-empty { padding: 0 16px 16px; margin: 0; }
.hc-cashflow-method {
  width: 100%; display: grid; grid-template-columns: 1fr auto 20px; align-items: center; gap: 8px;
  padding: 14px 16px; border: none; border-bottom: 1px solid #f3f4f6; background: #fff;
  cursor: pointer; text-align: left; font: inherit;
}
.hc-cashflow-method:active { background: #f9fafb; }
.hc-cashflow-method.open { background: #fafafa; }
.hc-cashflow-method-label { font-size: 15px; font-weight: 600; color: #111; }
.hc-cashflow-method-amt { font-size: 15px; font-weight: 700; color: #111; }
.hc-cashflow-method-chevron { color: #9ca3af; font-size: 18px; transition: transform .15s; }
.hc-cashflow-method.open .hc-cashflow-method-chevron { transform: rotate(90deg); }
.hc-cashflow-bills { background: #f9fafb; border-bottom: 1px solid #f3f4f6; }
.hc-cashflow-bills.hidden { display: none; }
.hc-cashflow-bill {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 10px 16px 10px 24px; border-bottom: 1px solid #f3f4f6; font-size: 13px;
}
.hc-cashflow-bill:last-child { border-bottom: none; }
.hc-cashflow-bill-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hc-cashflow-bill-left strong { font-size: 13px; }
.hc-cashflow-bill-left .muted { font-size: 12px; }
.hc-cashflow-bill-right { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.hc-cashflow-refund {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; margin-top: 8px; background: #fff; font-size: 14px;
}
.hc-cashflow-refund strong { color: #dc2626; }
/* legacy */
.hc-cashflow-summary { padding: 12px 16px 0; }
.hc-cashflow-total {
  background: linear-gradient(135deg, #eff6ff, #f5f3ff); border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.hc-cashflow-total span { font-size: 13px; color: #6b7280; }
.hc-cashflow-total strong { font-size: 28px; color: #1d4ed8; }
.hc-checkout-wallet-opt {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px 0;
  font-size: 13px; color: #374151; cursor: pointer;
}
.hc-checkout-donuts { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 12px 16px 16px; }
body.is-desktop .hc-checkout-donuts { grid-template-columns: 1fr 1fr; gap: 16px; }
.hc-checkout-donut-block {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 12px;
  min-width: 0; overflow: hidden;
}
.hc-checkout-donut-block h3 { font-size: 14px; margin: 0 0 10px; }
.checkout-chart { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; min-width: 0; }
.checkout-chart .checkout-donut { flex-shrink: 0; }
.checkout-chart .checkout-table { width: 100%; min-width: 0; }
.hc-perf-filter { padding: 8px 16px 0; }
.hc-perf-filter .input { width: 100%; margin: 0; }
.hc-perf-table-wrap { overflow-x: auto; padding: 12px 16px; -webkit-overflow-scrolling: touch; }
.hc-perf-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.hc-perf-table th, .hc-perf-table td { padding: 10px 8px; text-align: right; border-bottom: 1px solid #f3f4f6; white-space: nowrap; }
.hc-perf-table th:first-child, .hc-perf-table td:first-child { text-align: left; }
.hc-perf-table th { color: #6b7280; font-weight: 600; font-size: 12px; }
.hc-points-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px 16px 0;
}
.hc-points-card {
  background: #f9fafb; border-radius: 12px; padding: 14px 10px; text-align: center;
  display: flex; flex-direction: column; gap: 6px;
}
.hc-points-card span { font-size: 12px; color: #6b7280; }
.hc-points-card strong { font-size: 20px; color: #111; }
.hc-points-card.accent { background: linear-gradient(135deg, #eff6ff, #f5f3ff); }
.hc-points-card.accent strong { color: #1d4ed8; }
.hc-points-export { margin: 12px 16px 0; width: calc(100% - 32px); }

.hc-cashflow-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.hc-cashflow-date {
  flex: 1;
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.hc-cashflow-today {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
}

.hc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px;
}
.hc-kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.hc-kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.hc-kpi-value { font-size: 22px; font-weight: 700; }
.hc-kpi-value.accent { color: var(--accent-dark); }
.hc-kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

.hc-report-section {
  margin: 0 14px 16px;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
}
.hc-report-section h3 { font-size: 14px; margin: 0 0 10px; }
.hc-report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}
.hc-report-row.total strong { color: #2563eb; }
.hc-report-row-btn {
  width: 100%; border: none; background: none; text-align: left;
  cursor: pointer; font: inherit; color: inherit;
}
.hc-report-row-btn:active { background: #f9fafb; }
.hc-report-row-btn strong { color: var(--accent-dark); }
.hc-report-hint {
  padding: 12px 16px 0;
  font-size: 12px;
  color: var(--muted);
}

.hc-rank-table { font-size: 13px; }
.hc-rank-head, .hc-rank-row {
  display: grid;
  grid-template-columns: 48px 1fr 56px;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}
.hc-rank-head { color: var(--muted); font-size: 12px; }

.hc-placeholder-card {
  margin: 16px;
  padding: 24px 16px;
  background: #fff;
  border-radius: 12px;
  text-align: center;
}

.hc-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.hc-choice-modal.hidden { display: none; }
.hc-manual-panel { max-height: 85vh; display: flex; flex-direction: column; }
.hc-manual-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.hc-manual-head h3 { margin: 0; font-size: 17px; }
.hc-manual-body { overflow-y: auto; font-size: 14px; line-height: 1.55; }
.hc-manual-body section { margin-bottom: 16px; }
.hc-manual-body h4 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.hc-manual-body ol, .hc-manual-body ul { padding-left: 20px; margin: 0; }
.hc-manual-body li { margin-bottom: 6px; }
.hc-manual-body code { font-size: 12px; background: #f3f4f6; padding: 1px 5px; border-radius: 4px; }
.hc-manual-note { font-size: 12px; margin-top: 8px; }
.hc-choice-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.hc-choice-panel {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 20px 16px;
  width: min(360px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}
.hc-choice-panel h3 { text-align: center; margin: 0 0 14px; font-size: 16px; }
.hc-choice-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: #fff;
  cursor: pointer;
}
.hc-choice-card strong { display: block; margin-bottom: 6px; }
.hc-choice-formula { display: block; color: var(--accent-dark); font-size: 13px; margin-bottom: 6px; }
.hc-choice-icon { font-size: 22px; display: block; margin-bottom: 8px; }

.hc-svc-wrap { padding: 0 0 20px; }
.hc-svc-add {
  display: block;
  width: calc(100% - 28px);
  margin: 12px 14px;
  padding: 12px;
  border: none;
  background: transparent;
  color: #2563eb;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.hc-svc-list { background: var(--card); margin: 0 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
button.hc-svc-row {
  width: 100%;
  border: none;
  background: var(--card);
  text-align: left;
  font: inherit;
  color: inherit;
}
.hc-svc-ico { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.hc-svc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.hc-svc-del {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  cursor: pointer;
  flex-shrink: 0;
}
.hc-svc-info { flex: 1; min-width: 0; }
.hc-svc-info strong { display: block; font-size: 15px; }
.hc-svc-edit { border: none; background: none; font-size: 16px; color: var(--muted); cursor: pointer; }
.hc-svc-row.sub { padding-left: 28px; background: #fafafa; }
.hc-svc-row.sub .hc-svc-info strong { font-size: 14px; font-weight: 600; }
.hc-svc-add-sub {
  border: none; background: none; color: #2563eb; font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 0; margin-top: 4px;
}
.hc-svc-section-title {
  margin: 16px 14px 8px; font-size: 13px; font-weight: 700; color: var(--muted);
}
.hc-svc-addon-add { margin-top: 0; }
.db-svc-group { margin-bottom: 4px; }
.db-svc-sub { display: block; padding-left: 22px; font-size: 13px; color: var(--muted); }

.hc-inv-tab {
  display: inline-block;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.hc-inv-tab.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: transparent;
}
.hc-inv-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 6px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg, #f3f4f6);
}
.hc-inv-section-label {
  margin: 10px 14px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.hc-inv-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
}
.hc-inv-cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 600;
}
.hc-inv-detail-cat {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}
.hc-inv-list { padding: 0 14px 16px; }
.hc-inv-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  cursor: pointer;
}
.hc-inv-card.warn { border: 1px solid #fecaca; }
.hc-inv-ico { font-size: 20px; color: var(--accent-dark); }
.hc-inv-stock { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hc-inv-stock.neg { color: #dc2626; }

/* 進存貨詳情 */
.inventory-detail-panel,
.inventory-log-panel { max-height: 92vh; }
.inventory-detail-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.inventory-detail-head h3 { flex: 1; text-align: center; font-size: 17px; font-weight: 700; margin: 0; }
.inventory-detail-body { padding: 12px 14px 20px; overflow-y: auto; }
.inventory-detail-summary {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin-bottom: 12px;
}
.inventory-detail-summary strong { display: block; font-size: 18px; margin-bottom: 6px; }
.inventory-detail-stock { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.inventory-detail-stock.warn { color: #dc2626; }
.inventory-detail-warn { font-size: 13px; color: #dc2626; }
.inventory-detail-menu .hc-menu-row { width: 100%; }
.inventory-detail-menu .hc-menu-badge {
  font-size: 14px; font-weight: 600; color: var(--ink); background: none; padding: 0;
}
.inventory-log-body { max-height: calc(92vh - 56px); overflow-y: auto; padding: 8px 0 20px; }
.inventory-log-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); background: var(--card);
}
.inventory-log-row:last-child { border-bottom: none; }
.inventory-log-main { flex: 1; min-width: 0; }
.inventory-log-main strong { display: block; font-size: 15px; font-weight: 600; }
.inventory-log-meta { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.inventory-log-qty {
  font-size: 16px; font-weight: 700; flex-shrink: 0; min-width: 36px; text-align: right;
}
.inventory-log-qty.neg { color: #dc2626; }
.inventory-log-qty.pos { color: #059669; }

.service-edit-panel { max-height: 92vh; }
.service-edit-form { max-height: calc(92vh - 56px); overflow-y: auto; }
.service-edit-form .hc-head-save { font-size: 20px; }
.hc-svc-row.clickable { cursor: pointer; }
.hc-svc-row.clickable:active { background: #f9fafb; }
.hc-menu-row.danger .hc-menu-text strong { color: #dc2626; }

.hc-ob-add {
  display: block;
  width: calc(100% - 28px);
  margin: 12px 14px;
  padding: 12px;
  border: 1.5px solid #2563eb;
  border-radius: 10px;
  background: #fff;
  color: #2563eb;
  font-weight: 600;
  cursor: pointer;
}
.hc-ob-list { padding: 0 14px 16px; }
.hc-ob-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
}
.hc-ob-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.hc-ob-avatar.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  font-weight: 700;
}
.hc-ob-info { flex: 1; min-width: 0; }
.hc-ob-info strong { display: block; margin-bottom: 4px; }
.hc-ob-warn { display: block; color: #dc2626; font-size: 12px; margin-top: 4px; }
.hc-ob-edit { border: none; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.hc-ob-status { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; margin-top: 4px; }
.hc-ob-status.on { background: #dcfce7; color: #166534; }
.hc-ob-status.off { background: #fee2e2; color: #991b1b; }

.hc-bp-branch-tab {
  padding: 12px 16px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-dark);
  border-bottom: 2px solid var(--accent);
  margin: 0 16px;
  display: inline-block;
}
.hc-bp-section { padding: 8px 0 4px; }
.hc-bp-section-title {
  padding: 14px 16px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.hc-bp-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.hc-bp-row:active { background: #f9fafb; }
.hc-bp-row-main { flex: 1; min-width: 0; }
.hc-bp-row-title { font-size: 15px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 4px; }
.hc-bp-row-desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.hc-bp-row-value { font-size: 14px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.hc-bp-row-value::after { content: " ›"; color: #cbd5e1; }
.hc-bp-toggle-row { cursor: default; }
.hc-bp-toggle-row:active { background: var(--card); }
.hc-bp-switch {
  position: relative; width: 48px; height: 28px; flex-shrink: 0;
  border: none; border-radius: 999px; background: #e5e7eb; cursor: pointer;
}
.hc-bp-switch.on { background: #22c55e; }
.hc-bp-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .2s ease;
}
.hc-bp-switch.on::after { transform: translateX(20px); }
.hc-bp-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px calc(14px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--card);
}
.hc-bp-picker-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.hc-bp-picker-list button {
  width: 100%; text-align: left; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); font-size: 15px; cursor: pointer;
}
.hc-bp-picker-list button.active { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.hc-bp-diagnose-results { margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.hc-bp-diagnose-item { padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.hc-bp-diagnose-item.is-ok { background: #f0fdf4; color: #166534; }
.hc-bp-diagnose-item.is-warn { background: #fffbeb; color: #b45309; }
.hc-bp-diagnose-item.is-error { background: #fef2f2; color: #b91c1c; }
.hc-bp-diagnose-item.is-info { background: #f8fafc; color: #475569; }

.wh-tip { font-size: 13px; margin: 0 0 10px; }
.weekly-hours-grid { display: flex; flex-direction: column; gap: 8px; }
.wh-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
}
.wh-row.is-closed { opacity: 0.55; }
.wh-day { font-weight: 600; font-size: 14px; }
.wh-closed-label { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.wh-time { max-width: 88px; padding: 6px 8px; font-size: 14px; }
@media (max-width: 480px) {
  .wh-row { grid-template-columns: 48px 1fr; }
  .wh-time { max-width: none; }
}

.hc-designer-booking-panel { max-width: 420px; width: calc(100% - 32px); max-height: 90vh; overflow: auto; }

/* 服務人員 — 開放設定（三頁） */
.db-page {
  background: #f3f4f6; display: flex; flex-direction: column;
  min-height: 100%; height: 100%; max-height: 100dvh; overflow: hidden;
}
.db-head {
  display: grid; grid-template-columns: 44px 1fr minmax(56px, auto); align-items: center;
  background: #fff; border-bottom: 1px solid #e5e7eb; flex-shrink: 0;
  padding-right: max(8px, env(safe-area-inset-right));
}
.db-head-center { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 16px; min-width: 0; }
.db-head-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.db-save-btn { font-weight: 600; color: var(--primary, #6366f1); }
.db-tabs { display: flex; background: #fff; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; }
.db-tab {
  flex: 1; border: none; background: none; padding: 12px 8px; font-size: 14px; color: #6b7280; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.db-tab.active { color: #111; font-weight: 600; border-bottom-color: #111; }
.db-body {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; padding-bottom: 24px;
}
.db-msg { text-align: center; padding: 8px 16px 16px; font-size: 13px; flex-shrink: 0; }
.db-msg-success { color: #15803d; }
.db-msg-error { color: #dc2626; }

.db-tip { margin: 12px 14px; padding: 12px 14px; background: #fff; border-radius: 12px; font-size: 13px; color: #6b7280; line-height: 1.5; }
.db-tip-link { color: #ec4899; text-decoration: none; font-weight: 600; }
.db-card { margin: 0 14px 12px; background: #fff; border-radius: 12px; overflow: hidden; }
.db-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 15px;
}
.db-row:last-child { border-bottom: none; }
.db-row-label { color: #374151; }
.db-row-value { color: #6b7280; text-align: right; }
.db-row-note { padding: 0 16px 14px; font-size: 12px; color: #9ca3af; line-height: 1.5; }

.db-toggle { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.db-toggle input { opacity: 0; width: 0; height: 0; }
.db-toggle span {
  position: absolute; inset: 0; background: #d1d5db; border-radius: 999px; cursor: pointer; transition: 0.2s;
}
.db-toggle span::before {
  content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff;
  border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.db-toggle input:checked + span { background: #ec4899; }
.db-toggle input:checked + span::before { transform: translateX(20px); }

.db-section-title { padding: 16px 16px 8px; font-size: 13px; color: #6b7280; font-weight: 600; }

.db-setting-card {
  margin: 0 14px 12px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.db-setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.db-setting-row:last-child { border-bottom: none; }
.db-setting-row:active { background: #f8fafc; }
.db-setting-row.is-static { cursor: default; }
.db-setting-row.is-static:active { background: #fff; }
.db-setting-main { flex: 1; min-width: 0; }
.db-setting-title {
  font-size: 15px;
  font-weight: 650;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.db-setting-desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #94a3b8;
}
.db-setting-value {
  flex-shrink: 0;
  max-width: 46%;
  padding-top: 2px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-align: right;
  line-height: 1.35;
}
.db-setting-row[data-db-pick] .db-setting-value::after {
  content: " ›";
  color: #cbd5e1;
  font-weight: 500;
}
.db-setting-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}
.db-picker-hint {
  margin: -4px 0 12px;
  font-size: 13px;
  line-height: 1.45;
}
.db-picker-hint:empty { display: none; }
.db-pub-editor { display: flex; flex-direction: column; gap: 14px; }
.db-pub-group { display: flex; flex-direction: column; gap: 8px; }
.db-pub-label { font-size: 12px; font-weight: 700; color: #64748b; letter-spacing: 0.02em; }
.db-pub-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.db-pub-chip {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}
.db-pub-chip.active {
  border-color: var(--accent, #ec4899);
  background: var(--accent-soft, #fce7f3);
  color: var(--accent-dark, #9d174d);
  font-weight: 700;
}
.db-pub-preview {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  font-weight: 650;
  text-align: center;
}

.db-hours-toolbar {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #fff;
  border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 2;
}
.db-hours-month { font-weight: 600; font-size: 15px; border: none; background: none; cursor: pointer; }
.db-hours-nav { display: flex; gap: 8px; align-items: center; }
.db-hours-nav button { border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }

.db-day-row {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  background: #fff; border-bottom: 1px solid #f3f4f6; cursor: pointer;
}
.db-day-row:active { background: #fafafa; }
.db-day-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.db-day-name { width: 36px; font-size: 13px; color: #6b7280; }
.db-day-num {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 600; font-size: 15px;
}
.db-day-num.today { background: var(--accent-soft); color: var(--accent-dark); }
.db-day-num.weekend { color: #dc2626; }
.db-day-action { font-size: 14px; color: #6366f1; white-space: nowrap; }
.db-day-action.muted { color: #9ca3af; }
.db-day-action.closed { color: #9ca3af; }
.db-day-add {
  border: 1px solid #e5e7eb; background: #fff; border-radius: 10px; padding: 8px 16px;
  font-size: 14px; color: #374151; cursor: pointer; white-space: nowrap;
}
.db-day-add:active { background: #f9fafb; }
.db-day-slots { font-size: 14px; color: #6366f1; text-align: right; line-height: 1.4; }

/* 編輯開放時間 — 10 分鐘格線 */
.dse-page {
  background: #f3f4f6; display: flex; flex-direction: column;
  min-height: 100%; height: 100%; max-height: 100dvh; overflow: hidden;
}
.dse-header {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px;
  background: #fff; border-bottom: 1px solid #e5e7eb; padding: 8px 12px 8px 4px; flex-shrink: 0;
}
.dse-title { margin: 0; font-size: 16px; font-weight: 700; text-align: center; }
.dse-header-right { display: flex; gap: 6px; justify-content: flex-end; }
.dse-chip {
  border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; padding: 6px 10px;
  font-size: 12px; color: #374151; cursor: pointer; white-space: nowrap;
}
.dse-chip.on { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-dark); }
.dse-tip {
  margin: 10px 14px 0; padding: 10px 12px; background: #fff; border-radius: 10px;
  font-size: 12px; color: #6b7280; line-height: 1.5; flex-shrink: 0;
}
.dse-date-bar { padding: 10px 14px 0; flex-shrink: 0; }
.dse-date-btn {
  border: none; background: none; font-size: 15px; font-weight: 600; color: #111; cursor: pointer;
}
.dse-week-strip {
  display: flex; justify-content: space-between; gap: 4px; padding: 12px 14px;
  background: #fff; margin: 10px 14px 0; border-radius: 12px; flex-shrink: 0;
}
.dse-week-cell {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: none; background: none; cursor: pointer; padding: 4px 0;
}
.dse-week-dow { font-size: 11px; color: #9ca3af; }
.dse-week-num {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 14px; font-weight: 600; color: #111;
}
.dse-week-cell.weekend .dse-week-dow,
.dse-week-cell.weekend .dse-week-num { color: #dc2626; }
.dse-week-cell.active .dse-week-num { background: var(--accent-soft); color: var(--accent-dark); }
.dse-slot-grid {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  padding: 14px; margin: 10px 14px; background: #fff; border-radius: 12px;
}
.dse-slot {
  border: none; border-radius: 10px; padding: 10px 4px; font-size: 13px; font-weight: 600;
  background: #f3f4f6; color: #9ca3af; cursor: pointer; text-align: center;
}
.dse-slot.open { background: #ef4444; color: #fff; }
.dse-slot:active { opacity: 0.85; }
.dse-footer {
  display: flex; gap: 12px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid #e5e7eb; flex-shrink: 0;
}
.dse-foot-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid #e5e7eb; background: #fff; border-radius: 12px; padding: 14px 12px;
  font-size: 15px; font-weight: 600; color: #374151; cursor: pointer;
}
.dse-foot-ico { font-size: 18px; line-height: 1; opacity: 0.7; }

.dse-action-sheet {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.dse-action-sheet.open { pointer-events: auto; opacity: 1; }
.dse-action-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.4); }
.dse-action-panel {
  position: relative; width: 100%; max-width: 480px;
  background: #fff; border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .25s ease-out;
}
.dse-action-sheet.open .dse-action-panel { transform: translateY(0); }
.dse-action-title { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.dse-action-source { font-size: 13px; margin: 0 0 12px; }
.dse-action-seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px;
}
.dse-action-seg-btn {
  padding: 10px 6px; border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fff; font-size: 13px; font-weight: 600; color: #6b7280; cursor: pointer;
}
.dse-action-seg-btn.active {
  border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent-dark);
}
.dse-action-fields { margin-bottom: 14px; }
.dse-action-btns {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px;
}

#rescheduleDepositSheet {
  position: fixed; inset: 0; z-index: 12000;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
#rescheduleDepositSheet.open { pointer-events: auto; opacity: 1; }
#rescheduleDepositSheet .dse-action-panel { max-width: 420px; }
.reschedule-deposit-options { display: flex; flex-direction: column; gap: 10px; }
.reschedule-deposit-opt {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px;
  font-size: 14px; line-height: 1.45;
}
.reschedule-deposit-status {
  margin: 10px 0 0; font-size: 13px; font-weight: 600; text-align: center;
}
.reschedule-deposit-status.is-info { color: #2563eb; }
.reschedule-deposit-status.is-error { color: #dc2626; }
#rescheduleDepositConfirm { min-height: 44px; }
.apt-policy-card {
  margin: 12px 0; padding: 12px 14px; border-radius: 12px;
  background: #f9fafb; border: 1px solid #f0f0f0; font-size: 13px; line-height: 1.7;
}
.apt-history-section { margin-top: 12px; }
.apt-history-list { list-style: none; margin: 8px 0 0; padding: 0; }
.apt-history-list li {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px;
}
.apt-history-list li:last-child { border-bottom: none; }
.apt-history-msg { font-weight: 600; color: #111827; }
.apt-history-date { font-size: 11px; color: #9ca3af; white-space: nowrap; }

.dse-page { position: relative; }

.db-day-editor {
  padding: 12px 16px 16px; background: #f9fafb; border-bottom: 1px solid #e5e7eb;
}
.db-day-editor .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }

.db-svc-count { font-weight: 600; color: #111; }
.db-svc-list { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.db-svc-list label { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }

.hc-comm-card {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  margin: 0 14px 10px;
  padding: 14px;
}
.hc-comm-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.hc-comm-avatar.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  font-weight: 700;
}
.hc-comm-body { flex: 1; min-width: 0; }
.hc-comm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.hc-comm-link {
  border: none;
  background: none;
  font-size: 12px;
  color: var(--accent-dark);
  cursor: pointer;
  padding: 0;
}
.hc-comm-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}
.hc-comm-total {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  color: #2563eb;
  font-weight: 700;
}
.hc-staff-report-card {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}

#recordsList .mob-segment.hidden,
#page-records .mob-segment.hidden { display: none; }


/* 月曆 Hotcake 風格（#appScreen 隔離，避免 booking.css 圓形日曆樣式滲入） */
#appScreen .page-home { padding-left: 0; padding-right: 0; }
#appScreen .page-home .mob-cal-toolbar { padding-left: 12px; padding-right: 12px; }
#appScreen .schedule-month-wrap {
  background: var(--card);
  border-top: 1px solid var(--line);
}
#appScreen .mob-cal-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0 10px; gap: 6px; flex-wrap: nowrap;
}
#appScreen .mob-cal-toolbar .cal-nav.cal-nav-sm {
  flex-shrink: 0;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; font-size: 18px; line-height: 1;
  cursor: pointer; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
#appScreen .cal-month-btn {
  background: none; border: none; font-size: 15px; font-weight: 700;
  cursor: pointer; color: var(--ink); padding: 4px 6px;
  flex: 0 1 auto; min-width: 0; white-space: nowrap;
}
#appScreen .cal-toolbar-right { display: flex; gap: 6px; flex-shrink: 0; margin-left: auto; }
.cal-pill {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--card); font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink);
  white-space: nowrap;
}
.cal-pill-accent { border-color: var(--accent-tint); color: var(--accent-dark); background: #fff; }
.schedule-filter-bar { padding: 0 12px 10px; }
.schedule-filter-bar .input-inline { width: 100%; margin-bottom: 0; }
#appScreen .mob-cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: 12px; font-weight: 600; color: #6b7280;
  text-align: center; padding: 8px 0 6px;
  border-bottom: 1px solid var(--line);
}
#appScreen .mob-cal-weekdays .wkend { color: var(--wkend); }
#appScreen .mob-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(104px, auto);
  gap: 0;
}
#appScreen .mob-cal-grid .mob-cal-day {
  min-height: 104px;
  aspect-ratio: auto;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 6px 4px 4px;
  cursor: pointer; position: relative; background: var(--card);
  display: flex; flex-direction: column; align-items: stretch;
  justify-content: flex-start;
  color: var(--ink);
  user-select: auto;
}
#appScreen .mob-cal-grid .mob-cal-day:nth-child(7n) { border-right: none; }
#appScreen .mob-cal-grid .mob-cal-day.pad {
  pointer-events: none;
  background: #fafafa;
  min-height: 104px;
}
#appScreen .mob-cal-grid .mob-cal-day.wkend .mob-cal-day-num,
#appScreen .mob-cal-grid .mob-cal-day.wkend .mob-cal-day-total { color: var(--wkend); }
#appScreen .mob-cal-grid .mob-cal-day.today .mob-cal-day-num {
  background: transparent;
  color: var(--accent-dark);
  border: 2px solid var(--accent-dark);
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}
#appScreen .mob-cal-grid .mob-cal-day.selected { background: #fff5f7; }
#appScreen .mob-cal-day-num { font-size: 14px; font-weight: 600; margin-bottom: 2px; align-self: flex-start; line-height: 22px; }
#appScreen .mob-cal-day-total { font-size: 10px; color: #9ca3af; margin-bottom: 4px; font-weight: 500; }
#appScreen .mob-cal-apt {
  position: relative;
  display: flex; align-items: center; gap: 3px;
  font-size: 10px; line-height: 1.2;
  padding: 3px 5px 3px 4px;
  border-radius: 2px;
  margin-bottom: 3px;
  border-right: 3px solid var(--apt-accent, #93c5fd);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink); cursor: pointer;
}
#appScreen .mob-cal-apt.apt-stripe-blue {
  background: repeating-linear-gradient(
    -45deg,
    #eff6ff,
    #eff6ff 2px,
    #f8fafc 2px,
    #f8fafc 4px
  );
}
#appScreen .mob-cal-apt.apt-stripe-purple {
  background: repeating-linear-gradient(
    -45deg,
    #f5f3ff,
    #f5f3ff 2px,
    #faf5ff 2px,
    #faf5ff 4px
  );
}
#appScreen .mob-cal-apt.apt-warn {
  background: #fff1f2;
  border-right-color: #ef4444;
}
#appScreen .mob-cal-apt.apt-muted {
  background: #f3f4f6;
  border-right-color: #9ca3af;
  opacity: 0.75;
}
#appScreen .cal-apt-alert {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px;
  background: #ef4444; color: #fff;
  border-radius: 50%; font-size: 9px; font-weight: 800; line-height: 1;
}
#appScreen .cal-apt-time { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
#appScreen .mob-cal-day-more { font-size: 10px; color: var(--accent-dark); font-weight: 600; margin-top: 1px; }
.cal-nav-hidden { position: absolute; left: -9999px; }

/* 週曆 */
.week-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.week-toolbar .cal-title { flex: 1; text-align: center; font-size: 16px; font-weight: 700; }
.cal-nav { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.week-cal-grid { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.week-cal-inner { display: grid; grid-template-columns: 40px repeat(7, minmax(72px, 1fr)); min-width: 640px; }
.week-cal-head { font-size: 10px; font-weight: 700; text-align: center; padding: 6px 2px; color: var(--muted); border-bottom: 1px solid var(--line); }
.week-cal-head.today { color: var(--accent-dark); }
.week-cal-head .wk-date { display: block; font-size: 14px; color: var(--ink); margin-top: 2px; }
.week-cal-head.today .wk-date { background: var(--accent-dark); color: #fff; width: 24px; height: 24px; line-height: 24px; border-radius: 50%; margin: 2px auto 0; }
.week-time-label { font-size: 9px; color: var(--muted); text-align: right; padding: 4px 4px 0 0; border-right: 1px solid var(--line); }
.week-time-gutter { border-right: 1px solid var(--line); }
.week-day-col { position: relative; border-right: 1px solid #f3f4f6; cursor: pointer;
  background: repeating-linear-gradient(to bottom, transparent, transparent 47px, #f9fafb 47px, #f9fafb 48px); }
.week-day-col:last-child { border-right: none; }
.week-apt-block {
  position: absolute; left: 2px; right: 2px; border-radius: 6px; padding: 3px 5px;
  font-size: 9px; line-height: 1.3; color: #fff; cursor: pointer; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.12); z-index: 2;
}
.week-apt-block strong { display: block; font-size: 10px; }

/* Segmented / Tabs */
.mob-segment {
  display: flex; background: #f3f4f6; border-radius: 10px; padding: 3px; margin-bottom: 14px;
}
.mob-segment-3 .mob-segment-btn { font-size: 12px; padding: 8px 4px; }
.mob-segment-btn {
  flex: 1; padding: 9px 8px; border: none; border-radius: 8px;
  background: transparent; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer;
}
.mob-segment-btn.active { background: #4b5563; color: #fff; }
.mob-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.mob-tab {
  flex: 1; background: none; border: none; padding: 12px 8px;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.mob-tab.active { color: var(--ink); border-bottom-color: var(--ink); }

/* 選單卡片 */
.mob-menu-card {
  background: var(--card); border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); margin-bottom: 12px;
}
.mob-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  cursor: pointer; -webkit-user-select: none; user-select: none;
}
.mob-menu-item:last-child { border-bottom: none; }
.mob-menu-item:active { background: #fafafa; }
.mob-menu-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.mob-menu-icon.pink { background: var(--accent-soft); }
.mob-menu-icon.teal { background: #ccfbf1; }
.mob-menu-icon.green { background: #dcfce7; }
.mob-menu-icon.purple { background: #ede9fe; }
.mob-menu-icon.gray { background: #f3f4f6; }
.mob-menu-text { flex: 1; font-size: 15px; font-weight: 500; }
.mob-menu-body { flex: 1; min-width: 0; }
.mob-menu-body strong { display: block; font-size: 15px; margin-bottom: 2px; }
.mob-menu-body span { font-size: 12px; }
.mob-menu-chevron { color: #d1d5db; font-size: 18px; }

/* 列表卡片 */
.mob-list { }
.mob-empty { text-align: center; padding: 48px 16px; }
.record-card, .deposit-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
}
.record-card:active, .deposit-card:active { background: #fafafa; }
.record-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.record-time { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.record-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4b5563; margin-bottom: 4px; }
.deposit-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.deposit-card-head strong { font-size: 15px; }
.deposit-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 會員 */
.members-toolbar { margin-bottom: 12px; }
.members-search { margin-bottom: 0; }
.members-stats { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.members-stat { background: #f9fafb; border-radius: 10px; padding: 10px 14px; min-width: 100px; }
.members-stat .num { font-size: 20px; font-weight: 700; }
.members-stat .lbl { font-size: 11px; color: var(--muted); }
.member-card {
  display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; margin-bottom: 10px;
}
.member-card.clickable { cursor: pointer; }
.member-body { flex: 1; min-width: 0; }
.member-wallet-btn {
  align-self: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
  font-size: 18px; cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.member-wallet-btn:active { transform: scale(0.94); background: #f9fafb; }
.member-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: #f3f4f6;
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; color: var(--muted);
  overflow: hidden;
}
.member-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
}
.member-name { font-weight: 700; font-size: 15px; }
.member-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.member-tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px; background: #f3f4f6; color: var(--muted); }
.member-tag.line { background: #dcfce7; color: #166534; }
.member-tag.visits { background: var(--accent-soft); color: var(--accent-dark); }
.member-tag.new { background: var(--accent-soft); color: var(--accent-dark); }
.member-tag.credit { background: #e0e7ff; color: #3730a3; }
.member-tag.credit-lvl { background: #fef3c7; color: #92400e; }
.member-tag.credit-warn { background: #fee2e2; color: #b91c1c; }
.members-search-bar { margin: 0 16px 12px; width: calc(100% - 32px); }
.member-completeness { margin-top: 8px; }
.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: 11px; color: var(--muted); margin-top: 4px; }
.member-meta-line { font-size: 12px; color: var(--muted); margin-top: 2px; }
.smart-check-list { display: grid; gap: 8px; margin: 12px 0; }
.smart-check-item { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 12px; background: #f9fafb; border-radius: 10px; }
.smart-check-item.ok { color: #15803d; }
.smart-check-item.miss { color: #9ca3af; }
.customer-suggest { margin: -6px 0 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.customer-suggest button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: none; background: none; border-bottom: 1px solid var(--line); cursor: pointer; }
.customer-suggest button:last-child { border-bottom: none; }
.dup-group-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 0 16px 12px; }
.dup-group-reason { font-size: 12px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.dup-member-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.dup-member-row:first-of-type { border-top: none; }
.dup-primary-pick { display: flex; align-items: center; gap: 6px; flex-shrink: 0; min-width: 52px; }
.dup-primary-pick input { width: 16px; height: 16px; margin: 0; }
.dup-primary-label { font-size: 11px; font-weight: 700; color: var(--accent-dark); min-width: 28px; }
.dup-member-info { flex: 1; min-width: 0; }
.dup-member-actions { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }

.branch-pin-form .label { margin-top: 12px; }
.branch-pin-prompt-sheet {
  position: fixed; inset: 0; z-index: 220; display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0; transition: opacity .2s ease;
}
.branch-pin-prompt-sheet.open { pointer-events: auto; opacity: 1; }
.branch-pin-prompt-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.branch-pin-prompt-panel {
  position: relative; width: min(92vw, 360px); background: var(--card); border-radius: 16px;
  padding: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.branch-pin-prompt-panel h3 { margin: 0 0 8px; font-size: 18px; }
.branch-pin-prompt-actions { display: flex; gap: 10px; margin-top: 14px; }
.branch-pin-prompt-actions .btn, .branch-pin-prompt-actions .btn-secondary { flex: 1; }

.merge-log-list { list-style: none; margin: 0; padding: 0; }
.merge-log-list li { font-size: 12px; color: var(--text); padding: 8px 0; border-top: 1px solid var(--line); }
.merge-log-list li:first-child { border-top: none; }
.merge-log-date { color: var(--muted); margin-right: 6px; }

/* 設定 */
.mob-settings .settings-group {
  border: none; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 16px; margin-bottom: 0; background: var(--card);
}
.mob-settings .settings-group:last-child { border-bottom: none; }
.mob-settings .settings-group.hidden { display: none; }
.mob-save-btn { margin: 16px 0; }
.settings-group legend { font-weight: 700; font-size: 15px; padding: 0 0 12px; }
.mob-settings .settings-group .hc-section-label { margin: 16px 0 10px; }
.mob-settings .settings-group .hc-section-label:first-of-type { margin-top: 0; }
.brand-upload-row { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 8px 0; }
.settings-group-compact .label { margin-bottom: 4px; }
.settings-group-compact .brand-hint { font-size: 12px; margin: -2px 0 8px; }
.brand-basic-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 8px; }
.brand-field .input { margin-bottom: 0; }
.brand-theme-row {
  display: grid; grid-template-columns: 1fr; gap: 12px; align-items: stretch;
  margin: 8px 0 12px; padding: 12px; background: var(--accent-soft); border-radius: 12px;
}
.brand-color-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.brand-color-input {
  width: 100%; height: 40px; padding: 2px; border: 1px solid var(--accent-tint);
  border-radius: 8px; background: #fff; cursor: pointer;
}
.brand-theme-preview { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
.brand-theme-chip {
  display: inline-block; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; color: #fff;
}
.brand-theme-chip.primary { background: var(--primary-dark, #4b5563); }
.brand-theme-chip.admin { background: var(--accent-dark, #4b5563); }
.brand-theme-chip.accent { background: var(--accent, #6b7280); }
.brand-upload-compact .logo-preview.compact { width: 64px; height: 64px; font-size: 24px; }
.brand-upload-compact .cover-preview.compact { height: 72px; min-height: 72px; }
.brand-upload-compact .input-sm { font-size: 13px; padding: 8px 10px; margin-top: 6px; }
.brand-file-input { font-size: 12px; margin-top: 6px; max-width: 100%; width: 100%; }
.brand-intro-text { min-height: 56px; }
.brand-upload-col { min-width: 0; }
#page-settings-form .settings-form {
  width: 100%; max-width: 420px; margin: 0 auto;
}
#page-settings-form .hc-overlay-body {
  max-width: 100%;
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
}
.mob-settings .settings-group-compact .input,
.mob-settings .settings-group-compact .textarea { max-width: 100%; }
@media (min-width: 520px) {
  .brand-basic-grid { grid-template-columns: 1fr 1fr; }
  .brand-upload-row { grid-template-columns: 1fr 1fr; }
  .brand-theme-row { grid-template-columns: 1fr 1fr; }
}
#page-settings-form .settings-group-compact { padding-bottom: 8px; }
.records-bills-nav {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 0 0 12px; padding: 8px 0;
}
.records-bills-total { font-size: 13px; color: var(--muted); margin-bottom: 8px; text-align: center; }
.record-card.clickable { cursor: pointer; }
.record-card.clickable:active { opacity: 0.85; }
.bill-detail-panel { max-width: 420px; width: calc(100% - 32px); margin: auto; }
.bill-detail-panel {
  position: relative; z-index: 1; width: 100%; max-width: 420px; max-height: 85vh;
  background: var(--card, #fff); border-radius: 16px 16px 0 0; display: flex; flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
}
#billDetailModal { align-items: flex-end; background: rgba(0,0,0,.4); }
#billDetailModal .modal-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line, #eee);
}
#billDetailModal .modal-head h3 { flex: 1; margin: 0; font-size: 17px; }
.bill-detail-panel .modal-body { max-height: 60vh; overflow-y: auto; }
.bill-detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line, #eee); font-size: 14px; }
.bill-detail-row strong { font-weight: 600; }
.bill-detail-actions { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line, #eee); }
.bill-detail-actions .btn-secondary { flex: 1; }
.bill-detail-actions .btn-danger { flex: 1; }
.bill-edit-form .label { margin-top: 10px; }
.brand-preview { border: 1px dashed var(--line); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #fafafa; margin-bottom: 8px; }
.brand-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-preview { width: 72px; height: 72px; font-size: 24px; }
.cover-preview { width: 100%; height: 64px; font-size: 12px; }
.field-hint { font-size: 12px; color: var(--muted); margin: -8px 0 12px; }

/* 開通健檢 */
.setup-checklist { padding: 0 16px 16px; }
.setup-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.setup-item strong { display: block; font-size: 13px; margin-bottom: 2px; }
.setup-item span { font-size: 12px; color: var(--muted); }

/* 試算表容量 */
.storage-panel { padding: 0 16px 24px; margin-top: 8px; }
.storage-panel h3 { font-size: 15px; margin-bottom: 6px; }
.storage-hint { font-size: 12px; margin-bottom: 12px; }
.storage-status-box { margin-bottom: 16px; }
.storage-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; font-size: 12px; }
.storage-row.warn { border-color: #fed7aa; background: #fff7ed; }
.storage-row strong { font-size: 13px; }
.storage-form-row { margin-bottom: 8px; }
.storage-divider { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.btn-danger-outline { border: 1px solid #fecaca; color: #dc2626; background: #fff; }

/* 團隊管理 */
.team-list { padding: 0 16px 24px; }
.team-role-tabs {
  display: flex; margin: 0 16px 12px; padding: 4px;
  background: #f3f4f6; border-radius: 12px; gap: 4px;
}
.team-role-tab {
  flex: 1; border: none; background: transparent;
  padding: 10px 8px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.team-role-tab.active { background: #374151; color: #fff; }
.team-perm-hint {
  margin: 0 16px 10px; padding: 12px 14px;
  background: #f8fafc; border-radius: 12px;
  font-size: 12px; line-height: 1.55; color: #64748b;
}
.team-perm-group { margin: 0 16px 12px; }
.team-perm-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: #94a3b8; text-transform: uppercase; margin-bottom: 6px;
}
.team-perm-list {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 6px;
}
.team-perm-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: #374151; padding: 8px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.team-perm-item.deny { color: var(--muted); background: #fafafa; }
.team-perm-mark {
  flex: 0 0 auto; width: 16px; text-align: center;
  font-weight: 700; line-height: 1.4;
}
.team-perm-item.allow .team-perm-mark { color: #059669; }
.team-perm-item.deny .team-perm-mark { color: #dc2626; }
.team-invite-panel {
  margin: 0 16px 10px; padding: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
}
.team-invite-panel.hidden { display: none; }
.team-invite-card {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: calc(100% - 32px); margin: 0 16px 14px; padding: 16px;
  border-radius: 14px; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); cursor: pointer;
  font-size: 15px; font-weight: 600; color: #2563eb;
}
.team-invite-card:active { background: #f9fafb; }
.team-invite-plus { font-size: 20px; line-height: 1; }
.team-invite-form { padding: 0 16px 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.team-invite-form h3, .team-bind-section h3 { font-size: 15px; margin-bottom: 10px; }
.team-user-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.team-user-card.inactive { opacity: 0.6; }
.team-user-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.team-user-meta { font-size: 12px; color: var(--muted); }
.team-user-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.team-user-actions button { font-size: 11px; padding: 4px 10px; border: 1px solid var(--line); background: var(--card); border-radius: 6px; cursor: pointer; }
.team-bind-section { padding: 16px; margin-top: 8px; border-top: 1px solid var(--line); }
.account-line-bind {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}
.account-section-label {
  font-size: 13px; font-weight: 700; margin: 0 0 6px; color: var(--text);
}
.account-line-status { font-size: 13px; margin: 0 0 10px; }
.account-line-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-ical-advanced {
  margin: 4px 0 8px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 0 12px;
}
.account-ical-advanced summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  padding: 10px 0;
  list-style: none;
}
.account-ical-advanced summary::-webkit-details-marker { display: none; }
.account-ical-advanced[open] summary { border-bottom: 1px solid #e5e7eb; margin-bottom: 8px; }
#accountIcalOneTapBtn {
  font-size: 16px;
  font-weight: 700;
  padding: 14px 16px;
  border-radius: 12px;
}
.invite-result { margin-top: 10px; padding: 10px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; font-size: 12px; word-break: break-all; }
.invite-result.hidden { display: none; }
/* 僅品牌管理員可見（店長／服務人員隱藏）；不強制 display，保留原元件排版 */
body:not(.is-owner) .role-owner-only { display: none !important; }
body.is-staff .role-owner { display: none !important; }
.role-owner-only-nav { display: none !important; }
body.is-owner .role-owner-only-nav { display: block; }
body.is-owner .more-grid-item.role-owner-only-nav { display: flex; }
body.is-owner .page-feature-overlay.role-owner-only-nav.open { display: flex !important; }
.role-manager-only-nav { display: none !important; }
body.is-manager .role-manager-only-nav { display: block; }
body.is-manager .page-feature-overlay.role-manager-only-nav.open { display: flex !important; }
.role-reports-gated { display: none !important; }
body.can-view-reports .role-reports-gated { display: block; }
body.can-view-reports .mob-nav-item.role-reports-gated { display: flex; }
body.can-view-reports .more-grid-item.role-reports-gated { display: flex; }
body.can-view-reports .page-feature-overlay.role-reports-gated.open { display: flex !important; }
/* 底部導覽：設定／報表（品牌管理員、店長） */
.mob-nav-item.nav-settings-tab,
.mob-nav-item.nav-reports-tab { display: none !important; }
body.is-manager .mob-nav-item.nav-settings-tab { display: flex !important; }
body.is-manager .mob-nav-item.nav-reports-tab,
body.can-view-reports .mob-nav-item.nav-reports-tab { display: flex !important; }
.role-manager-only.mob-nav-item { display: none !important; }
body:not(.is-staff) .role-manager-only.mob-nav-item { display: flex; }
body:not(.is-staff) .more-grid-item.role-manager-only { display: flex; }

/* 左緣右滑返回 */
body.edge-swipe-active .page-feature-overlay.open,
body.edge-swipe-active .page-overlay.active {
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
}
.role-manager-only { /* 保留原元件 display，僅用 body.is-staff 隱藏 */ }
body.is-staff .role-manager-only { display: none !important; }
.hidden-feature { display: none !important; }
.btn-line { background: #06c755; color: #fff; border: none; }
.btn-line.btn-small { font-size: 13px; padding: 10px 14px; }

/* 服務人員 */
.designers-admin-list { padding: 0 16px 16px; }
.designer-admin-card { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.designer-admin-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.designer-admin-avatar.placeholder { background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.designer-admin-fields { flex: 1; min-width: 0; }

.hc-head-save {
  border: none; background: none; color: var(--accent-dark); font-size: 22px; font-weight: 700; cursor: pointer; padding: 4px 8px;
}
.hc-designers-wrap { padding: 0 14px 20px; }
.hc-designers-self {
  background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.hc-designers-self-row { display: flex; align-items: center; gap: 12px; }
.hc-designers-self-av {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: #f3f4f6; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #6b7280;
}
.hc-designers-self-info { flex: 1; min-width: 0; }
.hc-designers-self-info strong { display: block; font-size: 15px; }
.hc-designers-self-hint { font-size: 12px; margin: 10px 0 0; line-height: 1.45; }
.hc-toggle { position: relative; display: inline-flex; flex-shrink: 0; }
.hc-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.hc-toggle-ui {
  width: 48px; height: 28px; border-radius: 999px; background: #d1d5db;
  transition: background .2s; position: relative;
}
.hc-toggle-ui::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.hc-toggle input:checked + .hc-toggle-ui { background: var(--accent, #3b82f6); }
.hc-toggle input:checked + .hc-toggle-ui::after { transform: translateX(20px); }
.hc-designers-card {
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.hc-designers-add,
.hc-designers-invite {
  display: block; width: 100%; border: none; border-bottom: 1px solid var(--line);
  background: #fff; color: #2563eb; font-weight: 600; font-size: 15px;
  padding: 14px 16px; text-align: left; cursor: pointer;
}
.hc-designers-empty { padding: 16px; text-align: center; }
.hc-designers-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.hc-designers-row.dragging { opacity: .45; }
.hc-designers-row.drag-over { background: #f9fafb; }
.hc-designers-del {
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: #fee2e2; color: #dc2626; font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.hc-designers-avatar {
  width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
}
.hc-designers-avatar.ph {
  display: flex; align-items: center; justify-content: center;
  background: #f3f4f6; font-weight: 700; font-size: 16px;
}
.hc-designers-name { flex: 1; font-weight: 600; font-size: 15px; min-width: 0; }
.hc-designers-edit, .hc-designers-drag {
  border: none; background: none; color: #9ca3af; font-size: 18px; cursor: pointer; padding: 4px;
}
.hc-action-sheet {
  position: fixed; inset: 0; z-index: 220; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.hc-action-sheet.hidden { display: none; }
.hc-action-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.hc-action-panel {
  position: relative; background: #fff; border-radius: 14px; width: min(320px, 100%); overflow: hidden;
}
.hc-action-item {
  display: block; width: 100%; border: none; background: #fff; padding: 16px; font-size: 16px;
  text-align: center; cursor: pointer; border-bottom: 1px solid #f3f4f6;
}
.hc-action-item:last-child { border-bottom: none; }
.hc-designer-edit-body { padding: 16px 14px 32px; background: #f3f4f6; min-height: calc(100vh - 56px); }
.hc-de-avatar-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.hc-de-avatar-btn { position: relative; cursor: pointer; }
.hc-de-avatar-img {
  width: 88px; height: 88px; border-radius: 14px; object-fit: cover; display: block;
}
.hc-de-avatar-img.ph {
  display: flex; align-items: center; justify-content: center;
  background: #e5e7eb; font-size: 28px; font-weight: 700;
}
.hc-de-cam {
  position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px;
  border-radius: 50%; background: #fff; border: 1px solid #e5e7eb;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.hc-de-card {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px;
}
.hc-de-opt { font-size: 11px; color: #9ca3af; font-weight: 400; }
.hc-de-colors { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.hc-de-color {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; color: #fff; font-size: 14px; font-weight: 700; padding: 0;
}
.hc-de-color.active { border-color: #111; box-shadow: 0 0 0 2px #fff inset; }
.hc-de-bio { min-height: 100px; resize: vertical; }
.hc-de-count { text-align: right; font-size: 12px; color: #9ca3af; margin-top: 6px; }
.hc-de-advanced-toggle {
  display: block; margin: 8px auto 12px; border: 1px solid #bfdbfe; background: #eff6ff;
  color: #2563eb; border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer;
}
.hc-de-delete {
  display: block; width: 100%; margin-top: 20px; border: none; background: none;
  color: #dc2626; font-size: 15px; cursor: pointer; padding: 12px;
}
#page-designer-edit.active { z-index: 140; }
.save-msg { font-size: 12px; margin-top: 4px; }

/* 儀表板 */
.dash-period { display: flex; gap: 8px; margin: 12px 16px 16px; }
.dash-period-btn { padding: 8px 16px; border: 1px solid var(--line); background: var(--card); border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; }
.dash-period-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.dash-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 16px; margin-bottom: 20px; }
.dash-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.dash-card .label { margin-bottom: 4px; font-size: 11px; }
.dash-card .value { font-size: 18px; font-weight: 700; }
.dash-card .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dash-card.warn { border-color: #fed7aa; background: #fff7ed; }
.dash-section { padding: 0 16px 20px; }
.dash-section h3 { font-size: 15px; margin-bottom: 10px; }
.dash-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pending-row, .inventory-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; font-size: 13px; }
.pending-actions { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.pending-main { flex: 1; min-width: 0; }
.danger-btn { color: #dc2626 !important; border-color: #fecaca !important; }
.inventory-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.inventory-table th, .inventory-table td { border: 1px solid var(--line); padding: 8px 6px; text-align: left; }
.inventory-table input { width: 60px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.inventory-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.inventory-actions button { padding: 3px 8px; font-size: 11px; border: 1px solid var(--line); background: var(--card); border-radius: 6px; cursor: pointer; }
.inventory-low { color: #c2410c; font-weight: 600; }
.checkout-month-swipe,
.schedule-month-swipe { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.checkout-stats { display: grid; grid-template-columns: 1fr; gap: 16px; }

.checkout-donut { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.checkout-donut-inner { width: 76px; height: 76px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; }
.checkout-donut-inner strong { font-size: 14px; }
.checkout-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.checkout-table th, .checkout-table td { padding: 8px; text-align: left; border-bottom: 1px solid var(--line); }
.checkout-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }

/* 行銷 */
.marketing-form { margin: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.marketing-tabs { display: flex; gap: 16px; margin: 0 16px 12px; border-bottom: 1px solid var(--line); }
.marketing-tab { background: none; border: none; padding: 10px 4px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.marketing-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.marketing-list { padding: 0 16px 16px; }
.marketing-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.marketing-card-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.marketing-channel { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px; background: #dcfce7; color: #166534; }

/* 排程列 */
.schedule-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.schedule-time { font-weight: 700; font-size: 14px; }
.schedule-status { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px; background: #f3f4f6; color: var(--muted); margin-left: 6px; }
.schedule-row.clickable { cursor: pointer; }
.day-add-btn { width: 100%; margin-top: 8px; }

/* 全螢幕 Modal */
.modal-full { align-items: stretch; justify-content: stretch; overflow: hidden; }
.modal-full .fs-page {
  position: relative; background: var(--bg); width: 100%; max-width: 480px;
  margin: 0 auto; height: 100vh; height: 100dvh; max-height: 100dvh;
  display: flex; flex-direction: column; z-index: 1; overflow: hidden;
}
.fs-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-right: max(14px, env(safe-area-inset-right));
  padding-left: max(14px, env(safe-area-inset-left));
  background: var(--card); border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.fs-header h3 { flex: 1; text-align: center; font-size: 17px; font-weight: 700; margin-right: 32px; }
.fs-close { background: none; border: none; font-size: 28px; line-height: 1; color: var(--ink); cursor: pointer; width: 32px; }
.fs-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px 20px; }

/* 日期詳情 */
.day-fs-body { padding-bottom: 100px; }
.day-fs-footer {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 12px 14px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); z-index: 210;
}
.btn-outline-pink {
  padding: 14px; border: 2px solid var(--accent-dark); background: var(--card);
  color: var(--accent-dark); border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.btn-pink {
  padding: 14px; border: none; background: var(--accent-dark);
  color: #fff; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.day-apt-card {
  position: relative; background: var(--accent-soft); border: 1px solid var(--accent-tint);
  border-radius: 14px; padding: 14px 14px 14px 36px; margin-bottom: 12px; cursor: pointer;
}
.day-apt-card:active { opacity: .92; }
.day-apt-del {
  position: absolute; top: 10px; left: 10px; width: 22px; height: 22px;
  border-radius: 50%; border: none; background: #ef4444; color: #fff;
  font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.day-apt-time { font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.day-apt-designer {
  display: inline-block; font-size: 11px; font-weight: 700; color: #7c3aed;
  background: #ede9fe; padding: 2px 8px; border-radius: 6px; margin-bottom: 8px;
}
.day-apt-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.day-apt-service { font-size: 14px; color: #6b7280; }
.day-empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* 預約詳情 */
.apt-fs-header { flex-direction: column; align-items: stretch; gap: 4px; padding-bottom: 8px; }
.apt-fs-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; padding: 0 4px; }
.apt-short-id { background: #f3f4f6; padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 11px; }
.apt-alert-banner {
  background: #fef2f2; color: #b91c1c; padding: 10px 16px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.apt-alert-banner.hidden { display: none !important; }
.apt-fs-body { padding-bottom: 90px; }
.apt-customer-card {
  display: flex; gap: 12px; align-items: center; background: var(--card);
  border-radius: 14px; padding: 14px; margin-bottom: 12px;
}
.apt-customer-card .member-tags { margin-top: 6px; }
.member-tag.deposit-tag { background: #fff; border: 1px solid #fdba74; color: #ea580c; }
.apt-booking-card {
  background: var(--card); border-radius: 14px; padding: 16px; margin-bottom: 12px;
}
.apt-booking-brand { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.apt-booking-time { font-size: 18px; font-weight: 700; line-height: 1.4; margin-bottom: 6px; }
.apt-booking-summary { font-size: 13px; color: var(--muted); }
.apt-info-rows { background: var(--card); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.apt-info-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.apt-info-row:last-child { border-bottom: none; }
.apt-info-row:active { background: #fafafa; }
.apt-info-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.apt-info-body { flex: 1; min-width: 0; }
.apt-info-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.apt-info-value { font-size: 14px; font-weight: 600; }
.apt-info-value.warn { color: #dc2626; }
.apt-info-chevron { color: #d1d5db; font-size: 18px; }
.apt-notes-row {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
}
.apt-checkout-panel {
  background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px;
}
.apt-fs-toolbar, .passport-fs-toolbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: flex; justify-content: space-around;
  padding: 8px 4px; padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); z-index: 210;
}
.apt-tool-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; padding: 6px 8px; cursor: pointer; min-width: 56px;
}
.apt-tool-btn span { font-size: 20px; }
.apt-tool-btn small { font-size: 10px; color: var(--muted); font-weight: 600; }
.apt-tool-btn.danger small { color: #dc2626; }
.apt-tool-btn.disabled { opacity: .35; pointer-events: none; }
.apt-more-drawer { position: fixed; inset: 0; z-index: 220; max-width: 480px; margin: 0 auto; }
.apt-more-drawer.hidden { display: none !important; }
.apt-more-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.apt-more-sheet {
  position: absolute; bottom: 0; left: 0; right: 0; background: var(--card);
  border-radius: 20px 20px 0 0; padding: 20px 16px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
.apt-more-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px;
}
.apt-more-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--ink);
}
.apt-more-item.disabled { opacity: .35; pointer-events: none; }
.apt-more-item span { font-size: 24px; }
.apt-more-arrival { margin-top: 4px; }

/* 會員護照 */
.apt-fs-header { flex-direction: row; align-items: center; }
.apt-fs-header .apt-fs-meta { flex: 1; margin-left: 4px; }
.passport-fs-page .passport-tabs {
  background: var(--card); padding: 0 14px; flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.passport-fs-page .passport-tab { flex: 1; text-align: center; padding: 12px 8px; font-size: 14px; }
.passport-fs-page .passport-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.passport-fs-body { padding-bottom: 80px; background: var(--bg); }
.passport-profile-card {
  background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px;
}
.passport-profile-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.passport-wallet-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.passport-wallet-item { text-align: center; border-right: 1px solid var(--line); padding: 4px 8px; }
.passport-wallet-item:last-child { border-right: none; }
.passport-wallet-item .num { font-size: 18px; font-weight: 700; }
.passport-wallet-item .lbl { font-size: 11px; color: var(--muted); }
.passport-wallet-tap {
  border: none; background: none; width: 100%; cursor: pointer; font: inherit; color: inherit;
}
.passport-wallet-tap:active { background: #f9fafb; border-radius: 8px; }
.passport-wallet-tap.muted-wallet .num { color: var(--muted); }
.passport-section {
  background: var(--card); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
}
.passport-section-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-bottom: 10px; padding-right: 2px;
}
.passport-section-head .text-btn {
  flex-shrink: 0; min-width: 40px; min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
}
.passport-section-head h4 { font-size: 15px; font-weight: 700; }
.passport-tags-label { margin: 10px 0 6px; font-size: 12px; }
.pp-tag-editor { margin-top: 10px; }
.pp-tag-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.pp-tag-chip {
  border: none; background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.pp-tag-add-row { display: flex; gap: 8px; margin-top: 10px; }
.pp-tag-add-row .input { flex: 1; }
.pp-tag-catalog { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.pp-tag-catalog-label { width: 100%; margin: 0; font-size: 12px; color: var(--muted); }
.pp-tag-suggest {
  border: 1px dashed #d1d5db; background: #fff; color: #374151;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.survey-form-card .survey-form-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.survey-editor { padding-bottom: 24px; }
.survey-q-card {
  background: var(--card); border-radius: 12px; padding: 12px; margin: 10px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.survey-q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.survey-editor-actions { display: flex; gap: 8px; margin-top: 16px; }
.passport-kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.passport-kv:last-child { border-bottom: none; }
.passport-kv .k { color: var(--muted); }
.passport-apt-card {
  background: var(--card); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
}
.passport-apt-card:active { background: #fafafa; }
.passport-apt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.passport-status-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 12px;
}
.passport-status-badge.waiting { background: var(--accent-soft); color: var(--accent-dark); }
.passport-status-badge.arrived { background: #ccfbf1; color: #0f766e; }
.passport-status-badge.done { background: #f3f4f6; color: var(--muted); }
.passport-apt-time { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.passport-apt-price { font-size: 17px; font-weight: 700; float: right; margin-top: -28px; }
.passport-apt-row { display: flex; gap: 8px; font-size: 13px; color: #4b5563; margin-bottom: 4px; }
.passport-bill-card {
  background: var(--card); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
}
.passport-bill-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.passport-bill-main { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.passport-bill-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.passport-bill-actions button {
  padding: 8px 14px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--card); font-size: 13px; font-weight: 600; cursor: pointer;
}
.passport-bill-actions .btn-pink-sm {
  background: var(--accent-dark); color: #fff; border-color: var(--accent-dark);
}

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal.hidden { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.modal-sheet {
  position: relative; background: var(--card); width: 100%; max-width: 480px;
  max-height: 92vh; max-height: 92dvh; border-radius: 20px 20px 0 0;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0,0,0,.15);
  padding-bottom: var(--safe-b);
}
.modal-header { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-close { background: none; border: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0; }
.modal-meta { font-size: 12px; margin-bottom: 2px; }
.modal-header h3 { font-size: 17px; margin: 0; }
.modal-body { padding: 14px 16px 20px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.modal-sheet-wide { max-width: 480px; }
.apt-alerts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.apt-alert { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px; }
.apt-alert.warn { background: #fee2e2; color: #b91c1c; }
.apt-alert.info { background: #dbeafe; color: #1d4ed8; }
.apt-alert.ok { background: #dcfce7; color: #166534; }
.apt-customer { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.apt-customer-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.arrival-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 14px 0; }
.arrival-tab { padding: 9px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; }
.arrival-tab.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-dark); }
.apt-detail-card { background: #fafafa; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.apt-detail-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px solid #eee; }
.apt-detail-row:last-child { border-bottom: none; }
.checkout-methods { margin: 10px 0; }
.checkout-method-row { display: grid; grid-template-columns: 1fr 90px; gap: 8px; align-items: center; margin-bottom: 6px; }
.checkout-method-row label { font-size: 13px; font-weight: 600; }
.checkout-method-row input { margin-bottom: 0; padding: 8px; }
.checkout-method-readonly input { background: #f3f4f6; color: #6b7280; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.modal-actions .btn, .modal-actions .btn-secondary { width: auto; flex: 1; min-width: 100px; }
.passport-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 16px; }
.passport-tab { flex: 1; background: none; border: none; padding: 11px 6px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.passport-tab.active { color: var(--accent-dark); border-bottom-color: var(--accent-border); }
.passport-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.passport-stat { background: #fafafa; border-radius: 10px; padding: 10px; text-align: center; }
.passport-stat .num { font-size: 18px; font-weight: 700; }
.passport-stat .lbl { font-size: 10px; color: var(--muted); }
.change-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.change-due { font-size: 16px; font-weight: 700; color: var(--accent-dark); }
#reportsQuickStats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
#reportsQuickStats .dash-card { padding: 10px; }
#reportsQuickStats .dash-card .value { font-size: 15px; }
#reportsQuickStats .reports-quick-link {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--card); border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
#reportsQuickStats .reports-quick-link:active { opacity: .85; }
.hc-report-quick-links { display: flex; flex-wrap: wrap; gap: 8px; }
.reports-hub-body { padding-top: 8px; }
.reports-hub-gap { margin-top: 12px; }
.hc-stats-card {
  background: var(--card); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04); padding: 4px 8px 8px;
}
.hc-export-toolbar { padding: 12px 16px 8px; background: #f3f4f6; }
.hc-export-date-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px;
}
.hc-export-date {
  display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-weight: 600;
}
.hc-export-date input {
  border: none; background: none; font: inherit; width: 100%; color: var(--ink);
}
.hc-export-chips {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 4px; scrollbar-width: none;
}
.hc-export-chips::-webkit-scrollbar { display: none; }
.hc-export-chip {
  flex-shrink: 0; padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.hc-export-chip.active {
  border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft);
}
.hc-export-section { margin: 12px 16px 0; }
.hc-export-section-title {
  font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 4px 8px;
}
.hc-export-card {
  background: var(--card); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.hc-export-row {
  display: flex; align-items: center; gap: 10px; padding: 14px;
  border-bottom: 1px solid var(--line);
}
.hc-export-row:last-child { border-bottom: none; }
.hc-export-row-text { flex: 1; min-width: 0; }
.hc-export-row-text strong { display: block; font-size: 15px; font-weight: 600; }
.hc-export-row-text span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.hc-export-btn {
  flex-shrink: 0; padding: 6px 14px; border-radius: 8px; border: none;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
}
.hc-export-btn:disabled { opacity: .55; cursor: wait; }
.hc-export-btn:active:not(:disabled) { opacity: .9; }
.nav-feature.hidden-feature { display: none !important; }
.dash-section.hidden-feature { display: none !important; }

/* Sync Engine 骨架屏 */
@keyframes sk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.sk-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  grid-column: 1 / -1;
  padding: 8px 4px;
}
.sk-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  background: linear-gradient(90deg, #ececf1 25%, #f5f5f7 50%, #ececf1 75%);
  background-size: 200% 100%;
  animation: sk-pulse 1.2s ease-in-out infinite;
}
.sk-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.sk-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ececf1;
  flex-shrink: 0;
  animation: sk-pulse 1.2s ease-in-out infinite;
}
.sk-lines { flex: 1; }
.sk-line {
  height: 12px;
  border-radius: 6px;
  background: #ececf1;
  margin-bottom: 8px;
  animation: sk-pulse 1.2s ease-in-out infinite;
}
.sk-line.short { width: 55%; margin-bottom: 0; }
.sk-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.sk-stat {
  height: 72px;
  border-radius: 12px;
  background: #ececf1;
  animation: sk-pulse 1.2s ease-in-out infinite;
}
.sk-dash .sk-stat,
.sk-dash-card { min-height: 88px; height: auto; }
.sk-block { padding: 8px 0; }
.member-card-optimistic { opacity: 0.72; pointer-events: none; }
.perf-virt-list { position: relative; }
.perf-virt-spacer { width: 100%; pointer-events: none; }
.perf-virt-window { position: absolute; left: 0; right: 0; top: 0; }
.member-card img[data-lazy-src] { background: #e8e8ee; }

/* ── Flowee Performance Engine ── */
.perf-scroll-sentinel { min-height: 1px; padding: 8px 0; text-align: center; }
.perf-scroll-loading { font-size: 13px; }
.members-page-size { margin-left: auto; }
.members-page-size .perf-page-size { font-size: 13px; padding: 4px 8px; max-width: 96px; }
.perf-monitor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.perf-metric-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}
.perf-metric-card.warn { border-color: #f59e0b; background: #fffbeb; }
.perf-metric-label { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.perf-metric-value { font-size: 22px; font-weight: 700; color: #111827; }
.perf-metric-value span { font-size: 12px; font-weight: 500; color: #9ca3af; margin-left: 4px; }
.perf-metric-target { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.perf-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 2px;
}
.perf-log-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; padding: 8px 10px; background: #f9fafb; border-radius: 8px;
}
.perf-log-kind { font-weight: 600; text-transform: uppercase; font-size: 11px; color: #6b7280; min-width: 36px; }
.perf-log-ms { margin-left: auto; font-variant-numeric: tabular-nums; }
.perf-log-hit { font-size: 11px; color: #059669; background: #d1fae5; padding: 2px 6px; border-radius: 6px; }
.perf-monitor-sk { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.perf-sk-card { height: 72px; border-radius: 12px; background: #ececf1; animation: sk-pulse 1.2s ease-in-out infinite; }

@media (min-width: 481px) {
  body { background: #e5e7eb; }
  .mob-app { box-shadow: 0 0 40px rgba(0,0,0,.08); min-height: 100vh; }
}

/* ── 操作回饋：Toast / 按鈕忙碌 / 卡片淡出 ── */
.admin-toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 12000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 360px);
}
.admin-toast {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: #111827;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease;
}
.admin-toast.show { opacity: 1; transform: translateY(0); }
.admin-toast--success { background: #059669; }
.admin-toast--error { background: #dc2626; }
.admin-toast--info { background: #2563eb; }

/* App 內對話框（取代系統 alert/confirm/prompt） */
.flow-dialog-root {
  position: fixed; inset: 0; z-index: 13000;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.flow-dialog-root.open {
  pointer-events: auto; opacity: 1; visibility: visible;
  transition: opacity .2s ease, visibility 0s;
}
.flow-dialog-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .42);
}
.flow-dialog-sheet {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  margin: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-radius: 18px;
  padding: 20px 18px 16px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, .22);
  transform: translateY(18px);
  transition: transform .24s cubic-bezier(.32,.72,0,1);
}
.flow-dialog-root.open .flow-dialog-sheet { transform: translateY(0); }
.flow-dialog-title {
  margin: 0 0 8px; font-size: 17px; font-weight: 700; color: #111827; text-align: center;
}
.flow-dialog-msg {
  margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: #4b5563;
  white-space: pre-wrap; word-break: break-word; text-align: center;
}
.flow-dialog-msg.hidden { display: none; }
.flow-dialog-field { margin-bottom: 14px; }
.flow-dialog-field.hidden { display: none; }
.flow-dialog-input {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; border: 1.5px solid #d1d5db; border-radius: 12px;
  font-size: 16px; background: #f9fafb; color: #111827;
}
.flow-dialog-input:focus {
  outline: none; border-color: #4b5563;
  box-shadow: 0 0 0 3px rgba(75, 85, 99, .14); background: #fff;
}
.flow-dialog-actions {
  display: flex; gap: 10px;
}
.flow-dialog-btn {
  flex: 1; min-height: 46px; border-radius: 12px; border: none;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.flow-dialog-btn.ghost {
  background: #f3f4f6; color: #374151;
}
.flow-dialog-btn.ghost.hidden { display: none; }
.flow-dialog-btn.primary {
  background: #111827; color: #fff;
}
.flow-dialog-btn:active { transform: scale(0.98); }

.btn.is-busy, .text-btn.is-busy, button.is-busy {
  opacity: .88;
  pointer-events: none;
  transform: scale(0.98);
  filter: brightness(0.95);
}
#addAptSubmitBtn.is-busy::after,
#rescheduleDepositConfirm.is-busy::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: app-spin .7s linear infinite;
  vertical-align: -2px;
}
#rescheduleDepositConfirm.is-busy::after {
  border-color: rgba(255,255,255,.35);
  border-top-color: #fff;
}
.btn-secondary.is-busy::after {
  border-color: rgba(15,23,42,.15);
  border-top-color: #334155;
}
@keyframes app-spin { to { transform: rotate(360deg); } }
.admin-fade-out {
  opacity: 0;
  transform: scale(.98);
  transition: opacity .24s ease, transform .24s ease;
}
.deposit-card, .pending-row { transition: opacity .24s ease, transform .24s ease; }

/* 商品 Hub */
.products-hub-body { padding: 16px; display: flex; flex-direction: column; min-height: calc(100vh - 56px); }
.products-hub-card { margin-bottom: auto; }
.products-hub-card .hc-menu-icon.blue { background: #dbeafe; color: #1d4ed8; }
.products-back-cal {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 24px auto 32px; padding: 12px 20px; border: none; background: none;
  font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.product-item-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px;
  border: none; border-bottom: 1px solid var(--line); background: var(--card); text-align: left; cursor: pointer;
}
.product-item-row:active { background: #f9fafb; }
.product-item-ico {
  width: 40px; height: 40px; border-radius: 10px; background: #dbeafe; color: #1d4ed8;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.product-item-info { flex: 1; min-width: 0; }
.product-item-info strong { display: block; font-size: 15px; }
.product-item-info span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.product-item-price { font-size: 13px; font-weight: 700; color: var(--ink); flex-shrink: 0; }

/* 商品編輯器（全螢幕） */
.product-editor-sheet {
  position: fixed; inset: 0; z-index: 1200; background: #f3f4f6;
  display: none; flex-direction: column;
}
.product-editor-sheet.open { display: flex; }
.product-editor-page { display: flex; flex-direction: column; height: 100%; }
.product-editor-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.product-editor-head h2 { flex: 1; text-align: center; font-size: 17px; font-weight: 700; margin: 0; }
.product-editor-form { flex: 1; overflow-y: auto; padding: 16px 0 32px; }
.product-field-card {
  background: var(--card); margin: 0 16px 12px; border-radius: 14px; overflow: hidden;
}
.product-field { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.product-field:last-child { border-bottom: none; }
.product-field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.product-optional {
  font-size: 11px; font-weight: 600; color: var(--muted); background: #f3f4f6;
  padding: 2px 6px; border-radius: 6px; margin-left: 4px;
}
.product-field .input, .product-field .textarea { border: none; padding: 0; background: transparent; box-shadow: none; }
.product-field .input:focus, .product-field .textarea:focus { outline: none; }
.product-char-count { display: block; text-align: right; font-size: 11px; color: var(--muted); margin-top: 6px; }
.product-picker-row {
  display: flex; align-items: center; width: 100%; padding: 14px 16px; border: none; background: none; cursor: pointer; text-align: left;
}
.product-picker-row .product-field-label { flex: 1; margin: 0; }
.product-picker-value { font-size: 14px; color: var(--muted); margin-right: 4px; }
.product-section-divider {
  display: flex; align-items: center; gap: 12px; margin: 8px 16px 12px; color: var(--muted); font-size: 12px;
}
.product-section-divider::before, .product-section-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.product-price-field .product-price-input {
  display: flex; align-items: center; gap: 8px;
}
.product-price-field .input { flex: 1; text-align: right; }
.product-price-unit { font-size: 14px; color: var(--muted); flex-shrink: 0; }
.product-category-panel h3 { padding: 12px 16px 8px; margin: 0; font-size: 15px; }
#productCategorySheet {
  z-index: 1400;
  align-items: flex-end;
  padding: 0;
}
#productCategorySheet .hc-action-panel {
  width: 100%;
  max-width: 480px;
  margin: 0;
  border-radius: 18px 18px 0 0;
  max-height: 78vh;
  overflow: auto;
}
.product-category-row {
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--line); padding: 0 8px 0 0;
}
.product-category-row .hc-action-item {
  flex: 1; border-bottom: none; text-align: left;
}
.product-category-row.active .hc-action-item { font-weight: 700; }
.product-category-manage {
  display: flex; gap: 4px; flex-shrink: 0; padding-right: 8px;
}
.product-category-manage button {
  border: 1px solid var(--line); background: #fff; color: #4b5563;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.product-category-manage .is-danger { color: #dc2626; border-color: #fecaca; background: #fff5f5; }
.product-category-hint {
  margin: 0; padding: 4px 16px 12px; font-size: 12px; color: var(--muted);
}
.product-field .input::placeholder,
.product-field .textarea::placeholder { color: #9ca3af; }

/* 自動關懷解鎖彈窗 */
.care-unlock-modal {
  position: fixed; inset: 0; z-index: 1300; display: flex; align-items: flex-end; justify-content: center;
}
.care-unlock-modal.hidden { display: none; }
.care-unlock-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.care-unlock-panel {
  position: relative; width: 100%; max-width: 480px; background: var(--card);
  border-radius: 20px 20px 0 0; padding: 0 20px 28px; max-height: 92vh; overflow-y: auto;
  animation: careSlideUp .28s ease;
}
@keyframes careSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.care-unlock-hero {
  margin: 0 -20px 16px; padding: 24px 20px 20px; text-align: center;
  background: linear-gradient(180deg, var(--accent-soft) 0%, #fff 100%);
  border-radius: 20px 20px 0 0;
}
.care-unlock-illus { font-size: 48px; margin-bottom: 8px; }
.care-unlock-tagline { font-size: 13px; font-weight: 700; color: #9d174d; margin: 0; line-height: 1.5; }
.care-unlock-title { font-size: 18px; font-weight: 800; line-height: 1.45; margin: 0 0 12px; text-align: center; }
.care-unlock-title em { font-style: normal; color: var(--accent-dark); }
.care-unlock-sub { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.care-unlock-list { list-style: none; margin: 0 0 20px; padding: 0; }
.care-unlock-list li {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 14px; line-height: 1.45;
}
.care-unlock-ico { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.hc-menu-badge {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: #f3f4f6; color: #6b7280; flex-shrink: 0; align-self: center;
}
.hc-menu-badge.muted-badge { background: #f3f4f6; color: #9ca3af; }
.hc-menu-badge.soon-badge { background: #fef3c7; color: #b45309; }

.rc-coming-soon-foot {
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

/* Flowee AI 入口（尚未開放） */
.reply-center-body.is-ai-entry-closed {
  background: linear-gradient(180deg, #f5f3ff 0%, var(--bg) 220px);
  padding-top: 4px;
}
.ai-entry-page {
  padding: 0 0 24px;
  max-width: 420px;
  margin: 0 auto;
}
.ai-entry-hero {
  position: relative;
  text-align: center;
  padding: 20px 16px 22px;
  margin-bottom: 20px;
  border-radius: 20px;
  background: linear-gradient(145deg, #6d28d9 0%, #7c3aed 42%, #a78bfa 100%);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(109, 40, 217, .22);
}
.ai-entry-hero::after {
  content: "";
  position: absolute;
  width: 180px; height: 180px;
  right: -48px; top: -60px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  pointer-events: none;
}
.ai-entry-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.35);
  margin-bottom: 12px;
}
.ai-entry-hero-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.15));
}
.ai-entry-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.ai-entry-lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255,255,255,.92);
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}
.ai-entry-section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 4px 10px;
  letter-spacing: .02em;
}
.ai-entry-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.ai-entry-feature {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 12px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid rgba(15,23,42,.06);
  box-shadow: 0 1px 3px rgba(15,23,42,.05);
}
.ai-entry-feature strong {
  font-size: 14px;
  color: var(--ink);
}
.ai-entry-feature span:last-child {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.ai-entry-feature-ico {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.ai-entry-feature-ico.blue { background: #dbeafe; }
.ai-entry-feature-ico.purple { background: #ede9fe; }
.ai-entry-feature-ico.teal { background: #ccfbf1; }
.ai-entry-feature-ico.pink { background: #fce7f3; }
.ai-entry-info-card {
  background: var(--card);
  border: 1px solid #e9d5ff;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.ai-entry-info-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #5b21b6;
}
.ai-entry-checklist {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.65;
  color: #4b5563;
}
.ai-entry-checklist li { margin-bottom: 4px; }
.ai-entry-checklist li:last-child { margin-bottom: 0; }
.ai-entry-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.ai-entry-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  border: none;
  box-shadow: 0 4px 14px rgba(109,40,217,.28);
}
.ai-entry-btn-secondary {
  width: 100%;
  border-radius: 12px;
  padding: 12px;
  font-weight: 600;
}
.ai-entry-foot {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.care-unlock-actions { grid-template-columns: 1fr; }
.care-unlock-btn {
  padding: 14px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; border: 2px solid var(--accent-border);
}

/* ── 訂閱方案 ── */
.subscription-page-body { padding-bottom: 32px; }
.sub-soon-banner {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 12px;
  background: #fff7ed; border: 1px solid #fdba74; color: #9a3412;
  font-size: 13px; font-weight: 600;
}
.sub-current-card {
  background: linear-gradient(135deg, #f8fafc 0%, #fff 60%);
  border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 16px;
}
.sub-current-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sub-plan-badge { font-size: 18px; font-weight: 800; color: #0f172a; }
.sub-status-pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #f1f5f9; color: #475569; }
.sub-status-pill.is-subscribed { background: #ecfdf5; color: #047857; }
.sub-current-meta { font-size: 13px; margin: 0 0 8px; }
.sub-current-price { font-size: 15px; margin: 0 0 8px; }
.sub-current-price strong { font-size: 22px; color: #111; }
.sub-upgrade-note { font-size: 12px; margin: 0; }
.sub-billing-hint { font-size: 12px; margin: 12px 0 4px; }
.sub-calc-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 18px;
}
.sub-calc-hint { font-size: 13px; margin: 0 0 12px; }
.sub-calc-result { display: grid; gap: 8px; margin: 12px 0; }
.sub-calc-row {
  display: flex; align-items: baseline; gap: 8px; padding: 10px 12px;
  background: #f8fafc; border-radius: 10px; font-size: 14px;
}
.sub-calc-row span { flex: 1; font-weight: 600; }
.sub-calc-row strong { font-size: 18px; }
.sub-calc-row em { font-style: normal; color: var(--muted); font-size: 12px; }
.sub-calc-row.is-pro { background: #f1f5f9; }
.sub-calc-limits { border-top: 1px solid var(--line); padding-top: 10px; }
.sub-calc-limits .muted { font-size: 12px; margin: 0 0 6px; }
.sub-plan-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }
@media (min-width: 720px) { .sub-plan-grid { grid-template-columns: 1fr 1fr 1fr; } }
.sub-plan-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--card);
}
.sub-plan-card.is-current { border-color: #94a3b8; box-shadow: 0 0 0 2px rgba(148,163,184,.25); }
.sub-plan-card.is-pro { border-color: #64748b; }
.sub-plan-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sub-plan-card h3 { margin: 0; font-size: 17px; }
.sub-current-tag { font-size: 11px; font-weight: 700; color: #334155; white-space: nowrap; }
.sub-plan-cta { width: 100%; margin-top: 14px; opacity: .7; }
.sub-promo-price { font-size: 15px; margin: 8px 0 2px; }
.sub-promo-price strong { font-size: 22px; color: #0f172a; }
.sub-price-note { font-size: 12px; margin: 0 0 8px; }
.sub-trial-hint { font-size: 12px; margin: 4px 0 0; }
.sub-quota-block { margin: 10px 0 8px; }
.sub-quota-label { font-size: 13px; font-weight: 600; color: #0f172a; margin-bottom: 6px; }
.sub-quota-track {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.sub-quota-track.is-unlimited { opacity: .55; }
.sub-quota-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .35s ease;
  background: #22c55e;
}
.sub-quota-fill.tone-ok { background: linear-gradient(90deg, #34d399, #22c55e); }
.sub-quota-fill.tone-mid { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.sub-quota-fill.tone-warn { background: linear-gradient(90deg, #fb923c, #f97316); }
.sub-quota-fill.tone-full { background: linear-gradient(90deg, #f87171, #ef4444); }
.sub-quota-pct { font-size: 11px; margin-top: 4px; }
.sub-quota-indep { font-size: 12px; margin: 8px 0 0; line-height: 1.45; }
.sub-quota-alert {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45;
}
.sub-quota-alert.is-grace { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.sub-quota-alert.is-full { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.sub-quota-alert.is-locked { background: #111827; color: #f9fafb; border: 1px solid #374151; }
.sub-trial-notice { font-size: 12px; margin-top: 8px; line-height: 1.45; }
.quota-lock-overlay {
  position: fixed; inset: 0; z-index: 400; background: rgba(15, 23, 42, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.quota-lock-overlay.hidden { display: none; }
.quota-lock-card {
  max-width: 360px; width: 100%; background: #fff; border-radius: 16px; padding: 22px 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); text-align: center;
}
.quota-lock-card h3 { margin: 0 0 8px; font-size: 18px; }
.quota-lock-card p { margin: 0 0 16px; font-size: 14px; color: #4b5563; line-height: 1.5; }
.sub-limit-note { font-size: 12px; margin: 8px 0 0; }
.sub-feat-list { list-style: none; margin: 10px 0 0; padding: 0; }
.sub-feat-list li { display: flex; gap: 8px; font-size: 13px; margin: 0 0 6px; }
.sub-feat-check { color: #059669; font-weight: 700; }
.sub-tier-table-wrap, .sub-compare-wrap { overflow-x: auto; margin: 8px 0 4px; }
.sub-tier-table, .sub-compare-table {
  width: 100%; border-collapse: collapse; font-size: 12px; min-width: 280px;
}
.sub-tier-table th, .sub-tier-table td,
.sub-compare-table th, .sub-compare-table td {
  border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left;
}
.sub-compare-table th { font-size: 11px; color: var(--muted); }
.sub-cmp-yes { color: #059669; font-weight: 700; }
.sub-cmp-no { color: #cbd5e1; }
.sub-cmp-text { font-size: 11px; }
.sub-status-pill.is-subscribed { background: #ede9fe; color: #5b21b6; }
body:not(.is-manager) #accountGearSubscription { display: none; }
.care-unlock-btn.ghost { background: #fff; color: var(--accent-dark); }
.care-unlock-btn.primary { background: #ec4899; color: #fff; border-color: #ec4899; }

/* Reply Center */
.reply-center-body { padding-bottom: 48px; }
.rc-lead { font-size: 13px; line-height: 1.55; margin-bottom: 14px; }
.rc-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 14px; background: var(--card); }
.rc-master { background: linear-gradient(135deg, #faf5ff 0%, #fff 100%); border-color: #ddd6fe; }
.rc-toggle-master { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.rc-toggle-master input { width: 18px; height: 18px; margin-right: 8px; }
.rc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-grid { display: grid; grid-template-columns: 1fr; gap: 4px; }
@media (min-width: 640px) { .rc-grid { grid-template-columns: 1fr 1fr; } }
.rc-check-row, .rc-radio-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 13px; cursor: pointer; }
.rc-check-row.is-disabled { opacity: .55; }
.rc-check-row input, .rc-radio-row input { margin-top: 3px; flex-shrink: 0; }
.rc-health-summary { font-weight: 700; margin: 0 0 10px; }
.rc-webhook { font-size: 12px; word-break: break-all; }
.rc-health-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.rc-health-row:first-child { border-top: none; }
.rc-health-ok { border-left: 3px solid #22c55e; padding-left: 10px; }
.rc-health-warn { border-left: 3px solid #f59e0b; padding-left: 10px; }
.rc-health-err { border-left: 3px solid #ef4444; padding-left: 10px; }
.rc-health-unknown { border-left: 3px solid #94a3b8; padding-left: 10px; }
.rc-conflict { color: #b45309; font-size: 13px; margin: 8px 0 0; }
.rc-log-row { display: grid; grid-template-columns: 56px 1fr; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 12px; }
.rc-log-src { font-weight: 700; text-transform: uppercase; color: #7c3aed; }

/* Loyalty admin */
.loyalty-page-body { padding-bottom: 56px; }
.loyalty-tabs {
  display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 0 12px; margin-bottom: 4px; scrollbar-width: none;
}
.loyalty-tabs::-webkit-scrollbar { display: none; }
.loyalty-tab {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: #4b5563;
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.loyalty-tab.active { background: #1f2937; color: #fff; border-color: #1f2937; }
.loyalty-section-head { margin: 0 0 14px; }
.loyalty-section-title { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.loyalty-section-desc { margin: 0; font-size: 13px; line-height: 1.45; }
.loyalty-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-bottom: 14px;
}
.loyalty-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
.loyalty-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.loyalty-count { font-size: 12px; }
.loyalty-list { display: grid; gap: 10px; }
.loyalty-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; border-left: 4px solid var(--ly-accent, #e5e7eb);
}
.loyalty-item-main { flex: 1; min-width: 0; }
.loyalty-item-title-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px;
}
.loyalty-item-meta { margin: 2px 0 0; font-size: 12px; line-height: 1.45; }
.loyalty-item-actions {
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
}
.loyalty-action-btn {
  border: 1px solid var(--line); background: #fff; color: #374151;
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.loyalty-action-btn.is-danger { color: #dc2626; border-color: #fecaca; background: #fff5f5; }
.loyalty-chip {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 8px; font-size: 11px; font-weight: 600;
  background: #f3f4f6; color: #4b5563;
}
.loyalty-chip.is-on { background: #ecfdf5; color: #047857; }
.loyalty-chip.is-off { background: #f3f4f6; color: #9ca3af; }
.loyalty-level-badge {
  display: inline-flex; align-items: center; gap: 4px; color: #fff;
  font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.loyalty-empty {
  text-align: center; padding: 36px 16px; border: 1px dashed var(--line);
  border-radius: 16px; background: #fafafa;
}
.loyalty-empty-ico { font-size: 28px; line-height: 1; margin-bottom: 8px; }
.loyalty-empty-title { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.loyalty-empty-desc { margin: 0 0 14px; font-size: 13px; line-height: 1.45; }
.loyalty-form-wrap { margin-top: 12px; }
.loyalty-form h4 { margin: 0; font-size: 15px; }
.loyalty-form-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px;
}
.loyalty-form-actions { display: flex; gap: 8px; margin-top: 12px; }
.loyalty-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.loyalty-form .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.loyalty-colors { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.loyalty-color {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; color: #fff; font-size: 14px; font-weight: 700; padding: 0;
  line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.loyalty-color.active { border-color: #111; box-shadow: 0 0 0 2px #fff inset; }
.loyalty-toggle-list {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.loyalty-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; margin: 0;
}
.loyalty-toggle-row:last-child { border-bottom: none; }
.loyalty-toggle-row.is-master { background: #f8fafc; }
.loyalty-toggle-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.loyalty-toggle-copy strong { font-size: 14px; font-weight: 700; }
.loyalty-toggle-copy .muted { font-size: 12px; line-height: 1.4; }
.loyalty-sticky-actions { margin-top: 16px; }
.loyalty-check-grid { display: grid; gap: 8px; margin: 4px 0 8px; }
.loyalty-check {
  display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin: 0;
}
.loyalty-ach-admin-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.loyalty-ach-admin-card {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  background: var(--card);
}
.loyalty-ach-admin-ico { font-size: 22px; line-height: 1; }
.loyalty-ach-admin-card strong { display: block; font-size: 13px; margin-bottom: 2px; }
.loyalty-ach-admin-card .muted { margin: 0; font-size: 11px; line-height: 1.4; }
@media (max-width: 420px) {
  .loyalty-form-grid { grid-template-columns: 1fr; }
  .loyalty-item { flex-direction: column; }
  .loyalty-item-actions { flex-direction: row; }
}
@media (prefers-color-scheme: dark) {
  .loyalty-item, .loyalty-card, .loyalty-toggle-list, .loyalty-ach-admin-card, .loyalty-tab { background: var(--card); }
  .loyalty-tab.active { background: #e5e7eb; color: #111; border-color: #e5e7eb; }
  .loyalty-empty { background: rgba(255,255,255,.03); }
  .loyalty-toggle-row.is-master { background: rgba(255,255,255,.04); }
  .loyalty-action-btn { background: transparent; }
}


/* Today Console — Continuum strip above calendar (non-breaking) */
.today-console {
  margin: 0 12px 10px;
  padding: 12px 14px;
  border-radius: var(--flow-radius, 12px);
  background: linear-gradient(135deg, rgba(26, 107, 92, 0.08), rgba(11, 31, 36, 0.03));
  border: 1px solid var(--flow-line, rgba(11, 31, 36, 0.10));
  animation: flow-rise 0.45s var(--flow-ease, ease) both;
}
.today-console[hidden] { display: none !important; }
.today-console-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.today-console-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--flow-brand, #1a6b5c);
}
.today-console-metrics {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 0;
}
.today-metric {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 56px;
}
.today-metric em {
  font-style: normal;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--flow-ink, #0b1f24);
  font-variant-numeric: tabular-nums;
}
.today-metric small {
  color: var(--flow-muted, #5c6f76);
  font-size: 0.72rem;
}
.today-metric.is-warn em { color: var(--flow-warn, #b45309); }

.sub-founding-medal {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 4px 0 12px; padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(26,107,92,0.10), rgba(11,31,36,0.04));
  border: 1px solid rgba(26,107,92,0.22);
}
.sub-founding-medal-mark {
  font-size: 18px; line-height: 1.2; color: #1a6b5c; font-weight: 700;
}
.sub-founding-medal-copy { display: grid; gap: 2px; }
.sub-founding-medal-copy strong { font-size: 14px; color: #0b1f24; }
.sub-founding-medal-copy span { font-size: 12px; color: #5c6f76; line-height: 1.45; }

.marketing-hint { padding: 10px 16px 0; font-size: 13px; line-height: 1.55; }
.marketing-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.marketing-after-note { font-size: 12px; margin: 8px 0 0; line-height: 1.5; }
#marketingModeTabs { margin: 0 16px 4px; }
.marketing-status { font-size: 12px; color: var(--muted); margin-left: 8px; }
