/* 壽險語音活動管家 Activity Pro — Apple 極簡純白 × 極致手機 App 設計系統 */
:root {
  --desktop-bg: #ECECEF;
  --app-bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-muted: #F2F2F7;
  --ink: #1D1D1F;
  --ink-secondary: #6E6E73;
  --ink-tertiary: #AEAEB2;
  --hairline: rgba(0, 0, 0, 0.07);
  --hairline-strong: rgba(0, 0, 0, 0.12);

  /* Apple 系統點綴色 */
  --blue: #0071E3;
  --blue-soft: rgba(0, 113, 227, 0.1);
  --green: #28A745;
  --green-ring: #30B05B;
  --green-soft: rgba(48, 176, 91, 0.12);
  --coral: #FF3B30;
  --coral-soft: rgba(255, 59, 48, 0.1);
  --amber: #D97706;
  --amber-soft: rgba(217, 119, 6, 0.11);
  --purple: #7C3AED;
  --purple-soft: rgba(124, 58, 237, 0.1);

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.035), 0 1px 2px rgba(0, 0, 0, 0.025);
  --shadow-shell: 0 24px 68px rgba(0, 0, 0, 0.12), 0 2px 10px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--desktop-bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 15px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

svg.ico {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

/* ==========================================================================
   極致手機 App 外框容器（桌機置中 430px 精品畫布，真機全螢幕無縫貼合）
   ========================================================================== */
.app-stage {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 14px;
}

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: calc(100dvh - 40px);
  background: var(--app-bg);
  border-radius: 38px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-shell);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: clip;
}

@media (max-width: 500px) {
  html, body {
    background: var(--app-bg);
  }
  .app-stage {
    padding: 0;
  }
  .app-shell {
    max-width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

/* 頂部毛玻璃極簡導覽列 */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  background: rgba(245, 245, 247, 0.84);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 0.5px solid var(--hairline);
}

.top-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  text-transform: uppercase;
}

.month-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  position: relative;
}

.month-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding-right: 18px;
  cursor: pointer;
}

.month-select:focus {
  outline: none;
}

.month-chevron {
  position: absolute;
  right: 0;
  pointer-events: none;
  color: var(--ink-secondary);
  width: 14px !important;
  height: 14px !important;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-pill-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 0.5px solid var(--hairline);
  transition: transform 0.14s ease, background 0.14s ease;
}

.icon-pill-btn:hover {
  background: #EFEFF4;
}

.icon-pill-btn:active {
  transform: scale(0.93);
}

.icon-pill-btn.primary {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}

.icon-pill-btn.primary:hover {
  background: #323236;
}

/* 主捲動內容區 */
.app-body {
  flex: 1;
  padding: 14px 16px 96px;
}

.view-section {
  display: none;
  animation: viewFade 0.18s ease;
}

.view-section.active {
  display: block;
}

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

/* 卡片與區段標題 */
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
}

.card-compact {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 4px 10px;
}

.section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
  letter-spacing: 0.02em;
}

.section-meta {
  font-size: 12px;
  color: var(--ink-tertiary);
  font-weight: 500;
}

/* iOS Segmented Control */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: rgba(118, 118, 128, 0.12);
  padding: 3px;
  border-radius: 11px;
  margin-bottom: 14px;
}

.seg-btn {
  padding: 7px 10px;
  border-radius: 8.5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  transition: all 0.18s ease;
  text-align: center;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.09);
}

/* 橫向滑動膠囊列（電腦支援滑鼠滾輪橫滑與拖曳） */
.pill-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.14) transparent;
}

.pill-scroll.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.pill-scroll::-webkit-scrollbar {
  height: 4px;
}

.pill-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.14);
  border-radius: 999px;
}

/* 第 1～5 週專屬五等分一覽格（免滑動，電腦與手機一眼全見） */
.week-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.week-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 7px 2px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-secondary);
  border: 0.5px solid var(--hairline);
  transition: all 0.14s ease;
}

.week-tab-btn:hover:not(.active) {
  background: #EFEFF4;
  color: var(--ink);
}

.week-tab-btn .wt-num {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
}

.week-tab-btn .wt-range {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.72;
  line-height: 1.2;
  white-space: nowrap;
}

