:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #2b2724;
  --muted: #7a716a;
  --line: #e7dfd5;
  --brand: #b4532a;
  --brand-deep: #8f3f1e;
  --brand-tint: #f6e9e1;
  --danger: #b42318;
  --ok: #2f6b4f;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
html { scroll-padding: 84px 0 110px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.shell {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 16px 0 12px;
}
.brand { font-weight: 700; letter-spacing: 0.04em; font-size: 15px; }
.brand span { color: var(--muted); font-weight: 400; margin-left: 8px; }
.progress { height: 4px; background: var(--line); border-radius: 4px; margin-top: 12px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 4px; transition: width 0.4s ease; }

.center { flex: 1; display: grid; place-items: center; text-align: center; padding: 48px 0; }
.center h1 { font-size: 22px; margin: 0 0 8px; }
.center p { color: var(--muted); margin: 0; }

/* ---------- 選項（兩種模式共用） ---------- */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.option:hover { border-color: var(--brand); }
.option:active { transform: scale(0.99); }
.option.on { border-color: var(--brand); background: var(--brand-tint); }
.option:disabled { opacity: 0.45; cursor: not-allowed; }
.option .mark {
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: transparent;
  background: var(--surface);
}
.option.multi .mark { border-radius: 6px; }
.option.on .mark { background: var(--brand); border-color: var(--brand); color: #fff; }

.btn {
  flex: none;
  white-space: nowrap;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; font-weight: 400; padding-inline: 10px; }
.btn.ghost:hover { color: var(--ink); background: transparent; }
.btn.line { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 400; }
.btn.line:hover { border-color: var(--brand); background: var(--surface); }
.btn.small { padding: 6px 14px; font-size: 14px; }

.field {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}
.field:focus { border-color: var(--brand); }
textarea.field { resize: vertical; min-height: 96px; }

.error { color: var(--danger); font-size: 14px; margin-top: 10px; }

/* ---------- 點選問卷 ---------- */
.form-body { flex: 1; padding: 20px 0 24px; }
.intro { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.q-count { color: var(--muted); font-size: 13px; }
.q-title { font-size: 21px; line-height: 1.45; margin: 4px 0 4px; }
.q-hint { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.q-title + .options, .q-title + .field { margin-top: 18px; }
.other-input { margin-top: 10px; }
.form-nav {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  padding: 16px 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-nav .spacer { flex: 1; }

/* ---------- 對話 ---------- */
.chat { flex: 1; padding: 12px 0 8px; display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 86%; padding: 12px 16px; border-radius: 18px; white-space: pre-wrap; word-break: break-word; }
.bubble.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.typing { display: inline-flex; gap: 5px; padding: 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.chat-options { align-self: stretch; margin: 2px 0 4px; }
.chat-options .options { gap: 8px; }
.chat-options .option { padding: 11px 14px; }
.chat-options .row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.chat-options .row .spacer { flex: 1; }

.composer {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 75%, transparent);
  padding: 14px 0 18px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.composer textarea { min-height: 48px; max-height: 140px; resize: none; border-radius: 24px; padding: 11px 16px; }
.composer .btn { flex: none; }

/* ---------- 後台 ---------- */
.admin { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
.admin h1 { font-size: 22px; margin: 0 0 4px; }
.admin h2 { font-size: 17px; margin: 0 0 12px; }
.admin .sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-pick .option { align-items: flex-start; }
.mode-pick small { display: block; color: var(--muted); font-size: 13px; }
.notice { background: var(--brand-tint); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }

.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tr.clickable { cursor: pointer; }
.list tr.clickable:hover td { background: var(--bg); }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; background: var(--line); white-space: nowrap; }
.pill.completed { background: #dcefe4; color: var(--ok); }
.pill.in_progress { background: var(--brand-tint); color: var(--brand-deep); }
.muted { color: var(--muted); }

.brief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .brief-grid { grid-template-columns: 1fr; } }
.brief { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.brief.key { border-color: var(--brand); background: var(--brand-tint); }
.brief h3 { font-size: 14px; margin: 0 0 6px; }
.brief ul { margin: 0; padding-left: 18px; }
.brief p { margin: 0; }
.brief .empty { color: var(--muted); font-size: 14px; }
.summary { font-size: 17px; margin: 0 0 16px; }
.raw { font-size: 14px; }
.raw dt { color: var(--muted); margin-top: 10px; }
.raw dd { margin: 0; }
.raw .line { margin: 6px 0; }
.raw .who { color: var(--muted); margin-right: 6px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.linkbox { font-family: ui-monospace, monospace; font-size: 13px; background: var(--bg); padding: 6px 10px; border-radius: 8px; word-break: break-all; }

/* ---------- 後台：分頁、指標、圖表 ---------- */
:root { --c-agent: #b4532a; --c-briefing: #2f6b4f; --c-trend: #3b6ea5; --c-review: #9a7b1c; --c-product: #7a5a9a; --warn: #9a6b00; --warn-tint: #fbf1d8; --danger-tint: #fbe6e3; }
.admin-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 12px 0 20px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand-deep); border-bottom-color: var(--brand); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 28px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 13px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; flex: none; }

.hbars { display: grid; gap: 7px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.hbar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 14px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.hbar .fill { display: block; height: 100%; border-radius: 4px; background: var(--brand); min-width: 2px; }
.hbar .num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 64px; text-align: right; }
.hbar.zero .fill { display: none; }
.hbar.zero .lab { color: var(--muted); }

.cols { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-top: 8px; }
.col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.col .seg { width: 100%; }
.col .seg:first-child { border-radius: 3px 3px 0 0; }
.col:hover { opacity: 0.8; }
.col.empty::after { content: ""; display: block; height: 2px; background: var(--line); }
.col-axis { display: flex; gap: 3px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.col-axis span { flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 820px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.chart-card h3 { font-size: 14px; margin: 0 0 2px; }
.chart-card .meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chart-card .texts { font-size: 13px; color: var(--muted); margin-top: 10px; }
.num-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list th.num-cell { text-align: right; }

.pill.high { background: var(--danger-tint); color: var(--danger); }
.pill.mid { background: var(--warn-tint); color: var(--warn); }
.pill.low { background: var(--line); }
.pill.full { background: #dcefe4; color: var(--ok); }
.pill.partial { background: var(--warn-tint); color: var(--warn); }
.pill.none { background: var(--danger-tint); color: var(--danger); }

.fit { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; margin-bottom: 16px; }
@media (max-width: 640px) { .fit { grid-template-columns: 1fr; } }
.fit-score { font-size: 56px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.fit-score small { font-size: 18px; font-weight: 400; color: var(--muted); }
.fit-level { font-weight: 600; margin-top: 6px; }
.fit-track { height: 10px; background: var(--bg); border-radius: 6px; overflow: hidden; margin-top: 10px; }
.fit-track i { display: block; height: 100%; border-radius: 6px; background: currentColor; }
.fit-good { color: var(--ok); } .fit-ok { color: var(--warn); } .fit-bad { color: var(--danger); }

.rec { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.rec h3 { font-size: 15px; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec p { margin: 0; font-size: 14px; }
.plain-list { margin: 0; padding-left: 20px; }
.plain-list li { margin: 4px 0; }
.section-title { font-size: 15px; margin: 22px 0 10px; }

/* ---------- 後台：問卷編輯 ---------- */
.q-edit { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: var(--surface); }
.q-edit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.q-edit-head .n { font-weight: 600; }
.q-edit-head .spacer { flex: 1; }
.q-edit .grid { display: grid; grid-template-columns: 1fr 150px 110px; gap: 10px; }
@media (max-width: 720px) { .q-edit .grid { grid-template-columns: 1fr; } }
.q-edit textarea.field { min-height: 120px; font-size: 14px; }
.field.compact { padding: 8px 12px; border-radius: 10px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.sugg { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.sugg.done { opacity: 0.55; }
.sugg h3 { font-size: 15px; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sugg p { margin: 2px 0; font-size: 14px; }
.sugg .proposal { background: var(--bg); border-radius: 8px; padding: 8px 12px; margin-top: 8px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.actions .spacer { flex: 1; }
.tokens { color: var(--muted); font-size: 12px; margin-left: 8px; white-space: nowrap; }

@media print {
  .tabs, .toolbar, .actions, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; break-inside: avoid; }
  .admin { max-width: none; padding: 0; }
}

/* ---------- 後台：產品資訊 ---------- */
.p-chat { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; padding: 4px 2px 8px; }
.p-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.p-msg.user { align-self: flex-end; background: var(--brand); color: #fff; }
.p-msg.ai { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.p-msg .actions { margin-top: 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.meter { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; margin: 10px 0 6px; }
.meter i { display: block; height: 100%; background: var(--c-product); border-radius: 6px; transition: width 0.4s; }
.field.flash { border-color: var(--brand); background: var(--brand-tint); }
pre.draft { white-space: pre-wrap; word-break: break-word; background: var(--bg); border-radius: 10px; padding: 12px 14px; font: inherit; font-size: 14px; max-height: 320px; overflow-y: auto; margin: 10px 0; }

/* ---------- 展場收集頁 ---------- */
.cap-h { font-size: 16px; margin: 0 0 12px; }
.cap-field { margin-top: 12px; }
.cap-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.cap-actions .btn { text-align: center; cursor: pointer; }
.cap-wide { flex: 1; text-align: center; }
.cap-hint { font-size: 13px; color: var(--muted); margin-top: 8px; min-height: 0; }
.cap-hint:empty { display: none; }
.cap-hint.warn { color: var(--warn); }
.cap-preview { display: block; width: 100%; max-height: 220px; object-fit: contain; background: var(--bg); border-radius: 10px; margin-top: 12px; }
.btn.rec { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.cap-save { position: sticky; bottom: 0; z-index: 4; display: flex; flex-direction: column; padding: 12px 0 calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 78%, transparent); }
.cap-list { display: flex; flex-direction: column; }
.cap-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cap-row .muted { font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 20; background: var(--ink); color: #fff; padding: 8px 18px; border-radius: 999px; font-size: 14px; }

/* ---------- 後台：展場名單 ---------- */
:root { --c-lead: #4b7f86; }
.pill.sent { background: #e2ebf5; color: #3b6ea5; }
.pill.opened { background: var(--warn-tint); color: var(--warn); }
.list td.pick, .list th.pick { width: 34px; padding-right: 0; }
.list .memo-cell { max-width: 280px; white-space: pre-wrap; word-break: break-word; color: var(--muted); }
.selbar { position: sticky; top: 0; z-index: 6; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--brand-tint); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.selbar .spacer { flex: 1; }
.mail-preview { background: var(--bg); border-radius: 10px; padding: 12px 14px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.mail-preview b { display: block; margin-bottom: 8px; }
.lead-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 820px) { .lead-grid { grid-template-columns: 1fr; } }
.lead-card-img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.lead-audio { width: 100%; margin-top: 8px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form .field { flex: 1; min-width: 180px; }

/* 手機：名單表格欄位多，寧可橫向捲動也不要把欄位擠成一字一行 */
@media (max-width: 760px) {
  .leads-table { min-width: 720px; }
  .selbar { top: 4px; }
}
@media (max-width: 480px) {
  .mode-pick { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
label.btn { cursor: pointer; }
label.btn.off { opacity: 0.45; pointer-events: none; }
.btn.line.danger { color: var(--danger); border-color: var(--danger-tint); }
.btn.line.danger:hover { border-color: var(--danger); background: var(--danger-tint); }

/* ---------- 後台：潛在客戶（頁首、轉換概況、狀態篩選、分段表單） ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.page-head h2 { font-size: 20px; margin: 0 0 2px; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .muted { font-size: 13px; }
.card-desc { color: var(--muted); font-size: 14px; margin: -4px 0 14px; max-width: 72ch; }

.funnel { display: grid; grid-template-columns: repeat(5, 1fr); }
.funnel-step { padding: 2px 16px; border-left: 1px solid var(--line); }
.funnel-step:first-child { padding-left: 0; border-left: 0; }
.funnel-step .k { font-size: 13px; color: var(--muted); }
.funnel-step .v { font-size: 26px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.funnel-step .s { font-size: 12px; color: var(--muted); }
@media (max-width: 760px) {
  .funnel { grid-template-columns: 1fr 1fr; gap: 14px 0; }
  .funnel-step:nth-child(odd) { padding-left: 0; border-left: 0; }
}

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filter-row .spacer { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; white-space: nowrap; }
.chip:hover { border-color: var(--brand); }
.chip .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.on { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-deep); font-weight: 600; }
.chip.on .n { color: var(--brand-deep); }

.step { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: 0; margin-top: 0; padding-top: 4px; }
.step-title { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 12px; }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-deep); font-size: 12px; font-weight: 700; }
.break { word-break: break-all; }
.leads-table td { min-width: 0; }
@media (max-width: 760px) { .leads-table { min-width: 880px; } }

/* 可搜尋、可新增的下拉選單（活動名稱） */
.combo { position: relative; }
.combo-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; cursor: pointer; }
.combo-trigger > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-caret { color: var(--muted); font-size: 12px; flex: none; }
.combo-panel { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(43, 39, 36, 0.14); overflow: hidden; }
.combo-panel.up { top: auto; bottom: calc(100% + 6px); }
.combo-search { display: block; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); outline: none; background: var(--surface); font-size: 16px; }
.combo-list { max-height: 220px; overflow-y: auto; padding: 4px 0; }
.combo-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; font-size: 15px; }
.combo-option:hover, .combo-option.active { background: var(--bg); }
.combo-option.create { color: var(--brand-deep); font-weight: 600; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 11px; }
.combo-option.create:first-child { border-top: 0; margin-top: 0; }
.combo-check { color: var(--brand); font-size: 13px; }
.combo-empty { padding: 10px 12px; font-size: 13px; color: var(--muted); }
select.field { appearance: auto; }

/* ---------- 後台：匯入名片 ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; padding: 32px 16px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--bg); text-align: center; transition: border-color 0.15s, background 0.15s; }
.dropzone.over { border-color: var(--brand); background: var(--brand-tint); }
.dropzone.busy { opacity: 0.6; }
.dropzone-title { font-weight: 600; }
.dropzone-hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.field-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.dropzone-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---------- 多租戶：頁首、產品列、登入 ---------- */
.admin-head { align-items: center; }
.admin-head .spacer { flex: 1; }
.admin-head .org { font-size: 14px; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line); }
.product-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -8px 0 18px; font-size: 13px; }
.product-bar .spacer { flex: 1; }
.auth-wrap { min-height: 80vh; display: grid; place-items: center; padding: 24px 0; }
.auth-card { width: 100%; max-width: 400px; margin: 0; }
.auth-brand { font-weight: 700; letter-spacing: 0.02em; color: var(--brand-deep); margin-bottom: 4px; }
.auth-alt { font-size: 14px; color: var(--muted); margin: 16px 0 0; }
.linklike { border: 0; background: none; padding: 0 0 0 4px; color: var(--brand-deep); text-decoration: underline; font-size: inherit; }
.tag { display: inline-block; padding: 1px 8px; margin: 0 4px 2px 0; border-radius: 6px; font-size: 12px; background: var(--brand-tint); color: var(--brand-deep); white-space: nowrap; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.picks .chip { font-size: 14px; }
:root { --c-setup: #a0527a; }
.quick .spacer { flex: 1; }

/* 未儲存變更的固定儲存列：貼在視窗底部，內容再長都看得到 */
.savebar { position: sticky; bottom: 12px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; padding: 12px 16px; background: var(--surface); border: 1.5px solid var(--brand); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(43, 39, 36, 0.18); }
.savebar-text { flex: 1; min-width: 200px; font-size: 14px; }
.savebar-text .muted { font-size: 13px; }
@media print { .savebar { display: none !important; } }
