/**
 * style.css
 * 好選保健 PurePick — Modern Clinical Design System (#1ABC9C Teal + #3498DB Blue + Satoshi Typography)
 */

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

:root {
  /* Modern Clinical Primary & Secondary Palette */
  --primary: #1ABC9C;
  --primary-hover: #159A80;
  --primary-light: #E8F8F5;
  --primary-border: #B7EFE4;
  --primary-border-strong: #1ABC9C;

  --secondary: #3498DB;
  --secondary-hover: #2980B9;
  --secondary-light: #EBF5FB;

  /* Clean Clinical Surfaces */
  --bg-page: #F9FAFB;
  --bg-card: #FFFFFF;
  --bg-soft-yellow: #FFFBEB;
  --bg-soft-purple: #E8F8F5;

  --teal: #1ABC9C;
  --teal-light: #E8F8F5;
  --amber: #D97706;
  --amber-light: #FEF3C7;
  --rose: #E11D48;
  --rose-light: #FFE4E6;
  --emerald: #10B981;
  --emerald-light: #D1FAE5;

  /* High-Contrast Clinical Typography */
  --text-dark: #1C1C1C;
  --text-body: #1C1C1C;
  --text-neutral: #374151;
  --text-muted: #6B7280;

  /* Subtle 1px Clinical Borders */
  --border: #F3F4F6;
  --border-strong: #E5E7EB;

  /* Depth-Inducing Ambient Shadows & Smooth Transitions */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.08);
  --ease-clinical: cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 0.75rem; /* 12px */
  --radius-md: 1rem;    /* 16px */
  --radius-lg: 1.25rem; /* 20px */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==================== 全域臨床圖標系統 ==================== */
.icon-svg,
.icon-svg-lg,
.icon-svg-sm,
.b-svg,
.b-center-svg {
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.icon-svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke: #4B5563;
}

.icon-svg-lg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  stroke: #1ABC9C;
}

.icon-svg-sm {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  stroke: #4B5563;
}

body {
  font-family: 'Satoshi', 'Plus Jakarta Sans', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 92px;
}

/* ==================== 頂部臨床雙層搜尋標題列 (STICKY HEADER) ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #FFFFFF;
  color: var(--text-dark);
  border-bottom: 1px solid #F3F4F6;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  min-width: 0;
  flex-shrink: 0;
}

.brand-logo-box {
  width: 40px;
  height: 40px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #1ABC9C 0%, #3498DB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(26, 188, 156, 0.28);
  transition: transform 300ms var(--ease-clinical);
}

.brand-group:hover .brand-logo-box {
  transform: translateY(-1px) scale(1.03);
}

.brand-logo-box svg {
  width: 21px;
  height: 21px;
}

.brand-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #1C1C1C;
  white-space: nowrap;
  line-height: 1.2;
}

.brand-sub-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #1ABC9C;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* 桌面版置中雙欄整合搜尋列 (Height 48px, 180px 品類選擇器 + 1px 分隔線 + 關鍵字輸入) */
.clinical-dual-search {
  flex: 1;
  max-width: 42rem;
  height: 48px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  overflow: hidden;
  transition: border-color 300ms var(--ease-clinical), box-shadow 300ms var(--ease-clinical), background 300ms var(--ease-clinical);
}

.clinical-dual-search:focus-within {
  background: #FFFFFF;
  border-color: #1ABC9C;
  box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.14);
}

.dual-search-cat {
  width: 180px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.85rem;
  border-right: 1px solid #E5E7EB;
  flex-shrink: 0;
  color: #374151;
}

.dual-search-cat svg {
  width: 16px;
  height: 16px;
  stroke: #1ABC9C;
  flex-shrink: 0;
}

.dual-search-select {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1C1C1C;
  cursor: pointer;
  outline: none;
}

.dual-search-input-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.9rem;
}

.dual-search-input-wrap svg {
  width: 17px;
  height: 17px;
  stroke: #9CA3AF;
  flex-shrink: 0;
}

.dual-search-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  color: #1C1C1C;
  outline: none;
}

.dual-search-input::placeholder {
  color: #9CA3AF;
}

/* 手機版獨立全寬搜尋列 (Height 44px, Background #F9FAFB) */
.mobile-search-row {
  display: none;
  padding: 0 1rem 0.65rem 1rem;
  background: #FFFFFF;
}

.mobile-search-bar {
  height: 44px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.85rem;
  transition: border-color 300ms var(--ease-clinical), background 300ms var(--ease-clinical);
}

.mobile-search-bar:focus-within {
  background: #FFFFFF;
  border-color: #1ABC9C;
}

.mobile-search-bar svg {
  width: 17px;
  height: 17px;
  stroke: #9CA3AF;
  flex-shrink: 0;
}

.mobile-search-bar input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  color: #1C1C1C;
  outline: none;
}

@media (max-width: 1024px) {
  .header-inner {
    height: 64px;
    padding: 0 1.15rem;
  }
  .dual-search-cat {
    width: 145px;
  }
}

@media (max-width: 768px) {
  .header-inner {
    height: 56px;
    padding: 0 1rem;
  }
  .clinical-dual-search {
    display: none;
  }
  .mobile-search-row {
    display: block;
  }
  .brand-sub-tag {
    display: none;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-icon-top {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 0.75rem;
  border: 1px solid #F3F4F6;
  background: #F9FAFB;
  color: #4B5563;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 300ms var(--ease-clinical);
  flex-shrink: 0;
}

.btn-icon-top:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
  transform: translateY(-2px);
}

.btn-icon-top .icon-svg {
  stroke: #4B5563;
  transition: stroke 300ms var(--ease-clinical);
}

.btn-icon-top:hover .icon-svg {
  stroke: var(--primary);
}

.btn-icon-top.active {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-icon-top.active .icon-svg {
  stroke: #ffffff;
}

#pwa-install-btn.btn-icon-top {
  display: none;
  background: var(--primary);
  border-color: var(--primary);
}

#pwa-install-btn.btn-icon-top .icon-svg {
  stroke: #ffffff;
}

.btn-line-auth {
  min-height: 44px;
  padding: 0 0.9rem;
  border-radius: 0.75rem;
  background: #06C755;
  color: #ffffff;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(6, 199, 85, 0.22);
  transition: all 300ms var(--ease-clinical);
}

.btn-line-auth:hover {
  background: #05b34c;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(6, 199, 85, 0.3);
}

.line-svg {
  width: 15px;
  height: 15px;
}

.auth-box {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0E6251;
}

.btn-logout-demo {
  min-height: 40px;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  background: #F9FAFB;
  color: var(--text-dark);
  border: 1px solid #E5E7EB;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-family: inherit;
  transition: all 300ms var(--ease-clinical);
}

.btn-logout-demo:hover {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
  transform: translateY(-1px);
}

.btn-logout-demo .icon-svg-sm {
  stroke: #4B5563;
  transition: stroke 300ms var(--ease-clinical);
}

.btn-logout-demo:hover .icon-svg-sm {
  stroke: #DC2626;
}

.logout-text-short {
  display: none;
}

.btn-chip-logout {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

/* ==================== 下方 5 鍵常駐導覽列 (尋找／分析／＋／日曆／方案) ==================== */
.line-style-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1500;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid #F3F4F6;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.06);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-bar-inner {
  width: 100%;
  max-width: 780px;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 0.5rem;
}

.b-tab-item {
  background: transparent;
  border: none;
  min-height: 52px;
  min-width: 48px;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: #6B7280;
  font-family: inherit;
  transition: all 300ms var(--ease-clinical);
  position: relative;
}

.b-tab-item:hover {
  background: #F9FAFB;
  color: var(--primary);
}

.b-tab-item.active {
  background: var(--primary-light);
  color: #0E6251;
}

.b-tab-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.b-svg {
  width: 22px;
  height: 22px;
  stroke: #6B7280;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: stroke 300ms var(--ease-clinical), transform 300ms var(--ease-clinical);
}

.b-tab-item:hover .b-svg {
  stroke: var(--primary);
  transform: translateY(-1px);
}

.b-tab-item.active .b-svg {
  stroke: var(--primary);
  stroke-width: 2.3;
}

/* 中間獨立「+」新增按鈕 (48x48px 觸控標準) */
.b-center-action-btn {
  justify-self: center;
  align-self: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1ABC9C 0%, #3498DB 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(26, 188, 156, 0.36);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 300ms var(--ease-clinical), box-shadow 300ms var(--ease-clinical);
  margin: 0 auto;
  padding: 0;
  border: none;
}

.b-center-action-btn:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 10px 24px rgba(26, 188, 156, 0.45);
}

.b-center-action-btn:active {
  transform: translateY(0) scale(0.96);
}

.b-center-svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.b-tab-label {
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.b-tab-badge {
  position: absolute;
  top: -5px;
  right: -13px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.b-tab-badge.badge-emerald {
  background: #3498DB;
}

/* ==================== 主頁面容器 (Max-Width 1280px / 7xl) ==================== */
.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
}

@media (max-width: 768px) {
  .page-container {
    padding: 1rem 1rem 2rem;
  }
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 300ms var(--ease-clinical);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.section-banner h1 {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

.section-banner p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid #F3F4F6;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  transition: box-shadow 300ms var(--ease-clinical), transform 300ms var(--ease-clinical);
}

.card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid #F3F4F6;
}

.card-title-bar h3 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-dark);
}

.card-sub-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.pill-count {
  background: var(--primary-light);
  color: #0E6251;
  border: 1px solid var(--primary-border);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
}

/* 按鈕與觸控標準 (44px Desktop / 48px Mobile) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 300ms var(--ease-clinical);
  font-family: inherit;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .btn {
    min-height: 48px;
  }
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(26, 188, 156, 0.24);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(26, 188, 156, 0.32);
}

.btn-teal {
  background: var(--secondary);
  color: #ffffff;
  border-color: var(--secondary);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.22);
}
.btn-teal:hover {
  background: var(--secondary-hover);
  border-color: var(--secondary-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: #FFFFFF;
  border-color: #E5E7EB;
  color: var(--text-dark);
}
.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: #0E6251;
}

.btn-danger-soft {
  background: var(--rose-light);
  color: var(--rose);
  border-color: #FECDD3;
}
.btn-danger-soft:hover {
  background: #FECDD3;
}

.btn-sm {
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .btn-sm {
    min-height: 44px;
  }
}

.btn-lg {
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  font-size: 0.96rem;
}

.btn-block {
  width: 100%;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text-dark);
  background: #F9FAFB;
  transition: border-color 300ms var(--ease-clinical), box-shadow 300ms var(--ease-clinical), background 300ms var(--ease-clinical);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.14);
}

/* ==================== 功能一：【尋找】互動式表單 ==================== */
.form-step-block {
  padding-bottom: 1.4rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid #F3F4F6;
}
.form-step-block:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-header h3 {
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--text-dark);
}

.step-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sample-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.sample-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.chip-sample {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  color: #374151;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 300ms var(--ease-clinical);
  font-family: inherit;
}

.chip-sample:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: #0E6251;
}

/* 保養目標勾選網格 */
.goal-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.goal-check-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid #F3F4F6;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #F9FAFB;
  transition: all 300ms var(--ease-clinical);
}

.goal-check-card:hover {
  border-color: var(--primary-border);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.goal-check-card input[type="checkbox"] {
  margin-top: 4px;
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.goal-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 300ms var(--ease-clinical);
}

.goal-check-card:hover .goal-icon-box {
  background: #FFFFFF;
  color: var(--primary);
}

.goal-check-card input[type="checkbox"]:checked ~ .goal-icon-box {
  background: var(--primary);
  color: #ffffff;
}

.goal-check-card input[type="checkbox"]:checked ~ .goal-icon-box .icon-svg-lg {
  stroke: #ffffff;
}

.goal-text {
  display: flex;
  flex-direction: column;
}

.goal-text strong {
  font-size: 0.92rem;
  color: var(--text-dark);
}

.goal-text span {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* 細分預算區間卡片 (5 個區間) */
.budget-radio-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.budget-card {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.9rem;
  border: 1px solid #F3F4F6;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #F9FAFB;
  transition: all 300ms var(--ease-clinical);
}

.budget-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.budget-card input[type="radio"] {
  accent-color: var(--primary);
  margin-bottom: 0.35rem;
  width: 16px;
  height: 16px;
}

.budget-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-dark);
}

.budget-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.preference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: #F9FAFB;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid #F3F4F6;
}

.pref-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 220px;
}

.pref-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
}

/* 制定方案分析結果區 */
.finder-result-card {
  border: 1.5px solid var(--primary-border);
  background: linear-gradient(180deg, #E8F8F5 0%, #FFFFFF 130px);
}

.result-summary-box {
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.result-summary-box h3 {
  font-size: 1.08rem;
  font-weight: 800;
  color: #0E6251;
  margin-bottom: 0.45rem;
}

.dont-waste-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 4px solid var(--amber);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.86rem;
  color: #78350F;
}

.bundle-recommendation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: linear-gradient(135deg, #0E6251 0%, #1ABC9C 55%, #3498DB 100%);
  color: #ffffff;
  padding: 1.1rem 1.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(26, 188, 156, 0.24);
}

.bundle-price-tag {
  font-size: 1.3rem;
  font-weight: 900;
  color: #FFFFFF;
}

/* ==================== Health Conditions Category Grid (粉彩圓標分類網格) ==================== */
.clinical-cat-section {
  margin-bottom: 1.5rem;
}

.clinical-cat-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.clinical-cat-section-head h2 {
  font-size: 1.12rem;
  font-weight: 800;
  color: #1C1C1C;
}

.clinical-cat-section-head span {
  font-size: 0.8rem;
  color: #6B7280;
}

.category-filter-pills {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
  .category-filter-pills {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
  }
}

@media (max-width: 768px) {
  .category-filter-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
    padding: 2px 2px 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .category-filter-pills::-webkit-scrollbar {
    display: none;
  }
}

.cat-pill {
  height: 108px;
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: 0.75rem;
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: all 300ms var(--ease-clinical);
  text-align: center;
}

@media (max-width: 768px) {
  .cat-pill {
    height: 38px;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0 0.8rem 0 0.38rem;
    border-radius: 999px;
    box-shadow: none;
    text-align: left;
  }

  .cat-pill:hover {
    transform: none;
  }

  .cat-pill-icon-circle {
    width: 26px !important;
    height: 26px !important;
  }

  .cat-pill-icon-circle svg {
    width: 14px !important;
    height: 14px !important;
  }

  .cat-pill-label {
    font-size: 0.8rem !important;
    white-space: nowrap;
    display: block !important;
  }
}

.cat-pill:hover {
  transform: translateY(-0.25rem);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-border);
}