.week-tab-btn.active {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.week-tab-btn.active .wt-range {
  opacity: 0.8;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface);
  color: var(--ink-secondary);
  border: 0.5px solid var(--hairline);
  transition: all 0.14s ease;
}

.pill.active {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}

/* ==========================================================================
   分頁 1：Apple Watch 三環活動量進度卡 ＋ Spotlight 語音輸入列
   ========================================================================== */
.rings-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 18px 16px;
}

.rings-svg-wrap {
  width: 118px;
  height: 118px;
  flex-shrink: 0;
  position: relative;
  display: grid;
  place-items: center;
}

.rings-svg {
  width: 118px;
  height: 118px;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke-width: 9.5;
  opacity: 0.15;
}

.ring-progress {
  fill: none;
  stroke-width: 9.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.rings-center {
  position: absolute;
  text-align: center;
  line-height: 1.05;
}

.rings-center-val {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.rings-center-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-top: 2px;
}

.rings-metrics {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ring-metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.ring-metric-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.ring-metric-val {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.ring-metric-val small {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-tertiary);
}

.rings-footnote {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 0.5px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-secondary);
}

.rings-footnote strong {
  color: var(--ink);
  font-weight: 700;
}

/* Spotlight 極簡語音列 */
.voice-bar-card {
  padding: 12px 12px 12px 16px;
  border-radius: 22px;
  margin-bottom: 10px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.voice-bar-card:focus-within {
  border-color: rgba(0, 113, 227, 0.35);
  box-shadow: 0 4px 20px rgba(0, 113, 227, 0.09);
}

.voice-bar-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.voice-input {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  padding: 8px 0 6px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}

.voice-input::placeholder {
  color: var(--ink-tertiary);
}

.voice-input:focus {
  outline: none;
}

.voice-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
}

.mic-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  transition: transform 0.14s ease, background 0.18s ease;
}

.mic-circle:active {
  transform: scale(0.92);
}

.mic-circle.recording {
  background: var(--coral);
  animation: micPulse 1.3s infinite;
}

@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.send-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.send-circle:active {
  transform: scale(0.92);
}

.voice-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px 8px;
  font-size: 11.5px;
  color: var(--ink-secondary);
  flex-wrap: wrap;
}

.sample-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sample-link {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--blue);
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  transition: opacity 0.15s;
}

.sample-link:hover {
  opacity: 0.8;
}

/* 智慧拆解預覽卡片 */
.draft-card {
  background: var(--surface);
  border: 1px solid rgba(48, 176, 91, 0.32);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(48, 176, 91, 0.08);
}

.draft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.draft-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.draft-row {
  padding: 10px 0;
  border-top: 0.5px solid var(--hairline);
}

.draft-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.draft-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.mini-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--ink-secondary);
}

.mini-tag.blue { background: var(--blue-soft); color: var(--blue); }
.mini-tag.green { background: var(--green-soft); color: #1E7E34; }
.mini-tag.purple { background: var(--purple-soft); color: var(--purple); }
.mini-tag.amber { background: var(--amber-soft); color: var(--amber); }

/* 乾淨列表項（Timeline / 名單 / 明細通用） */
.list-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 14px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 0.5px solid var(--hairline);
  transition: background 0.12s ease;
}

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

.list-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1;
}

.avatar-code {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--surface-muted);
  color: var(--ink);
}

.list-text {
  min-width: 0;
  flex: 1;
}

.list-primary {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-secondary {
  font-size: 12px;
  color: var(--ink-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pts-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.ghost-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-tertiary);
  transition: background 0.14s, color 0.14s;
}

.ghost-icon-btn:hover {
  background: var(--coral-soft);
  color: var(--coral);
}

/* 通用 Apple 風格按鈕 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: 13px;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.12s ease, opacity 0.14s ease, background 0.14s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-full {
  width: 100%;
}

.btn-dark {
  background: var(--ink);
  color: #FFFFFF;
}

.btn-blue {
  background: var(--blue);
  color: #FFFFFF;
}

.btn-soft {
  background: var(--surface-muted);
  color: var(--ink);
}

.btn-danger-text {
  background: var(--coral-soft);
  color: var(--coral);
}

.btn-xs {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
}

/* ==========================================================================
   分頁 2：百分卡（週一～週日柱狀圖 ＋ 極簡 6 階正字清單）
   ========================================================================== */
.week-hero-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.big-score {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.big-score small {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-tertiary);
  margin-left: 2px;
}

.bar-chart-7 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
  height: 108px;
  padding-top: 16px;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 10px;
  transition: background 0.14s;
}

