
:root{
  --reb-chat-gold:#f5b326;
  --reb-chat-blue1:#087fa8;
  --reb-chat-blue2:#0aa0cb;
  --reb-chat-ink:#18212b;
  --reb-chat-font:Ubuntu,"Noto Sans Khmer","Khmer OS",Arial,sans-serif;
}
.reb-floating-chat{display:none!important}

/* Floating launcher */
.reb-customer-chat-launcher{
  position:fixed!important;right:18px!important;bottom:18px!important;z-index:2147483000!important;
  width:54px!important;height:54px!important;min-width:54px!important;max-width:54px!important;padding:0!important;
  border:0!important;border-radius:50%!important;background:#101214!important;overflow:visible!important;
  display:flex!important;align-items:center!important;justify-content:center!important;cursor:pointer!important;
  box-shadow:0 10px 28px rgba(0,0,0,.32),0 0 0 2px rgba(245,179,38,.18)!important;
  animation:rebSupportBounce 1.75s ease-in-out infinite!important;
}
.reb-customer-chat-launcher:hover{transform:scale(1.08)!important}
.reb-support-launcher-image{
  display:block!important;width:46px!important;height:46px!important;object-fit:contain!important;border-radius:50%!important;pointer-events:none!important;
}
.reb-chat-launcher-badge{
  position:absolute!important;top:-5px!important;right:-5px!important;display:none!important;
  min-width:19px!important;height:19px!important;padding:0 5px!important;border-radius:999px!important;
  align-items:center!important;justify-content:center!important;background:#e53935!important;color:#fff!important;
  border:2px solid #fff!important;font:900 10px/1 Arial,sans-serif!important;
}
.reb-chat-launcher-badge.show{display:flex!important}
@keyframes rebSupportBounce{
  0%,100%{transform:translateY(0) rotate(0deg)}
  22%{transform:translateY(-9px) rotate(-5deg)}
  45%{transform:translateY(-2px) rotate(4deg)}
  70%{transform:translateY(-7px) rotate(-3deg)}
}

/* Chat shell desktop */
.reb-chat-shell{
  position:fixed!important;right:20px!important;bottom:84px!important;z-index:2147483100!important;
  width:390px!important;height:610px!important;max-width:calc(100vw - 32px)!important;max-height:calc(100vh - 110px)!important;
  background:#fff!important;border:1px solid #dfe5ea!important;border-radius:20px!important;
  box-shadow:0 24px 70px rgba(10,22,34,.30)!important;overflow:hidden!important;display:none!important;
  font-family:var(--reb-chat-font)!important;color:var(--reb-chat-ink)!important;
}
.reb-chat-shell.open{display:flex!important;flex-direction:column!important}
.reb-chat-shell,.reb-chat-shell *{box-sizing:border-box}
.reb-chat-shell button,.reb-chat-shell input,.reb-chat-shell textarea,.reb-chat-shell a,.reb-chat-shell span,.reb-chat-shell strong{
  font-family:var(--reb-chat-font)!important;
}

