:root {
  /* 預設主題：與 panda.emchina.com.hk 一致。
     主色與輔色以 RGB 分量宣告，衍生色（光暈、淡底、深色）由此推導，
     因此切換主題只需覆寫這四個分量，不必逐一維護數十個色票。 */
  --primary-rgb: 26 77 122;
  --primary-dk-rgb: 16 58 94;
  --accent-rgb: 0 180 166;
  --accent-dk-rgb: 0 143 132;

  --c-primary: rgb(var(--primary-rgb));
  --c-primary-dk: rgb(var(--primary-dk-rgb));
  --c-accent: rgb(var(--accent-rgb));
  --c-accent-dk: rgb(var(--accent-dk-rgb));

  /* 由主色／輔色推導的衍生色 */
  --c-accent-soft: rgb(var(--accent-rgb) / 0.12);
  --c-accent-glow: rgb(var(--accent-rgb) / 0.15);
  --c-accent-shadow: rgb(var(--accent-rgb) / 0.4);
  --c-primary-soft: rgb(var(--primary-rgb) / 0.1);

  --c-bg: #f0f4f8;
  --c-card: #ffffff;
  --c-text: #2c3e50;
  --c-text-light: #6b7d8f;
  --c-border: #e1e8ed;
  --c-border-dk: #c8d3dc;
  --c-success: #27ae60;
  --c-warning: #e67e22;
  --c-danger: #c0392b;
  --c-whatsapp: #25d366;
  --c-whatsapp-dk: #128c7e;
  --shadow: 0 2px 12px rgb(var(--primary-dk-rgb) / 0.1);
  --shadow-lg: 0 8px 30px rgb(var(--primary-dk-rgb) / 0.14);
  --transition: 0.2s ease;

  /* 沿用舊變數名，映射到新配色，讓既有樣式規則不必全部重寫 */
  --bg: var(--c-bg);
  --bg-raised: var(--c-card);
  --bg-sunken: rgb(var(--primary-rgb) / 0.07);
  --panel: rgb(var(--primary-rgb) / 0.03);
  --line: var(--c-border);
  --line-strong: var(--c-border-dk);
  --ink: var(--c-text);
  --ink-muted: var(--c-text-light);
  --ink-faint: #9aa9b6;
  --gold: var(--c-primary);
  --gold-dim: var(--c-accent);
  --teal: var(--c-accent);
  --rose: #d9646f;
  --violet: #7b6fd0;
  --green: var(--c-success);
  --red: var(--c-danger);
  --radius: 10px;
  --radius-sm: 6px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "PingFang TC", "Microsoft JhengHei", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0;
  min-height: 100vh;
  /* 直向 flex 讓頁尾在內容不足時仍貼齊視窗底部 */
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ------------------------------------------------------------------ chrome */

.topbar {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dk) 100%);
  color: #fff;
  box-shadow: var(--shadow);
  width: 100%;
  flex: 0 0 auto;
}

/* header 內容置中，與內文同寬 */
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 24px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 1px;
}

.brand-mark {
  line-height: 1;
  display: inline-flex;
  align-items: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  flex: 0 0 auto;
}

.brand-mark svg, .brand-mark img { display: block; width: 38px; height: 38px; border-radius: 6px; object-fit: contain; }

.brand-text { display: flex; flex-direction: column; }
.brand-sub {
  color: rgba(255,255,255,0.82);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0;
  margin-top: 2px;
}

/* 導覽列另起一行，滿版底色 */
.nav-bar {
  background: rgba(0,0,0,0.14);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.nav a {
  padding: 11px 16px;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.nav a:hover { background: rgba(255,255,255,0.09); color: #fff; }
.nav a.active { color: #fff; border-bottom-color: var(--c-accent); background: rgba(255,255,255,0.06); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

/* ------------------------------------------------------ 配色選擇器（純色塊） */

.theme-picker { position: relative; display: flex; align-items: center; }

.theme-btn {
  display: flex;
  align-items: center;
  padding: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  line-height: 0;
}

.theme-btn:hover { background: rgba(255, 255, 255, 0.22); }

.theme-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.55);
}

/* 兩個色塊並列，中間不留縫，讀起來像一張配色卡 */
.swatch-pair {
  display: flex;
  border-radius: 3px;
  overflow: hidden;
  flex: 0 0 auto;
}

.swatch {
  display: block;
  width: 15px;
  height: 22px;
}

.theme-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  padding: 10px;
  background: var(--c-card);
  border: 1px solid var(--c-border-dk);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  max-width: calc(100vw - 24px);
}

.theme-panel[hidden] { display: none; }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 8px;
}

.theme-option {
  padding: 3px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition);
  line-height: 0;
}

.theme-option:hover { border-color: var(--c-border-dk); }
.theme-option.active { border-color: var(--c-text); }

.theme-option .swatch {
  width: 22px;
  height: 30px;
}

/* 真站的三步流程橫幅 */
.flow-banner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}

.flow-step {
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  white-space: nowrap;
}

.flow-step-active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
  font-weight: 600;
}

.flow-arrow { color: rgba(255,255,255,0.55); }

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  color: var(--ink-muted);
  white-space: nowrap;
}

.mode-pill {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
  backdrop-filter: blur(4px);
}

.mode-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.7); }
.mode-pill.live { border-color: rgba(255,255,255,0.25); color: #fff; }
.mode-pill.live .dot { background: var(--green); }
.mode-pill.demo { border-color: rgba(255,255,255,0.28); color: #fff; }
.mode-pill.demo .dot { background: #ffd479; }
.mode-pill.warn { border-color: rgba(255,255,255,0.3); color: #fff; }
.mode-pill.warn .dot { background: #ff8f8f; }
a.mode-pill { transition: border-color 0.14s, background 0.14s; }
a.mode-pill:hover { background: rgba(255,255,255,0.24); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.14s;
}

.icon-btn { color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.22); }
.icon-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* 單欄堆疊：搜尋卡與結果卡上下排列，不分左右兩欄 */
.layout {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.layout > * { min-width: 0; }

/* ------------------------------------------------------------------- 頁尾 */

.sitefoot {
  border-top: 1px solid var(--c-border);
  background: var(--c-card);
  padding: 20px 24px 24px;
  margin-top: auto;
  /* body 是直向 flex，子元素預設不撐滿寬度，需明確指定 */
  width: 100%;
}

.sitefoot-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text-light);
}

.sitefoot-name {
  font-weight: 600;
  letter-spacing: 0;
  color: var(--c-primary);
}

.sitefoot-brand {
  font-weight: 600;
  letter-spacing: 0;
  color: var(--c-primary);
}

.sitefoot-sep { color: var(--c-border-dk); }

/* 技術標記比公司名低調一階 */
.sitefoot-tech { color: var(--ink-faint); font-size: 12px; }

/* 卡片：白底、圓角、陰影，與真站一致 */
.card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 標題左側的青綠色短豎線 */
.card-title::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--c-accent);
  border-radius: 2px;
  flex: 0 0 auto;
}

/* 搜尋表單攤成全寬多欄 */
.search-form { display: flex; flex-direction: column; gap: 16px; }

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.form-group {
  flex: 1;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group-full { flex-basis: 100%; }

.form-group > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="search"],
.form-group input[type="email"],
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--c-text);
  background: #fff;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-glow);
}

/* select 固定高度 36px：上下內邊距歸零使文字垂直置中（否則擠壓會偏下），
   右側保留下拉箭頭空間 */
.form-group select {
  padding: 0 28px 0 14px;
}

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

/* 熱門路線膠囊 */
.popular-routes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.popular-label {
  font-size: 13px;
  color: var(--c-text-light);
  font-weight: 600;
  white-space: nowrap;
}

