.customer-service-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.34);
  backdrop-filter: blur(12px);
}

.customer-service-dialog {
  width: min(600px, 100%);
  height: min(600px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 18px;
  padding: 24px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(20, 24, 38, 0.24);
}

.customer-service-header,
.customer-service-brand,
.customer-service-composer-row,
.customer-service-message-head {
  display: flex;
  align-items: center;
}

.customer-service-header { justify-content: space-between; gap: 16px; }
.customer-service-brand { gap: 10px; color: #1d1d1f; font-size: 16px; font-weight: 700; }
.customer-service-logo { width: 34px; height: 34px; border-radius: 11px; }
.customer-service-close { border: 0; background: #f2f2f7; color: #6e6e73; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 20px; }
.customer-service-tabs { display: flex; gap: 10px; padding: 5px; border-radius: 16px; background: #ebe8f4; box-shadow: inset 0 1px 2px rgba(37, 31, 75, .08); }
.customer-service-tab { flex: 1; border: 0; border-radius: 12px; padding: 11px 14px; background: transparent; color: #5e5a68; cursor: pointer; font-size: 14px; font-weight: 800; transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.customer-service-tab.is-active { background: linear-gradient(135deg, #7c5cfc, #6366f1); color: #fff; box-shadow: 0 5px 12px rgba(99, 102, 241, .28); }
.customer-service-tab { position: relative; }
.customer-service-tab-dot,
.customer-service-entry-dot { position: absolute; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: #ff3b30; box-shadow: 0 1px 4px rgba(181, 28, 22, .32); }
.customer-service-tab-dot { top: 5px; right: 7px; }
#sidebarServiceBtn { position: relative; }
.customer-service-entry-dot { top: 7px; right: 9px; }
.customer-service-tab-dot[hidden],
.customer-service-entry-dot[hidden] { display: none; }
.customer-service-main { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 4px 2px; }
.customer-service-main.is-bug-active { overflow-y: hidden; }
.customer-service-panel { display: flex; flex: 1; flex-direction: column; gap: 16px; }
.customer-service-panel[hidden] { display: none; }
.customer-service-welcome { text-align: center; padding: 6px 0 2px; }
.customer-service-orb { width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 50%; background: radial-gradient(circle at 34% 28%, #fff, #9f87ff 30%, #6d4df8 65%, #2eb8ff); box-shadow: 0 0 0 10px rgba(124, 92, 252, .09), 0 0 0 20px rgba(46, 184, 255, .06); animation: customer-service-breathe 2.8s ease-in-out infinite; }
.customer-service-welcome h2 { margin: 0; color: #1d1d1f; font-size: 21px; }
.customer-service-welcome p { margin: 8px 0 0; color: #86868b; font-size: 13px; }
.customer-service-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.customer-service-suggestion { border: 0; border-radius: 14px; padding: 11px 12px; background: #f3efff; color: #6146d7; text-align: left; cursor: pointer; font-size: 13px; font-weight: 600; }
.customer-service-conversation { display: flex; flex-direction: column; gap: 12px; }
.customer-service-message { max-width: 88%; padding: 12px 14px; border-radius: 18px; font-size: 13px; line-height: 1.6; }
  .customer-service-message.user { align-self: flex-end; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(135deg, #7c5cfc, #6366f1); color: #fff; border-bottom-right-radius: 5px; }
.customer-service-message.assistant { align-self: flex-start; background: #f5f5f7; color: #1d1d1f; border-bottom-left-radius: 5px; }
  .customer-service-message-head { gap: 7px; margin-bottom: 5px; color: #6d4df8; font-weight: 700; font-size: 12px; }
  .customer-service-message-image { display: block; overflow: hidden; max-width: 220px; border-radius: 12px; box-shadow: 0 2px 8px rgba(26, 15, 78, .2); }
  .customer-service-message-image img { display: block; width: 100%; max-height: 190px; object-fit: cover; }
.customer-service-sources { display: block; margin-top: 8px; color: #86868b; font-size: 11px; }
.customer-service-composer { border-top: 1px solid #ececf0; padding-top: 14px; }
.customer-service-composer-row { align-items: stretch; gap: 10px; }
.customer-service-input-wrap { position: relative; flex: 1; min-width: 0; }
.customer-service-input { width: 100%; min-height: 76px; resize: vertical; box-sizing: border-box; border: 1px solid #dedee5; border-radius: 16px; padding: 12px; color: #1d1d1f; font: inherit; font-size: 13px; outline: none; }
.customer-service-input:focus { border-color: #7c5cfc; box-shadow: 0 0 0 3px rgba(124, 92, 252, .12); }
.customer-service-send { align-self: flex-end; border: 0; border-radius: 14px; padding: 0 18px; min-height: 42px; background: linear-gradient(135deg, #7c5cfc, #6366f1); color: #fff; cursor: pointer; font-size: 13px; font-weight: 700; }
.customer-service-bug-panel { position: relative; gap: 8px; padding: 4px; }
.customer-service-bug-topbar { display: flex; align-items: stretch; justify-content: flex-end; gap: 8px; min-height: 38px; }
.customer-service-bug-summary { position: relative; flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 8px; row-gap: 3px; padding: 8px 11px; border-radius: 12px; background: #f8f7fc; box-shadow: inset 0 0 0 1px #ece8f8; }
.customer-service-bug-summary[hidden] { display: none; }
.customer-service-bug-summary-head { display: flex; align-items: center; gap: 5px; min-width: 0; color: #827b97; font-size: 11px; }
.customer-service-bug-summary-head em { border-radius: 999px; padding: 2px 6px; background: #fff4e5; color: #b54708; font-size: 10px; font-style: normal; }
.customer-service-bug-summary-head em.is-resolved { background: #e7f7ea; color: #167c3a; }
.customer-service-bug-summary-head em.is-unread { background: #f0eaff; color: #6941c6; }
.customer-service-bug-summary-head i { width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #ff3b30; box-shadow: 0 1px 4px rgba(181, 28, 22, .28); }
.customer-service-bug-summary-head i[hidden] { display: none; }
.customer-service-bug-summary strong { overflow: hidden; grid-column: 1; color: #36313f; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.customer-service-bug-summary p { overflow: hidden; grid-column: 2; grid-row: 1 / span 2; align-self: center; max-width: 130px; margin: 0; color: #777084; font-size: 11px; line-height: 1.35; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.customer-service-bug-summary.is-entering { animation: customer-service-summary-enter .38s ease-out; }
.customer-service-bug-label { display: grid; gap: 8px; color: #38383d; font-size: 13px; font-weight: 700; }
.customer-service-bug-title { width: 100%; box-sizing: border-box; border: 1px solid #dedee5; border-radius: 14px; padding: 12px 13px; color: #1d1d1f; font: inherit; font-size: 13px; outline: none; }
.customer-service-bug-title:focus { border-color: #7c5cfc; box-shadow: 0 0 0 3px rgba(124, 92, 252, .12); }
.customer-service-bug-description-wrap { position: relative; }
.customer-service-bug-input { width: 100%; min-height: 100px; resize: none; box-sizing: border-box; border: 1px solid #dedee5; border-radius: 18px; padding: 12px 12px 45px; color: #1d1d1f; font: inherit; font-size: 13px; line-height: 1.6; outline: none; }
.customer-service-bug-input:focus { border-color: #7c5cfc; box-shadow: 0 0 0 3px rgba(124, 92, 252, .12); }
.customer-service-bug-preview { display: none; position: absolute; bottom: 38px; left: 4px; width: fit-content; }
.customer-service-bug-preview.is-visible { display: block; }
.customer-service-bug-preview img { display: block; width: 52px; height: 52px; object-fit: cover; border-radius: 12px; border: 1px solid #dedee5; }
.customer-service-bug-preview button { position: absolute; right: -7px; top: -7px; width: 21px; height: 21px; border: 0; border-radius: 50%; background: #1d1d1f; color: #fff; cursor: pointer; line-height: 1; }
.customer-service-bug-actions { display: flex; justify-content: flex-end; }
.customer-service-bug-upload { position: absolute; left: 10px; bottom: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #eee9ff; color: #6547d7; cursor: pointer; }
.customer-service-bug-upload svg { width: 18px; height: 18px; }
.customer-service-bug-submit { border: 0; border-radius: 14px; padding: 11px 18px; background: linear-gradient(135deg, #7c5cfc, #6366f1); color: #fff; cursor: pointer; font-size: 13px; font-weight: 700; }
.customer-service-history-button { position: relative; border: 0; border-radius: 12px; padding: 10px 12px; background: #f1eff7; color: #5e4ab8; cursor: pointer; font-size: 13px; font-weight: 700; }
.customer-service-history-button i { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: #ff3b30; }
.customer-service-bug-status { min-height: 20px; margin: 0; color: #517062; font-size: 12px; }
.customer-service-bug-status.is-error { color: #c23a31; }
.customer-service-success-toast { position: absolute; top: 18px; left: 50%; z-index: 3; transform: translate(-50%, -12px); padding: 11px 18px; border-radius: 999px; background: #167c3a; color: #fff; font-size: 13px; font-weight: 700; opacity: 0; box-shadow: 0 10px 24px rgba(22, 124, 58, .24); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.customer-service-success-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.customer-service-history-modal { position: fixed; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(17, 24, 39, .35); backdrop-filter: blur(8px); }
.customer-service-history-modal[hidden] { display: none; }
.customer-service-history-dialog { width: min(520px, 100%); max-height: min(560px, calc(100vh - 48px)); overflow-y: auto; border-radius: 24px; padding: 22px; background: #fff; box-shadow: 0 24px 70px rgba(20, 24, 38, .25); }
.customer-service-history-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.customer-service-history-dialog h2 { margin: 0; color: #1d1d1f; font-size: 20px; }
.customer-service-history-dialog header p { margin: 5px 0 0; color: #86868b; font-size: 12px; }
.customer-service-history-dialog header button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f2f2f7; color: #6e6e73; cursor: pointer; font-size: 18px; }
.customer-service-history-list { display: grid; gap: 10px; margin-top: 18px; }
.customer-service-history-item { display: grid; gap: 10px; border-radius: 14px; padding: 12px; background: #f8f8fb; }
.customer-service-history-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.customer-service-history-item-head div { min-width: 0; display: grid; gap: 3px; }
.customer-service-history-item strong { overflow: hidden; color: #313136; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.customer-service-history-item span { color: #86868b; font-size: 11px; }
.customer-service-history-item em { flex: 0 0 auto; border-radius: 999px; padding: 4px 7px; background: #f0eaff; color: #6941c6; font-size: 11px; font-style: normal; }
.customer-service-history-item em.is-pending { background: #fff4e5; color: #b54708; }
.customer-service-history-item em.is-resolved { background: #e7f7ea; color: #167c3a; }
.customer-service-history-item p { margin: 0; color: #5d5d64; font-size: 12px; line-height: 1.6; }
.customer-service-history-item p b { color: #393942; }
.customer-service-history-empty { margin: 0; color: #86868b; font-size: 12px; }
.customer-service-history-empty.is-error { color: #c23a31; }
.customer-service-send:disabled, .customer-service-suggestion:disabled, .customer-service-bug-submit:disabled { opacity: .6; cursor: wait; }
@keyframes customer-service-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes customer-service-summary-enter { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .customer-service-orb { animation: none; } }
@media (max-width: 520px) { .customer-service-modal { padding: 12px; } .customer-service-dialog { height: calc(100vh - 24px); padding: 18px; border-radius: 22px; } .customer-service-suggestions { grid-template-columns: 1fr; } .customer-service-composer-row { align-items: flex-end; } }