.cat-pill.active {
  background: #FFFFFF;
  border: 2px solid #1ABC9C;
  box-shadow: 0 10px 26px rgba(26, 188, 156, 0.16);
}

.cat-pill-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 300ms var(--ease-clinical);
}

.cat-pill:hover .cat-pill-icon-circle {
  transform: scale(1.08);
}

.cat-pill-icon-circle svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cat-pill-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #1C1C1C;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-pill.active .cat-pill-label {
  color: #0E6251;
}

/* ==================== Pharmacy / Product Grid (1/2/3 欄 16:9 臨床視覺商品卡) ==================== */
.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}

.catalog-header h2 {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-dark);
}

.catalog-header p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.catalog-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.catalog-controls .form-input {
  width: 240px;
}

.catalog-controls .form-select {
  width: 210px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
  }
}

@media (max-width: 640px) {
  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.supp-card {
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: 1rem;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 300ms var(--ease-clinical), box-shadow 300ms var(--ease-clinical), border-color 300ms var(--ease-clinical);
}

.supp-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  border-color: #D1F2EB;
}

.supp-card.top-recommended {
  border: 1.5px solid #1ABC9C;
  box-shadow: 0 8px 24px rgba(26, 188, 156, 0.12);
}

/* 16:9 Featured Visual Stage + Hover Gradient Overlay + Scale 1.05 */
.supp-visual-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.supp-visual-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  transition: transform 300ms var(--ease-clinical);
}

.supp-card:hover .supp-visual-inner {
  transform: scale(1.05);
}

.hover-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26, 188, 156, 0.12) 0%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease-clinical);
}

.supp-card:hover .hover-gradient-overlay {
  opacity: 1;
}

.supp-badge-topleft {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: #1ABC9C;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(26, 188, 156, 0.35);
}

.supp-badge-bottomright {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #1C1C1C;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.supp-visual-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 65%;
}

.supp-visual-en {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.supp-visual-form {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1C1C1C;
}

.supp-visual-icon-orb {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.supp-visual-icon-orb svg {
  width: 30px;
  height: 30px;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.supp-body-pad {
  padding: 0 4px;
}

.supp-sub-cat-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6B7280;
  margin-bottom: 0.25rem;
}

.supp-brand-title {
  font-size: 1.06rem;
  font-weight: 800;
  color: #1C1C1C;
  margin-bottom: 0.65rem;
  line-height: 1.35;
}

.supp-price-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  border-radius: 0.75rem;
  padding: 0.6rem 0.5rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.68rem;
  color: #6B7280;
  font-weight: 600;
}

.metric-val {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1C1C1C;
}

.metric-val.highlight-daily {
  color: #0E6251;
}

.supp-spec-list {
  font-size: 0.8rem;
  color: #374151;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.spec-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.spec-tag {
  font-weight: 700;
  color: #1C1C1C;
  white-space: nowrap;
}

.pros-cons-box {
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  border-radius: 0.75rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.77rem;
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.pro-line {
  color: #065F46;
}

.con-line {
  color: #9F1239;
}

.supp-actions-row {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 0.5rem;
  padding: 0.65rem 4px 2px 4px;
  border-top: 1px solid #F3F4F6;
}

/* 電腦版隱藏手機專屬精簡摘要與展開鈕 */
.supp-mobile-summary,
.supp-mobile-expand-btn {
  display: none;
}

/* 手機版（<= 768px）方案 A：橫式精簡比價清單卡 ＋ 點擊原地展開詳情 */
@media (max-width: 768px) {
  .section-banner {
    padding: 0.9rem 1rem;
    margin-bottom: 0.85rem;
  }

  .section-banner h1 {
    font-size: 1.15rem;
  }

  .section-banner p {
    font-size: 0.8rem;
  }

  .catalog-section-card {
    padding: 0.95rem;
  }

  .catalog-header {
    gap: 0.55rem;
    margin-bottom: 0.75rem;
  }

  .catalog-header h2 {
    font-size: 1.05rem;
  }

  .catalog-controls {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    width: 100%;
    gap: 0.45rem;
  }

  .catalog-controls .form-input,
  .catalog-controls .form-select {
    width: 100%;
    height: 36px;
    padding: 0 0.6rem;
    font-size: 0.8rem;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .supp-card {
    padding: 0.72rem 0.8rem;
    border-radius: 0.85rem;
  }

  .supp-card:hover {
    transform: none;
  }

  .supp-visual-stage {
    display: none !important;
  }

  .supp-mobile-summary {
    display: flex;
    align-items: center;
    gap: 0.62rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .supp-mobile-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .supp-mobile-icon-box svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .supp-mobile-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .supp-mobile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.69rem;
    font-weight: 700;
    color: #6B7280;
    line-height: 1.2;
  }

  .supp-mobile-top-tag {
    background: #1ABC9C;
    color: #FFFFFF;
    font-size: 0.64rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
  }

  .supp-mobile-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 800;
    color: #1C1C1C;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .supp-mobile-ing {
    font-size: 0.74rem;
    color: #4B5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .supp-mobile-price-col {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    padding-left: 0.2rem;
  }

  .supp-mobile-daily {
    font-size: 0.98rem;
    font-weight: 900;
    color: #0E6251;
    line-height: 1.15;
    white-space: nowrap;
  }

  .supp-mobile-daily small {
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 1px;
  }

  .supp-mobile-subprice {
    font-size: 0.68rem;
    font-weight: 600;
    color: #6B7280;
    margin-top: 2px;
    white-space: nowrap;
  }

  /* 預設收合詳細規格與優缺點，點擊後才原地展開 */
  .supp-body-pad {
    display: none;
  }

  .supp-card.is-mobile-expanded .supp-body-pad {
    display: block;
    margin-top: 0.62rem;
    padding: 0.62rem 0 0;
    border-top: 1px dashed #E5E7EB;
    animation: fadeIn 180ms var(--ease-clinical);
  }

  .supp-card.is-mobile-expanded .supp-sub-cat-row,
  .supp-card.is-mobile-expanded .supp-brand-title {
    display: none;
  }

  .supp-card.is-mobile-expanded .pros-cons-box {
    margin-bottom: 0.2rem;
  }

  .supp-actions-row {
    grid-template-columns: auto 1fr 1.08fr;
    gap: 0.38rem;
    padding: 0.5rem 0 0 0;
    margin-top: 0.5rem;
    align-items: center;
  }

  .supp-mobile-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 32px;
    padding: 0 0.55rem;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    color: #4B5563;
    font-family: inherit;
    font-size: 0.73rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
  }

  .supp-expand-chevron {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    transition: transform 200ms ease;
  }

  .supp-card.is-mobile-expanded .supp-expand-chevron {
    transform: rotate(180deg);
  }

  .supp-actions-row .btn-sm {
    height: 32px;
    padding: 0 0.42rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

/* ==================== 功能二：【管理 A：有興趣清單與去冗分析】 ==================== */
.wishlist-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-stat-card {
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: transform 300ms var(--ease-clinical), box-shadow 300ms var(--ease-clinical);
}

.kpi-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-stat-card.savings-highlight {
  background: #FFF1F2;
  border-color: #FECDD3;
}

.kpi-stat-card.optimized-highlight {
  background: #E8F8F5;
  border-color: #B7EFE4;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
}

.kpi-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-top: 0.2rem;
}

.kpi-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.two-col-management {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.25rem;
  align-items: start;
}

.managed-item-card {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.85rem;
  background: #fffef9;
}

.managed-item-card.redundant-warning {
  border: 2px solid var(--rose);
  border-left: 5px solid var(--rose);
  background: #fff5f7;
}

.verdict-banner {
  background: var(--primary-light);
  border: 1.5px solid var(--border-strong);
  border-left: 5px solid var(--primary);
  padding: 1rem 1.15rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  color: var(--text-dark);
}

.redundancy-alert-card {
  background: #fff1f2;
  border: 1.5px solid #fda4af;
  border-left: 5px solid var(--rose);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 0.85rem;
}

.redundancy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.redundancy-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: #be123c;
}

.save-badge {
  background: var(--rose);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.dosage-table-wrap {
  margin-top: 1.25rem;
}

.dosage-row {
  border: 1px solid #F3F4F6;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  background: #F9FAFB;
}

.dosage-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dosage-bar-track {
  height: 8px;
  background: #E5E7EB;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.dosage-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.fill-optimal { background: #1ABC9C; }
.fill-high { background: var(--amber); }
.fill-exceed { background: var(--rose); }
.fill-low { background: #3498DB; }

/* ==================== 功能三：【管理 B：月經日曆式服用追蹤與日誌】 ==================== */
.calendar-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.calendar-workspace {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.calendar-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.cal-month-switcher {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cal-month-switcher h2 {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--text-dark);
}

.btn-cal-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #E5E7EB;
  background: #FFFFFF;
  color: var(--text-dark);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 300ms var(--ease-clinical);
}
.btn-cal-arrow:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: #0E6251;
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: #374151;
  margin-bottom: 0.9rem;
  padding: 0.6rem 0.85rem;
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  border-radius: 0.75rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-full { background: #1ABC9C; }
.dot-partial { background: var(--amber); }

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #6B7280;
  margin-bottom: 0.45rem;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.cal-day-cell {
  min-width: 0;
  overflow: hidden;
  min-height: 76px;
  border: 1px solid #F3F4F6;
  border-radius: 0.75rem;
  padding: 0.45rem;
  background: #FFFFFF;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 300ms var(--ease-clinical);
}

.cal-day-cell:hover {
  border-color: var(--primary-border);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cal-day-cell.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.cal-day-cell.empty:hover {
  transform: none;
  box-shadow: none;
}

.cal-day-cell.is-today {
  border: 1.5px solid #3498DB;
  background: #EBF5FB;
}

.cal-day-cell.is-selected {
  border: 2px solid #1ABC9C;
  background: #E8F8F5;
  box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.16);
}

.cal-day-num {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.today-pill {
  font-size: 0.62rem;
  background: #3498DB;
  color: #FFFFFF;
  padding: 1px 6px;
  border-radius: 999px;
}

.cal-day-indicators {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.25rem;
}

.cal-intake-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: fit-content;
}

.cal-intake-pill .icon-svg-sm {
  width: 11px;
  height: 11px;
  stroke: currentColor;
}

.cal-intake-pill.full {
  background: var(--emerald-light);
  color: var(--emerald);
  border: 1px solid #6ee7b7;
}

.cal-intake-pill.partial {
  background: var(--amber-light);
  color: var(--amber);
  border: 1px solid #fcd34d;
}

.cal-mood-icons {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
  color: #64748b;
  margin-top: 2px;
}

.cal-mood-icons .icon-svg-sm {
  width: 12px;
  height: 12px;
  stroke: #64748b;
}

/* 右側當日打卡與身體日誌面板 */
.daily-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  border-bottom: 1.5px dashed var(--border);
}

.daily-tag {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--primary);
}

.daily-header h3 {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-dark);
}

.daily-progress-badge {
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid var(--border-strong);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
}

.daily-section {
  margin-bottom: 1.2rem;
}

.daily-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.daily-section h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.55rem;
}

.btn-link-sm {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
}

.intake-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
  background: #fffbeb;
  transition: all 0.15s ease;
}

.intake-check-item.checked {
  border-color: var(--primary);
  background: var(--primary-light);
}

.intake-check-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.intake-check-left input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.timing-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #fef3c7;
  border: 1px solid var(--border);
  color: var(--text-dark);
  white-space: nowrap;
}

.mood-group {
  margin-bottom: 0.75rem;
}

.mood-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.mood-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.mood-pill {
  padding: 0.45rem 0.4rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #F8FAFC;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.mood-pill .icon-svg {
  width: 15px;
  height: 15px;
  stroke: #64748b;
  transition: stroke 0.15s ease;
}

.mood-pill:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.mood-pill:hover .icon-svg {
  stroke: var(--primary);
}

.mood-pill.active {
  background: var(--primary);
  border-color: #0E6251;
  color: #ffffff;
}

.mood-pill.active .icon-svg {
  stroke: #ffffff;
}

.daily-note-box {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.daily-note-box label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* 生病休養 / 重感冒暫停服用模式樣式 */
.sick-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.1rem;
  transition: all 0.25s ease;
}

.sick-mode-bar.active {
  background: #fffbeb;
  border-color: #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.sick-mode-info {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.sick-mode-info .icon-svg-sm {
  margin-top: 3px;
  stroke: #64748b;
  flex-shrink: 0;
}

.sick-mode-bar.active .sick-mode-info .icon-svg-sm {
  stroke: #b45309;
}

.sick-mode-info strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 800;
  color: #1e1b4b;
}

.sick-mode-bar.active .sick-mode-info strong {
  color: #92400e;
}

.sick-mode-desc {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.35;
  margin-top: 2px;
}

.sick-mode-bar.active .sick-mode-desc {
  color: #b45309;
}

.btn-toggle-sick {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-toggle-sick:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.sick-mode-bar.active .btn-toggle-sick {
  background: #f59e0b;
  border-color: #d97706;
  color: #ffffff;
}

/* 動態健康狀況反饋卡片 (Dynamic Health Feedback Card) */
.dynamic-feedback-card {
  margin-top: 1rem;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1.5px solid #c4b5fd;
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.05rem;
  animation: purepickSlideIn 0.3s ease;
}

.feedback-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid #c4b5fd;
  color: #6d28d9;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.feedback-badge .icon-svg-sm {
  stroke: #6d28d9;
}