.route-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.route-chip {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-primary);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.route-chip:hover {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

/* 艙等膠囊（真站的 check-pill） */
.checkbox-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* 緊湊表單：機場⇄機場＋日期＋彈性＋轉機同一行，窄屏自動換行 */
.compact-row { align-items: flex-end; gap: 8px; }
.compact-row .form-group { min-width: 130px; flex: 1 1 150px; }
.compact-row .combo { flex: 2 1 180px; }

.swap-btn {
  flex: 0 0 auto;
  align-self: flex-end;
  height: 36px;
  width: 38px;
  border: 1px solid var(--line-strong);
  background: var(--bg-sunken);
  color: var(--c-primary);
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
}
.swap-btn:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* 交換動畫：奇數次向右（順時針）、偶數次向左（逆時針），各 180° */
.swap-btn.swap-spin { animation: swap-rotate 0.45s ease; }
.swap-btn.swap-spin-reverse { animation: swap-rotate-reverse 0.45s ease; }
@keyframes swap-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(180deg); }
}
@keyframes swap-rotate-reverse {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-180deg); }
}
@media (prefers-reduced-motion: reduce) {
  .swap-btn.swap-spin, .swap-btn.swap-spin-reverse { animation: none; }
}

/* 里程計畫：抬頭列（標題＋快捷鈕） */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.section-controls { display: flex; gap: 8px; flex-wrap: wrap; }

/* 折疊的計畫分組清單（為捲動容器） */
.program-groups {
  margin-top: 10px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--bg-sunken);
}
.program-group { margin-bottom: 12px; }
.program-group:last-child { margin-bottom: 0; }
.program-group-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.program-group .checkbox-row { gap: 6px; }
.program-group .check-pill {
  padding: 5px 12px;
  font-size: 12.5px;
}

/* 聯盟快捷鈕三態：全選主題色／部份選中灰色／全不選空白 */
.section-controls .btn-mini.qs-all {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.section-controls .btn-mini.qs-some {
  background: var(--ink-muted);
  border-color: var(--ink-muted);
  color: #fff;
}
.search-submit { width: 100%; font-size: 15px; }

.check-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 2px solid var(--c-accent);
  border-radius: 25px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 600;
  user-select: none;
  background: #fff;
  color: var(--c-text);
}

.check-pill input { display: none; }
.check-pill:has(input:checked) { background: var(--c-accent); color: #fff; }
.check-pill:hover { opacity: 0.88; }

/* 里程計劃格狀多選 */
.program-grid-select {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: #fafcfe;
}

/* 類別選擇器 .program-grid-select 會覆寫瀏海預設的 [hidden]{display:none}，
   因此收合時必須顯式宣告，否則清單永遠顯示、按鈕看似無效 */
.program-grid-select[hidden] { display: none; }

.program-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1.5px solid var(--c-border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 12.5px;
  user-select: none;
  background: #fff;
  color: var(--c-text);
}

.program-pill input {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--c-accent);
  flex-shrink: 0;
}

.program-pill:has(input:checked) { background: var(--c-accent-soft); border-color: var(--c-accent); }
.program-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.alliance-group-label {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 4px;
}

.alliance-group-label:first-child { padding-top: 0; }

/* 小按鈕（全選／清除） */
.btn-mini {
  padding: 4px 12px;
  background: var(--c-bg);
  border: 1px solid var(--c-border-dk);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--c-text);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-mini:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

.select-all-row { display: flex; gap: 6px; }

/* ------------------------------------------------- 航空公司下拉多選（照真站） */

.form-group-airline-dd { flex: 1; min-width: 250px; }

.airline-dropdown-wrap { position: relative; }

.airline-dd-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: var(--c-text);
  text-align: left;
  transition: var(--transition);
}

.airline-dd-btn:hover { border-color: var(--c-border-dk); }

.airline-dd-btn[aria-expanded="true"] {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-glow);
}

.airline-dd-btn > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dd-arrow {
  font-size: 10px;
  color: var(--c-text-light);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.airline-dd-btn[aria-expanded="true"] .dd-arrow { transform: rotate(180deg); }

.airline-dd-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--c-card);
  border: 1.5px solid var(--c-border-dk);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.airline-dd-panel[hidden] { display: none; }

.airline-dd-search { padding: 8px; border-bottom: 1px solid var(--c-border); }

.airline-dd-search input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--c-text);
}

.airline-dd-search input:focus {
  outline: none;
  border-color: var(--c-accent);
}

.airline-dd-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px;
  border-bottom: 1px solid var(--c-border);
}

.airline-mode-toggle {
  display: inline-flex;
  border: 1.5px solid var(--c-border-dk);
  border-radius: 6px;
  overflow: hidden;
  margin-right: auto;
}

.btn-mode {
  padding: 4px 12px;
  background: #fff;
  border: none;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--c-text-light);
  cursor: pointer;
  transition: var(--transition);
}

.btn-mode.active { background: var(--c-primary); color: #fff; }
.btn-mode:not(.active):hover { background: var(--c-bg); }

.airline-dd-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
}

.airline-dd-list .airline-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.airline-dd-list .airline-pill:hover { background: var(--c-bg); }

.airline-dd-list .airline-code {
  font-weight: 700;
  color: var(--c-primary);
  min-width: 30px;
}

.airline-dd-list .airline-name { color: var(--c-text-light); }

.airline-dd-list.mode-exclude .airline-pill:has(input:checked) {
  background: rgba(192, 57, 43, 0.08);
}

.airline-dd-list.mode-exclude .airline-pill:has(input:checked) .airline-code {
  color: var(--c-danger);
}

.airline-dd-empty {
  padding: 14px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--c-text-light);
}

/* 結果卡標頭 */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.results-header .card-title { margin-bottom: 0; }

.results-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-light);
  background: var(--c-bg);
  padding: 4px 12px;
  border-radius: 20px;
}

.results-summary {
  font-size: 13px;
  color: var(--c-text-light);
  margin: 14px 0;
  padding: 10px 14px;
  background: var(--c-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--c-accent);
}

.filter-title { font-size: 13px; font-weight: 600; color: var(--c-text-light); }

/* ------------------------------------------------------------------- forms */

.field { margin-bottom: 14px; }

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

input[type="text"], input[type="date"], input[type="number"], input[type="password"],
input[type="tel"], input[type="search"], input[type="email"], select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.14s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold-dim);
}

input::placeholder { color: #5b6478; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2398a1b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.hint { font-size: 11px; color: var(--ink-muted); margin-top: 5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s;
  white-space: nowrap;
}

.btn-primary {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-dk) 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--c-accent-shadow);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

/* 搜索按鈕加載態：旋轉圖標 */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

.btn-whatsapp {
  background: var(--c-whatsapp);
  color: #fff;
}

.btn-whatsapp:hover { background: var(--c-whatsapp-dk); }

/* 微信渠道用品牌綠；電郵用沉穩藍 */
.btn-wechat {
  background: #07c160;
  color: #fff;
}