.bar-col.selected {
  background: var(--surface-muted);
}

.bar-val {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  height: 14px;
}

.bar-track {
  width: 18px;
  height: 58px;
  background: var(--surface-muted);
  border-radius: 999px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  border-radius: 999px;
  background: #B8C4D4;
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-fill.hit {
  background: var(--green-ring);
}

.bar-fill.selected-fill {
  background: var(--blue);
}

.bar-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.tally-stage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--hairline);
}

.tally-stage-row:last-child {
  border-bottom: none;
}

.tally-glyphs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.stat-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-mini {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  box-shadow: var(--shadow-card);
}

.stat-mini-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.stat-mini-val {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
  color: var(--ink);
}

.stat-mini-sub {
  font-size: 11px;
  color: var(--ink-tertiary);
  margin-top: 2px;
}

/* ==========================================================================
   分頁 3：iOS 原生風格四色工作日誌（橫向星期列 ＋ 垂直時間軸）
   ========================================================================== */
.day-strip-7 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 8px 6px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
}

.day-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 2px;
  border-radius: 12px;
  transition: background 0.14s ease;
}

.day-chip .d-wk {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.day-chip .d-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.day-chip.active .d-num {
  background: var(--ink);
  color: #FFFFFF;
}

.day-dots {
  display: flex;
  gap: 2.5px;
  height: 5px;
  align-items: center;
}

.day-dots i {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  display: block;
}

.inline-note-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inline-note-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-note-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  white-space: nowrap;
  min-width: 56px;
}

.inline-note-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--ink);
  padding: 2px 0;
}

.inline-note-input:focus {
  outline: none;
}

.inline-note-input::placeholder {
  color: var(--ink-tertiary);
}

.timeline-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.hour-slot {
  display: flex;
  align-items: stretch;
  min-height: 48px;
  border-bottom: 0.5px solid var(--hairline);
  cursor: pointer;
  transition: background 0.12s;
}

.hour-slot:last-child {
  border-bottom: none;
}

.hour-slot:hover {
  background: #FAFAFC;
}

.hour-label {
  width: 56px;
  padding: 13px 10px 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-tertiary);
  flex-shrink: 0;
}

.hour-events {
  flex: 1;
  padding: 7px 12px 7px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.event-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  border-left: 3.5px solid currentColor;
  font-size: 13.5px;
  font-weight: 600;
}

.event-pill.tentative {
  border: 1.2px dashed currentColor;
  border-left-width: 3.5px;
  opacity: 0.85;
}

/* ==========================================================================
   分頁 4：百人名單搜尋列
   ========================================================================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(118, 118, 128, 0.11);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 10px;
  color: var(--ink-secondary);
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14.5px;
  color: var(--ink);
}

.search-bar input:focus {
  outline: none;
}

.search-bar input::placeholder {
  color: var(--ink-secondary);
}

/* ==========================================================================
   分頁 5：M.E.A 漏斗與金錢需求手風琴
   ========================================================================== */
.progress-bar-slim {
  height: 6px;
  background: var(--surface-muted);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-slim > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-bar-slim > span.green {
  background: var(--green-ring);
}

.funnel-row {
  padding: 11px 16px;
  border-bottom: 0.5px solid var(--hairline);
}

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

.funnel-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
}

.accordion-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
  overflow: hidden;
}

.accordion-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.accordion-body {
  padding: 0 16px 12px;
  border-top: 0.5px solid var(--hairline);
}

.budget-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 0.5px solid var(--hairline);
  font-size: 13.5px;
}

.budget-line:last-child {
  border-bottom: none;
}

.budget-input {
  width: 112px;
  text-align: right;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid var(--hairline-strong);
  background: var(--app-bg);
  font-size: 14px;
  font-weight: 600;
}