/* ==================== 本週健康總結與配方升級卡片 ==================== */
.weekly-summary-card {
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #fbf9ff 60%, #f5f3ff 100%);
  border: 1.5px solid #ddd6fe;
  border-radius: var(--radius);
  padding: 1.25rem 1.45rem;
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.06);
}

.weekly-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1.5px dashed #e2e8f0;
  margin-bottom: 0.95rem;
}

.weekly-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #6d28d9;
  color: #ffffff;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.weekly-badge .icon-svg-sm {
  stroke: #ffffff;
}

.weekly-date-range {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}

.weekly-trend-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.weekly-trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: #334155;
}

.weekly-trend-pill.alert {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
  font-weight: 700;
}

.weekly-trend-pill.positive {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
  font-weight: 700;
}

.weekly-upgrade-box {
  background: #ffffff;
  border: 1.5px solid #c4b5fd;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.weekly-upgrade-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #2e1065;
}

.weekly-upgrade-desc {
  font-size: 0.83rem;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.weekly-upgrade-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.weekly-price-impact {
  font-size: 0.78rem;
  color: #6d28d9;
  font-weight: 700;
}

.purchased-cabinet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* ==================== 彈跳視窗 (MODALS) ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(46, 16, 101, 0.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-dialog {
  background: var(--bg-card);
  border: 2.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 40px rgba(76, 29, 149, 0.28);
  overflow: hidden;
}

.modal-dialog.modal-lg {
  max-width: 720px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.05rem 1.35rem;
  background: #fef3c7;
  border-bottom: 1.5px solid var(--border-strong);
}

.modal-header h3 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dark);
  cursor: pointer;
}

.modal-body {
  padding: 1.35rem;
  max-height: 78vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 0.95rem 1.35rem;
  background: #fffbeb;
  border-top: 1.5px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.3rem;
}

/* 訂閱方案卡片 */
.sub-intro-text {
  font-size: 0.92rem;
  color: var(--text-dark);
  margin-bottom: 1.2rem;
  background: #fef3c7;
  border: 1.5px solid var(--border);
  padding: 0.85rem 1rem;
  border-radius: 10px;
}

.sub-plans-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1rem;
}

.sub-plan-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  background: #fffef9;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sub-plan-card.featured {
  border-color: var(--primary);
  background: var(--primary-light);
}

.plan-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #fef08a;
  border: 1px solid var(--border-strong);
  color: var(--text-dark);
  width: fit-content;
  margin-bottom: 0.6rem;
}

.plan-badge.badge-pro {
  background: var(--primary);
  color: #ffffff;
}

.plan-price {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.85rem;
}

.plan-price span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.btn-line-full {
  background: #06C755;
  color: #ffffff;
  padding: 0.7rem;
  border-radius: 8px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

/* ==================== 課程專題免責聲明 (FOOTER) ==================== */
.legal-disclaimer-footer {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.legal-disclaimer-card {
  background: #fffbeb;
  border: 2px solid var(--border-strong);
  border-left: 6px solid var(--primary);
  border-radius: 12px;
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-sm);
}

.legal-statement-core {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 0.5rem 0;
  line-height: 1.5;
}

.legal-statement-desc {
  font-size: 0.8rem;
  color: #5b4b7a;
  line-height: 1.65;
  margin: 0 0 0.85rem 0;
}

.legal-footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 0.65rem;
  border-top: 1.5px dashed var(--border);
}

/* Toast 通知 */
.toast-container {
  position: fixed;
  bottom: 5.2rem;
  right: 1.25rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast-msg {
  background: var(--primary);
  border: 1.5px solid #fef08a;
  color: #ffffff;
  padding: 0.75rem 1.15rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(76, 29, 149, 0.3);
  animation: fadeIn 0.2s ease;
}

.toast-msg.toast-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem 0.65rem 1.05rem;
}

.toast-text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.toast-action-btn {
  flex-shrink: 0;
  padding: 0.32rem 0.78rem;
  border-radius: 7px;
  border: 1.5px solid #fef08a;
  background: #fef08a;
  color: #3b0764;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.toast-action-btn:hover {
  background: #ffffff;
  border-color: #ffffff;
  transform: translateY(-1px);
}

.toast-action-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

/* ==================== 手機與平板響應式設計 ==================== */
@media (max-width: 960px) {
  .header-inner {
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    padding: 0 0.65rem;
    gap: 0.4rem;
  }

  .brand-name {
    font-size: 0.94rem;
  }

  .brand-logo-box {
    width: 30px;
    height: 30px;
  }

  .btn-install-top,
  #pwa-install-btn {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 0.48rem !important;
    font-size: 0.72rem !important;
  }

  .btn-demo-toggle,
  .btn-line-auth {
    height: 28px;
    padding: 0 0.5rem;
    font-size: 0.72rem;
  }

  .budget-radio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col-management,
  .calendar-workspace,
  .sub-plans-grid {
    grid-template-columns: 1fr;
  }

  .toast-container {
    bottom: 5rem;
    right: 0.85rem;
    left: 0.85rem;
  }
}

@media (max-width: 480px) {
  .budget-radio-grid,
  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .cal-day-cell {
    min-height: 62px;
    padding: 0.25rem;
  }

  .b-tab-label {
    font-size: 0.68rem;
  }
}

/* ==================== 頂部預約按鈕 ==================== */
.btn-top-lead {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  background: var(--primary-light);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-sm);
  color: var(--primary-hover);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-top-lead:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-top-lead .icon-svg-sm {
  stroke: currentColor;
}

/* ==================== 頂部工具按鈕 ==================== */
.btn-top-ext {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  background: #f5f3ff;
  border: 1.5px solid #c4b5fd;
  border-radius: var(--radius-sm);
  color: #6d28d9;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-top-ext:hover {
  background: #6d28d9;
  color: #ffffff;
  border-color: #6d28d9;
}

.btn-top-ext .icon-svg-sm {
  stroke: currentColor;
}

/* ==================== 手機版 App 彈窗樣式 ==================== */
.ext-modal-hero {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1.5px solid #ddd6fe;
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
}

.ext-modal-hero h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #2e1065;
  margin: 0.5rem 0 0.35rem 0;
}

.ext-modal-hero p {
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.badge-store-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.status-dot-amber {
  width: 7px;
  height: 7px;
  background: #f59e0b;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.ext-steps-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ext-step-item {
  display: flex;
  gap: 0.85rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.ext-step-idx {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6d28d9;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.ext-step-content strong {
  display: block;
  font-size: 0.88rem;
  color: #1e1b4b;
  margin-bottom: 0.2rem;
}

.ext-step-content p {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

.ext-code-inline {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: #0f172a;
}

.ext-demo-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #faf5ff;
  border: 1.5px dashed #c4b5fd;
  border-radius: 10px;
  padding: 0.85rem 1.15rem;
  margin-top: 0.5rem;
}

.ext-demo-box strong {
  font-size: 0.86rem;
  color: #5b21b6;
}

/* 懸浮攔截卡片（在當前網頁 live demo 模擬用） */
.simulated-ext-floating-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 370px;
  max-width: 90vw;
  background: #ffffff;
  border: 2px solid #7c3aed;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(109, 40, 217, 0.25);
  z-index: 99999;
  font-family: inherit;
  color: #1e1b4b;
  animation: purepickSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* ==================== 潛在消費者名單登記 (Lead CTA) ==================== */
.lead-cta-card {
  margin: 1.5rem 0 1.25rem 0;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 45%, #f5f3ff 100%);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.lead-cta-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 260px;
}

.lead-cta-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f3e8ff;
  border: 1.5px solid #c4b5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lead-cta-icon-wrap .icon-svg-lg {
  stroke: var(--primary);
}

.lead-cta-content h4 {
  font-size: 1.02rem;
  font-weight: 800;
  color: #2e1065;
  margin-bottom: 0.2rem;
}

.lead-cta-content p {
  font-size: 0.84rem;
  color: #4b5563;
  margin: 0;
  line-height: 1.45;
}

/* ==================== 創創成果驗證名單表格 ==================== */
.leads-table-container {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.leads-table th {
  position: sticky;
  top: 0;
  background: #f5f3ff;
  color: #4c1d95;
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
  z-index: 2;
}

.leads-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid #e9d5ff;
  vertical-align: middle;
}

.leads-table tr:hover td {
  background: #fffbeb;
}

.badge-source {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #ede9fe;
  color: #5b21b6;
}

.btn-footer-pill {
  background: transparent;
  border: 1.5px solid #8b5cf6;
  color: #5b21b6;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  display: inline-block;
}

.btn-footer-pill:hover {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
}

/* ==================== MVP 概念驗證說明框（純說明，非按鈕） ==================== */
.mvp-notice-card {
  margin: 0.85rem 0;
  padding: 0.85rem 1rem;
  background: #fef08a;
  border: 1.5px dashed #ca8a04;
  border-radius: var(--radius-sm);
}

.mvp-notice-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #854d0e;
  margin-bottom: 0.35rem;
}

.mvp-notice-title .icon-svg-sm {
  stroke: #854d0e;
}

.mvp-notice-text {
  font-size: 0.78rem;
  color: #713f12;
  margin: 0;
  line-height: 1.45;
}

/* ==================== Pro 門檻引導卡片 (PRO GATING) ==================== */
.pro-gate-card {
  margin: 1.25rem 0;
  padding: 1.25rem 1.4rem;
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 2px solid var(--primary-border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.pro-gate-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.pro-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  letter-spacing: 0.5px;
}

.pro-gate-header h4 {
  font-size: 1.02rem;
  font-weight: 800;
  color: #2e1065;
  margin: 0;
}

.pro-gate-card p {
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.mvp-gate-note {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #713f12;
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.mvp-gate-note .icon-svg-sm {
  stroke: #a16207;
  flex-shrink: 0;
  margin-top: 2px;
}

.pro-unlocked-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  border-radius: var(--radius-sm);
  color: #065f46;
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.pro-unlocked-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: #059669;
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.pro-lock-overlay-wrap {
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
}

.pro-blur-content {
  filter: blur(4px);
  user-select: none;
  opacity: 0.45;
  pointer-events: none;
}

.pro-lock-overlay-btn-box {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  gap: 0.5rem;
}

/* ========================================================
   流程滿意度 1-5 分按鈕組 (Satisfaction Rating Pills)
   ======================================================== */
.rating-pills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.rating-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.35rem;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: #334155;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.rating-pill .pill-desc {
  font-size: 0.68rem;
  font-weight: 500;
  color: #64748b;
  margin-top: 0.2rem;
  line-height: 1.2;
}

.rating-pill:hover {
  background: #f5f3ff;
  border-color: #a78bfa;
  color: #6d28d9;
}

.rating-pill.active {
  background: #7c3aed;
  border-color: #6d28d9;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.rating-pill.active .pill-desc {
  color: #ede9fe;
}

@media (max-width: 640px) {
  .rating-pills {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
  }
  .rating-pill {
    padding: 0.45rem 0.15rem;
    font-size: 0.78rem;
  }
  .rating-pill .pill-desc {
    font-size: 0.62rem;
  }
}

/* ========================================================
   日曆狀態日誌 Pro 鎖定提示卡片
   ======================================================== */
.pro-locked-card {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 1.5px dashed #c084fc;
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-top: 1rem;
}

.pro-locked-card .pro-locked-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cabinet-channels-hint {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

/* ========================================================
   手機版 Web App 按鈕與「告知醫生目前使用的保健品」看診專區
   ======================================================== */
.btn-top-webapp {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.72rem;
  background: #f5f3ff;
  border: 1.5px solid #c4b5fd;
  border-radius: var(--radius-sm);
  color: #6d28d9;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-top-webapp:hover {
  background: #6d28d9;
  color: #ffffff;
  border-color: #6d28d9;
}

.btn-top-webapp .icon-svg-sm {
  stroke: currentColor;
}

.doctor-show-card {
  border: 2px solid #0d9488;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.08);
  margin-bottom: 1.35rem;
}

.doctor-card-header {
  align-items: flex-start;
  flex-wrap: wrap;
}

.doctor-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.doctor-title-row h3 {
  font-size: 1.2rem;
  font-weight: 900;
  color: #111827;
}

.doctor-action-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mobile-quick-import-bar {
  background: #f0fdfa;
  border: 1.5px solid #99f6e4;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.quick-import-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #115e59;
}

.quick-import-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.quick-import-controls .form-input {
  flex: 1;
  min-width: 210px;
}

.doctor-inline-tip {
  margin-top: 0.45rem;
  padding: 0.35rem 0.65rem;
  background: #fffbeb;
  border-left: 3px solid #d97706;
  border-radius: 0 6px 6px 0;
  font-size: 0.8rem;
  color: #92400e;
  font-weight: 600;
}

/* ==================== 全螢幕大字看診卡 Modal ==================== */
.doctor-fullscreen-dialog {
  max-width: 760px;
  width: 96%;
}

.doctor-modal-header {
  background: #f0fdfa;
  border-bottom: 1.5px solid #99f6e4;
}

.doctor-patient-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #111827;
  margin-bottom: 0.85rem;
}

.doctor-general-alert {
  padding: 0.85rem 1rem;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: 10px;
  font-size: 0.92rem;
  color: #78350f;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.doctor-show-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.doctor-show-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
}

.doctor-show-index {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0d9488;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.doctor-show-main {
  flex: 1;
  min-width: 0;
}

.doctor-show-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.doctor-show-cat {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: #ccfbf1;
  color: #115e59;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.doctor-show-timing {
  font-size: 0.86rem;
  font-weight: 700;
  color: #374151;
}

.doctor-show-name {
  font-size: 1.18rem;
  font-weight: 900;
  color: #111827;
  line-height: 1.35;
  margin-bottom: 0.3rem;
}

.doctor-show-ing {
  font-size: 0.96rem;
  color: #1f2937;
  line-height: 1.5;
  margin-bottom: 0.35rem;
}

.doctor-show-note {
  font-size: 0.88rem;
  color: #92400e;
  background: #fef3c7;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-weight: 700;
}

/* ==================== iOS 加入主畫面底部引導橫條 ==================== */
.ios-install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 78px;
  z-index: 1500;
  background: #ffffff;
  border: 1.5px solid #7c3aed;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.16);
  padding: 0.85rem 1rem;
}

.ios-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ios-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ios-text {
  flex: 1;
  font-size: 0.82rem;
  color: #1f2937;
  line-height: 1.45;
}

.ios-text strong {
  color: #111827;
}

.ios-text p {
  margin: 0.15rem 0 0 0;
  color: #4b5563;
}

.ios-close-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0 0.25rem;
}

/* ==================== 手機版 UI 適配與觸控優化 ==================== */
@media (max-width: 768px) {
  .header-inner {
    height: auto;
    min-height: 52px;
    max-height: none;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.5rem 0.75rem 0.45rem 0.75rem;
    row-gap: 0.45rem;
    column-gap: 0.5rem;
    overflow: visible;
  }

  /* 第一排：Logo 與品牌名稱獨立完整呈現，絕不被右側按鈕擠壓或遮擋 */
  .brand-group {
    width: 100%;
    flex: 1 1 100%;
    flex-shrink: 0;
    gap: 0.55rem;
  }

  .brand-logo-box {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 0.98rem;
  }

  /* 第二排：上方工具按鈕與 LINE 登入區塊整齊排列（自動換行絕不裁切） */
  .header-actions {
    width: 100%;
    flex: 1 1 100%;
    flex-shrink: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: 0.35rem;
    column-gap: 0.35rem;
    padding-top: 0.42rem;
    border-top: 1px solid var(--border);
    overflow: visible;
  }

  .auth-box {
    margin-left: auto;
    flex-shrink: 0;
    gap: 0.35rem;
  }

  .btn-top-webapp,
  .btn-top-lead {
    height: 30px;
    padding: 0 0.55rem;
    font-size: 0.74rem;
    gap: 0.28rem;
    flex-shrink: 0;
  }

  .btn-icon-top {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .btn-line-auth {
    height: 30px;
    padding: 0 0.6rem;
    font-size: 0.74rem;
  }

  .user-chip {
    max-width: 96px;
    padding: 0.18rem 0.55rem;
    font-size: 0.74rem;
    overflow: hidden;
  }

  .user-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .btn-logout-demo {
    height: 30px;
    padding: 0 0.55rem;
    font-size: 0.74rem;
    gap: 0.25rem;
  }

  .logout-text-full {
    display: none;
  }

  .logout-text-short {
    display: inline;
  }
}

@media (max-width: 390px) {
  .header-inner {
    padding: 0.45rem 0.6rem 0.4rem 0.6rem;
  }

  .header-actions {
    gap: 0.3rem;
  }

  .btn-top-webapp,
  .btn-top-lead,
  .btn-line-auth,
  .btn-logout-demo {
    padding: 0 0.45rem;
    font-size: 0.71rem;
  }

  .user-chip {
    max-width: 78px;
    padding: 0.16rem 0.45rem;
    font-size: 0.71rem;
  }
}

@media (max-width: 640px) {
  .page-container {
    padding: 0.85rem 0.75rem 2rem 0.75rem;
  }

  .card {
    padding: 1.05rem 0.95rem;
  }

  .doctor-action-btns {
    width: 100%;
    justify-content: stretch;
  }

  .doctor-action-btns .btn {
    flex: 1;
    justify-content: center;
    min-height: 42px;
  }

  .quick-import-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-import-controls .form-input,
  .quick-import-controls .btn {
    width: 100%;
    min-height: 42px;
  }

  .doctor-show-row {
    padding: 0.85rem;
    gap: 0.65rem;
  }

  .doctor-show-name {
    font-size: 1.06rem;
  }

  .doctor-show-ing {
    font-size: 0.9rem;
  }
}

/* ========================================================
   尋找頁：互動需求表單收合入口按鈕 ＋ 平滑動畫展開抽屜
   ======================================================== */
.finder-toggle-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.95rem 1.15rem;
  margin-bottom: 1rem;
  background: #ffffff;
  border: 1.5px solid #c4b5fd;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.finder-toggle-card:hover {
  border-color: var(--primary);
  background: #faf5ff;
  box-shadow: var(--shadow-md);
}

.finder-toggle-card.is-open {
  border-color: var(--primary);
  background: #f5f3ff;
  margin-bottom: 0.65rem;
}

.finder-toggle-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.finder-toggle-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--primary-light);
  border: 1.5px solid #ddd6fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.finder-toggle-icon-wrap .icon-svg {
  stroke: #52525b;
}