.btn-wechat:hover { background: #06ad56; }

.btn-email {
  background: #2f6fb0;
  color: #fff;
}

.btn-email:hover { background: #275c93; }

/* LINE：品牌綠；Telegram：品牌藍；其它：中性灰 */
.btn-line { background: #06c755; color: #fff; }
.btn-line:hover { background: #05a849; }
.btn-telegram { background: #229ed9; color: #fff; }
.btn-telegram:hover { background: #1b86b9; }
.btn-other { background: #6b7280; color: #fff; }
.btn-other:hover { background: #565c66; }

.btn-ghost {
  background: #fff;
  border: 1.5px solid var(--c-border-dk);
  color: var(--c-text);
  height: 34px;
  padding: 0 14px;
}

.btn-ghost:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* segmented + checkable controls */

.check-grid { display: grid; gap: 5px; }
.check-grid.two { grid-template-columns: 1fr 1fr; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 12.5px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.14s;
  user-select: none;
}

.check:hover { background: #f2f7fb; }
.check input { accent-color: var(--gold); width: 14px; height: 14px; cursor: pointer; flex: 0 0 auto; }
.check input:checked ~ span { color: var(--ink); font-weight: 600; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
}

.switch { position: relative; width: 38px; height: 21px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  position: absolute; inset: 0;
  background: #363e54; border-radius: 999px;
  transition: background 0.16s; pointer-events: none;
}
.switch-track::after {
  content: ""; position: absolute;
  top: 3px; left: 3px; width: 15px; height: 15px;
  background: #fff; border-radius: 50%;
  transition: transform 0.16s;
}
.switch input:checked + .switch-track { background: var(--gold-dim); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }

.sidebar-section {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.link-btn {
  background: none; border: none; padding: 0;
  color: var(--gold); font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}

.link-btn:hover { text-decoration: underline; }

.program-scroll { max-height: 232px; overflow-y: auto; padding-right: 2px; }

.alliance-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0;
  margin: 9px 0 3px;
  padding-left: 2px;
}

.alliance-label:first-child { margin-top: 0; }

/* ----------------------------------------------------------------- results */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-title { font-size: 19px; font-weight: 700; }
.page-sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }

.route-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; }
.route-arrow { color: var(--gold); display: inline-flex; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 14px;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--ink-muted);
}

.notice.warn { border-color: #f3d7ae; background: #fdf6ec; color: #8a5a1a; }
.notice.error { border-color: rgba(255,71,87,0.3); background: rgba(255,71,87,0.07); color: #ffa9b2; }
.notice svg { flex: 0 0 auto; margin-top: 1px; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.stat {
  background: var(--bg-raised);
  padding: 11px 14px;
}

.stat-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 3px;
}

.stat-value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-value.gold { color: var(--gold); }
.stat-note { font-size: 11px; color: var(--ink-muted); }

/* date rail */

.rail-wrap { margin-bottom: 16px; }

.rail {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.rail-day {
  flex: 0 0 auto;
  width: 84px;
  padding: 8px 6px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.14s;
}

.rail-day:hover { border-color: var(--line-strong); background: var(--panel); }
.rail-day.best { border-color: var(--c-accent); }
.rail-day.selected { border-color: var(--c-primary); background: var(--c-accent-soft); }
.rail-date { font-size: 11px; color: var(--ink-muted); margin-bottom: 3px; }
.rail-miles { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rail-day.best .rail-miles { color: var(--gold); }
.rail-count { font-size: 10px; color: var(--ink-muted); }

/* result rows */

.results { display: flex; flex-direction: column; gap: 7px; }

.result {
  display: grid;
  grid-template-columns: 128px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.14s;
}

.result:hover { border-color: var(--line-strong); }

.result-date { min-width: 0; }
.result-date-main { font-size: 13px; font-weight: 600; }
.result-program { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

.alliance-chip {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.alliance-chip.star { background: var(--gold); }
.alliance-chip.oneworld { background: var(--teal); }
.alliance-chip.skyteam { background: var(--violet); }
.alliance-chip.other { background: var(--rose); }

.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 6px;
  min-width: 0;
}

.offer {
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-sunken);
  min-width: 0;
}

.offer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.offer-cabin { font-size: 10.5px; font-weight: 700; color: var(--ink-muted); }
.offer-miles { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.offer-meta { font-size: 10.5px; color: var(--ink-muted); display: flex; gap: 6px; flex-wrap: wrap; }

.offer.economy { border-left: 2px solid var(--teal); }
.offer.premium { border-left: 2px solid var(--violet); }
.offer.business { border-left: 2px solid var(--gold); }
.offer.first { border-left: 2px solid var(--rose); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: #eef3f7;
  color: var(--c-text-light);
}

.tag.direct { background: rgba(46,213,115,0.14); color: var(--green); }
.tag.seats { background: var(--c-primary-soft); color: var(--c-primary); }

.result-action { display: flex; align-items: center; }

/* empty + loading states */

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--ink-muted);
}

.empty-icon { font-size: 34px; margin-bottom: 10px; opacity: 0.75; line-height: 1; }
.empty-icon svg { display: inline-block; width: 46px; height: 46px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.empty-text { font-size: 13px; max-width: 380px; margin: 0 auto; }

/* ------------------------------------------------------------ trip details */

.trip {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 9px;
  overflow: hidden;
}

.trip-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.trip-price { min-width: 92px; }
.trip-miles { font-size: 17px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.trip-taxes { font-size: 11px; color: var(--ink-muted); }

.trip-timing {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.clock { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock-sub { font-size: 10.5px; color: var(--ink-muted); }

.duration-line {
  flex: 1;
  min-width: 78px;
  text-align: center;
  position: relative;
}

.duration-text { font-size: 11px; color: var(--ink-muted); }

.duration-bar {
  height: 1px;
  background: var(--line-strong);
  margin: 4px 0;
  position: relative;
}

.duration-bar::before,
.duration-bar::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink-muted);
}

.duration-bar::before { left: 0; }
.duration-bar::after { right: 0; }

.trip-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.segments { padding: 4px 14px 12px; }

.segment {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}

.segment:last-child { border-bottom: none; }
.segment-flight { font-weight: 700; font-variant-numeric: tabular-nums; }
.segment-aircraft { font-size: 10.5px; color: var(--ink-muted); }
.segment-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.segment-port { font-variant-numeric: tabular-nums; }
.segment-city { font-size: 10.5px; color: var(--ink-muted); }

.layover {
  font-size: 11px;
  color: var(--gold);
  padding: 5px 0 5px 84px;
  border-bottom: 1px dashed var(--line);
}

/* ---------------------------------------------------------------- data table */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
}

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

thead th {
  text-align: left;
  padding: 9px 12px;
  background: var(--panel);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel); }

.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.gold { color: var(--gold); }
.muted { color: var(--ink-muted); }
.strong { font-weight: 700; }

/* program cards */

.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 8px;
}

.program-card {
  padding: 13px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.14s;
}

.program-card:hover { border-color: var(--line-strong); }
.program-name { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.program-src { font-size: 11px; color: var(--ink-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.program-cabins { display: flex; gap: 4px; margin-top: 9px; flex-wrap: wrap; }

.cabin-dot {
  width: 22px; height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid var(--line-strong);
  color: var(--ink-muted);
}

.cabin-dot.on.Y { background: rgba(63,185,165,0.18); color: var(--teal); border-color: transparent; }
.cabin-dot.on.W { background: rgba(139,124,240,0.18); color: var(--violet); border-color: transparent; }
.cabin-dot.on.J { background: var(--c-primary-soft); color: var(--c-primary); border-color: transparent; }
.cabin-dot.on.F { background: rgba(226,85,123,0.18); color: var(--rose); border-color: transparent; }

.program-flags { display: flex; gap: 10px; margin-top: 9px; font-size: 10.5px; color: var(--ink-muted); }
.flag-yes { color: var(--green); }
.flag-no { color: var(--ink-faint); }

/* ------------------------------------------------------------- suggestions */

.combo { position: relative; }

.suggest {
  position: absolute;
  top: calc(100% + 3px);
  left: 0; right: 0;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  z-index: 60;
  max-height: 232px;
  overflow-y: auto;
  display: none;
  box-shadow: var(--shadow-lg);
}

.suggest.open { display: block; }

.suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12.5px;
}

.suggest-item:hover, .suggest-item.active { background: var(--c-accent-soft); }
.suggest-icon { flex: 0 0 auto; }
.suggest-code {
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  min-width: 38px;
}
.suggest-name { color: var(--ink); flex: 1 1 auto; }
.suggest-tag {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--c-accent-soft);
  color: var(--c-primary);
}
.suggest-empty { color: var(--ink-muted); justify-content: center; cursor: default; }

.chip-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }

.chip {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-muted);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s;
}

.chip:hover { border-color: var(--gold-dim); color: var(--gold); }

/* ---------------------------------------------------------- account quota */

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}

.account-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 13px 14px;
}

.account-card.active { border-color: rgba(46,213,115,0.4); }
.account-card.exhausted { border-color: #f0cf9a; }
.account-card.disabled { border-color: rgba(255,71,87,0.32); }

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.account-id { display: flex; align-items: baseline; gap: 7px; min-width: 0; }

.account-index {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
  flex: 0 0 auto;
}

.account-label {
  font-size: 13px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-status {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid var(--line-strong);
  color: var(--ink-muted);
  white-space: nowrap;
}

.account-status.active { border-color: rgba(46,213,115,0.4); color: var(--green); }
.account-status.exhausted { border-color: #f0cf9a; color: var(--c-warning); }
.account-status.disabled { border-color: rgba(255,71,87,0.35); color: var(--red); }

.account-kind { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }

.quota-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-sunken);
  overflow: hidden;
  margin: 11px 0 8px;
}

.quota-fill { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.quota-fill.active { background: var(--green); }
.quota-fill.exhausted { background: var(--gold); }
.quota-fill.disabled { background: var(--red); }

.account-numbers {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12.5px;
}

.account-left { margin-left: auto; color: var(--gold); font-weight: 600; white-space: nowrap; }

.account-notes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--ink-muted);
}

.account-warn { color: #e8d49a; }

/* 後台密鑰明細表 */
.keys-detail-table .quota-bar { width: 150px; }
.key-numbers { font-size: 12px; color: var(--ink-muted); }
.key-numbers b { color: var(--ink); }
.key-warn { font-size: 11px; color: var(--gold-dim); margin-top: 5px; line-height: 1.4; }
.key-meta { font-size: 11.5px; line-height: 1.6; }
.key-kind { font-size: 11px; margin-top: 3px; }

.rotation-card {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-sunken);
  padding: 14px 18px;
}

.rotation-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 13px 16px;
}

.rotation-title { font-size: 12.5px; font-weight: 700; margin-bottom: 7px; }

.rotation-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--ink-muted);
}

.rotation-list li { margin-bottom: 3px; }

/* ------------------------------------------------------------- 購物車 */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
}

.cart-link:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.cart-link.active { border-color: var(--c-accent); background: rgba(255, 255, 255, 0.12); color: #fff; }

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--c-whatsapp);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.cart-badge[hidden] { display: none; }

.offer-cart {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.cart-qty-input {
  width: 42px;
  flex: 0 0 42px;
  height: 28px;
  padding: 0 4px;
  font-size: 12px;
  text-align: center;
}

.btn-add-cart {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 28px;
  padding: 0 6px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--c-accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-add-cart:hover:not(:disabled) { background: var(--c-accent-dk); }
.btn-add-cart:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: var(--bg-sunken);
  color: var(--ink-muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 1200;
  max-width: min(90vw, 420px);
  padding: 11px 18px;
  border-radius: var(--radius);
  background: rgba(30, 41, 59, 0.95);
  color: #fff;
  font-size: 13px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.toast.success { background: var(--c-success); }
.toast.error { background: var(--c-danger); }

/* ------------------------------------------------------------- 購物車頁 */

.cart-sub { font-size: 12.5px; color: var(--ink-muted); margin: -6px 0 14px; }
.cart-loading { padding: 30px 0; text-align: center; color: var(--ink-muted); font-size: 13px; }

.cart-empty-icon { color: var(--ink-muted); opacity: 0.5; }
.cart-empty-icon svg { width: 44px; height: 44px; }
.cart-back { width: auto; margin-top: 16px; padding: 0 22px; }

.cart-list { display: flex; flex-direction: column; gap: 10px; }

.cart-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  padding: 10px 12px;
}

.cart-item-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.cart-item-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  font-size: 11px;
  flex: 0 0 auto;
}

.cart-item-date { font-variant-numeric: tabular-nums; }
.cart-item-route { font-weight: 700; }

.tag.promo { background: rgba(233, 69, 96, 0.12); color: var(--c-danger); }

.btn-remove {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--ink-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 4px;
}
.btn-remove:hover { color: var(--c-danger); }

.cart-item-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.cart-item-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12.5px;
  color: var(--ink);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  white-space: nowrap;
}

.cart-item-qty .cart-qty-input { width: 56px; flex-basis: 56px; height: 32px; }
.qty-max {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--c-accent);
  background: var(--c-accent-soft, rgba(0, 180, 166, 0.14));
  border: 1px solid var(--c-accent);
  white-space: nowrap;
}
.qty-max b { font-size: 14px; line-height: 1; }
.cart-line-price { font-size: 12.5px; color: var(--c-primary); white-space: nowrap; }
.cart-line-price b { font-size: 14px; }