.budget-input:focus {
  outline: none;
  border-color: var(--blue);
  background: #FFFFFF;
}

/* ==========================================================================
   底部固定 iOS 毛玻璃 5 鍵 Tab Bar
   ========================================================================== */
.tab-bar {
  position: sticky;
  bottom: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 7px 6px calc(9px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-top: 0.5px solid var(--hairline);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 0;
  color: var(--ink-tertiary);
  font-size: 10.5px;
  font-weight: 600;
  transition: color 0.14s ease;
}

.tab-item svg.ico {
  width: 21px;
  height: 21px;
}

.tab-item.active {
  color: var(--blue);
}

/* ==========================================================================
   統一 iOS Bottom Sheet（底部滑出抽屜）
   ========================================================================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet-panel {
  width: 100%;
  max-width: 430px;
  max-height: 88dvh;
  background: var(--app-bg);
  border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  transform: translateY(24px);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.16);
}

.sheet-backdrop.open .sheet-panel {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4.5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  margin: 0 auto 14px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sheet-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.field-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 5px;
}

.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 0.5px solid var(--hairline-strong);
  background: var(--surface);
  font-size: 14.5px;
  color: var(--ink);
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
}

/* iOS Toggle Switch */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 27px;
  flex-shrink: 0;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-slider {
  position: absolute;
  inset: 0;
  background: #D1D1D6;
  border-radius: 999px;
  transition: background 0.2s;
  cursor: pointer;
}

.ios-slider::before {
  content: "";
  position: absolute;
  width: 23px;
  height: 23px;
  left: 2px;
  top: 2px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.ios-switch input:checked + .ios-slider {
  background: var(--green-ring);
}

.ios-switch input:checked + .ios-slider::before {
  transform: translateX(19px);
}

/* 完整矩陣表格（於彈窗或列印檢視） */
.matrix-wrap {
  overflow-x: auto;
  background: var(--surface);
  border-radius: 14px;
  border: 0.5px solid var(--hairline);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.matrix-table th, .matrix-table td {
  padding: 7px 6px;
  text-align: center;
  border-bottom: 0.5px solid var(--hairline);
  border-right: 0.5px solid var(--hairline);
  white-space: nowrap;
}

.matrix-table th {
  background: var(--app-bg);
  font-weight: 700;
  color: var(--ink-secondary);
}

/* 動態島風格極簡浮動 Toast */
.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -14px);
  z-index: 120;
  background: rgba(29, 29, 31, 0.94);
  backdrop-filter: blur(16px);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  max-width: 390px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 空狀態 */
.empty-box {
  text-align: center;
  padding: 36px 20px;
  color: var(--ink-secondary);
}

.empty-box svg.ico {
  width: 30px;
  height: 30px;
  color: var(--ink-tertiary);
  margin-bottom: 8px;
}

/* 專屬 A4 百分卡 PDF 向量列印版面 */
.pdf-print-sheet {
  display: none;
}

@page {
  size: A4 landscape;
  margin: 10mm 11mm;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  html, body {
    background: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #1D1D1F !important;
    font-size: 11px !important;
  }
  .app-stage, .sheet-backdrop, .toast, .no-print {
    display: none !important;
  }
  .pdf-print-sheet {
    display: block !important;
    width: 100%;
    background: #FFFFFF;
  }
  .pdf-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    border-bottom: 2px solid #1D1D1F;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }
  .pdf-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #1D1D1F;
  }
  .pdf-sub {
    font-size: 11px;
    color: #55555A;
    margin-top: 2px;
  }
  .pdf-score-badge {
    background: #1D1D1F;
    color: #FFFFFF;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }
  .pdf-sec-title {
    font-size: 12px;
    font-weight: 800;
    color: #1D1D1F;
    margin: 10px 0 5px;
    letter-spacing: 0.03em;
  }
  .pdf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    margin-bottom: 10px;
  }
  .pdf-table th, .pdf-table td {
    border: 0.75px solid #C7C7CC;
    padding: 5px 4px;
    text-align: center;
    vertical-align: middle;
  }
  .pdf-table th {
    background: #F2F2F7;
    font-weight: 700;
    color: #1D1D1F;
  }
  .pdf-table td.p-col {
    background: #F2F7FE;
    font-weight: 700;
  }
  .pdf-table td.left, .pdf-table th.left {
    text-align: left;
    padding-left: 7px;
  }
  .pdf-table tr.pdf-total-row td {
    background: #FAF7EE;
    font-weight: 800;
    font-size: 11px;
  }
  .pdf-summary-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 8px 0 12px;
  }
  .pdf-summary-strip.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .pdf-stat-box {
    border: 0.75px solid #D1D1D6;
    border-radius: 8px;
    padding: 6px 8px;
    background: #FAFAFC;
  }
  .pdf-stat-lbl {
    font-size: 9.5px;
    color: #6E6E73;
    font-weight: 600;
  }
  .pdf-stat-val {
    font-size: 13px;
    font-weight: 800;
    color: #1D1D1F;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
  }
  .pdf-footer {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 9.5px;
    color: #86868B;
  }
}