.finder-toggle-card.is-open .finder-toggle-icon-wrap {
  background: var(--primary);
  border-color: var(--primary);
}

.finder-toggle-card.is-open .finder-toggle-icon-wrap .icon-svg {
  stroke: #ffffff;
}

.finder-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.finder-toggle-text strong {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.35;
}

.finder-toggle-text span {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.finder-toggle-right {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.finder-toggle-pill {
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.finder-toggle-card.is-open .finder-toggle-pill {
  background: #475569;
}

.acc-chevron {
  stroke: #64748b;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  flex-shrink: 0;
}

.finder-toggle-card.is-open .acc-chevron,
.analysis-acc-card.is-open .acc-chevron {
  transform: rotate(180deg);
}

/* 平滑 Grid 展開抽屜動畫（無固定 max-height 裁切問題） */
.finder-drawer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    grid-template-rows 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.24s ease,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    margin-bottom 0.3s ease;
  margin-bottom: 0;
  pointer-events: none;
}

.finder-drawer.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 1.15rem;
  pointer-events: auto;
}

.finder-drawer-inner {
  overflow: hidden;
  min-height: 0;
}

.finder-drawer .finder-form-card {
  margin-bottom: 0;
}

/* ========================================================
   分析頁：可展開／收縮的三合一摘要卡片（警訊 / 劑量 / 時段）
   ======================================================== */
.analysis-accordions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.analysis-acc-card {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.analysis-acc-card.acc-tone-danger {
  border-color: #fda4af;
  background: #fff1f2;
}

.analysis-acc-card.acc-tone-warn {
  border-color: #fcd34d;
  background: #fffbeb;
}

.analysis-acc-card.acc-tone-safe {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.analysis-acc-card.acc-tone-neutral {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.analysis-acc-card.is-open {
  box-shadow: var(--shadow-sm);
}

.analysis-acc-header,
.analysis-acc-static {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  text-align: left;
  font-family: inherit;
}

.analysis-acc-header {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.analysis-acc-header:hover {
  background: rgba(15, 23, 42, 0.03);
}

.acc-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.acc-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
}

.acc-icon-box .icon-svg-sm {
  stroke: #52525b;
}

.acc-icon-danger {
  border-color: #fda4af;
}

.acc-icon-danger .icon-svg-sm {
  stroke: #be123c;
}

.acc-icon-warn {
  border-color: #fcd34d;
}

.acc-icon-warn .icon-svg-sm {
  stroke: #b45309;
}

.acc-icon-safe {
  border-color: #a7f3d0;
}

.acc-icon-safe .icon-svg-sm {
  stroke: #059669;
}

.acc-text-group {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.acc-text-group strong {
  font-size: 0.93rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.acc-tone-danger .acc-text-group strong {
  color: #881337;
}

.acc-tone-safe .acc-text-group strong {
  color: #065f46;
}

.acc-count-highlight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #e11d48;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
}

.acc-text-group span {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.35;
}

.acc-pro-mini {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

.acc-toggle-right {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.acc-toggle-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

.acc-badge {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.acc-badge-safe {
  background: #dcfce7;
  color: #15803d;
}

.analysis-acc-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
  background: #ffffff;
}

.analysis-acc-card.is-open .analysis-acc-body {
  grid-template-rows: 1fr;
  opacity: 1;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.analysis-acc-body-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 0.9rem;
  transition: padding 0.28s ease;
}

.analysis-acc-card.is-open .analysis-acc-body-inner {
  padding: 0.9rem;
}

.analysis-acc-body-inner .redundancy-alert-card:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .finder-toggle-card {
    padding: 0.85rem 0.9rem;
    gap: 0.6rem;
  }

  .finder-toggle-icon-wrap {
    width: 34px;
    height: 34px;
  }

  .finder-toggle-text strong {
    font-size: 0.88rem;
  }

  .finder-toggle-text span {
    font-size: 0.74rem;
  }

  .finder-toggle-pill {
    padding: 0.28rem 0.55rem;
    font-size: 0.73rem;
  }

  .analysis-acc-header,
  .analysis-acc-static {
    padding: 0.78rem 0.82rem;
    gap: 0.5rem;
  }

  .acc-text-group strong {
    font-size: 0.87rem;
  }

  .acc-text-group span {
    font-size: 0.74rem;
  }

  .acc-toggle-label {
    display: none;
  }
}

/* ========================================================
   日曆頁：LINE 每日服用提醒設定卡片
   ======================================================== */
.line-reminder-acc {
  margin-bottom: 1.15rem;
}

.reminder-status-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}

.reminder-status-pill.is-active {
  background: #dcfce7;
  color: #15803d;
}

.reminder-login-gate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.reminder-login-gate p {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
}

.reminder-friend-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.reminder-friend-banner strong {
  display: block;
  font-size: 0.86rem;
  color: #166534;
}

.reminder-friend-banner span {
  display: block;
  font-size: 0.76rem;
  color: #15803d;
  margin-top: 0.12rem;
}

.reminder-friend-btn {
  text-decoration: none;
  border-color: #16a34a !important;
  color: #15803d !important;
  background: #ffffff !important;
  font-weight: 700;
  flex-shrink: 0;
}

.reminder-friend-btn:hover {
  background: #16a34a !important;
  color: #ffffff !important;
}

.reminder-master-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 0.85rem;
}

.reminder-master-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.reminder-master-toggle strong {
  display: block;
  font-size: 0.88rem;
  color: #0f172a;
}

.reminder-master-toggle span {
  display: block;
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 0.12rem;
}

.reminder-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.reminder-slot-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.7rem;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
}

.slot-chk-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.83rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
}

.slot-chk-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.form-select-sm {
  padding: 0.36rem 0.5rem;
  font-size: 0.82rem;
  min-height: 34px;
}

.reminder-actions-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .reminder-slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reminder-actions-row .btn {
    flex: 1 1 100%;
    justify-content: center;
    min-height: 40px;
  }
}

/* ========================================================
   今日服用清單項目內建移除按鈕 ＆ 電腦版預設隱藏手機右滑選單元素
   ======================================================== */
.btn-intake-remove {
  padding: 0.16rem 0.48rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #be123c;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-intake-remove:hover {
  background: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
}

.mobile-cal-tap-hint,
.daily-drawer-backdrop,
.mobile-drawer-close-bar {
  display: none;
}

/* ========================================================
   手機版（<= 768px）：
   1. 分析與日曆頁上方三項統整資訊合併為一體式橫向三欄看板
   2. 日曆頁點選日期後，當日紀錄從右側滑出選單（電腦版維持左右雙欄）
   ======================================================== */
@media (max-width: 768px) {
  .wishlist-kpi-grid,
  .calendar-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    background: #ffffff;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1rem;
  }

  .wishlist-kpi-grid .kpi-stat-card,
  .calendar-kpi-row .kpi-stat-card {
    border: none;
    border-right: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    padding: 0.72rem 0.45rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    min-width: 0;
  }

  .wishlist-kpi-grid .kpi-stat-card:last-child,
  .calendar-kpi-row .kpi-stat-card:last-child {
    border-right: none;
  }

  .wishlist-kpi-grid .kpi-label,
  .calendar-kpi-row .kpi-label {
    font-size: 0.72rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
  }

  .wishlist-kpi-grid .kpi-number,
  .calendar-kpi-row .kpi-number {
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 0.2rem;
    word-break: break-word;
  }

  .wishlist-kpi-grid .kpi-number span,
  .calendar-kpi-row .kpi-number span {
    font-size: 0.7rem !important;
  }

  .wishlist-kpi-grid .kpi-sub,
  .calendar-kpi-row .kpi-sub {
    font-size: 0.65rem;
    line-height: 1.25;
  }

  /* 手機版日曆提示條與 7 欄緊湊適配 */
  .calendar-workspace,
  .calendar-main-card {
    min-width: 0;
  }

  .calendar-days-grid {
    gap: 0.25rem;
  }

  .mobile-cal-tap-hint {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    color: #5b21b6;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 0.42rem 0.7rem;
    margin-bottom: 0.65rem;
    text-align: center;
  }

  /* 手機版右滑抽屜背景遮罩 */
  .daily-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    z-index: 2050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease;
  }

  .daily-drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* 手機版當日紀錄改為右側滑出抽屜 */
  .calendar-workspace .daily-tracker-card {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(88vw, 370px);
    max-width: 100vw;
    height: 100dvh;
    margin: 0;
    z-index: 2100;
    border-radius: 18px 0 0 18px;
    border-right: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.95rem 0.95rem 5.5rem 0.95rem;
    box-shadow: -8px 0 28px rgba(15, 23, 42, 0.22);
    transform: translateX(105%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .calendar-workspace .daily-tracker-card.is-drawer-open {
    transform: translateX(0);
  }

  .mobile-drawer-close-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.65rem;
    margin-bottom: 0.75rem;
    border-bottom: 1.5px solid var(--border);
  }

  .mobile-drawer-bar-title {
    font-size: 0.84rem;
    font-weight: 800;
    color: #475569;
  }

  .btn-drawer-close {
    padding: 0.28rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 800;
    color: #1e293b;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
  }

  .btn-drawer-close:hover {
    background: #e2e8f0;
  }
}

/* ==================== Vertex AI 拍照 / 上傳辨識區塊（+ 按鈕選單內） ==================== */
.vertex-scan-box {
  background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
  border: 1.5px solid #c4b5fd;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
}

.vertex-scan-head {
  margin-bottom: 0.7rem;
}

