:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --danger: #dc2626;
  --ok: #059669;
  --warn: #d97706;
  --side: #0f172a;
  --side-ink: #e2e8f0;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --lh: 1.5;
  --fw: 400;
  --fw-md: 500;
  --fw-sb: 600;
  --fw-bd: 700;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font);
  font-size: var(--fs-sm);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw);
  line-height: var(--lh);
}

h1, h2, h3, strong {
  font-weight: var(--fw-bd);
  letter-spacing: 0;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
}

a { color: var(--brand); }
code, kbd {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw);
  background: #f3f4f6;
  color: #334155;
  padding: 1px 6px;
  border-radius: 6px;
}
.hidden { display: none !important; }

/* ——— Auth ——— */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 500px at 20% -10%, #99f6e4 0%, transparent 50%), var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.auth-logo { display: block; width: 56px; height: 56px; border-radius: 14px; margin-bottom: 14px; }
.auth-card h1 {
  margin: 0 0 6px;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bd);
  line-height: 1.3;
}
.auth-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* ——— Forms ——— */
label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-sb);
  margin: 12px 0 6px;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #9ca3af; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(20, 184, 166, 0.28);
  outline-offset: 1px;
  border-color: var(--brand-2);
}
textarea { min-height: 88px; resize: vertical; }
.ta-md { min-height: 120px; }
.ta-lg { min-height: 140px; }
.ta-xl { min-height: 240px; }

.btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: var(--fw-sb);
  line-height: 1.4;
  background: #e5e7eb;
  color: var(--ink);
  white-space: nowrap;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:hover:not(:disabled) { filter: brightness(0.97); }
.auth-card .btn { width: 100%; margin-top: 16px; }
.msg {
  min-height: 1.4em;
  font-size: var(--fs-sm);
  color: var(--danger);
  margin-top: 10px;
}

/* ——— Shell ——— */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  background: var(--side);
  color: var(--side-ink);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bd);
  line-height: 1.35;
  padding: 6px 10px 16px;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; }
.brand span {
  color: var(--brand-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-sb);
  display: block;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group + .nav-group { margin-top: 10px; }
.nav-group-label {
  margin: 0;
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: var(--fw-sb);
  letter-spacing: 0.08em;
  color: #64748b;
  line-height: 1.3;
}
.nav-btn {
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: var(--fw-md);
  line-height: 1.4;
}
.nav-btn.active, .nav-btn:hover { background: rgba(255,255,255,.08); }
.side-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  font-size: var(--fs-xs);
  color: #94a3b8;
  line-height: 1.45;
}

.main { padding: 22px 26px 48px; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.topbar h2 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bd);
  line-height: 1.3;
}
.userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* ——— Cards / panels ——— */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.k, .card .k {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-md);
  line-height: 1.4;
}
.card .v {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bd);
  margin-top: 6px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.card .v.text {
  font-size: var(--fs-md);
  font-weight: var(--fw-sb);
  word-break: break-all;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-h {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--fs-sm);
}
.panel-h strong {
  font-size: var(--fs-md);
  font-weight: var(--fw-bd);
}

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar select, .toolbar input { width: auto; min-width: 11rem; flex: 0 1 auto; }
.toolbar .search { min-width: 12rem; }
.toolbar.sub { padding: 0 16px 10px; }