/* ==========================================================================
   VOXA 語記 商用多租戶版專屬樣式（登入門戶 / 訂閱徽章 / 到期橫幅 / Android 快記）
   ========================================================================== */
.auth-gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: var(--desktop-bg);
}

.auth-gate[hidden],
.app-stage[hidden],
.qv-overlay[hidden],
.expired-banner[hidden] {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 410px;
  background: var(--surface);
  border-radius: 28px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow-shell);
}

.auth-brand {
  text-align: center;
  margin-bottom: 18px;
}

.auth-logo {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  margin-bottom: 10px;
}

.auth-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-tertiary);
}

.auth-title {
  margin: 4px 0 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.auth-sub {
  margin: 0;
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.auth-form {
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  padding-left: 2px;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--app-bg);
  color: var(--ink);
  font-size: 14.5px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
  color: var(--ink-tertiary);
}

.form-input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

.seg-btn:focus:not(:focus-visible) {
  outline: none;
}

.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 2px 14px;
}

.auth-remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-secondary);
  cursor: pointer;
  user-select: none;
}

.auth-forgot-btn {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  white-space: nowrap;
}

.auth-forgot-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-remember-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--ink);
  cursor: pointer;
  margin: 0;
}

.auth-switch-hint {
  margin-top: 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.auth-switch-btn {
  color: var(--blue);
  font-weight: 700;
  font-size: 12.5px;
  margin-left: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-error {
  background: var(--coral-soft);
  color: var(--coral);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.auth-perks {
  background: var(--app-bg);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

.auth-perk-item strong {
  color: var(--ink);
  margin-right: 4px;
}

.auth-pricing-hint {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-tertiary);
  margin-bottom: 10px;
}

.auth-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-tertiary);
}

.text-link-btn {
  color: var(--ink-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 11.5px;
}

/* 頂部精巧訂閱狀態膠囊 */
.sub-badge-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.sub-badge-pill.paid {
  background: var(--green-soft);
  color: #1E7E34;
}

.sub-badge-pill.expired {
  background: var(--coral-soft);
  color: var(--coral);
}

/* 到期唯讀橫幅 */
.expired-banner {
  margin: 10px 16px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #FFF2F0;
  border: 1px solid rgba(255, 59, 48, 0.22);
  color: #B42318;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Android 一鍵語音直達全螢幕覆蓋層 */
.qv-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(245, 245, 247, 0.96);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.qv-panel {
  width: 100%;
  max-width: 400px;
  min-height: 520px;
  background: var(--surface);
  border-radius: 30px;
  padding: 20px 22px 24px;
  box-shadow: var(--shadow-shell);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.qv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qv-center {
  text-align: center;
  padding: 20px 0;
}

.qv-mic-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--ink);
  color: #FFFFFF;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  transition: transform 0.15s ease, background 0.15s ease;
  margin-bottom: 18px;
}

.qv-mic-btn.recording {
  background: var(--coral);
  box-shadow: 0 0 0 14px rgba(255, 59, 48, 0.14), 0 12px 28px rgba(255, 59, 48, 0.25);
}

.qv-status {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.qv-transcript {
  min-height: 44px;
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.5;
  padding: 0 6px;
}

.qv-result {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1E7E34;
  line-height: 1.55;
}