.vertex-scan-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
  color: #1e1b4b;
  margin-bottom: 0.25rem;
}

.vertex-ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #6d28d9 0%, #4f46e5 100%);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.vertex-scan-desc {
  margin: 0;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.45;
}

.vertex-scan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.btn-vertex-primary,
.btn-vertex-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.58rem 0.75rem;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}

.btn-vertex-primary {
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  color: #ffffff;
  border: 1.5px solid #5b21b6;
  box-shadow: 0 3px 10px rgba(109, 40, 217, 0.2);
}

.btn-vertex-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-vertex-outline {
  background: #ffffff;
  color: #5b21b6;
  border: 1.5px solid #c4b5fd;
}

.btn-vertex-outline:hover:not(:disabled) {
  background: #f5f3ff;
  border-color: #8b5cf6;
}

.btn-vertex-primary:disabled,
.btn-vertex-outline:disabled {
  opacity: 0.6;
  cursor: wait;
}

.vertex-preview-wrap {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #c4b5fd;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.vertex-preview-img {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid #ddd6fe;
  background: #ffffff;
  flex-shrink: 0;
}

.vertex-preview-info {
  flex: 1;
  min-width: 0;
}

.vertex-status-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #312e81;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.vertex-status-text.is-success {
  color: #065f46;
}

.vertex-status-text.is-error {
  color: #b91c1c;
}

.vertex-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #c4b5fd;
  border-top-color: #6d28d9;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  margin-top: 2px;
  animation: vertexSpin 0.8s linear infinite;
}

@keyframes vertexSpin {
  to { transform: rotate(360deg); }
}

.vertex-nutrient-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.vertex-nutrient-chip {
  display: inline-block;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #c4b5fd;
  color: #4c1d95;
  font-size: 0.72rem;
  font-weight: 700;
}

.btn-vertex-clear {
  margin-top: 0.45rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.btn-vertex-clear:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.vertex-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.25rem 0 0.8rem 0;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
}

.vertex-divider::before,
.vertex-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.ai-filled-flash {
  animation: aiFieldFlash 1.4s ease;
}

@keyframes aiFieldFlash {
  0% { background-color: #E8F8F5; border-color: #1ABC9C; }
  100% { background-color: #ffffff; }
}

/* ========================================================
   Modern Clinical 全站元件一致性美化 (消除舊版紫/黃區塊)
   ======================================================== */
.finder-toggle-card {
  background: #FFFFFF !important;
  border: 1px solid #F3F4F6 !important;
  border-radius: 1rem !important;
  box-shadow: var(--shadow-sm) !important;
  transition: transform 300ms var(--ease-clinical), box-shadow 300ms var(--ease-clinical), border-color 300ms var(--ease-clinical) !important;
}

.finder-toggle-card:hover {
  transform: translateY(-0.2rem) !important;
  box-shadow: var(--shadow-hover) !important;
  border-color: #B7EFE4 !important;
}

.finder-toggle-icon-wrap {
  background: #E8F8F5 !important;
  border-color: #B7EFE4 !important;
  color: #1ABC9C !important;
}

.finder-toggle-icon-wrap svg {
  stroke: #1ABC9C !important;
}

.finder-toggle-pill {
  background: #1ABC9C !important;
  color: #FFFFFF !important;
  border: none !important;
}

.btn-top-lead,
.btn-top-webapp {
  min-height: 40px !important;
  background: #F9FAFB !important;
  border: 1px solid #F3F4F6 !important;
  border-radius: 0.75rem !important;
  color: #374151 !important;
  transition: all 300ms var(--ease-clinical) !important;
}

.btn-top-lead:hover,
.btn-top-webapp:hover {
  background: #E8F8F5 !important;
  border-color: #1ABC9C !important;
  color: #0E6251 !important;
  transform: translateY(-1px) !important;
}

.pro-gate-card,
.pro-locked-card {
  background: linear-gradient(135deg, #E8F8F5 0%, #EBF5FB 100%) !important;
  border: 1px solid #B7EFE4 !important;
  border-radius: 1rem !important;
}

.pro-badge,
.rating-pill.active,
.vertex-ai-badge,
.btn-vertex-primary {
  background: linear-gradient(135deg, #1ABC9C 0%, #3498DB 100%) !important;
  border-color: #1ABC9C !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(26, 188, 156, 0.25) !important;
}

.rating-pill:hover {
  background: #E8F8F5 !important;
  border-color: #1ABC9C !important;
  color: #0E6251 !important;
}

.vertex-scan-box {
  background: linear-gradient(135deg, #E8F8F5 0%, #EBF5FB 100%) !important;
  border: 1px solid #B7EFE4 !important;
  border-radius: 1rem !important;
}

.btn-vertex-outline {
  color: #0E6251 !important;
  border: 1px solid #B7EFE4 !important;
}

.btn-vertex-outline:hover:not(:disabled) {
  background: #E8F8F5 !important;
  border-color: #1ABC9C !important;
}

.vertex-nutrient-chip {
  border-color: #B7EFE4 !important;
  color: #0E6251 !important;
}

.managed-item-card,
.analysis-acc-card {
  border-radius: 0.75rem !important;
  border-width: 1px !important;
  box-shadow: var(--shadow-sm) !important;
}

.mobile-cal-tap-hint {
  color: #0E6251 !important;
  background: #E8F8F5 !important;
  border-color: #B7EFE4 !important;
}

/* ========================================================
   Modern Clinical 4-Column Footer (#F9FAFB)
   ======================================================== */
.clinical-footer {
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
  margin-top: 2.5rem;
  padding: 2.75rem 1.5rem 2rem;
}

.clinical-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.clinical-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #E5E7EB;
}

@media (max-width: 900px) {
  .clinical-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 560px) {
  .clinical-footer-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.footer-col-heading {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #1C1C1C;
  margin-bottom: 0.85rem;
}

.footer-brand-desc {
  font-size: 13px;
  color: #4B5563;
  line-height: 1.6;
  margin-top: 0.65rem;
}

.footer-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: #4B5563;
  cursor: pointer;
  text-align: left;
  transition: color 300ms var(--ease-clinical);
}

.footer-link-btn:hover {
  color: #1ABC9C;
}

.clinical-legal-note {
  margin-top: 1.35rem;
  padding: 1rem 1.25rem;
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: 0.75rem;
  font-size: 12px;
  color: #6B7280;
  line-height: 1.55;
}

.clinical-legal-note strong {
  color: #1C1C1C;
}

.clinical-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  font-size: 11px;
  color: #6B7280;
}

.footer-social-icons {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #9CA3AF;
}

.footer-social-icons span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 11px;
  font-weight: 600;
}

/* ========================================================
   Modern Clinical 單頁 A4 臨床健檢報告 (Clinical Lab Report)
   ======================================================== */
.btn-a4-report {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, #1ABC9C 0%, #3498DB 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(26, 188, 156, 0.28);
  transition: transform 300ms var(--ease-clinical), box-shadow 300ms var(--ease-clinical), opacity 300ms var(--ease-clinical);
}

.btn-a4-report:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(26, 188, 156, 0.38);
  color: #ffffff;
}

.btn-a4-report:disabled {
  opacity: 0.68;
  cursor: wait;
}

.a4-input-summary-pill {
  padding: 0.65rem 0.9rem;
  background: #E8F8F5;
  border: 1px solid #B7EFE4;
  border-radius: 0.75rem;
  color: #0E6251;
  font-size: 0.82rem;
  font-weight: 600;
}

.a4-preset-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.a4-preset-chip {
  padding: 0.28rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #0E6251;
  background: #E8F8F5;
  border: 1px solid #B7EFE4;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: all 300ms var(--ease-clinical);
}

.a4-preset-chip:hover {
  background: #1ABC9C;
  color: #FFFFFF;
}

.a4-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(17, 24, 39, 0.76);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
}

.a4-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  background: #FFFFFF;
  color: #1C1C1C;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
}

.a4-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.94rem;
}

.a4-model-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #E8F8F5;
  color: #0E6251;
  border: 1px solid #B7EFE4;
}

.a4-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.a4-preview-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem 2.5rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* 極淨臨床風直式 A4 畫布 (210mm x 297mm) */
.a4-sheet {
  width: 210mm;
  min-height: 294mm;
  max-height: 296mm;
  background: #FFFFFF;
  color: #1C1C1C;
  padding: 9mm 10mm 8mm 10mm;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3.2mm;
  box-sizing: border-box;
  overflow: hidden;
  font-family: 'Satoshi', 'Plus Jakarta Sans', 'Noto Sans TC', sans-serif;
  position: relative;
}

.a4-sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #1ABC9C 0%, #3498DB 100%);
}

.a4-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4mm;
  padding: 2.5mm 0 3.2mm 0;
  background: #FFFFFF;
  color: #1C1C1C;
  border-bottom: 1.5px solid #F3F4F6;
}

.a4-header-main {
  flex: 1;
  min-width: 0;
}

.a4-brand-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #1ABC9C;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.a4-headline {
  font-size: 1.16rem;
  font-weight: 900;
  line-height: 1.28;
  color: #1C1C1C;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem 0;
}

.a4-subject-meta {
  font-size: 0.73rem;
  color: #6B7280;
  line-height: 1.38;
}

.a4-subject-meta strong {
  color: #1C1C1C;
}

/* SVG Donut Gauge 評分儀表環 */
.a4-donut-gauge {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.a4-donut-gauge svg {
  width: 68px;
  height: 68px;
  transform: rotate(-90deg);
}

.a4-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.a4-grade-letter {
  font-size: 1.28rem;
  font-weight: 900;
  line-height: 1;
  color: #1C1C1C;
}

.a4-grade-caption {
  font-size: 0.54rem;
  font-weight: 800;
  color: #6B7280;
  margin-top: 2px;
}

/* 執行摘要與頂部費用視覺對比卡 */
.a4-exec-strip {
  display: grid;
  grid-template-columns: 1.32fr 1fr;
  gap: 3.2mm;
  align-items: stretch;
}

.a4-exec-box {
  padding: 3mm 3.8mm;
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  border-radius: 10px;
  font-size: 0.73rem;
  line-height: 1.5;
  color: #374151;
}

.a4-exec-box strong {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1ABC9C;
  margin-bottom: 0.2rem;
}

.a4-cost-compare-box {
  padding: 2.8mm 3.6mm;
  background: linear-gradient(135deg, #E8F8F5 0%, #EBF5FB 100%);
  border: 1px solid #D1F2EB;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
}

.a4-cost-bar-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
}

.a4-cost-bar-label {
  width: 58px;
  font-weight: 700;
  color: #4B5563;
  flex-shrink: 0;
}

.a4-cost-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  overflow: hidden;
}

.a4-cost-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.a4-cost-val {
  font-weight: 900;
  font-size: 0.76rem;
  min-width: 64px;
  text-align: right;
}

/* 2x2 臨床資訊圖表卡片主網格（無壓迫感細邊框 ＋ 乾淨留白） */
.a4-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3.4mm;
  flex: 1;
  min-height: 0;
}

.a4-card {
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.025);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.a4-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.4mm 3.4mm;
  background: #FFFFFF;
  border-bottom: 1px solid #F3F4F6;
}

.a4-card-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #1C1C1C;
}

.a4-card-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #E8F8F5;
  color: #0E6251;
  font-size: 0.65rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.a4-card-tag {
  font-size: 0.64rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.tag-teal { background: #E8F8F5; color: #0E6251; }
.tag-rose { background: #FFE4E6; color: #BE123C; }
.tag-amber { background: #FEF3C7; color: #B45309; }
.tag-blue { background: #EBF5FB; color: #1F618D; }

.a4-card-visual {
  padding: 2.6mm 3.4mm;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.34rem;
  background: #FFFFFF;
}

.a4-card-caption {
  padding: 2.4mm 3.4mm;
  background: #F9FAFB;
  border-top: 1px solid #F3F4F6;
  font-size: 0.7rem;
  line-height: 1.46;
  color: #4B5563;
}

.a4-card-caption strong {
  color: #1C1C1C;
}

/* 卡片 1：保留 vs 剔除視覺膠囊列 */
.a4-vs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  font-size: 0.7rem;
}

.a4-vs-keep {
  background: #E8F8F5;
  border: 1px solid #B7EFE4;
  color: #0E6251;
}

.a4-vs-drop {
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  color: #9F1239;
}

.a4-pill-mini {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* 卡片 2：醫院抽血報告式 DRIs 參考區間尺 */
.a4-dri-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.a4-dri-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.67rem;
  color: #374151;
}

.a4-dri-track {
  position: relative;
  height: 8px;
  background: linear-gradient(90deg, #F3F4F6 0%, #E8F8F5 35%, #E8F8F5 85%, #FFE4E6 85%, #FFE4E6 100%);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #E5E7EB;
}

.a4-dri-fill {
  height: 100%;
  border-radius: 999px;
}

.a4-dri-ul-marker {
  position: absolute;
  right: 15%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #E11D48;
}

/* 卡片 3：早中晚三欄視覺時刻表 */
.a4-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.2mm;
}

.a4-slot-col {
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  border-radius: 8px;
  padding: 0.36rem 0.42rem;
  min-height: 60px;
}

.a4-slot-head {
  font-size: 0.65rem;
  font-weight: 800;
  color: #1C1C1C;
  border-bottom: 1px solid #E5E7EB;
  padding-bottom: 3px;
  margin-bottom: 4px;
}

.a4-slot-chip {
  display: block;
  font-size: 0.63rem;
  line-height: 1.3;
  color: #374151;
  padding: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 卡片 4：看診提醒與訪談追問區 */
.a4-doc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.a4-doc-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  background: #EBF5FB;
  border: 1px solid #AED6F1;
  color: #1B4F72;
}

.a4-interview-box {
  padding: 2.3mm 3.5mm;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-left: 3.5px solid #3498DB;
  border-radius: 8px;
  font-size: 0.68rem;
  color: #374151;
  line-height: 1.4;
}

.a4-interview-box strong {
  color: #1F618D;
}

.a4-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6rem;
  color: #9CA3AF;
  border-top: 1px solid #F3F4F6;
  padding-top: 1.8mm;
}

@media (max-width: 820px) {
  .a4-sheet {
    width: 100%;
    min-height: auto;
    max-height: none;
    padding: 1rem;
  }
  .a4-exec-strip,
  .a4-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* 專用單頁 A4 列印樣式：隱藏所有網站介面，100% 鎖定直式單頁 A4 彩色輸出 */
@media print {
  @page {
    size: A4 portrait;
    margin: 6mm;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-a4-report > *:not(#a4-report-preview-modal) {
    display: none !important;
  }

  body.printing-a4-report #a4-report-preview-modal {
    position: static !important;
    display: block !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
  }

  body.printing-a4-report .no-print,
  body.printing-a4-report .a4-preview-toolbar {
    display: none !important;
  }

  body.printing-a4-report .a4-preview-scroll {
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
  }

  body.printing-a4-report .a4-sheet {
    width: 198mm !important;
    height: 284mm !important;
    min-height: 284mm !important;
    max-height: 284mm !important;
    padding: 6mm 7mm !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  body.printing-a4-report .a4-exec-strip {
    grid-template-columns: 1.32fr 1fr !important;
  }

  body.printing-a4-report .a4-cards-grid {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
  }
}

/* ========================================================
   獨立系統設定頁 (Settings View) ＆ 頂部極簡個人設定入口
   ======================================================== */
.btn-header-settings {
  min-height: 44px;
  padding: 0 0.9rem;
  border-radius: 999px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  color: #1C1C1C;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 300ms var(--ease-clinical);
}

.btn-header-settings:hover,
.btn-header-settings.is-active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: #0E6251;
  transform: translateY(-1px);
}

.btn-header-settings:hover .icon-svg,
.btn-header-settings.is-active .icon-svg {
  stroke: var(--primary);
}

.header-avatar-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1ABC9C 0%, #3498DB 100%);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 日曆頁輕量提醒跳轉橫條 */
.cal-reminder-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.15rem;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 0.84rem;
  transition: all 300ms var(--ease-clinical);
}

.cal-reminder-shortcut:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.cal-rem-shortcut-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-neutral);
}

.cal-rem-shortcut-left strong {
  color: var(--primary);
  font-weight: 800;
}

.cal-rem-shortcut-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: #3498DB;
}

