.zalo-bot-page {
  --zb-primary:#087f8c;
  --zb-ink:#172b3a;
  --zb-muted:#758491;
  padding:10px 12px 12px;
  color:var(--zb-ink);
  width:100%;
  min-width:0
}
.zb-topbar{display:flex;align-items:center;gap:8px;border-bottom:1px solid #dce7e9;margin-bottom:10px;min-width:0}
.zb-tabs{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:thin}
.zb-tabs button{flex:none;border:0;border-bottom:3px solid transparent;background:transparent;padding:9px 13px;color:#61727e;font-size:13px;font-weight:600;white-space:nowrap;cursor:pointer}
.zb-tabs button.is-active{border-bottom-color:#087f8c;color:#087f8c}
.zb-tabs button span{display:inline-block;margin-left:5px;padding:1px 7px;border-radius:12px;background:#e1f2f1;font-size:11px}
.zb-refresh{margin-left:auto}
.zb-settings{max-width:760px;margin:0 auto;background:#fff;border:1px solid #e3e9ed;border-radius:16px;padding:26px;box-shadow:0 8px 30px #233d5010}
.zb-settings-heading{display:flex;align-items:start;justify-content:space-between;margin-bottom:24px}
.zb-settings-heading h2{font-size:20px;margin:0 0 6px}
.zb-settings-heading p,.zb-settings-hint{font-size:13px;color:#667784;margin:0}
.zb-settings form{display:grid;gap:22px}
.zb-settings-switch{display:flex;align-items:center;gap:13px;cursor:pointer}
.zb-settings-switch input{width:20px;height:20px;accent-color:#087f8c}
.zb-settings-switch span{display:grid;gap:3px}
.zb-settings-switch small,.zb-settings-field small{color:#667784;font-size:12px}
.zb-settings-field{display:grid;gap:8px;font-weight:600;font-size:14px}
.zb-settings-field select,.zb-settings-field textarea{width:100%;padding:10px 12px;border:1px solid #ccd9df;border-radius:9px;background:#fff;color:#172b3a;font:inherit;font-weight:400}
.zb-settings-field textarea{resize:vertical;min-height:116px}
.zb-settings-field :disabled{background:#f3f6f7}
.zb-settings-hint{padding:10px 12px;background:#f0f7f8;border-radius:8px}
.zb-settings-save{justify-self:start;border:0;border-radius:9px;padding:11px 18px;background:#087f8c;color:#fff;font-weight:600;cursor:pointer}
.zb-settings-save:disabled{opacity:.6;cursor:default}
.zb-settings-success{margin-bottom:15px;color:#146c43;font-weight:600}
.zb-icon-button {
  border:0;
  background:transparent;
  color:#71818f;
  width:36px;
  height:36px;
  border-radius:9px;
  flex-shrink:0;
  display:inline-flex;
  align-items:center;
  justify-content:center
}
.zb-icon-button:hover,.zb-icon-button.is-active {
  background:#eaf4f4;
  color:var(--zb-primary)
}
.zb-icon-button:disabled {
  opacity:.35
}
.zb-workspace {
  display:flex;
  height:calc(100dvh - 126px);
  min-height:400px;
  max-height:1100px;
  background:#fff;
  border:1px solid #e3e9ed;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 8px 30px #233d5010
}
.zb-inbox {
  width:clamp(260px, 23vw, 310px);
  flex-shrink:0;
  display:flex;
  flex-direction:column;
  border-right:1px solid #e9eef1
}
.zb-inbox-tools {
  padding:10px 12px 8px
}
.zb-inbox h2,.zb-info h2 {
  font-size:15px;
  font-weight:700;
  margin:0 0 8px
}
.zb-inbox h2 small {
  float:right;
  font-weight:400;
  color:var(--zb-muted);
  font-size:11px
}
.zb-search {
  display:flex;
  align-items:center;
  gap:9px;
  background:#f3f6f8;
  border:1px solid transparent;
  border-radius:10px;
  padding-left:12px;
  color:#8493a0
}
.zb-search:focus-within {
  border-color:var(--zb-primary)
}
.zb-search input {
  width:100%;
  min-width:0;
  border:0;
  outline:0;
  background:transparent;
  font-size:12px;
  padding:8px 0
}
.zb-inbox select {
  width:100%;
  font-size:12px;
  border:1px solid #e3e9ed;
  background:#fff;
  border-radius:8px;
  padding:6px 8px;
  margin-top:6px;
  color:#526575
}
.zb-inbox-list {
  overflow:auto;
  flex:1;
  min-height:0
}
.zb-contact {
  width:100%;
  display:flex;
  gap:11px;
  border:0;
  border-left:3px solid transparent;
  background:#fff;
  padding:13px 12px;
  text-align:left;
  color:inherit
}
.zb-contact:hover {
  background:#f7fafb
}
.zb-contact.active {
  background:#ecf7f6;
  border-left-color:var(--zb-primary)
}
.zb-avatar {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:39px;
  height:39px;
  background:#e5f1f2;
  color:var(--zb-primary);
  font-size:14px;
  font-weight:700;
  border-radius:13px;
  flex-shrink:0
}
.zb-contact-content {
  flex:1;
  min-width:0
}
.zb-avatar zalo-avatar { display:flex; width:100%; height:100%; align-items:center; justify-content:center; overflow:hidden; border-radius:inherit }
.zb-avatar img { display:block; width:100%; height:100%; object-fit:cover }
.zb-tags-header { display:flex; align-items:center; justify-content:space-between; gap:8px }
.zb-tags { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0 16px }
.zb-tag { border:1px solid #cbdde1; border-radius:16px; padding:7px 12px; background:#fff; color:#345566; font-size:12px; overflow-wrap:anywhere; max-width:100%; min-height:36px }
.zb-tag.is-assigned { background:#e4f4f2; border-color:#078493; color:#006875 }
.zb-tag:disabled { opacity:.7; cursor:default }
.zb-process-row { display:flex; align-items:center; flex-wrap:wrap; gap:5px; margin-top:0 }
.zb-process-labels { position:relative; font-weight:400 }
.zb-process-labels summary { display:flex; align-items:center; gap:7px; list-style:none; cursor:pointer; background:#eef0f4; color:#476479; border-radius:5px; padding:5px 8px; font-size:11px; min-height:28px }
.zb-process-labels summary::-webkit-details-marker { display:none }
.zb-process-labels summary:focus-visible { outline:2px solid #078493; outline-offset:2px }
.zb-process-menu { position:absolute; top:calc(100% + 5px); left:0; z-index:30; width:260px; max-width:calc(100vw - 100px); max-height:320px; overflow-y:auto; background:#fff; border:1px solid #dce3e9; box-shadow:0 8px 24px #17324b24; border-radius:8px; padding:8px }
.zb-process-menu button { display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:#fff; color:#49677c; border:0; border-radius:5px; padding:10px; font-size:12px; min-height:40px }
.zb-process-menu button span { flex:1; overflow-wrap:anywhere }
.zb-process-menu button:hover,.zb-process-menu button.active { background:#e6f4f2; color:#007786 }
.zb-process-menu button:disabled { opacity:.65; cursor:default }
.zb-process-menu p,.zb-process-menu small { display:block; font-size:12px; margin:8px }
.zb-process-current { font-size:11px; color:#007786; background:#e6f4f2; border-radius:5px; padding:4px 7px; overflow-wrap:anywhere; max-width:100% }
.zb-contact-title {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px
}
.zb-contact-title strong {
  font-size:13px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.zb-contact-title time {
  font-size:10px;
  color:var(--zb-muted)
}
.zb-preview {
  display:block;
  font-size:12px;
  color:#758491;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  margin:6px 0 8px
}
.zb-contact-meta {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:10px;
  color:var(--zb-muted)
}
.zb-contact-meta>span:last-child {
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.zb-status {
  font-size:10px;
  color:#778796;
  white-space:nowrap
}
.zb-status:before {
  content:'';
  display:inline-block;
  width:5px;
  height:5px;
  border-radius:50%;
  background:currentColor;
  margin-right:5px;
  vertical-align:middle
}
.zb-status.COLLECTING {
  color:#0c9082
}
.zb-status.HUMAN_HANDOFF {
  color:#5377b2
}
.zb-pagination {
  border-top:1px solid #edf1f4;
  padding:8px 15px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:11px;
  color:var(--zb-muted)
}
.zb-chat {
  flex:1;
  min-width:0;
  background:#f6f8fa;
  display:flex;
  position:relative
}
.zb-chat-inner {
  display:flex;
  flex-direction:column;
  width:100%;
  min-height:0
}
.zb-chat-header {
  background:#fff;
  padding:7px 12px;
  display:flex;
  align-items:center;
  gap:9px;
  border-bottom:1px solid #e9eef1
}
.zb-chat-header > .zb-avatar { width:34px; height:34px; border-radius:10px }
.zb-chat-person {
  flex:1;
  min-width:0;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:3px 9px
}
.zb-chat-person h2 {
  font-size:14px;
  font-weight:700;
  margin:0;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.zb-chat-notice {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  font-size:11px;
  color:#687d8b;
  padding:5px 12px;
  background:#f0f5f7
}
.zb-chat-notice i {
  color:#7f9aa8
}
.zb-test {
  font-size:9px;
  padding:2px 5px;
  background:#fff0ce;
  color:#a07018;
  border-radius:4px
}
.zb-messages {
  flex:1;
  min-height:0;
  overflow:auto;
  padding:16px 18px;
  overscroll-behavior:contain
}
.zb-timeline {
  text-align:center;
  color:#9aa8b2;
  font-size:10px;
  margin-bottom:20px
}
.zb-message {
  display:flex;
  margin:12px 0
}
.zb-message.outbound {
  justify-content:flex-end
}
.zb-bubble {
  max-width:85%;
  background:#fff;
  border:1px solid #e9eef1;
  border-radius:13px 13px 13px 3px;
  padding:11px 14px;
  overflow-wrap:anywhere;
  box-shadow:0 2px 3px #233d5004
}
.zb-message.outbound .zb-bubble {
  background:#e6f2f1;
  border-color:#dcecea;
  border-radius:13px 13px 3px 13px
}
.zb-message.human .zb-bubble {
  background:#087f8c;
  border-color:#087f8c;
  color:#fff
}
.zb-bubble p {
  white-space:pre-wrap;
  margin:0;
  font-size:13px;
  line-height:1.65
}
.zb-sender {
  display:block;
  font-size:9px;
  font-weight:600;
  color:#69958f;
  margin-bottom:4px
}
.human .zb-sender {
  color:#c4e5e8
}
.zb-message-meta {
  display:flex;
  justify-content:flex-end;
  gap:8px;
  color:#8b9fa7;
  font-size:9px;
  margin-top:5px
}
.human .zb-message-meta {
  color:#c4e5e8
}
.zb-composer {
  background:#fff;
  border-top:1px solid #e8eef1;
  padding:7px 12px 5px
}
.zb-composer-row {
  display:flex;
  align-items:flex-end;
  gap:10px
}
.zb-composer textarea {
  resize:none;
  flex:1;
  min-width:0;
  height:44px;
  min-height:44px;
  max-height:90px;
  border:1px solid #e4ebee;
  border-radius:11px;
  background:#fafcfd;
  padding:8px 10px;
  font-size:13px;
  outline:0
}
.zb-composer textarea:focus {
  border-color:var(--zb-primary)
}
.zb-send-button {
  width:40px;
  height:40px;
  flex-shrink:0;
  border:0;
  border-radius:12px;
  background:var(--zb-primary);
  color:#fff
}
.zb-send-button:disabled {
  opacity:.4
}
.zb-composer-hint {
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:9px;
  color:#96a4ae;
  padding-top:3px
}
.zb-state {
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:10px;
  padding:35px;
  text-align:center;
  color:#91a0ac;
  font-size:12px;
  width:100%;
  height:100%
}
.zb-inbox-list .zb-state {
  height:auto;
  min-height:200px
}
.zb-state>i {
  font-size:28px
}
.zb-welcome h2 {
  font-size:19px;
  color:#526776;
  font-weight:600
}
.zb-welcome-icon {
  display:flex;
  align-items:center;
  justify-content:center;
  width:75px;
  height:75px;
  background:#e7f2f2;
  border-radius:24px;
  color:var(--zb-primary);
  font-size:30px;
  margin-bottom:10px
}
.zb-info {
  width:280px;
  flex-shrink:0;
  border-left:1px solid #e9eef1;
  background:#fff;
  display:flex;
  flex-direction:column
}
.zb-info header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:15px 17px;
  border-bottom:1px solid #e9eef1
}
.zb-info h2 {
  margin:0
}
.zb-info-body {
  overflow:auto;
  padding:18px
}
.zb-info-identity {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  text-align:center;
  margin-bottom:17px
}
.zb-info-identity .zb-avatar {
  width:52px;
  height:52px;
  border-radius:17px;
  font-size:18px
}
.zb-info-identity strong {
  font-size:13px
}
.zb-info-identity small {
  font-size:10px;
  color:var(--zb-muted);
  overflow-wrap:anywhere
}
.zb-call {
  display:block;
  text-align:center;
  border:1px solid #cfe5e3;
  border-radius:8px;
  padding:9px;
  color:var(--zb-primary);
  font-size:12px;
  background:#f0f8f7
}
.zb-info h3 {
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:1px;
  color:#93a0aa;
  font-weight:700;
  margin:24px 0 12px
}
.zb-info dl>div {
  padding:9px 0;
  border-bottom:1px solid #f0f3f5
}
.zb-info dt {
  font-size:10px;
  font-weight:400;
  color:#8595a0;
  margin-bottom:3px
}
.zb-info dd {
  font-size:12px;
  font-weight:600;
  margin:0;
  overflow-wrap:anywhere
}
.zb-info-summary {
  font-size:12px;
  line-height:1.65;
  color:#6a7e8c;
  overflow-wrap:anywhere
}
.zb-info-note {
  font-size:11px;
  color:var(--zb-primary)
}
.zb-delete {
  margin-top:25px;
  border:1px solid #f1dede;
  border-radius:8px;
  padding:9px;
  width:100%;
  font-size:11px;
  background:#fff;
  color:#bf6262
}
.zb-alert,.zb-send-error {
  padding:10px;
  font-size:12px;
  background:#fff1eb;
  color:#b5643e;
  border-radius:8px;
  margin-bottom:10px
}
.zb-back {
  display:none
}
.zb-icon-button:focus-visible,.zb-contact:focus-visible,.zb-send-button:focus-visible {
  outline:2px solid var(--zb-primary);
  outline-offset:-2px
}

@media(min-width:768px) and (max-width:1500px) {
  .zb-info {
  position:absolute;
  right:0;
  top:0;
  bottom:0;
  z-index:5;
  box-shadow:-10px 0 25px #172b3a12
}
.zb-workspace {
  position:relative
}
.zb-inbox {
  width:280px
}

}

@media(max-width:767px) {
  .zalo-bot-page {
  padding:6px 8px 8px
}
.zb-workspace {
  height:calc(100dvh - 122px);
  min-height:0;
  max-height:none;
  border-radius:9px;
  position:relative
}
.zb-topbar { margin-bottom:8px }
.zb-tabs button { padding:8px 10px; font-size:12px }
.zb-settings { padding:16px; border-radius:10px }
.zb-settings-heading { margin-bottom:16px }
.zb-settings form { gap:16px }
.zb-settings-field select,.zb-settings-field textarea { font-size:16px }
.zb-inbox-tools { padding:12px 12px 10px }
.zb-search input,.zb-inbox select { font-size:16px }
.zb-inbox {
  width:100%;
  border:0
}
.zb-chat {
  display:none
}
.has-selection .zb-inbox {
  display:none
}
.has-selection .zb-chat {
  display:flex;
  width:100%
}
.zb-back {
  display:inline-flex
}
.zb-chat-header {
  padding:7px 8px;
  gap:6px
}
.zb-chat-header .zb-avatar {
  width:32px;
  height:32px;
  border-radius:10px
}
.zb-chat-person h2 {
  font-size:13px
}
.zb-chat-notice {
  padding:7px 10px;
  font-size:10px
}
.zb-messages {
  padding:14px 12px
}
.zb-bubble {
  max-width:90%
}
.zb-composer {
  padding:7px 10px;
  padding-bottom:max(7px,env(safe-area-inset-bottom))
}
.zb-composer textarea {
  height:48px;
  min-height:48px;
  font-size:16px
}
.zb-composer-hint span:first-child {
  max-width:75%
}
.zb-info {
  position:absolute;
  inset:0;
  width:100%;
  z-index:10;
  border:0
}
.zb-info header {
  padding:12px 17px
}
.zb-contact {
  padding:17px 13px
}
.zb-icon-button {
  min-width:40px;
  min-height:40px
}
.zb-info-body {
  padding:18px 24px
}
.zb-info dl {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0 12px
}

}
@media(max-width:390px) {
  .zb-tabs button { padding:8px 7px }
  .zb-refresh { width:32px; min-width:32px }
  .zb-info dl { grid-template-columns:1fr }
}
.zb-image-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 5px; }
.zb-image-button { display: block; padding: 0; border: 0; background: transparent; border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.zb-image-button img { display: block; width: auto; max-width: min(300px, 100%); max-height: 340px; height: auto; border-radius: 8px; object-fit: contain; }
.zb-image-fallback { border: 1px solid #d4e5e8; background: #f0f8fa; color: #087f8c; border-radius: 8px; padding: 18px; font-size: 12px; }
.zb-image-viewer { position: fixed; inset: 0; z-index: 2000; background: rgba(12, 24, 35, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 20px 28px; gap: 16px; }
.zb-image-viewer>img { max-width: 100%; max-height: calc(100dvh - 130px); object-fit: contain; }
.zb-viewer-close { position: absolute; top: 16px; right: 16px; border: 0; width: 44px; height: 44px; border-radius: 50%; color: white; background: #ffffff20; }
.zb-image-viewer>a { color: #fff; font-size: 13px; }
.zb-phone-token { cursor: context-menu; text-decoration: underline dotted; text-underline-offset: 3px; }
.zb-phone-menu-backdrop { position: fixed; inset: 0; z-index: 1998; background: transparent; }
.zb-phone-menu { position: fixed; z-index: 1999; width: 260px; padding: 12px; border: 1px solid #dce7e9; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px #172b3a33; display: grid; gap: 8px; font-size: 13px; }
.zb-phone-menu strong { color: #172b3a; }
.zb-phone-menu button { border: 0; border-radius: 7px; padding: 8px 10px; background: #087f8c; color: white; text-align: left; cursor: pointer; }
.zb-phone-menu button:disabled { opacity: .6; cursor: default; }
.zb-phone-menu .zb-phone-menu-close { background: #edf3f4; color: #425563; }
.zb-phone-menu p { margin: 0; color: #b42318; }
@media (max-width: 767px) { .zb-image-button img { max-width: 100%; max-height: 300px; } }