.reb-chat-header{
  flex:0 0 66px!important;min-height:66px!important;padding:10px 12px!important;
  display:flex!important;align-items:center!important;gap:10px!important;background:linear-gradient(135deg,#111317,#25272b)!important;color:#fff!important;
}
.reb-chat-avatar{width:40px!important;height:40px!important;flex:0 0 40px!important;border-radius:12px!important;background:var(--reb-chat-gold)!important;display:flex!important;align-items:center!important;justify-content:center!important;color:#111!important}
.reb-chat-headcopy{min-width:0!important;flex:1!important}
.reb-chat-headcopy strong{display:block!important;font-size:14px!important;font-weight:800!important}
.reb-chat-headcopy span{display:block!important;margin-top:2px!important;color:#cbd0d5!important;font-size:10px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.reb-chat-close{width:34px!important;height:34px!important;border-radius:10px!important;border:1px solid rgba(255,255,255,.14)!important;background:rgba(255,255,255,.07)!important;color:#fff!important;cursor:pointer!important}

.reb-chat-status{display:none!important;padding:6px 9px!important;background:#fff7df!important;color:#7a5a00!important;font-size:10px!important}
.reb-chat-status.show{display:block!important}
.reb-chat-status.error{background:#fff0f0!important;color:#a82727!important}
.reb-chat-progress{display:none!important;height:2px!important;background:#eee!important}
.reb-chat-progress.show{display:block!important}

.reb-chat-body{
  flex:1 1 auto!important;min-height:0!important;overflow:auto!important;padding:10px 9px 12px!important;
  background:linear-gradient(180deg,#f7f8fa,#f2f5f7)!important;
}
.reb-chat-empty,.reb-chat-login{height:100%!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;text-align:center!important;padding:18px!important;color:#7a858f!important}
.reb-chat-empty strong{color:#27313b!important;margin-bottom:5px!important}
.reb-chat-empty p,.reb-chat-login p{margin:0!important;font-size:11px!important;line-height:1.5!important}
.reb-empty-icon{width:40px!important;height:40px!important;border-radius:12px!important;background:#fff1c4!important;color:#b77b00!important;display:flex!important;align-items:center!important;justify-content:center!important;margin-bottom:10px!important}
.reb-chat-day{text-align:center!important;margin:7px 0!important}
.reb-chat-day span{display:inline-block!important;background:#e7ebef!important;border-radius:999px!important;padding:3px 7px!important;font-size:9px!important;color:#6f7983!important}
.reb-chat-row{display:flex!important;margin:7px 0!important}
.reb-chat-row.user{justify-content:flex-end!important}
.reb-chat-row.admin{justify-content:flex-start!important}
.reb-chat-bubble{
  display:inline-block!important;width:auto!important;max-width:84%!important;padding:8px 10px!important;border-radius:15px!important;overflow:hidden!important;
}
.reb-chat-row.user .reb-chat-bubble{background:linear-gradient(145deg,var(--reb-chat-blue1),var(--reb-chat-blue2))!important;color:#fff!important;border-bottom-right-radius:5px!important}
.reb-chat-row.admin .reb-chat-bubble{background:#fff!important;color:#202832!important;border:1px solid #e3e8ec!important;border-bottom-left-radius:5px!important}
.reb-chat-sender{font-size:10px!important;font-weight:800!important;margin-bottom:4px!important;color:#a87600!important}
.reb-chat-row.user .reb-chat-sender{color:#e9fbff!important;text-align:right!important}
.reb-chat-text{font-size:12px!important;line-height:1.45!important;white-space:pre-wrap!important;word-break:break-word!important}
.reb-chat-meta{margin-top:4px!important;display:flex!important;justify-content:flex-end!important;gap:4px!important;font-size:9px!important;color:#919ba4!important}
.reb-chat-row.user .reb-chat-meta{color:rgba(255,255,255,.80)!important}
.reb-chat-inline-link{color:#eaffff!important;text-decoration:underline!important;overflow-wrap:anywhere!important}
.reb-chat-row.admin .reb-chat-inline-link{color:#136fca!important}

.reb-chat-media{display:block!important;width:max-content!important;max-width:250px!important;margin-top:5px!important;border-radius:10px!important;overflow:hidden!important}
.reb-chat-media img,.reb-chat-media video{display:block!important;max-width:250px!important;max-height:220px!important;width:auto!important;height:auto!important;object-fit:contain!important;border-radius:10px!important}
.reb-chat-media audio{display:block!important;width:220px!important;max-width:100%!important;height:40px!important}
.reb-chat-file-card{display:flex!important;align-items:center!important;gap:7px!important;margin-top:5px!important;width:230px!important;max-width:100%!important;padding:7px!important;border-radius:10px!important;background:rgba(255,255,255,.10)!important;border:1px solid rgba(150,160,170,.25)!important}
.reb-chat-file-icon{width:31px!important;height:31px!important;flex:0 0 31px!important;border-radius:8px!important;background:var(--reb-chat-gold)!important;display:flex!important;align-items:center!important;justify-content:center!important}
.reb-chat-file-copy{min-width:0!important;flex:1!important}
.reb-chat-file-copy strong{font-size:10px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;display:block!important}
.reb-chat-file-copy span{font-size:8.5px!important;color:#8e98a3!important;display:block!important}
.reb-chat-file-card button{border:0!important;background:#111!important;color:#fff!important;border-radius:7px!important;padding:6px 7px!important;font-size:9px!important}

.reb-chat-rich-preview{margin-top:6px!important}
.reb-chat-preview-card{display:flex!important;width:250px!important;max-width:100%!important;min-height:62px!important;border-radius:10px!important;overflow:hidden!important;text-decoration:none!important;border:1px solid rgba(150,160,170,.25)!important;background:rgba(255,255,255,.09)!important;color:inherit!important}
.reb-chat-row.admin .reb-chat-preview-card{background:#f7f8fa!important;color:#1f2933!important}
.reb-chat-preview-card>img{width:76px!important;height:64px!important;object-fit:cover!important;flex:0 0 76px!important}
.reb-chat-preview-thumb-fallback{width:64px!important;flex:0 0 64px!important;display:flex!important;align-items:center!important;justify-content:center!important;background:#dff5fb!important;color:#087fa8!important}
.reb-chat-preview-copy{min-width:0!important;flex:1!important;padding:7px!important}
.reb-chat-preview-copy strong{font-size:10px!important;line-height:1.25!important}
.reb-chat-preview-copy small{display:block!important;margin-top:3px!important;font-size:8px!important;opacity:.7!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.reb-chat-preview-open{width:26px!important;display:flex!important;align-items:center!important;justify-content:center!important}

.reb-chat-attach-preview{display:none!important;padding:6px 8px!important;border-top:1px solid #e7e9ed!important;background:#fff!important;font-size:10px!important}
.reb-chat-attach-preview.show{display:flex!important;align-items:center!important;justify-content:space-between!important}
.reb-chat-composer{flex:0 0 auto!important;background:#fff!important;border-top:1px solid #e5e9ed!important;padding:6px!important}
.reb-chat-tools{display:flex!important;align-items:center!important;gap:5px!important;margin-bottom:5px!important;overflow:visible!important}
.reb-chat-tool{
  position:relative!important;width:33px!important;height:33px!important;flex:0 0 33px!important;border:1px solid #e2e6ea!important;background:#fff!important;border-radius:10px!important;
  display:flex!important;align-items:center!important;justify-content:center!important;color:#526170!important;padding:0!important;cursor:pointer!important;
}
.reb-chat-tool svg{width:17px!important;height:17px!important;pointer-events:none!important}
.reb-chat-mic{color:#a62f2f!important;background:#fff8f8!important;border-color:#efd5d5!important;touch-action:none!important}
.reb-chat-mic.recording{background:#d92d2d!important;color:#fff!important}
.reb-chat-record-label{display:none!important;color:#c43333!important;font-size:9px!important;font-weight:800!important}
.reb-chat-mic.recording~.reb-chat-record-label{display:inline!important}

.reb-chat-compose-row{display:flex!important;align-items:flex-end!important;gap:5px!important}
.reb-chat-text-indicator{width:32px!important;height:38px!important;flex:0 0 32px!important;border:1px solid #e3e7eb!important;background:#f7f8fa!important;border-radius:10px!important;display:flex!important;align-items:center!important;justify-content:center!important;color:#64717e!important}
.reb-chat-input{flex:1!important;min-height:38px!important;max-height:66px!important;resize:none!important;border:1px solid #dfe4e8!important;background:#f8f9fa!important;border-radius:10px!important;padding:9px!important;font-size:12px!important;outline:none!important}
.reb-chat-send{width:38px!important;height:38px!important;flex:0 0 38px!important;border:0!important;border-radius:10px!important;background:var(--reb-chat-gold)!important;display:flex!important;align-items:center!important;justify-content:center!important;cursor:pointer!important}

/* ONE mobile rule only */
@media (max-width:760px),(pointer:coarse){
  .reb-customer-chat-launcher{
    right:14px!important;bottom:14px!important;width:50px!important;height:50px!important;min-width:50px!important;max-width:50px!important;
  }
  .reb-support-launcher-image{width:42px!important;height:42px!important}
  .reb-chat-shell{
    right:14px!important;bottom:72px!important;left:auto!important;top:auto!important;
    width:286px!important;height:390px!important;min-width:0!important;min-height:0!important;
    max-width:calc(100vw - 84px)!important;max-height:calc(100dvh - 180px)!important;
    border-radius:20px!important;
  }
  .reb-chat-header{flex-basis:58px!important;min-height:58px!important;padding:8px 9px!important}
  .reb-chat-avatar{width:36px!important;height:36px!important;flex-basis:36px!important}
  .reb-chat-headcopy strong{font-size:12px!important}
  .reb-chat-headcopy span{font-size:9px!important}
  .reb-chat-body{padding:7px!important}
  .reb-chat-bubble{max-width:90%!important}
  .reb-chat-media,.reb-chat-media img,.reb-chat-media video{max-width:205px!important}
  .reb-chat-media audio{width:195px!important}
  .reb-chat-file-card,.reb-chat-preview-card{width:205px!important}
  .reb-chat-composer{padding:5px!important}
  .reb-chat-tool{width:31px!important;height:31px!important;flex-basis:31px!important}
  .reb-chat-input{min-height:36px!important;max-height:56px!important;padding:8px!important;font-size:11.5px!important}
  .reb-chat-send{width:36px!important;height:36px!important;flex-basis:36px!important}
  .reb-chat-text-indicator{width:30px!important;height:36px!important;flex-basis:30px!important}
}

/* Upload fallback panel: browser-native file inputs are intentionally NOT hidden/styled. */
.reb-chat-native-picker-panel[hidden]{display:none!important}
.reb-chat-native-picker-panel{
  margin:0 0 7px!important;padding:8px!important;border:1px solid #dfe5ea!important;
  border-radius:11px!important;background:#f8fafb!important;box-shadow:0 6px 18px rgba(0,0,0,.08)!important;
}
.reb-chat-native-picker-head{display:flex!important;align-items:center!important;justify-content:space-between!important;margin-bottom:7px!important}
.reb-chat-native-picker-head strong{font-size:11px!important;color:#28333d!important}
.reb-chat-native-picker-close{
  width:26px!important;height:26px!important;border:0!important;border-radius:7px!important;
  background:#eceff2!important;color:#333!important;font-size:16px!important;cursor:pointer!important;
}
.reb-chat-native-picker-row{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:7px!important;background:#fff!important;border:1px solid #e5e9ed!important;border-radius:9px!important;
}
.reb-chat-native-picker-row span{font-size:10.5px!important;font-weight:700!important;color:#46525e!important}
.reb-chat-native-picker-row input[type="file"]{
  position:static!important;display:block!important;width:165px!important;height:auto!important;
  opacity:1!important;visibility:visible!important;pointer-events:auto!important;
  font-size:10px!important;color:#333!important;background:transparent!important;
}
@media(max-width:760px),(pointer:coarse){
  .reb-chat-native-picker-panel{padding:7px!important}
  .reb-chat-native-picker-row{display:block!important}
  .reb-chat-native-picker-row span{display:block!important;margin-bottom:5px!important}
  .reb-chat-native-picker-row input[type="file"]{width:100%!important;font-size:10px!important}
}

.reb-chat-media-panel .reb-chat-native-picker-row,.reb-chat-file-panel .reb-chat-native-picker-row{margin:0!important}