/* 設定頁雙欄網格 */
.settings-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.35rem;
}

.settings-span-full {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .settings-layout-grid {
    grid-template-columns: 1fr;
  }
}

.settings-group-card {
  margin-bottom: 0;
}

.settings-sec-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-guest-box,
.settings-member-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-guest-info strong {
  display: block;
  font-size: 0.96rem;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.settings-guest-info p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.settings-guest-actions,
.settings-member-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.settings-member-profile {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.settings-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1ABC9C 0%, #3498DB 100%);
  color: #FFFFFF;
  font-size: 1.2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(26, 188, 156, 0.28);
}

.settings-sync-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-light);
  color: #1ABC9C;
  border: 1px solid var(--primary-border);
}

/* 外觀深／亮色視覺選擇卡片 */
.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 560px) {
  .theme-selector-grid {
    grid-template-columns: 1fr;
  }
}

.theme-option-card {
  background: var(--bg-page);
  border: 1.5px solid var(--border-strong);
  border-radius: 0.85rem;
  padding: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: all 300ms var(--ease-clinical);
}

.theme-option-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.theme-option-card.active {
  border: 2px solid #1ABC9C;
  background: var(--primary-light);
  box-shadow: 0 6px 18px rgba(26, 188, 156, 0.16);
}

.theme-preview-swatch {
  height: 52px;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.swatch-light {
  background: #F9FAFB;
}
.swatch-light .swatch-bar {
  height: 6px;
  width: 45%;
  border-radius: 99px;
  background: #1ABC9C;
}
.swatch-light .swatch-card-mini {
  height: 20px;
  border-radius: 5px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
}

.swatch-dark {
  background: #0B1120;
}
.swatch-dark .swatch-bar {
  height: 6px;
  width: 45%;
  border-radius: 99px;
  background: #1ABC9C;
}
.swatch-dark .swatch-card-mini {
  height: 20px;
  border-radius: 5px;
  background: #1E293B;
  border: 1px solid #334155;
}

.swatch-system {
  background: linear-gradient(135deg, #F9FAFB 0%, #F9FAFB 50%, #0B1120 50%, #0B1120 100%);
}
.swatch-system .swatch-bar {
  height: 6px;
  width: 45%;
  border-radius: 99px;
  background: #3498DB;
}
.swatch-system .swatch-card-mini {
  height: 20px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #CBD5E1;
}

.theme-opt-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dark);
}

.theme-opt-info span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 設定頁列表項目 (iOS Settings Rows) */
.settings-action-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  overflow: hidden;
}

.settings-list-row {
  width: 100%;
  background: var(--bg-page);
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.95rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 300ms var(--ease-clinical);
}

.settings-list-row:last-child {
  border-bottom: none;
}

.settings-list-row:hover {
  background: var(--primary-light);
}

.settings-row-left strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.settings-row-left span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.settings-row-chevron {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
}

/* ========================================================
   Modern Clinical 深色護眼模式 (html[data-theme="dark"])
   ======================================================== */
html[data-theme="dark"] {
  --bg-page: #0B1120;
  --bg-card: #131C2E;
  --bg-soft-yellow: rgba(217, 119, 6, 0.15);
  --bg-soft-purple: rgba(26, 188, 156, 0.14);

  --primary-light: rgba(26, 188, 156, 0.16);
  --primary-border: rgba(26, 188, 156, 0.36);
  --secondary-light: rgba(52, 152, 219, 0.16);

  --text-dark: #F8FAFC;
  --text-body: #E2E8F0;
  --text-neutral: #CBD5E1;
  --text-muted: #94A3B8;

  --border: #1E293B;
  --border-strong: #334155;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .mobile-search-row {
  background: #0F172A;
  border-color: #1E293B;
}

html[data-theme="dark"] .brand-name {
  color: #F8FAFC;
}

html[data-theme="dark"] .clinical-dual-search,
html[data-theme="dark"] .mobile-search-bar {
  background: #1E293B;
  border-color: #334155;
}

html[data-theme="dark"] .clinical-dual-search:focus-within,
html[data-theme="dark"] .mobile-search-bar:focus-within {
  background: #0F172A;
  border-color: #1ABC9C;
}

html[data-theme="dark"] .dual-search-cat {
  border-right-color: #334155;
}

html[data-theme="dark"] .dual-search-select,
html[data-theme="dark"] .dual-search-input,
html[data-theme="dark"] .mobile-search-bar input {
  color: #F8FAFC;
}

html[data-theme="dark"] .dual-search-select option {
  background: #131C2E;
  color: #F8FAFC;
}

html[data-theme="dark"] .btn-header-settings,
html[data-theme="dark"] .btn-icon-top {
  background: #1E293B;
  border-color: #334155;
  color: #F8FAFC;
}

html[data-theme="dark"] .btn-header-settings:hover,
html[data-theme="dark"] .btn-header-settings.is-active {
  background: rgba(26, 188, 156, 0.2);
  border-color: #1ABC9C;
  color: #5EEAD4;
}

html[data-theme="dark"] .icon-svg,
html[data-theme="dark"] .icon-svg-sm {
  stroke: #94A3B8;
}

html[data-theme="dark"] .line-style-bottom-bar {
  background: rgba(15, 23, 42, 0.95);
  border-top-color: #1E293B;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .b-tab-item {
  color: #94A3B8;
}

html[data-theme="dark"] .b-tab-item:hover {
  background: #1E293B;
  color: #5EEAD4;
}

html[data-theme="dark"] .b-tab-item.active {
  background: rgba(26, 188, 156, 0.18);
  color: #5EEAD4;
}

html[data-theme="dark"] .b-tab-badge {
  border-color: #0F172A;
}

html[data-theme="dark"] .section-banner,
html[data-theme="dark"] .card,
html[data-theme="dark"] .kpi-stat-card,
html[data-theme="dark"] .finder-toggle-card,
html[data-theme="dark"] .cat-pill,
html[data-theme="dark"] .supp-card,
html[data-theme="dark"] .managed-item-card,
html[data-theme="dark"] .analysis-acc-card,
html[data-theme="dark"] .modal-dialog {
  background: #131C2E !important;
  border-color: #1E293B !important;
  color: #E2E8F0;
}

html[data-theme="dark"] .cat-pill.active {
  border-color: #1ABC9C !important;
  background: rgba(26, 188, 156, 0.14) !important;
}

html[data-theme="dark"] .cat-pill-label,
html[data-theme="dark"] .supp-brand-title,
html[data-theme="dark"] .metric-val,
html[data-theme="dark"] .spec-tag {
  color: #F8FAFC !important;
}

html[data-theme="dark"] .metric-val.highlight-daily,
html[data-theme="dark"] .pill-count {
  color: #5EEAD4 !important;
}

html[data-theme="dark"] .supp-visual-stage {
  filter: brightness(0.92);
}

html[data-theme="dark"] .supp-visual-form {
  color: #0F172A;
}

html[data-theme="dark"] .supp-price-metrics,
html[data-theme="dark"] .pros-cons-box,
html[data-theme="dark"] .goal-check-card,
html[data-theme="dark"] .budget-card,
html[data-theme="dark"] .preference-row,
html[data-theme="dark"] .dosage-row,
html[data-theme="dark"] .calendar-legend,
html[data-theme="dark"] .result-summary-box,
html[data-theme="dark"] .reminder-friend-banner,
html[data-theme="dark"] .reminder-master-toggle,
html[data-theme="dark"] .reminder-slot-item {
  background: #0F172A !important;
  border-color: #1E293B !important;
  color: #E2E8F0 !important;
}

html[data-theme="dark"] .pro-line {
  color: #34D399 !important;
}

html[data-theme="dark"] .con-line {
  color: #FDA4AF !important;
}

html[data-theme="dark"] .supp-spec-list {
  color: #CBD5E1;
}

html[data-theme="dark"] .supp-actions-row,
html[data-theme="dark"] .card-title-bar,
html[data-theme="dark"] .form-step-block,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
  border-color: #1E293B !important;
}