.cart-summary {
  margin-top: 14px;
  margin-left: auto;
  width: min(340px, 100%);
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--c-card-soft, rgba(127, 127, 127, 0.08));
  border: 1px solid var(--line);
  font-size: 13px;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  color: var(--ink-muted);
}
.summary-val {
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--c-accent-soft, rgba(0, 180, 166, 0.14));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.summary-val-total {
  background: var(--c-accent);
  color: #fff;
  font-weight: 700;
}
.cart-summary-row.total {
  color: var(--ink); font-size: 15px; font-weight: 700;
  margin-top: 15px; padding-top: 10px;
  border-top: 1px solid var(--line);
}
.cart-disclaimer { margin-top: 8px; font-size: 11px; line-height: 1.5; color: var(--ink-muted); text-align: right; }

.cart-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.cart-actions .btn-whatsapp,
.cart-actions .btn-wechat,
.cart-actions .btn-email {
  height: 40px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 700;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .result { grid-template-columns: 112px 1fr; }
  .result-action { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 860px) {
  .layout { padding: 18px 14px 40px; gap: 16px; }
  .card { padding: 18px 16px; }
  .topbar-inner { padding: 18px 16px 14px; }
  .nav { padding: 0 16px; }
  .flow-banner { padding: 10px 16px 12px; font-size: 12px; }
  .result { grid-template-columns: 1fr; gap: 10px; }
  .trip-head { grid-template-columns: 1fr; gap: 10px; }
  .trip-meta { justify-content: flex-start; }
  .segment { grid-template-columns: 64px 1fr; }
  .layover { padding-left: 0; }
  .airline-dd-list { max-height: 220px; }
  .airline-dd-controls { gap: 5px; }
  .airline-mode-toggle { margin-right: 0; }
}

@media (max-width: 560px) {
  .brand { font-size: 19px; }
  .brand-mark svg, .brand-mark img { width: 32px; height: 32px; }
  .offer-grid { grid-template-columns: 1fr 1fr; }
  /* header 右側空間不足，購物車只留圖標與角標 */
  .cart-link { padding: 7px 9px; gap: 0; }
  .cart-link-text { display: none; }
  .cart-badge { margin-left: 5px; }
  .form-group { min-width: 100%; }
  /* 窄螢幕縮小色塊，避免 header 右側擠壓 */
  .swatch { width: 13px; height: 19px; }
  .theme-grid { grid-template-columns: repeat(3, auto); }
  .theme-option .swatch { width: 20px; height: 27px; }
  /* 按鈕在窄螢幕靠左，面板改為左對齊才不會往畫面外溢出 */
  .theme-panel { right: auto; left: 0; }
  /* 購物車頁：下單鈕整列堆疊，移除鈕靠右 */
  .cart-actions { flex-direction: column-reverse; align-items: stretch; }
  .cart-actions .btn { width: 100%; height: 42px; }
  .btn-remove { margin-left: 0; width: 100%; text-align: right; }
}

/* ------------------------------------------------------------- 營運後台 */

.admin-login {
  width: 100%;
  max-width: 380px;
  margin: 7vh auto;
  padding: 28px 26px;
  background: var(--bg-raised, #fff);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.admin-login-brand { text-align: center; margin-bottom: 18px; }
.admin-login-brand .brand-mark { justify-content: center; margin-bottom: 8px; }
.admin-login-brand h1 { font-size: 19px; margin: 4px 0; color: var(--ink); }
.admin-login-brand p { font-size: 12px; color: var(--ink-muted); }
.admin-login-form .form-group { margin-bottom: 14px; }
.admin-login-hint { margin-top: 14px; font-size: 11.5px; color: var(--ink-muted); text-align: center; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.admin-module {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.admin-module-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.admin-module-desc { font-size: 12px; color: var(--ink-muted); flex: 1; }
.admin-module .tag { align-self: flex-start; }
.admin-module a.tag { cursor: pointer; text-decoration: none; }

a.admin-module-link { text-decoration: none; color: inherit; transition: var(--transition); }
a.admin-module-link:hover { border-color: var(--c-primary); box-shadow: var(--shadow); }

.admin-form { margin-top: 10px; }
.pricing-section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pricing-section:last-of-type { border-bottom: none; }

.rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px 16px;
  margin-top: 8px;
}
.rate-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.rate-name { flex: 1; min-width: 0; }
.rate-row input { width: 110px; flex: 0 0 110px; height: 32px; }

.tier-row { display: flex; align-items: center; gap: 6px; margin: 8px 0; font-size: 13px; flex-wrap: wrap; }
.tier-row input { width: 100px; height: 32px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table th {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
  text-align: center;
}
.admin-table td { text-align: center; }
.admin-table input[type="number"], .admin-table input[type="text"] { height: 32px; }

/* 狀態標籤：背景框比字大一圈 */
/* 訂單列表：逐航班列出編號、航線、張數、里程 */
.order-flight-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.order-flight-lines li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
}
.order-flight-lines li b { min-width: 64px; }

.status-new,
.status-quoted,
.status-confirmed,
.status-closed {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
.status-new { background: #fff3cd; color: #8a6d00; }
.status-quoted { background: #f1e4ff; color: #6f42c1; }
.status-confirmed { background: #d4edda; color: #1e7e34; }
.status-closed { background: #e9ecef; color: #6c757d; }

/* 訂單中心 */
.order-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.order-tabs .check-pill { cursor: pointer; }
.active-pill { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.table-wrap { overflow-x: auto; }
.order-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0;
  font-size: 13px;
}
.order-meta > div {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  padding: 9px 12px;
}
.customer-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.order-actions { margin: 10px 0 14px; }
.note-form { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.note-form textarea { width: 100%; font-family: inherit; font-size: 13px; padding: 9px 10px; }
.note-form .btn { margin-top: 4px; }
.event-list { margin: 0; padding-left: 18px; font-size: 12.5px; }
.event-list li { margin-bottom: 6px; line-height: 1.5; }
.order-no-note { margin-bottom: 10px; }

/* 訂單人工修訂金額 */
.revise-grid { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; align-items: stretch; }
.revise-grid label {
  flex: 1 1 0; min-width: 120px;
  display: flex; flex-direction: column; justify-content: flex-start;
  font-size: 13px; color: var(--ink-muted);
}
.revise-grid input, .revise-grid select {
  width: 100%; margin-top: 4px; height: 38px; box-sizing: border-box;
}
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.revise-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; width: 100%; }
.factor-row { justify-content: space-between; }
.factor-equation { margin: 0; flex: 1 1 auto; text-align: left; font-variant-numeric: tabular-nums; }

/* 訂單修訂：左側金額與右側修訂區水平並排、等高、頂部對齊 */
.revise-wrap {
  display: flex; align-items: stretch; justify-content: flex-start;
  gap: 20px; flex-wrap: wrap; margin-top: 14px;
}
.revise-wrap .cart-summary {
  flex: 0 0 auto; margin: 0; min-width: 240px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
/* 右側一整組：頁簽在上、表單在其下，與金額塊同高 */
.revise-side {
  flex: 1 1 320px; min-width: 280px;
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
}
.revise-side .revise-inline { margin-top: 0; width: 100%; flex: 1 1 auto; }

/* 修訂金額浮層（保留，供其他場景） */
.revise-inline {
  width: 100%; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(127,127,127,.04);
}
.revise-inline[hidden] { display: none; }

.revise-tabs { display: flex; gap: 8px; justify-content: flex-end; width: 100%; }
.order-lines-table .order-line { cursor: pointer; }
.order-lines-table .order-line:hover { background: rgba(0,180,166,.07); }
.order-lines-table .order-line.line-selected { background: var(--c-accent-soft, rgba(0,180,166,.16)); }
.order-lines-table .order-line.line-selected td:first-child { box-shadow: inset 3px 0 0 var(--c-accent); }
.line-history-btn {
  margin-left: 6px; width: 22px; height: 22px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: transparent;
  cursor: pointer; font-size: 11px; line-height: 1;
}
.line-history-btn:hover { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.line-history-row td { background: rgba(127,127,127,.05); text-align: left; }
.line-event-list { margin: 0; padding-left: 0; list-style: none; font-size: 12px; text-align: left; }
.line-event-list li { margin-bottom: 4px; line-height: 1.5; text-align: left; }

/* 訂單狀態進度條：用與訂單列表狀態徽標同款配色 */
.order-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.order-step {
  padding: 5px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap;
  border: 1px solid transparent; color: var(--ink-muted); background: rgba(0,0,0,.04);
}
.order-step-arrow { color: var(--ink-muted); font-size: 13px; }
/* 各環節底色＝列表狀態色 */
.step-new { background: #fff3cd; color: #8a6d00; }
.step-quoted { background: #f1e4ff; color: #6f42c1; }
.step-confirmed { background: #d4edda; color: #1e7e34; }
.step-closed { background: #e9ecef; color: #6c757d; }
/* 未到的環節淡化 */
.order-step:not(.is-current):not(.is-done) { background: rgba(0,0,0,.04); color: var(--ink-muted); }
/* 當前環節加粗描邊突出 */
.order-step.is-current { font-weight: 700; box-shadow: 0 0 0 2px rgba(0,0,0,.12); }

/* 備註框＋提交並排 */
.submit-row { flex-direction: row; align-items: stretch; }
.submit-row textarea { flex: 1 1 auto; margin: 0; }
.submit-row .btn { flex: 0 0 auto; align-self: stretch; }
@media (max-width: 560px) {
  .order-step { padding: 4px 10px; font-size: 12px; }
  .submit-row { flex-direction: column; }
  .submit-row .btn { align-self: flex-end; height: 40px; }
}
.revise-tab {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.revise-tab.active { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }

@media (max-width: 720px) {
  .revise-wrap { flex-direction: column; }
  .revise-side { flex: 1 1 auto; min-width: 0; width: 100%; }
  .revise-grid { flex-direction: column; gap: 8px; }
  .revise-grid label { flex: 1 1 auto; }
}

/* 站內確認彈窗（取代原生 confirm） */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}
.modal-mask[hidden] { display: none; }
.modal-card {
  width: min(420px, 100%);
  background: var(--bg-raised, #fff);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px 22px 18px;
  text-align: center;
  animation: modalIn 0.16s ease;
}
@keyframes modalIn {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(192, 57, 43, 0.12);
  color: var(--c-danger);
  margin-bottom: 12px;
}
.modal-card h3 { font-size: 16px; margin: 0 0 8px; color: var(--ink); }
.modal-card p { font-size: 13px; line-height: 1.6; color: var(--ink-muted); margin: 0 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn { height: 38px; padding: 0 20px; width: auto; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #a33024; }

/* 微信／電郵下單引導彈窗（購物車） */
.channel-card {
  width: min(480px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  text-align: left;
}
.channel-body { font-size: 13.5px; color: var(--ink); }
.channel-steps { margin: 4px 0 12px; padding-left: 20px; line-height: 1.75; }
.channel-steps li { margin-bottom: 4px; }
.channel-addr {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
  word-break: break-all;
}
.channel-qr-wrap { text-align: center; margin: 10px 0 4px; }
.channel-qr {
  width: 184px;
  height: 184px;
  object-fit: contain;
  border: 1px solid var(--c-border-dk);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}
.channel-card .modal-actions { margin-top: 14px; flex-wrap: wrap; }
.modal-card p.channel-hint { font-size: 12px; color: var(--ink-muted); margin: 12px 0 4px; line-height: 1.6; }
.channel-copybox {
  width: 100%;
  height: 150px;
  resize: vertical;
  font-size: 12.5px;
  line-height: 1.55;
  padding: 8px 10px;
  border: 1px solid var(--c-border-dk);
  border-radius: 8px;
  background: var(--bg, #f7f8fa);
  color: var(--ink);
  font-family: inherit;
}

.rate-new-tag { font-size: 10px; font-weight: 600; vertical-align: middle; margin-left: 4px; padding: 1px 6px; }

.notify-block {
  border: 1px solid var(--c-border-dk);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
}
.notify-title { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.notify-block select, .notify-block input[type="text"], .notify-block input[type="number"],
.notify-block input[type="password"] { height: 34px; }
.notify-resend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }

.channel-thankyou {
  text-align: center;
  padding: 18px 8px 8px;
}
.channel-thankyou p:first-child {
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink);
  margin-bottom: 12px;
}
.channel-thankyou .muted { font-size: 12.5px; }

/* 後台收單渠道設定 */.ch-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 20px; }
.ch-tabs .ch-tab {
  background: var(--bg-raised, #fff);
  border-color: var(--c-border-dk);
  color: var(--ink);
  font-family: inherit;
}
.ch-tabs .ch-tab.active-pill {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.channels-h { margin: 26px 0 4px; font-size: 16px; color: var(--ink); }
.channels-h:first-of-type { margin-top: 8px; }
.channels-field { max-width: 480px; }
.tpl-editor {
  width: 100%;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  padding: 10px 12px;
  border: 1px solid var(--c-border-dk);
  border-radius: 8px;
  background: var(--bg, #f7f8fa);
  color: var(--ink);
  white-space: pre;
  overflow-x: auto;
}
.tpl-item { min-height: 170px; }
.tpl-body { min-height: 230px; }
.tpl-form { margin-top: 6px; }
.tpl-actions { margin-top: 8px; }
.tpl-reset { margin: 8px 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tpl-state-hint { font-size: 12px; color: var(--ink-muted); }
.tpl-help { margin: 8px 0; font-size: 12.5px; color: var(--ink-muted); }
.tpl-help summary { cursor: pointer; margin-bottom: 6px; }
.tpl-help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tpl-help ul { padding-left: 18px; margin: 4px 0 0; line-height: 1.7; }
.tpl-help code {
  background: var(--c-bg, #eef1f4);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}
@media (max-width: 700px) { .tpl-help-grid { grid-template-columns: 1fr; } }

/* 密鑰管理 */
.add-key-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0 18px; }
.add-key-form .form-group { margin: 0; }
.add-key-form input[type="text"] { min-width: 320px; }
.inline-form { display: inline-flex; gap: 6px; margin: 0; }
.danger-mini { color: var(--c-danger); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.reset-form input[type="password"] { width: 130px; height: 30px; }
.safety-note {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* 訪客日誌 */
.visitor-filter { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0 4px; }
.visitor-filter .form-group { margin: 0; min-width: 150px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; font-size: 13px; }
.pager .btn-mini { text-decoration: none; }

/* 系統設定 */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  padding: 16px 18px;
  margin-top: 12px;
}
.setting-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.setting-desc { font-size: 12.5px; color: var(--ink-muted); line-height: 1.6; }

/* ════════════════════════════════════════════════════════
   動態搜尋結果區
   ════════════════════════════════════════════════════════ */
.results-actions { display: flex; align-items: center; gap: 8px; }
.results-actions .btn-secondary { padding: 6px 12px; font-size: 12.5px; }
.btn-secondary {
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}
.btn-secondary:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary); }
.btn-secondary:disabled { opacity: 0.5; cursor: default; }

.results-summary {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin: 10px 0;
  line-height: 1.6;
}

/* 主搜尋列：所有欄位維持同一行，視窗太窄時橫向捲動 */
/* 寬屏同一行，窄屏自動換行；不設 overflow，避免絕對定位的機場下拉被裁進此容器、出現縱向捲動 */
.all-one-row { flex-wrap: wrap; }
.all-one-row .form-group { flex: 1 1 auto; min-width: 110px; }
.all-one-row .form-group.combo { flex: 2 1 160px; }
.all-one-row .swap-btn { align-self: flex-end; flex: 0 0 auto; }

/* 艙位（左）＋航空公司（右）同一行、兩端對齊 */
.cabin-airline-row {
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.cabin-group { flex: 1 1 auto; min-width: 0; }
.airline-group { flex: 0 0 auto; margin-left: auto; }

/* ════════════ 方案（trip）詳情 ════════════ */
.trip-cabin-block { margin-bottom: 14px; }
.trip-cabin-block:last-child { margin-bottom: 0; }
.trips-loading, .trips-empty {
  padding: 12px;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.trip-detail-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-raised);
}
.trip-detail-block:last-child { margin-bottom: 0; }
.trip-select-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.trip-carrier-tag {
  font-weight: 700;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(0,0,0,.08);
  color: var(--ink-muted);
}
.trip-cabin-label {
  padding: 8px 12px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-accent);
}

.trip-layovers {
  padding: 4px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.layover-info { font-size: 12px; color: var(--gold-dim); }
.trip-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 12px;
  font-size: 12.5px;
  border-top: 1px solid var(--line);
}
/* ── 新 trip 佈局 ─────────────────────────────── */
/* 第1行：時間（間隔拉開） */
.trip-time-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.ttl-time { font-weight: 800; font-size: 15px; color: var(--text); }
.ttl-duration { font-weight: 700; color: var(--ink-muted); }
.ttl-stops { font-weight: 700; color: var(--gold-dim); }
.ttl-stops.ttl-direct { color: var(--c-success); }
.ttl-route { font-weight: 700; color: var(--c-accent); margin-left: auto; letter-spacing: .5px; }

/* 第2行：航班號突出 */
.trip-flight-nums {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.trip-flight-nums .tfn-label {
  font-size: 10px; font-weight: 700; color: #fff;
  background: var(--c-accent); border-radius: 4px; padding: 2px 7px;
}
.trip-flight-nums .tfn-value {
  font-size: 15px; font-weight: 800; letter-spacing: .5px; color: var(--text);
}
.trip-flight-nums .tfn-seats {
  margin-left: auto;
  font-size: 13px; font-weight: 700; color: var(--gold-dim); white-space: nowrap;
}

/* 第3區：票價／稅金／總價，標籤與數值水平一致 */
.trip-summary {
  align-items: baseline;
}
.trip-summary small {
  display: inline;
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 600;
  margin-right: 4px;
}
.trip-fare, .trip-taxes, .trip-total {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  line-height: 1.2;
}
.trip-fare { font-size: 17px; font-weight: 800; color: var(--text); }
.trip-taxes { font-size: 17px; font-weight: 800; color: var(--text); }
.trip-total {
  font-size: 17px; font-weight: 800; color: var(--c-accent);
  background: var(--c-accent-soft);
  padding: 4px 10px;
  border-radius: 6px;
}
.trip-updated {
  margin-left: 4px;
  align-self: baseline;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-muted);
}

/* 數量＋／− 圖標按鈕（50x23 SVG） */
.qty-step {
  width: 50px;
  height: 23px;
  padding: 0;
  border: none;
  background: none;
  line-height: 0;
  cursor: pointer;
  flex: 0 0 auto;
}
.qty-step img { display: block; width: 50px; height: 23px; }
.qty-step:hover img { filter: brightness(0.96); }

/* 航段表 */
.trip-segments { padding: 8px 12px 12px; }
.seg-header, .seg-row {
  display: grid;
  grid-template-columns: 64px 64px 56px 22px 56px 72px 1fr 46px;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}
.seg-header {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.seg-row { padding: 5px 0; }
.seg-flight { font-weight: 800; }
.seg-time { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.seg-arrow { text-align: center; color: var(--ink-muted); }
.seg-meta { color: var(--ink-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-meta.fare-class { font-family: ui-monospace, monospace; }
@media (max-width: 768px) {
  .seg-header, .seg-row { grid-template-columns: 52px 44px 40px 14px 40px 44px 1fr 34px; font-size: 11px; }
}

/* 結果摘要列 */
.results-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--ink-muted);
}
.results-summary .rs-route,
.results-summary .rs-date { font-weight: 700; color: var(--text); white-space: nowrap; }
.results-summary .rs-programs { flex: 1 1 100%; color: var(--ink-muted); }
.results-summary .rs-source { white-space: nowrap; color: var(--ink-muted); }

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  padding: 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  overflow-x: auto;
}
.filter-bar > .filter-select { flex: 1 1 auto; min-width: 96px; }
/* 前三個下拉縮短，計畫／排序維持原寬 */
#filterDate { flex: 0 0 92px; min-width: 92px; }
#filterAirline { flex: 0 0 100px; min-width: 100px; }
#filterCabin { flex: 0 0 112px; min-width: 112px; }
#filterProgram { flex: 0 0 150px; min-width: 150px; }
#filterStops { flex: 0 0 86px; min-width: 86px; }
#sortBy { flex: 0 0 132px; min-width: 132px; }
.filter-title { font-size: 12.5px; color: var(--ink-muted); }
.filter-select {
  height: 32px;
  padding: 0 6px;
  font-size: 12.5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  color: var(--ink);
}
/* 回程日期＋清除按鈕 */
.return-date-wrap { position: relative; display: flex; }
.return-date-wrap input[type="date"] { padding-right: 34px; }
.return-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--line-strong);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.return-clear-btn:hover { background: var(--c-primary); }

/* 收款區塊 */
.paid-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--green, #27ae60);
  border-radius: var(--radius-sm);
  background: rgba(39,174,96,.08);
}
.paid-flag { color: var(--green, #27ae60); font-size: 14px; }
.receipt-thumb {
  display: block;
  width: 96px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
}
.note-form input[type="number"],
.note-form input[type="file"] {
  margin: 4px 0 10px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
}

/* 往返分組：去程／回程標題與空提示 */
.rt-group { margin-bottom: 18px; }
.rt-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-accent);
  padding: 6px 10px;
  margin-bottom: 8px;
  background: var(--c-accent-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--c-primary);
}
.rt-empty {
  padding: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

.results-list { display: flex; flex-direction: column; gap: 8px; }

/* 結果卡片（摘要列） */
.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  overflow: hidden;
}
.result-card.expanded { border-color: var(--c-primary); }
.result-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  flex-wrap: wrap;
}
.result-card-header:hover { background: var(--bg-sunken); }
.expand-icon { color: var(--ink-muted); font-size: 10px; flex: 0 0 12px; }
.rc-date { font-weight: 700; white-space: nowrap; }
.rc-route { color: var(--ink); }
.tag-program {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c-accent-soft);
  color: var(--c-primary);
  white-space: nowrap;
}
.rc-cabins-summary { display: flex; gap: 6px; flex-wrap: wrap; }
.cabin-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-sunken);
}
.chip-hkd { font-weight: 700; color: var(--ink); }
.cabin-chip em { font-style: normal; color: var(--ink-muted); font-size: 11px; }
.plus-tax { color: var(--ink-muted); font-size: 10.5px; margin-left: 2px; }
.promo-flag {
  font-size: 10px;
  color: var(--c-whatsapp);
  font-weight: 700;
}
.rc-meta { margin-left: auto; font-size: 11px; display: flex; align-items: center; gap: 8px; }
.direct-yes { color: var(--c-success); font-weight: 700; }
.direct-no { color: var(--gold-dim); font-weight: 700; }

/* 卡片標題：航司標籤 */
.rc-carrier-tag {
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--c-accent-soft);
  color: var(--c-accent);
}
/* 航線僅英文代碼 */
.rc-route { font-weight: 700; font-size: 12.5px; }
/* 艙位簡字 */
.rc-cabin-letter {
  font-weight: 700;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  margin-right: 2px;
}
/* 里程計畫名：含稅／不含稅 → 帶底色標籤（走主題變數） */
.tag-program.has-tax {
  color: #fff;
  background: var(--c-success);
  padding: 2px 8px;
  border-radius: 4px;
}
.tag-program.no-tax {
  color: var(--ink-muted);
  background: var(--bg-sunken);
  padding: 2px 8px;
  border-radius: 4px;
}
/* 最後更新時間 */
.rc-updated { color: var(--ink-muted); font-size: 10.5px; }

/* 展開明細 */
.result-card-detail { border-top: 1px solid var(--line); padding: 12px; }
.flight-detail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.flight-detail-label {
  padding: 8px 12px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
}
.flight-cabin-name { font-weight: 700; font-size: 12.5px; }
.flight-detail-body { padding: 10px 12px; }
.flight-detail-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 16px;
  font-size: 12.5px;
}
.fdi-item { display: flex; justify-content: space-between; gap: 8px; }
.fdi-label { color: var(--ink-muted); }
.fdi-value { font-weight: 600; }
.fdi-total { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.fdi-total-value { color: var(--c-primary); font-weight: 700; }
.tax-na { color: var(--ink-muted); font-weight: 400; }
.cart-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.cart-add-row .cart-qty-input { width: 60px; flex: 0 0 60px; height: 30px; }
.cart-add-row .btn-add-cart { height: 30px; padding: 0 14px; width: auto; font-size: 12.5px; }
.add-cart-icon { display: none; vertical-align: middle; }

@media (max-width: 560px) {
  .cart-add-row .btn-add-cart {
    width: 38px; min-width: 38px; padding: 0;
    justify-content: center;
  }
  .add-cart-text { display: none; }
  .add-cart-icon { display: inline-block; }
}
.soldout-row { justify-content: center; }
.soldout-flag {
  display: inline-block; width: 100%; text-align: center;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(180, 40, 40, .10); color: #b3261e;
  font-weight: 700; font-size: 12.5px;
}

/* 航線地圖 */
.route-map-container svg { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
.map-placeholder {
  padding: 30px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

/* 分頁 */
.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}
.pagination .btn-page { padding: 6px 14px; }
.page-info { font-size: 12.5px; color: var(--ink-muted); }

/* ════════════════════════════════════════════════════════
   會員體系（邀請註冊／登錄／我的訂單）＋ B/C 雙站 2026-11
   ════════════════════════════════════════════════════════ */

/* 頂部提示條與會員菜單 */
.flash-bar {
  width: 100%;
  background: var(--c-accent-soft, rgba(0, 180, 166, 0.12));
  color: var(--c-primary);
  font-size: 13px;
  text-align: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.member-dd { position: relative; }
.member-dd > summary { list-style: none; cursor: pointer; }
.member-dd > summary::-webkit-details-marker { display: none; }
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong, var(--line));
  background: var(--bg-raised, #fff);
  font-size: 13px;
  color: var(--ink);
  max-width: 220px;
}
.member-chip-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px;
}
.member-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--c-accent);
  color: #fff;
  vertical-align: middle;
  margin-left: 4px;
}
.member-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  background: var(--bg-raised, #fff);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.12));
  padding: 6px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.member-panel a, .member-logout {
  text-align: left;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}
.member-panel a:hover, .member-logout:hover { background: var(--bg-sunken); }
.member-login-link { text-decoration: none; }

/* 登錄／註冊卡片 */
.member-card { max-width: 520px; margin: 0 auto; }
.member-sub { font-size: 12.5px; color: var(--ink-muted); margin: 4px 0 14px; }
.member-form { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.member-submit { width: 100%; height: 42px; }

/* 獨立登入卡片（/login，後台登入頁樣式）與會員卡片的輸入框統一尺寸 */
.admin-login-form input,
.member-form input {
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  font-size: 15px;
}
.admin-login-form .form-group,
.member-form .form-group { margin-bottom: 4px; }
.admin-login-form label,
.member-form label { display: block; margin-bottom: 6px; font-size: 13px; }
.member-links {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.notice.ok {
  border: 1px solid rgba(39,174,96,.35);
  background: rgba(39,174,96,.08);
  color: var(--green, #1e7e34);
}

/* 我的訂單：狀態分頁 */
.mo-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.mo-tab {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-strong, var(--line));
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  background: var(--bg-raised, #fff);
}
.mo-tab.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.mo-tab-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(127,127,127,.18);
  font-size: 11px;
  text-align: center;
  margin-left: 3px;
}
.mo-tab.active .mo-tab-count { background: rgba(255,255,255,.25); }

.mo-list { display: flex; flex-direction: column; gap: 12px; }
a.mo-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--bg-raised, #fff);
  transition: var(--transition, border-color .15s);
}
a.mo-card:hover { border-color: var(--c-primary); box-shadow: var(--shadow, 0 2px 10px rgba(0,0,0,.06)); }
.mo-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.mo-no { font-weight: 700; color: var(--ink); }
.mo-status-badge {
  margin-left: auto;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.mo-status-new { background: #fff3cd; color: #8a6d00; }
.mo-status-quoted { background: #f1e4ff; color: #6f42c1; }
.mo-status-confirmed { background: #d4edda; color: #1e7e34; }
.mo-status-closed { background: #e9ecef; color: #6c757d; }
.mo-status-cancelled { background: #f8d7da; color: #a02c2c; }
.mo-routes { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.mo-route { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.mo-route-date { color: var(--ink-muted); font-size: 12.5px; min-width: 86px; }
.mo-route-path { font-weight: 700; }
.mo-route-cabin { color: var(--c-accent); font-size: 12px; }
.mo-route-qty { color: var(--ink-muted); font-size: 12px; }
.mo-more { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.mo-card-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--ink-muted);
}
.mo-total { font-weight: 700; color: var(--ink); font-size: 14px; }

/* 訂單詳情 */
.mo-detail-head {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px; font-size: 13px;
}
.mo-steps {
  list-style: none;
  display: flex;
  gap: 0;
  margin: 6px 0 18px;
  padding: 0;
}
.mo-step {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.mo-step::before {
  content: "";
  position: absolute;
  top: 7px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--line-strong, var(--line));
  z-index: 0;
}
.mo-step:first-child::before { display: none; }
.mo-step-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--line-strong, #cfd6dd);
  border: 3px solid var(--bg-raised, #fff);
  z-index: 1;
}
.mo-step.done { color: var(--ink); }
.mo-step.done::before, .mo-step.done .mo-step-dot { background: var(--c-accent); }
.mo-step.current { color: var(--c-primary); font-weight: 700; }
.mo-step.current .mo-step-dot { box-shadow: 0 0 0 3px var(--c-accent-soft, rgba(0,180,166,.2)); }
.mo-progress.cancelled {
  padding: 10px 14px;
  border-radius: 8px;
  background: #f8d7da;
  color: #a02c2c;
  font-weight: 700;
  margin-bottom: 16px;
}
.mo-section {
  font-size: 14px;
  margin: 18px 0 8px;
  padding-left: 9px;
  border-left: 4px solid var(--c-accent);
}
.mo-items { display: flex; flex-direction: column; gap: 10px; }
.mo-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--bg-sunken, rgba(0,0,0,.02));
}
.mo-item-route { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.mo-item-date { color: var(--ink-muted); font-size: 12.5px; }
.mo-item-meta {
  display: flex; gap: 6px 18px; flex-wrap: wrap;
  margin-top: 6px; font-size: 12.5px; color: var(--ink-muted);
}
.mo-amounts { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.mo-amounts > div { display: flex; justify-content: space-between; padding: 3px 0; }
.mo-amounts .total { font-weight: 700; font-size: 15px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.mo-contacts { font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.mo-timeline { list-style: none; margin: 0; padding: 0; }
.mo-timeline li {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}
.mo-timeline-time { color: var(--ink-muted); flex: 0 0 84px; font-variant-numeric: tabular-nums; }
.mo-timeline-text { flex: 1; }
.mo-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
.mo-actions .btn-whatsapp { text-decoration: none; display: inline-flex; align-items: center; }

/* 後台：邀請／客戶／跨站用量 */
.invite-create { margin-top: 14px; }
.form-group-grow { flex: 2 1 260px; }
.form-group-btn { display: flex; align-items: flex-end; }
.invite-link-row { display: flex; gap: 8px; margin-top: 8px; }
.invite-link-input { flex: 1; font-size: 12.5px; padding: 8px 10px; }
.customer-filter {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  margin: 12px 0;
}
.customer-filter select { width: 120px; flex: 0 0 120px; }
.customer-filter input[type="search"] { flex: 1 1 auto; min-width: 160px; }
.customer-filter .btn, .customer-filter .btn-mini {
  width: auto; flex: 0 0 auto; white-space: nowrap;
}
.customer-filter select, .customer-filter input { height: 36px; padding: 0 10px; }
.customer-filter .btn-mini {
  text-decoration: none; display: inline-flex; align-items: center; height: 36px;
}
@media (max-width: 640px) {
  .customer-filter { flex-wrap: wrap; }
  .customer-filter select { flex: 1 1 calc(50% - 4px); }
  .customer-filter input[type="search"] { flex: 1 1 100%; order: 5; }
  .customer-filter .btn, .customer-filter .btn-mini { flex: 0 0 auto; }
}
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 18px;
  margin: 14px 0;
}
.kv-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  word-break: break-all;
}
.kv-grid span { display: block; font-size: 11.5px; color: var(--ink-muted); margin-bottom: 2px; }
.file-list { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.cust-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}
.cust-actions form { display: inline-flex; gap: 6px; align-items: center; }
.reject-form input[type="text"] { min-width: 260px; height: 36px; }

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}
.usage-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  background: var(--bg-sunken, rgba(0,0,0,.02));
}
.usage-box-title { font-size: 12.5px; color: var(--ink-muted); }
.usage-num { font-size: 30px; font-weight: 800; color: var(--c-primary); margin: 4px 0; font-variant-numeric: tabular-nums; }
.usage-box-total { border-color: var(--c-accent); background: var(--c-accent-soft, rgba(0,180,166,.1)); }
.usage-form { margin-top: 10px; }
.usage-form fieldset[disabled] { opacity: .7; }
/* 去掉 fieldset 瀏覽器預設黑框與內距，用卡片自身排版 */
.usage-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.usage-form fieldset:disabled { pointer-events: none; }
.halt-check { display: flex; gap: 8px; align-items: center; margin: 12px 0; font-size: 13px; }

/* 訪客日誌：依時間清空 */
.purge-logs {
  margin: 14px 0;
  border: 1px solid rgba(192,57,43,.35);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: rgba(192,57,43,.04);
}
.purge-logs summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--c-danger);
  user-select: none;
}
.purge-form { margin-top: 12px; }
.purge-form input[type="datetime-local"] { height: 36px; }

@media (max-width: 560px) {
  .member-chip-name { max-width: 70px; }
  .mo-steps { gap: 4px; }
  .mo-step-label { font-size: 11px; }
  .mo-card-foot { flex-direction: column; gap: 4px; align-items: flex-start; }
  .reject-form input[type="text"] { min-width: 0; width: 100%; }
  .cust-actions { flex-direction: column; align-items: stretch; }
  .cust-actions form { width: 100%; }
}

