:root { --bg:#0f1115; --panel:#171a21; --line:#2a2f3a; --text:#e8eaed; --muted:#9aa0a6; --accent:#3b82f6; --ok:#22c55e; --warn:#f59e0b; }
* { box-sizing: border-box; }
html, body { height:100%; overflow:hidden; }
body { margin:0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
.hidden { display:none !important; }
.login { max-width: 360px; margin: 10vh auto; padding: 24px; background: var(--panel); border-radius: 12px; border:1px solid var(--line); display:flex; flex-direction:column; gap:12px; }
.login label { display:flex; flex-direction:column; gap:6px; font-size:14px; color:var(--muted); }
.login input, .composer textarea, select { background:#0d0f14; border:1px solid var(--line); color:var(--text); border-radius:8px; padding:10px; font:inherit; }
.login button, .actions button, .actions #adminLink, .composer button { background: var(--accent); color:#fff; border:0; border-radius:8px; padding:10px 14px; cursor:pointer; font:inherit; }
.ghost { background: transparent !important; border:1px solid var(--line) !important; color: var(--text) !important; }
.err { color:#f87171; min-height: 1.2em; }
.hint { color: var(--muted); margin-top:-8px; }
/* desk-sticky-composer-20261110: keep composer on screen when session list/messages are long */
.desk { display:grid; grid-template-columns: 320px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height:100%; height:100dvh; max-height:100dvh; overflow:hidden; min-height:0; }
.sidebar { border-right:1px solid var(--line); background: var(--panel); display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.side-top { display:flex; justify-content:space-between; align-items:center; padding:12px; border-bottom:1px solid var(--line); }
.muted { color:var(--muted); font-size:12px; }
.tabs { display:flex; gap:4px; padding:8px; }
.tab { flex:1; background:#12151c; border:1px solid var(--line); color:var(--text); border-radius:8px; padding:8px; cursor:pointer; }
.tab.active { border-color: var(--accent); }
.conv-list { overflow:auto; flex:1; min-height:0; }
.conv { padding:12px; border-bottom:1px solid var(--line); cursor:pointer; display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 132px); align-items:center; column-gap:10px; }
.conv:hover, .conv.active { background:#12151c; }
.conv-main { min-width:0; }
.conv .top { grid-column:1 / -1; display:flex; align-items:center; gap:6px; }
.conv-name { min-width:0; margin-right:auto; overflow-wrap:anywhere; }
.conv .badge { flex-shrink:0; }
.conversation-topic { flex:none; padding:3px 6px; border:1px solid #36516c; border-radius:5px; background:#1e3142; color:#c7def5; font-size:11px; line-height:1.3; white-space:nowrap; }
.conversation-topic[data-topic="installation"] { border-color:#735629; background:#3e2f19; color:#ffdb8b; }
.conversation-topic[hidden], .conversation-source[hidden], .conversation-owner[hidden], .chat-labels[hidden] { display:none; }
.conv-meta { display:flex; align-items:center; flex-wrap:wrap; gap:4px 5px; margin-top:5px; }
.conversation-source { flex:none; padding:2px 5px; border:1px solid #674893; border-radius:5px; background:#322443; color:#e3caff; font-size:11px; }
.conversation-owner { min-width:0; max-width:100%; color:var(--muted); font-size:12px; line-height:1.3; overflow-wrap:anywhere; }
.conversation-owner.is-assigned { color:#cdd2dc; }
.quick-image-draft { display:flex; align-items:center; gap:10px; flex:none; padding:6px 12px; border-top:1px solid var(--line); background:var(--panel); }
.quick-image-draft[hidden] { display:none; }
.quick-image-draft img { width:64px; height:44px; object-fit:contain; border-radius:5px; background:var(--bg); }
.quick-image-draft span { flex:1; min-width:0; overflow-wrap:anywhere; font-size:13px; }
.quick-image-draft button { border-radius:6px; padding:5px 8px; color:var(--text); cursor:pointer; }
#personalQuickReplyDialog { max-height: min(760px, 86vh); overflow:auto; }
.conv-preview { margin-top:3px; overflow:hidden; overflow-wrap:anywhere; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-height:1.4; }
.reception-badge { display:inline-flex; align-items:center; min-width:0; max-width:100%; padding:5px 8px; border:1px solid transparent; border-radius:7px; font-size:12px; line-height:1.4; vertical-align:middle; }
.reception-badge[hidden] { display:none; }
.conv > .reception-badge { justify-self:end; }
.reception-badge__text { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reception-badge--assigned { color:#a7f3d0; background:#173c31; border-color:#285e4b; }
.reception-badge--replied { color:#b8bec8; background:#262b34; border-color:#3a414e; }
.reception-badge--replied-online { color:#bbf7d0; background:#194233; border-color:#327456; }
.reception-badge--waiting { color:#fcd58b; background:#3b2e19; border-color:#625030; }
.badge { background: #ef4444; color:#fff; border-radius:999px; padding:0 7px; font-size:12px; }
.chat { display:flex; flex-direction:column; min-width:0; min-height:0; height:100%; overflow:hidden; }
.chat-top { display:flex; justify-content:space-between; gap:12px; align-items:center; flex-wrap:wrap; padding:12px 16px; border-bottom:1px solid var(--line); background: var(--panel); flex-shrink:0; }
.chat-heading { display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-width:0; flex:1 1 180px; }
.chat-labels { display:flex; align-items:center; flex-wrap:wrap; gap:6px; max-width:100%; }
#chatTitle { max-width:100%; overflow-wrap:anywhere; }
.actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.desk-tool-link { padding:10px 14px; border:1px solid #49596e; border-radius:8px; color:#e5eaf4; background:#243147; text-decoration:none; white-space:nowrap; }
.desk-tool-link:hover { background:#32415b; }
.desk-tool-link:focus-visible { outline:2px solid #93bcff; outline-offset:2px; }
.quick-reply-desk-permission { display:block; margin:8px 0; font-size:13px; }
.actions #adminLink { background:#6944b5; box-shadow:inset 0 0 0 1px #a587de; font-weight:600; text-decoration:none; white-space:nowrap; }
.actions #adminLink:hover { background:#7952c4; }
.actions #adminLink:active { background:#58389b; }
.actions #adminLink:focus-visible { outline:2px solid #e1cfff; outline-offset:2px; }
.actions #copyNavUrlBtn {
  display: inline-grid;
  place-content: center;
  justify-items: center;
  row-gap: 1px;
  min-inline-size: min(100%, calc(9em + 28px));
  max-inline-size: 100%;
  block-size: calc(1lh + 20px);
  padding: 0 14px;
  white-space: nowrap;
  color: #d6e5ff;
  background: #202b3c;
  box-shadow: inset 0 0 0 1px #59739a;
}
#deskNavLabel { line-height: 1.15; }
#deskNavUrl {
  max-inline-size: min(42ch, calc(100vw - 64px));
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .75em;
  line-height: 1.15;
  color: #bccbdf;
}
.actions #copyNavUrlBtn:hover { background: #2b3950; }
.actions #copyNavUrlBtn:focus-visible { outline: 2px solid #8cb8ff; outline-offset: 2px; }
.actions #copyNavUrlBtn[data-copied] { color: #b8f5d4; background: #193b30; box-shadow: inset 0 0 0 1px #3d866b; }
.desk-clipboard-source { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.msgs { flex:1; overflow:auto; padding:16px; display:flex; flex-direction:column; gap:10px; min-height:0; }
.bubble { max-width: 70%; padding:8px 12px; border-radius:10px; background:#1d2330; white-space:pre-wrap; overflow-wrap:anywhere; word-break:break-word; flex-shrink:0; /* img-bubble-fix-20261109c: never shrink/clip in .msgs flex */ }
.bubble.mine { align-self:flex-end; background:#1e3a5f; }
.bubble.system { align-self:center; background:transparent; color:var(--muted); font-size:12px; }
.bubble img, .bubble video { max-width:100%; display:block; border-radius:6px; margin-top:6px; }


.meta { font-size:11px; color:var(--muted); margin-bottom:4px; }
.quick { display:flex; gap:8px; flex-wrap:wrap; padding:8px 12px; border-top:1px solid var(--line); background:#12151c; flex-shrink:0; }
.quick button { background:#1d2330; border:1px solid var(--line); color:var(--text); border-radius:999px; padding:6px 10px; cursor:pointer; font-size:13px; }
.composer { display:flex; gap:8px; align-items:flex-end; padding:12px; border-top:1px solid var(--line); background: var(--panel); flex-shrink:0; }
.composer textarea { flex:1; min-height:48px; max-height:200px; overflow-y:auto; resize:none; overflow-wrap:anywhere; word-break:break-word; line-height:1.4; white-space:pre-wrap; }
.file { display:inline-flex; align-items:center; padding:10px 12px; border-radius:8px; cursor:pointer; }
@media (max-width: 860px) {
  .desk { grid-template-columns: 1fr; grid-template-rows: minmax(0, 40vh) minmax(0, 1fr); }
  .sidebar { max-height: 40vh; }
}


/* 如何发截图 · 对齐 visitor，适配 desk 深色 */
.shot-bar {
  background: #12151c;
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.shot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.shot-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.shot-fold {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.shot-fold:hover { background: #1d2330; color: var(--text); }
.shot-body { display: flex; flex-direction: column; gap: 6px; }
.shot-bar.is-collapsed { gap: 0; padding: 6px 12px; }
.shot-bar.is-collapsed .shot-body { display: none; }
.shot-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.shot-os {
  font-weight: 600;
  color: var(--text);
  min-width: 7.5em;
  flex-shrink: 0;
}
.shot-keys { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.shot-keys .plus { color: #6b7280; font-size: 11px; }
.shot-desc { color: var(--muted); }
.shot-desc kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid #3a4150;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #1d2330;
  font-size: 11px;
  font-family: inherit;
  color: var(--text);
  min-height: auto;
}
.shot-bar kbd {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border: 1px solid #3a4150;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: linear-gradient(#2a3140, #1d2330);
  font-size: 11px;
  font-family: inherit;
  color: var(--text);
  min-height: 22px;
}
.shot-bar .win-key {
  background: linear-gradient(#3a3f4a, #111827);
  color: #fff;
  border-color: #4b5563;
  font-weight: 600;
}
.shot-bar .win-key .win-svg { display: block; flex-shrink: 0; }
.shot-mobile { display: none; }
@media (max-width: 860px) {
  .shot-desktop { display: none; }
  .shot-mobile { display: flex; }
}

/* payment bubble */
.pay-bubble .pay-head { font-weight: 600; margin-bottom: 4px; }
.pay-bubble .pay-desc { font-size: 12px; color: #666; margin-bottom: 6px; }
.pay-bubble .pay-qr { max-width: 200px !important; margin: 6px 0; background: #fff; padding: 6px; border-radius: 8px; }
.pay-bubble .pay-tip { font-size: 12px; color: #888; }
.pay-bubble .pay-paid {
  display: inline-block; margin-top: 6px; padding: 4px 10px; border-radius: 999px;
  background: #dcfce7; color: #166534; font-weight: 600; font-size: 13px;
}

/* img-bubble-fix-20261109c: full image, no nested scroll, no flex-shrink clip */
.bubble.is-media {
  padding: 0 !important;
  background: transparent !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  white-space: normal !important;
  border: 0 !important;
  box-shadow: none !important;
  flex-shrink: 0 !important;
}
.bubble.is-media.mine {
  background: transparent !important;
}
.bubble.is-media .meta {
  margin: 0 0 4px 2px;
  padding: 0 2px;
}
.bubble.is-media > img,
.bubble.is-media > video {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  max-width: min(720px, 100%) !important;
  max-height: none !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  background: transparent !important;
}

/* password show/hide */
.pw-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.pw-wrap input {
  width: 100%;
  padding-right: 52px !important;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent !important;
  border: 0 !important;
  color: var(--muted) !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  cursor: pointer;
  border-radius: 6px !important;
  line-height: 1.2;
  margin: 0 !important;
  width: auto !important;
  box-shadow: none !important;
}
.pw-toggle:hover {
  color: var(--text) !important;
  background: rgba(255,255,255,.06) !important;
}
.login .pw-toggle {
  background: transparent !important;
  color: var(--muted) !important;
  border: 0 !important;
  padding: 4px 8px !important;
  font-weight: 500 !important;
  margin-top: 0 !important;
}
.login input { width: 100%; min-width: 0; }
.login .pw-toggle { min-width: 40px; min-height: 32px; margin: 0 !important; width: auto !important; }
[hidden] { display: none !important; }
.payment-mode-notice { padding: 7px 16px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.personal-qr-missing { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: #fffbeb; color: #92400e; border-bottom: 1px solid #fcd34d; font-size: 14px; }
.personal-qr-missing button { background: #fff; color: #92400e; border: 1px solid #d97706; border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; }

/* layout-fix-20261117: payment-mode notice / no-QR bar spacing above the message list */
.payment-mode-notice { padding: 8px 16px 9px; line-height: 1.5; background: #12151c; flex-shrink: 0; }
.personal-qr-missing { flex-shrink: 0; }
.payment-mode-notice:not([hidden]) ~ .msgs,
.personal-qr-missing:not([hidden]) ~ .msgs { padding-top: 22px; }
@media (max-width: 720px) {
  .payment-mode-notice { padding: 8px 12px; }
  .personal-qr-missing { padding: 10px 12px; gap: 8px; }
}

/* payment-packages-20261110c */
.pay-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.pay-modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  width: min(420px, 100%);
}
.pay-modal h3 { margin: 0 0 12px; font-size: 16px; }
.pay-pkg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pay-pkg-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: #12151c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.pay-pkg-btn:hover { border-color: var(--accent); }
.pay-pkg-name { font-weight: 600; }
.pay-pkg-amount { color: #93c5fd; font-weight: 600; white-space: nowrap; }
.pay-modal .ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}

/* img-clarity-20261110d: larger in-bubble preview + original-view lightbox */
.bubble.is-media {
  max-width: min(720px, 100%);
}
.bubble.is-media > img {
  cursor: pointer;
}
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: zoom-out;
}
.img-lightbox.hidden { display: none !important; }
.img-lightbox img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-out;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* desk-notify-merge-20261111a */
.conv.has-unread { box-shadow: inset 3px 0 0 #ef4444; background: #1a1518; }
.desk-toast {
  position: fixed;
  right: 20px;
  top: 16px;
  z-index: 80;
  background: #b91c1c;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  cursor: pointer;
  max-width: 320px;
  font-size: 14px;
  line-height: 1.4;
}
.desk-toast.hidden { display: none !important; }
.receipt-entry:focus-visible, .receipt-dialog :focus-visible { outline: 2px solid #8cb8ff; outline-offset: 2px; }
.receipt-entry { margin: 4px 8px 0; padding: 9px 12px; text-align: left; color: var(--text); background: #202637; border: 1px solid #39465b; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; flex-shrink: 0; }
.receipt-reminder { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; background: #382b1a; color: #ffdda1; font-size: 14px; }
.receipt-reminder[hidden], .receipt-actions[hidden], .receipt-dialog form[hidden] { display: none; }
.receipt-reminder button, .receipt-dialog button { background: #243147; color: #dbe8f8; border: 1px solid #425474; border-radius: 6px; padding: 7px 10px; font: inherit; cursor: pointer; }
.receipt-reminder button { flex-shrink: 0; }
.receipt-dialog { width: min(600px, calc(100vw - 24px)); max-height: 85vh; padding: 20px; overflow: auto; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.receipt-dialog::backdrop { background: #0009; }
.receipt-dialog header, .receipt-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.receipt-dialog header { justify-content: space-between; }
.receipt-dialog h2 { margin: 0; font-size: 20px; }
.receipt-dialog article { padding: 14px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.receipt-dialog h3 { margin: 0; font-size: 16px; }
.receipt-dialog p { margin: 8px 0; font-size: 13px; line-height: 1.45; color: #bbc8d8; }
.receipt-dialog [data-review-action="confirm"] { background: #13634a; color: white; border-color: #2c866b; }
.receipt-dialog form label { display: block; margin-bottom: 8px; }
.receipt-dialog form input { display: block; margin-top: 5px; width: 100%; color: var(--text); background: var(--bg); padding: 8px; border: 1px solid var(--line); border-radius: 5px; }
.receipt-dialog form button { margin-right: 6px; }
.receipt-dialog button:disabled { opacity: .55; cursor: default; }
.customer-home-copy-dialog { width: min(480px, calc(100vw - 24px)); }
.customer-home-copy-dialog input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 16px;
}

.composer-tools { display: flex; flex: none; align-items: center; gap: 8px; }
.composer textarea { min-width: 0; }
#receiptCodeOpen { white-space: nowrap; }
#receiptCodeOpen:disabled { opacity: .55; cursor: default; }
.receipt-code-dialog { width: min(420px, calc(100vw - 24px)); box-sizing: border-box; }
.receipt-code-dialog label { display: block; margin-bottom: 6px; }
.receipt-code-dialog label[hidden] { display: none; }
.receipt-code-dialog select { width: 100%; }
.receipt-code-dialog #receiptCodeSend { margin-top: 12px; }
.receipt-code-dialog .receipt-code-send-preview {
  display: block;
  width: min(100%, 220px);
  aspect-ratio: 1;
  object-fit: contain;
  margin: 12px auto 0;
  background: #fff;
  border-radius: 6px;
}
.receipt-code-send-preview[hidden] { display: none; }
.receipt-code-dialog p.err { color: #ffb4a8; }
.static-receipt-dialog { width: min(480px, calc(100vw - 24px)); }
.static-receipt-dialog header { margin-bottom: 10px; }
.static-receipt-dialog p.err { color: #ffb4a8; }
.static-receipt-dialog form input { margin: 0 0 12px; min-height: 40px; font: inherit; }
.static-receipt-dialog form label { margin: 0 0 4px; }
.static-receipt-dialog form { padding: 12px 0; }
.static-receipt-dialog article:last-child { padding-bottom: 4px; }
.static-receipt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.static-receipt-dialog .static-receipt-actions button { margin-right: 0; }
.static-receipt-actions button, .static-receipt-message button { min-height: 36px; }
#staticReceiptSave { background: var(--accent); border-color: var(--accent); color: #fff; }
.static-receipt-message { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.static-receipt-message span { color: #b7c3d5; font-size: 12px; }
#staticReceiptOpen { white-space: nowrap; }
@media (max-width: 520px) {
  .composer { flex-wrap: wrap; }
  .composer-tools { flex-basis: 100%; }
}