html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-textarea,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .chip-sample,
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn-logout-demo,
html[data-theme="dark"] .btn-cal-arrow {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

html[data-theme="dark"] .btn-outline:hover,
html[data-theme="dark"] .chip-sample:hover {
  background: rgba(26, 188, 156, 0.18) !important;
  border-color: #1ABC9C !important;
  color: #5EEAD4 !important;
}

html[data-theme="dark"] .cal-day-cell {
  background: #0F172A;
  border-color: #1E293B;
}

html[data-theme="dark"] .cal-day-cell.empty {
  background: transparent;
  border-color: transparent;
}

html[data-theme="dark"] .cal-day-cell.is-today {
  background: rgba(52, 152, 219, 0.18);
  border-color: #3498DB;
}

html[data-theme="dark"] .cal-day-cell.is-selected {
  background: rgba(26, 188, 156, 0.2);
  border-color: #1ABC9C;
}

html[data-theme="dark"] .pro-gate-card,
html[data-theme="dark"] .pro-locked-card,
html[data-theme="dark"] .vertex-scan-box {
  background: linear-gradient(135deg, rgba(26, 188, 156, 0.14) 0%, rgba(52, 152, 219, 0.14) 100%) !important;
  border-color: rgba(26, 188, 156, 0.35) !important;
}

html[data-theme="dark"] .pro-gate-card p,
html[data-theme="dark"] .vertex-scan-desc {
  color: #CBD5E1 !important;
}

html[data-theme="dark"] .vertex-scan-title-wrap,
html[data-theme="dark"] .pro-gate-header h4 {
  color: #F8FAFC !important;
}

html[data-theme="dark"] .pro-lock-overlay-btn-box {
  background: rgba(15, 23, 42, 0.86) !important;
}

html[data-theme="dark"] .pro-lock-overlay-btn-box div {
  color: #F8FAFC !important;
}

html[data-theme="dark"] .pro-lock-overlay-btn-box p {
  color: #CBD5E1 !important;
}

html[data-theme="dark"] .clinical-footer {
  background: #0F172A;
  border-top-color: #1E293B;
}

html[data-theme="dark"] .clinical-footer-grid {
  border-bottom-color: #1E293B;
}

html[data-theme="dark"] .footer-col-heading {
  color: #F8FAFC;
}

html[data-theme="dark"] .footer-brand-desc,
html[data-theme="dark"] .footer-link-btn,
html[data-theme="dark"] .clinical-legal-note {
  color: #94A3B8;
}

html[data-theme="dark"] .clinical-legal-note {
  background: #131C2E;
  border-color: #1E293B;
}

html[data-theme="dark"] .clinical-legal-note strong {
  color: #F8FAFC;
}

html[data-theme="dark"] .a4-preview-toolbar {
  background: #0F172A;
  color: #F8FAFC;
  border-bottom-color: #1E293B;
}

/* ==================== 深色模式全站文字高對比補齊（覆蓋行內深色字與次要區塊） ==================== */
html[data-theme="dark"] .page-container h1,
html[data-theme="dark"] .page-container h2,
html[data-theme="dark"] .page-container h3,
html[data-theme="dark"] .page-container h4,
html[data-theme="dark"] .page-container h5,
html[data-theme="dark"] .modal-dialog h3,
html[data-theme="dark"] .modal-dialog h4,
html[data-theme="dark"] .modal-dialog h5,
html[data-theme="dark"] .modal-dialog label,
html[data-theme="dark"] .modal-dialog strong,
html[data-theme="dark"] .finder-toggle-text strong,
html[data-theme="dark"] .acc-text-group strong,
html[data-theme="dark"] .managed-item-card h4,
html[data-theme="dark"] .daily-tracker-card h3,
html[data-theme="dark"] .daily-tracker-card h4,
html[data-theme="dark"] .weekly-summary-card h4,
html[data-theme="dark"] .weekly-upgrade-title,
html[data-theme="dark"] .ext-step-content strong,
html[data-theme="dark"] .sub-plan-card h4,
html[data-theme="dark"] .cal-day-num {
  color: #F8FAFC !important;
}

/* 彈窗標題列維持淺黃／淺色底，因此標題與關閉按鈕在暗色模式下保持深色高對比 */
html[data-theme="dark"] .modal-dialog .modal-header h3,
html[data-theme="dark"] .modal-dialog .modal-header .modal-close {
  color: #1C1C1C !important;
}

html[data-theme="dark"] .modal-dialog .modal-header .icon-svg {
  stroke: #1C1C1C !important;
}

html[data-theme="dark"] .page-container p,
html[data-theme="dark"] .modal-dialog p,
html[data-theme="dark"] .modal-body span,
html[data-theme="dark"] .finder-toggle-text span,
html[data-theme="dark"] .acc-text-group span,
html[data-theme="dark"] .acc-toggle-label,
html[data-theme="dark"] .managed-item-card div,
html[data-theme="dark"] .weekly-summary-body,
html[data-theme="dark"] .weekly-upgrade-desc,
html[data-theme="dark"] .dosage-row,
html[data-theme="dark"] .dosage-row div,
html[data-theme="dark"] .dosage-row span,
html[data-theme="dark"] .reminder-login-gate p,
html[data-theme="dark"] .footer-link-list span,
html[data-theme="dark"] .checklist-item,
html[data-theme="dark"] .purchased-cabinet-item {
  color: #CBD5E1 !important;
}

html[data-theme="dark"] .finder-result-card {
  background: linear-gradient(180deg, rgba(26, 188, 156, 0.16) 0%, #131C2E 140px) !important;
  border-color: rgba(26, 188, 156, 0.4) !important;
}

html[data-theme="dark"] .finder-result-card div[style*="background:#F9FAFB"],
html[data-theme="dark"] .finder-result-card div[style*="background: #F9FAFB"] {
  background: #0F172A !important;
  border-color: #1E293B !important;
}

html[data-theme="dark"] .finder-result-card strong[style*="color:#0E6251"] {
  color: #5EEAD4 !important;
}

html[data-theme="dark"] .dont-waste-box {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #FDE68A !important;
}

html[data-theme="dark"] .kpi-stat-card.savings-highlight {
  background: rgba(225, 29, 72, 0.16) !important;
  border-color: rgba(251, 113, 133, 0.4) !important;
}

html[data-theme="dark"] .kpi-stat-card.savings-highlight .kpi-label,
html[data-theme="dark"] .kpi-stat-card.savings-highlight .kpi-number {
  color: #FDA4AF !important;
}

html[data-theme="dark"] .kpi-stat-card.optimized-highlight {
  background: rgba(26, 188, 156, 0.16) !important;
  border-color: rgba(26, 188, 156, 0.4) !important;
}

html[data-theme="dark"] .kpi-stat-card.optimized-highlight .kpi-label,
html[data-theme="dark"] .kpi-stat-card.optimized-highlight .kpi-number {
  color: #5EEAD4 !important;
}

html[data-theme="dark"] .analysis-acc-card.acc-tone-danger {
  border-color: rgba(251, 113, 133, 0.45) !important;
}

html[data-theme="dark"] .analysis-acc-card.acc-tone-warn {
  border-color: rgba(251, 191, 36, 0.42) !important;
}

html[data-theme="dark"] .analysis-acc-card.acc-tone-safe {
  border-color: rgba(52, 211, 153, 0.42) !important;
}

html[data-theme="dark"] .analysis-acc-header:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

html[data-theme="dark"] .analysis-acc-body {
  background: #0B1220 !important;
  border-top-color: #1E293B !important;
}

html[data-theme="dark"] .acc-icon-box {
  background: #0F172A !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .acc-icon-box .icon-svg-sm,
html[data-theme="dark"] .acc-chevron {
  stroke: #94A3B8 !important;
}

html[data-theme="dark"] .acc-icon-danger {
  background: rgba(225, 29, 72, 0.16) !important;
  border-color: rgba(251, 113, 133, 0.45) !important;
}

html[data-theme="dark"] .acc-icon-danger .icon-svg-sm {
  stroke: #FDA4AF !important;
}

html[data-theme="dark"] .acc-icon-warn {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(251, 191, 36, 0.45) !important;
}

html[data-theme="dark"] .acc-icon-warn .icon-svg-sm {
  stroke: #FCD34D !important;
}

html[data-theme="dark"] .acc-icon-safe {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(52, 211, 153, 0.45) !important;
}

html[data-theme="dark"] .acc-icon-safe .icon-svg-sm {
  stroke: #34D399 !important;
}

html[data-theme="dark"] .acc-badge-safe {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #6EE7B7 !important;
}

html[data-theme="dark"] .acc-pro-mini {
  background: rgba(26, 188, 156, 0.2) !important;
  border-color: rgba(45, 212, 191, 0.45) !important;
  color: #5EEAD4 !important;
}

html[data-theme="dark"] .redundancy-alert-card,
html[data-theme="dark"] .redundancy-alert-box {
  background: rgba(225, 29, 72, 0.14) !important;
  border-color: rgba(251, 113, 133, 0.38) !important;
  border-left-color: #FB7185 !important;
}

html[data-theme="dark"] .redundancy-title {
  color: #FDA4AF !important;
}

html[data-theme="dark"] .redundancy-alert-card p,
html[data-theme="dark"] .redundancy-alert-box p {
  color: #FFE4E6 !important;
}

html[data-theme="dark"] .btn-danger-soft {
  background: rgba(225, 29, 72, 0.2) !important;
  border-color: rgba(251, 113, 133, 0.45) !important;
  color: #FECDD3 !important;
}

html[data-theme="dark"] .btn-danger-soft:hover {
  background: rgba(225, 29, 72, 0.32) !important;
}

html[data-theme="dark"] .dosage-row .dosage-status-pill.status-optimal {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #6EE7B7 !important;
}

html[data-theme="dark"] .dosage-row .dosage-status-pill.status-exceed_ul {
  background: rgba(225, 29, 72, 0.22) !important;
  color: #FDA4AF !important;
}

html[data-theme="dark"] .dosage-row .dosage-status-pill.status-duplicate_high {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #FCD34D !important;
}

html[data-theme="dark"] .dosage-row .dosage-status-pill.status-low {
  background: #1E293B !important;
  color: #CBD5E1 !important;
}

html[data-theme="dark"] #wishlist-analysis-container div[style*="background:#fffbeb"],
html[data-theme="dark"] #wishlist-analysis-container div[style*="background: #fffbeb"] {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #FDE68A !important;
}

html[data-theme="dark"] #wishlist-analysis-container div[style*="background:#fffbeb"] span,
html[data-theme="dark"] #wishlist-analysis-container div[style*="background: #fffbeb"] span {
  color: #FDE68A !important;
}

html[data-theme="dark"] #wishlist-analysis-container div[style*="background:#fffbeb"] .icon-svg-sm {
  stroke: #FCD34D !important;
}

html[data-theme="dark"] #wishlist-analysis-container div[style*="background:#f8fafc"],
html[data-theme="dark"] #wishlist-analysis-container div[style*="background: #f8fafc"],
html[data-theme="dark"] .weekly-upgrade-box,
html[data-theme="dark"] .dynamic-feedback-card,
html[data-theme="dark"] .sick-mode-box,
html[data-theme="dark"] .checklist-item,
html[data-theme="dark"] .purchased-cabinet-item,
html[data-theme="dark"] .sub-plan-card,
html[data-theme="dark"] .ext-step-item,
html[data-theme="dark"] .rating-pill {
  background: #0F172A !important;
  border-color: #1E293B !important;
  color: #E2E8F0 !important;
}

html[data-theme="dark"] .mood-pill,
html[data-theme="dark"] .mood-btn {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #CBD5E1 !important;
}

html[data-theme="dark"] .mood-pill.active,
html[data-theme="dark"] .mood-btn.active {
  background: rgba(26, 188, 156, 0.22) !important;
  border-color: #1ABC9C !important;
  color: #5EEAD4 !important;
}

html[data-theme="dark"] .weekly-trend-pill {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

html[data-theme="dark"] .weekly-trend-pill.positive {
  background: rgba(26, 188, 156, 0.2) !important;
  color: #5EEAD4 !important;
}

html[data-theme="dark"] .a4-input-summary-pill,
html[data-theme="dark"] .a4-preset-chip,
html[data-theme="dark"] .pro-unlocked-banner {
  background: rgba(26, 188, 156, 0.16) !important;
  border-color: rgba(26, 188, 156, 0.38) !important;
  color: #5EEAD4 !important;
}

html[data-theme="dark"] .mvp-gate-note {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #FDE68A !important;
}

html[data-theme="dark"] .modal-dialog div[style*="background:#f5f0ff"] {
  background: rgba(26, 188, 156, 0.14) !important;
  border-color: rgba(26, 188, 156, 0.35) !important;
  color: #5EEAD4 !important;
}

html[data-theme="dark"] .supp-visual-stage .supp-visual-form,
html[data-theme="dark"] .supp-visual-stage .supp-badge-bottomright {
  color: #1C1C1C !important;
}

/* 手機版精簡比價卡片：深色模式高對比支援 */
html[data-theme="dark"] .supp-mobile-title {
  color: #F8FAFC !important;
}

html[data-theme="dark"] .supp-mobile-meta,
html[data-theme="dark"] .supp-mobile-subprice {
  color: #94A3B8 !important;
}

html[data-theme="dark"] .supp-mobile-ing {
  color: #CBD5E1 !important;
}

html[data-theme="dark"] .supp-mobile-daily {
  color: #5EEAD4 !important;
}

html[data-theme="dark"] .supp-mobile-icon-box {
  filter: brightness(0.92);
}

html[data-theme="dark"] .supp-card.is-mobile-expanded .supp-body-pad {
  border-top-color: #1E293B !important;
}

html[data-theme="dark"] .supp-mobile-expand-btn {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #CBD5E1 !important;
}

/* 日曆當日紀錄：服用清單商品名稱與份量在深色模式下的高對比 */
.intake-item-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
}

.intake-item-dose {
  font-size: 0.75rem;
  color: #64748b;
}

html[data-theme="dark"] .intake-check-item {
  background: #0F172A !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .intake-check-item.checked {
  background: rgba(26, 188, 156, 0.16) !important;
  border-color: #1ABC9C !important;
}

html[data-theme="dark"] .intake-item-name {
  color: #F8FAFC !important;
}

html[data-theme="dark"] .intake-item-dose {
  color: #94A3B8 !important;
}

html[data-theme="dark"] .timing-tag {
  background: rgba(52, 152, 219, 0.18) !important;
  border-color: rgba(96, 165, 250, 0.4) !important;
  color: #BFDBFE !important;
}

html[data-theme="dark"] .btn-intake-remove {
  background: transparent !important;
  border-color: #475569 !important;
  color: #CBD5E1 !important;
}

/* 方案說明彈窗：移除深色模式下刺眼的亮黃底色（反光問題） */
html[data-theme="dark"] .sub-intro-text {
  background: #131C2E !important;
  border-color: #334155 !important;
  color: #CBD5E1 !important;
}

html[data-theme="dark"] .sub-intro-text strong {
  color: #5EEAD4 !important;
}

html[data-theme="dark"] .sub-plan-card.featured {
  background: rgba(26, 188, 156, 0.1) !important;
  border-color: rgba(26, 188, 156, 0.55) !important;
}

html[data-theme="dark"] .plan-badge {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

html[data-theme="dark"] .plan-badge.badge-pro {
  background: #1ABC9C !important;
  border-color: #1ABC9C !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] .plan-price {
  color: #F8FAFC !important;
}

html[data-theme="dark"] .plan-price span {
  color: #94A3B8 !important;
}

html[data-theme="dark"] .plan-features li,
html[data-theme="dark"] .plan-features li strong {
  color: #E2E8F0 !important;
}

html[data-theme="dark"] .mvp-notice-card {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
}

html[data-theme="dark"] .mvp-notice-title,
html[data-theme="dark"] .mvp-notice-title span {
  color: #FCD34D !important;
}

html[data-theme="dark"] .mvp-notice-title .icon-svg-sm {
  stroke: #FCD34D !important;
}

html[data-theme="dark"] .mvp-notice-text,
html[data-theme="dark"] .mvp-notice-text strong {
  color: #FDE68A !important;
}

/* 保護單頁 A4 紙本報告永遠維持標準純白臨床列印底色與深炭黑文字 */
html[data-theme="dark"] .a4-sheet {
  background: #FFFFFF !important;
  color: #1C1C1C !important;
}

html[data-theme="dark"] .a4-sheet h2,
html[data-theme="dark"] .a4-sheet strong {
  color: #1C1C1C !important;
}

html[data-theme="dark"] .a4-sheet .a4-card-caption,
html[data-theme="dark"] .a4-sheet .a4-exec-box,
html[data-theme="dark"] .a4-sheet .a4-subject-meta {
  color: #374151 !important;
}

/* ========================================================
   Win XP / Rover 致敬版：左下角小柴犬「選寶 Picky」與頭頂單列式對話氣泡框
   ======================================================== */
.shiba-side-dock {
  position: fixed;
  left: 18px;
  bottom: 82px;
  z-index: 1620;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
  pointer-events: none;
  transition: opacity 220ms var(--ease-clinical);
}

.shiba-side-dock.is-hidden {
  display: none !important;
}

/* 切換至分析／日曆／設定頁時：小柴犬轉身往左側小跑步跑走退場 */
.shiba-side-dock.is-running-away {
  animation: shibaRunAwayLeft 380ms cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}

.shiba-side-dock.is-running-away .shiba-svg {
  transform: scaleX(-1);
}

.shiba-side-dock.is-running-away .paw-left {
  animation: shibaPawTrot 110ms ease-in-out infinite alternate;
}

.shiba-side-dock.is-running-away .paw-right {
  animation: shibaPawTrot 110ms ease-in-out 55ms infinite alternate;
}

/* 切回尋找頁時：小柴犬從左側小跑步回來坐好 */
.shiba-side-dock.is-running-in {
  animation: shibaRunInLeft 440ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.shiba-side-dock.is-running-in .paw-left {
  animation: shibaPawTrot 120ms ease-in-out 3;
}

.shiba-side-dock.is-running-in .paw-right {
  animation: shibaPawTrot 120ms ease-in-out 60ms 3;
}

@keyframes shibaRunAwayLeft {
  0% { transform: translateX(0) translateY(0); opacity: 1; }
  25% { transform: translateX(-14px) translateY(-6px); opacity: 1; }
  55% { transform: translateX(-65px) translateY(0); opacity: 0.92; }
  100% { transform: translateX(-210px) translateY(-4px); opacity: 0; }
}

@keyframes shibaRunInLeft {
  0% { transform: translateX(-190px) translateY(-4px); opacity: 0; }
  55% { transform: translateX(8px) translateY(-5px); opacity: 1; }
  80% { transform: translateX(-3px) translateY(0); opacity: 1; }
  100% { transform: translateX(0) translateY(0); opacity: 1; }
}

@keyframes shibaPawTrot {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

/* 左下角未展開時的輕巧招呼小氣泡（帶向下對話尖角） */
.shiba-dock-bubble {
  pointer-events: auto;
  position: relative;
  max-width: 240px;
  background: #FFFFFF;
  border: 1.5px solid #14967C;
  border-radius: 15px;
  padding: 0.62rem 1.55rem 0.62rem 0.82rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: transform 250ms var(--ease-clinical), box-shadow 250ms var(--ease-clinical);
}

.shiba-dock-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 36px;
  width: 12px;
  height: 12px;
  background: #FFFFFF;
  border-right: 1.5px solid #14967C;
  border-bottom: 1.5px solid #14967C;
  transform: rotate(45deg);
}

.shiba-dock-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(26, 188, 156, 0.22);
}

.shiba-bubble-text strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  color: #0E6251;
  margin-bottom: 2px;
}