/* ——— Table ——— */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
th, td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
th {
  background: #f8fafc;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-sb);
  letter-spacing: 0.02em;
}
td .btn { padding: 5px 10px; }
tr:hover td { background: #fafbfc; }
.clamp { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 28px 14px; font-size: var(--fs-sm); }

.badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-sb);
  line-height: 1.4;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--ok);
}
.badge.warn { background: #fffbeb; color: var(--warn); }
.badge.off { background: #f3f4f6; color: var(--muted); }
.badge.danger { background: #fef2f2; color: var(--danger); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form { padding: 16px; display: grid; gap: 4px; }
.form .k { margin: 0 0 8px; }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-md);
}
.check input { width: auto; }
.site-checks {
  display: grid;
  gap: 8px;
  margin: 6px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  background: #fafafa;
}
.site-checks .check code {
  font-size: 12px;
  color: var(--muted);
}
.hint {
  margin: 0;
  padding: 10px 16px 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.panel-h .hint { padding: 0; }
.form > .hint { padding: 4px 0 8px; }
.form-h {
  margin: 16px 0 4px;
  font-size: var(--fs-md);
  font-weight: var(--fw-bd);
  line-height: 1.4;
}
.rule-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.rule-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}
.rule-row .row2 { margin: 0; }
.rule-row .rule-ops { display: flex; justify-content: flex-end; }
.visitor-card .row2 { align-items: end; }
.m-status {
  margin: 0 0 8px;
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
}
.m-status.ok { color: var(--ok); }
.m-status.warn { color: var(--warn); }
.m-key-actions .btn { margin-top: 4px; }
.view > .panel + .panel { margin-top: 18px; }

.spark {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 16px 18px 14px;
  min-height: 110px;
}
.spark-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}
.spark-col i {
  display: block;
  width: 100%;
  max-width: 28px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
}
.spark-col span {
  font-size: var(--fs-xs);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.spark .empty { padding: 16px; }
.stars {
  color: var(--warn);
  letter-spacing: 1px;
  font-size: var(--fs-sm);
}

/* ——— Modal / toast ——— */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  display: none;
  place-items: center;
  padding: 16px;
  z-index: 40;
}
.modal.show { display: grid; }
.modal-box {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 14px;
  max-height: 92vh;
  overflow: auto;
  font-size: var(--fs-sm);
}
.modal-box header, .modal-box footer {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.modal-box header { border-bottom: 1px solid var(--line); }
.modal-box header strong {
  font-size: var(--fs-md);
  font-weight: var(--fw-bd);
}
.modal-box footer { border-top: 1px solid var(--line); }
.modal-box .body { padding: 16px 18px; }

.toast {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 50;
  background: #fff;
  border-left: 4px solid var(--ok);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: var(--fs-sm);
  line-height: 1.45;
  max-width: min(360px, calc(100vw - 32px));
}
.toast.err { border-left-color: var(--danger); }

.embed-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.embed-tabs .btn.is-on {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.embed-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.embed-pre {
  margin: 0 0 10px;
  padding: 12px 14px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: auto;
  max-height: 180px;
}

.desk {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(200px, 260px);
  min-height: calc(100vh - 88px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.desk-list, .desk-side { border-right: 1px solid var(--line); overflow: auto; }
.desk-side { border-right: 0; border-left: 1px solid var(--line); }
.desk-tickets { display: flex; flex-direction: column; }
.desk-item {
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
}
.desk-item.is-on { background: #ecfdf5; }
.desk-thread { display: flex; flex-direction: column; min-width: 0; }
.desk-ai {
  max-height: 28vh;
  overflow: auto;
  padding: 10px 14px;
  background: #f8fafc;
  font-size: var(--fs-xs);
  border-bottom: 1px solid var(--line);
}
.desk-ai-turn { margin-bottom: 10px; }
.desk-ai .muted, .desk-msg span { color: var(--muted); font-size: var(--fs-xs); display: block; }
.desk-msgs { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.desk-msg { padding: 8px 10px; border-radius: 8px; background: #f3f4f6; max-width: 90%; }
.desk-msg.agent { background: #ecfdf5; align-self: flex-end; }
.desk-msg.visitor { background: #eff6ff; }
.desk-msg.bot { background: #ecfdf5; align-self: flex-end; }
.desk-msg.system { background: #f3f4f6; font-style: italic; }
.desk-msg.note { background: #fffbeb; font-style: italic; }
.desk-compose { padding: 10px 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.desk-compose textarea { width: 100%; min-height: 64px; resize: vertical; }
.kb-suggest, .kb-hits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kb-suggest .chip, .desk-side .chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--text);
}

.crm-desk { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }
.crm-thread { overflow: auto; }
.crm-profile { border-bottom: 1px solid var(--line); }
.crm-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.9fr);
  min-height: 360px;
}
.crm-col { min-width: 0; display: flex; flex-direction: column; }
.crm-col + .crm-col { border-left: 1px solid var(--line); }
.crm-chats { max-height: 42vh; }
.crm-follows {
  padding: 10px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  max-height: 28vh;
}
.crm-follow {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
}
.crm-follow strong { font-size: var(--fs-sm); }
.crm-follow .muted { color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }
.crm-follow p { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; }

.crm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  align-items: start;
}
.crm-filter .search { min-width: 180px; flex: 1 1 180px; }
.crm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.crm-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
  color: var(--ink);
}
.crm-chip strong { margin-left: 4px; }
.crm-chip.is-on {
  border-color: var(--brand);
  background: #ecfdf5;
  color: var(--brand);
}
.crm-table-panel tbody tr { cursor: pointer; }
.crm-table-panel tbody tr.is-on td { background: #ecfdf5; }
.crm-record { max-width: 360px; }
.work-follow-box { margin-top: 12px; border-top: 1px solid var(--line); }
.work-follow-box .desk-compose { border-top: 0; padding: 10px 0; }
.badge.hot { background: #fef2f2; color: #b91c1c; }
.badge.ok { background: #ecfdf5; color: var(--ok); }
.badge.normal { background: #eff6ff; color: #1d4ed8; }
.badge.low { background: #f3f4f6; color: var(--muted); }

@media (max-width: 960px) {
  .crm-desk { grid-template-columns: 1fr; }
  .crm-split { grid-template-columns: 1fr; }
  .crm-col + .crm-col { border-left: 0; border-top: 1px solid var(--line); }
  .crm-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .desk { grid-template-columns: 1fr; min-height: auto; }
  .desk-side { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side {
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    position: static;
  }
  .side-foot { display: none; }
  .nav-group {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1 1 100%;
    align-items: center;
    gap: 4px;
  }
  .nav-group + .nav-group { margin-top: 4px; }
  .nav-group-label {
    flex: 0 0 100%;
    padding: 8px 12px 0;
  }
  .row2 { grid-template-columns: 1fr; }
  .main { padding: 16px 14px 40px; }
}

.muted { color: var(--muted); }
.an-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.an-filter select,
.an-filter input[type="date"] {
  width: auto;
  min-width: 0;
}
.table-wrap { overflow-x: auto; }
.intent-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 12px 16px 8px;
  font-size: var(--fs-xs);
  color: var(--ink);
}
.intent-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
}
.intent-bar {
  display: flex;
  height: 12px;
  margin: 0 16px 16px;
  border-radius: 999px;
  overflow: hidden;
  background: #f3f4f6;
}
.intent-bar span { display: block; height: 100%; }
.intent-high, .dot.intent-high { background: #0f766e; }
.intent-mid, .dot.intent-mid { background: #14b8a6; }
.intent-low, .dot.intent-low { background: #fbbf24; }
.intent-none, .dot.intent-none { background: #94a3b8; }
.intent-unset, .dot.intent-unset { background: #e5e7eb; }
.ch-web, .dot.ch-web { background: #0f766e; }
.ch-mp, .dot.ch-mp { background: #22c55e; }
.ch-mini, .dot.ch-mini { background: #f59e0b; }
.ch-app, .dot.ch-app { background: #6366f1; }
.src-search, .dot.src-search { background: #2563eb; }
.src-external, .dot.src-external { background: #d97706; }
.src-direct, .dot.src-direct { background: #64748b; }
.eng-baidu, .dot.eng-baidu { background: #2932e1; }
.eng-google, .dot.eng-google { background: #ea4335; }
.eng-bing, .dot.eng-bing { background: #008373; }
.eng-sogou, .dot.eng-sogou { background: #fb6443; }
.eng-so360, .dot.eng-so360 { background: #00b42a; }
.eng-sm, .dot.eng-sm { background: #7c3aed; }
.eng-toutiao, .dot.eng-toutiao { background: #f43f5e; }
.eng-yahoo, .dot.eng-yahoo { background: #6001d2; }
.eng-other, .dot.eng-other { background: #94a3b8; }
.ch-desktop, .dot.ch-desktop { background: #0f766e; }
.ch-mobile, .dot.ch-mobile { background: #0284c7; }
.ch-wechat, .dot.ch-wechat { background: #22c55e; }
.spark-pair {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  max-width: 28px;
  min-height: 72px;
}
.spark-pair i { width: 50%; max-width: none; }
.spark-pair i.uv { background: linear-gradient(180deg, #99f6e4, #5eead4); }
.funnel {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 16px 18px 18px;
}
.funnel-step { flex: 1; min-width: 0; }
.funnel-bar {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  margin-bottom: 8px;
}
.funnel-k { font-size: var(--fs-xs); color: var(--muted); }
.funnel-n { font-size: var(--fs-lg); font-weight: var(--fw-bd); }
.funnel-arr {
  align-self: center;
  color: var(--muted);
  font-size: 18px;
}
.visit-url {
  max-width: 640px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.region-rank { padding: 8px 18px 12px; }
.region-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 40px 44px;
  gap: 8px;
  align-items: center;
  font-size: var(--fs-xs);
  margin-bottom: 6px;
}
.region-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.region-row .bar-bg {
  height: 8px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}
.region-row .bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
}
#deskOutcomeBox .panel-h { border-top: 1px solid var(--line); }
.modal-box.embed-wide { width: min(980px, 100%); }
.embed-look {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  margin: 4px 0 16px;
  align-items: start;
}
.embed-look-cfg label { margin-top: 8px; }
.look-styles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.look-card {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.look-card strong { display: block; font-size: var(--fs-sm); }
.look-card span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.4;
}
.look-card.is-on {
  border-color: var(--brand);
  background: #ecfdf5;
  box-shadow: inset 0 0 0 1px var(--brand);
}
.look-pos { display: flex; gap: 16px; margin: 8px 0 4px; }
.look-pos.hidden { display: none; }
.look-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.look-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
  padding: 0;
}
.look-swatch.is-on { box-shadow: 0 0 0 2px var(--brand); }
.look-colors input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.embed-look-preview {
  background: #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.look-stage {
  position: relative;
  width: 100%;
  height: 256px;
}
.look-stage--phone {
  width: 148px;
  height: 256px;
  background: #0f172a;
  border-radius: 22px;
  padding: 8px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
}
.look-stage--web {
  height: 256px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}
.look-chrome {
  height: 22px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}
.look-page {
  position: relative;
  height: calc(100% - 22px);
  background: #f8fafc;
}
.look-phone-screen {
  height: 100%;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.look-hd {
  padding: 10px 10px 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.look-hd em { font-style: normal; opacity: 0.85; font-size: 10px; }
.look-bd {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f8fafc;
}
.look-b {
  max-width: 82%;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.35;
}
.look-b.bot { background: #fff; border: 1px solid #e5e7eb; color: #334155; align-self: flex-start; }
.look-b.user { color: #fff; align-self: flex-end; }
.look-ft {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}
.look-ft i {
  flex: 1;
  height: 22px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
}
.look-ft b {
  width: 36px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.look-dock {
  position: absolute;
  background: var(--c, #0f766e);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}
.look-dock--bubble {
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.look-dock--bar {
  right: 10px;
  bottom: 10px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
}
.look-dock--tab {
  right: 0;
  top: 48%;
  width: 16px;
  height: 64px;
  border-radius: 6px 0 0 6px;
  font-size: 8px;
  writing-mode: vertical-rl;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.08em;
}
.look-dock--card {
  right: 8px;
  bottom: 8px;
  width: 72px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 9px;
  line-height: 1.3;
}
.look-dock.is-left { right: auto; left: 10px; }
.look-dock--tab.is-left { left: 0; border-radius: 0 6px 6px 0; }
.look-skin-wechat .look-hd {
  background: #ededed !important;
  color: #111827;
  border-bottom: 1px solid #d9d9d9;
}
.look-skin-wechat .look-bd { background: #ededed; }
.look-skin-wechat .look-b.bot { border: 0; }
.look-skin-simple .look-hd {
  background: #fff !important;
  color: #0f766e;
  border-bottom: 1px solid #e5e7eb;
}
.look-skin-simple .look-hd em { color: #64748b; }
.embed-look-note { color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 760px) {
  .embed-look { grid-template-columns: 1fr; }
  .embed-look-preview { min-height: 220px; }
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 28px 16px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  color: var(--muted);
  text-align: center;
}
.dropzone strong { color: var(--ink); font-weight: var(--fw-sb); }
.dropzone.is-over { border-color: var(--brand); background: #ecfdf5; }
.cat-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cat-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  gap: 8px;
  align-items: center;
}
.cat-row input { margin: 0; }
.desk-img img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; margin: 6px 0; }
.desk-img a { display: inline-block; }
.label-box { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 6px 0 10px; }
.canned-new { margin-top: 16px; padding-top: 12px; border-top: 1px solid #e5e7eb; }
.visitor-card p { margin: 0 0 8px; }
.visitor-hist { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: var(--fs-xs); }
.team-box select[multiple] { min-height: 72px; margin-bottom: 10px; }