.shiba-bubble-text span {
  display: block;
  font-size: 0.73rem;
  line-height: 1.38;
  color: #374151;
}

.shiba-bubble-dismiss {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #9CA3AF;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}

.shiba-bubble-dismiss:hover {
  color: #1C1C1C;
  background: #F3F4F6;
}

/* 左下角小柴犬觸發按鈕 */
.shiba-mascot-trigger {
  pointer-events: auto;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 280ms var(--ease-clinical);
}

.shiba-mascot-trigger:hover {
  transform: translateY(-4px) scale(1.04);
}

.shiba-mascot-trigger .shiba-svg {
  width: 92px;
  height: 92px;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.16));
  transition: transform 250ms ease;
}

.shiba-dock-pill {
  margin-top: -8px;
  background: linear-gradient(135deg, #1ABC9C 0%, #3498DB 100%);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(26, 188, 156, 0.35);
  border: 2px solid #FFFFFF;
}

/* ==================== 小柴犬 SVG 細緻生命力微動畫 ==================== */
.shiba-tail {
  transform-origin: 84px 84px;
  animation: shibaTailWag 1.8s ease-in-out infinite alternate;
}

@keyframes shibaTailWag {
  0% { transform: rotate(-7deg); }
  100% { transform: rotate(11deg); }
}

.shiba-eyes-normal {
  transform-origin: 60px 48px;
  animation: shibaBlink 4.2s infinite;
}

@keyframes shibaBlink {
  0%, 93%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.08); }
}

.shiba-eyes-happy,
.shiba-magnifier,
.shiba-sparkles {
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.shiba-head-group {
  transform-origin: 60px 62px;
  transition: transform 280ms var(--ease-clinical);
}

/* 狀態 1：listening（歪頭豎耳傾聽） */
.mood-listening .shiba-head-group {
  transform: rotate(-8deg) translateY(-1px);
}

.mood-listening .shiba-tail {
  animation-duration: 0.75s;
}

/* 狀態 2：searching（經典 Win XP 舉放大鏡掃描翻找） */
.mood-searching .shiba-magnifier {
  opacity: 1;
  transform-origin: 75px 75px;
  animation: shibaMagnifierScan 0.55s ease-in-out infinite alternate;
}

.mood-searching .shiba-head-group {
  animation: shibaSearchNod 0.55s ease-in-out infinite alternate;
}

@keyframes shibaMagnifierScan {
  0% { transform: translate(-14px, -6px) rotate(-12deg); }
  100% { transform: translate(6px, 2px) rotate(10deg); }
}

@keyframes shibaSearchNod {
  0% { transform: rotate(-4deg) translateX(-3px); }
  100% { transform: rotate(5deg) translateX(3px); }
}

/* 狀態 3：happy（找到方案開心跳躍＋彎彎笑眼＋閃星） */
.mood-happy .shiba-eyes-normal {
  opacity: 0;
}

.mood-happy .shiba-eyes-happy,
.mood-happy .shiba-sparkles {
  opacity: 1;
}

.mood-happy .shiba-svg {
  animation: shibaHappyBounce 0.55s ease-in-out 2;
}

@keyframes shibaHappyBounce {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-9px); }
}

/* ==================== 經典 Rover / XP 浮動單列式對話氣泡框 ==================== */
.shiba-speech-balloon {
  pointer-events: auto;
  position: relative;
  width: min(312px, calc(100vw - 28px));
  background: #FFFFFF;
  border: 2px solid #14967C;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(20, 150, 124, 0.12);
  transform-origin: 42px 100%;
  animation: shibaBalloonPop 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* 指向正下方小柴犬額頭的對話框尖角 */
.shiba-speech-balloon::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 36px;
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border-right: 2px solid #14967C;
  border-bottom: 2px solid #14967C;
  transform: rotate(45deg);
}

@keyframes shibaBalloonPop {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.shiba-balloon-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem 0.5rem;
}

.shiba-balloon-question {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.4;
  color: #1C1C1C;
}

.shiba-balloon-step {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  color: #0E6251;
  background: #E8F8F5;
  border: 1px solid #B7EFE4;
  border-radius: 999px;
  padding: 1px 7px;
  margin-top: 1px;
}

.shiba-balloon-form {
  display: flex;
  flex-direction: column;
  padding: 0 0.8rem 0.8rem;
}

.shiba-step-pane {
  display: none;
  max-height: min(375px, calc(100dvh - 275px));
  overflow-y: auto;
  padding-right: 2px;
}

.shiba-step-pane.active {
  display: block;
  animation: fadeIn 180ms var(--ease-clinical);
}

/* 單列式緊湊選項清單（不再是一格一格的大卡片） */
.shiba-row-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shiba-choice-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.34rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 140ms ease;
}

.shiba-choice-row:hover {
  background: #F0FDF9;
}

.shiba-choice-row:has(input:checked) {
  background: #E8F8F5;
}

.shiba-choice-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* 致敬 Rover 對話框的雙圈圓點按鈕 */
.shiba-dot-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.8px solid #64748B;
  background: #F8FAFC;
  box-shadow: inset 0 0 0 2px #FFFFFF;
  flex-shrink: 0;
  transition: all 150ms ease;
}

.shiba-choice-row:hover .shiba-dot-icon {
  border-color: #1ABC9C;
}

.shiba-choice-row input:checked + .shiba-dot-icon {
  border-color: #0E6251;
  background: #1ABC9C;
  box-shadow: inset 0 0 0 2.5px #FFFFFF;
}

.shiba-row-text {
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.35;
  color: #1F2937;
}

.shiba-choice-row input:checked ~ .shiba-row-text {
  color: #0E6251;
  font-weight: 800;
}

/* 致敬 Win XP「You may also want to...」分隔小標與綠色箭頭列 */
.shiba-also-divider {
  font-size: 0.73rem;
  font-weight: 700;
  color: #6B7280;
  margin: 0.55rem 0 0.2rem 0.25rem;
}

.shiba-quick-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shiba-arrow-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1.35;
  color: #1F2937;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.shiba-arrow-row:hover {
  background: #EBF5FB;
  color: #0E6251;
}

.xp-arrow-box {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: linear-gradient(180deg, #2ECC71 0%, #16A085 100%);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(14, 98, 81, 0.25);
}

.shiba-arrow-select input:checked + .xp-arrow-box {
  background: linear-gradient(180deg, #1ABC9C 0%, #0E6251 100%);
  box-shadow: 0 0 0 2px #A7F3D0;
}

.xp-note-box {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: #EFF6FF;
  border: 1px solid #93C5FD;
  color: #2563EB;
  font-size: 0.7rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shiba-mini-textarea {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-family: inherit;
  font-size: 0.79rem;
  line-height: 1.4;
  color: #1C1C1C;
  background: #F8FAFC;
  resize: none;
}

.shiba-mini-textarea:focus {
  outline: none;
  border-color: #1ABC9C;
  background: #FFFFFF;
}

/* 對話框底部膠囊操作列（致敬 Rover 對話框底部膠囊鈕） */
.shiba-balloon-actions {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #E2E8F0;
}

.shiba-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  border: 1.5px solid #CBD5E1;
  background: #F8FAFC;
  color: #374151;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 160ms ease;
}

.shiba-pill-btn:hover:not(:disabled) {
  border-color: #94A3B8;
  background: #F1F5F9;
}

.shiba-pill-primary {
  background: #1ABC9C;
  border-color: #0E6251;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(26, 188, 156, 0.25);
}

.shiba-pill-primary:hover:not(:disabled) {
  background: #16A085;
  border-color: #0B4F41;
  color: #FFFFFF;
  transform: translateY(-1px);
}

.shiba-pill-primary:disabled {
  opacity: 0.7;
  cursor: wait;
}

.shiba-pill-cancel {
  margin-left: auto;
  background: #FFFFFF;
  border-color: #94A3B8;
  color: #475569;
}

.shiba-pill-cancel:hover {
  background: #FEF2F2;
  border-color: #FCA5A5;
  color: #DC2626;
}

/* 手機窄螢幕：左下角小柴犬與頭頂對話氣泡適配 */
@media (max-width: 768px) {
  .shiba-side-dock {
    left: 10px;
    bottom: 76px;
    gap: 9px;
  }
  .shiba-dock-bubble {
    max-width: 205px;
    padding: 0.5rem 1.4rem 0.5rem 0.7rem;
  }
  .shiba-dock-bubble::after {
    left: 28px;
  }
  .shiba-speech-balloon {
    width: min(300px, calc(100vw - 20px));
    transform-origin: 34px 100%;
  }
  .shiba-speech-balloon::after {
    left: 28px;
  }
  .shiba-step-pane {
    max-height: calc(100dvh - 255px);
  }
  .shiba-mascot-trigger .shiba-svg {
    width: 68px;
    height: 68px;
  }
}

/* 深色模式小柴犬與浮動對話氣泡框完整適配 */
html[data-theme="dark"] .shiba-dock-bubble {
  background: #131C2E;
  border-color: #2DD4BF;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .shiba-dock-bubble::after {
  background: #131C2E;
  border-color: #2DD4BF;
}

html[data-theme="dark"] .shiba-bubble-text strong {
  color: #5EEAD4;
}

html[data-theme="dark"] .shiba-bubble-text span {
  color: #E2E8F0;
}

html[data-theme="dark"] .shiba-speech-balloon {
  background: #131C2E;
  border-color: #2DD4BF;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.58);
}

html[data-theme="dark"] .shiba-speech-balloon::after {
  background: #131C2E;
  border-color: #2DD4BF;
}

html[data-theme="dark"] .shiba-balloon-question {
  color: #F8FAFC;
}

html[data-theme="dark"] .shiba-balloon-step {
  background: rgba(26, 188, 156, 0.18);
  border-color: rgba(45, 212, 191, 0.4);
  color: #5EEAD4;
}

html[data-theme="dark"] .shiba-choice-row:hover {
  background: rgba(26, 188, 156, 0.12);
}

html[data-theme="dark"] .shiba-choice-row:has(input:checked) {
  background: rgba(26, 188, 156, 0.2);
}

html[data-theme="dark"] .shiba-dot-icon {
  background: #0F172A;
  border-color: #64748B;
  box-shadow: inset 0 0 0 2px #0F172A;
}

html[data-theme="dark"] .shiba-choice-row input:checked + .shiba-dot-icon {
  background: #1ABC9C;
  border-color: #5EEAD4;
  box-shadow: inset 0 0 0 2.5px #0F172A;
}

html[data-theme="dark"] .shiba-row-text {
  color: #E2E8F0;
}

html[data-theme="dark"] .shiba-choice-row input:checked ~ .shiba-row-text {
  color: #5EEAD4;
}

html[data-theme="dark"] .shiba-also-divider {
  color: #94A3B8;
}

html[data-theme="dark"] .shiba-arrow-row {
  color: #E2E8F0;
}

html[data-theme="dark"] .shiba-arrow-row:hover {
  background: rgba(52, 152, 219, 0.16);
  color: #5EEAD4;
}

html[data-theme="dark"] .xp-note-box {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(96, 165, 250, 0.45);
  color: #93C5FD;
}

html[data-theme="dark"] .shiba-mini-textarea {
  background: #0F172A;
  border-color: #334155;
  color: #F8FAFC;
}

html[data-theme="dark"] .shiba-balloon-actions {
  border-top-color: #1E293B;
}

html[data-theme="dark"] .shiba-pill-btn {
  background: #0F172A;
  border-color: #334155;
  color: #E2E8F0;
}

html[data-theme="dark"] .shiba-pill-primary {
  background: #1ABC9C;
  border-color: #2DD4BF;
  color: #FFFFFF;
}

html[data-theme="dark"] .shiba-pill-cancel {
  background: #0F172A;
  border-color: #475569;
  color: #CBD5E1;
}

html[data-theme="dark"] .shiba-pill-cancel:hover {
  background: rgba(220, 38, 38, 0.18);
  border-color: #F87171;
  color: #FCA5A5;
}

@media print {
  .shiba-side-dock,
  .shiba-speech-balloon {
    display: none !important;
  }
}







