/* Live chat (public tracking page, shipper dashboard, admin). Works with or without style.css. */
.cx, .cx * { box-sizing: border-box; }
.cx {
  --cx-me: var(--cx-me-o, var(--primary, #5B4FE0));
  --cx-acc: var(--cx-acc-o, var(--primary, #5B4FE0));
  --cx-line: var(--border, #E7E7F2);
  --cx-muted: var(--text-muted, #6B7180);
  --cx-faint: var(--text-faint, #9AA0AE);
  --cx-text: var(--text, #1B1E2B);
  --cx-soft: #F6F6FB;
  font-family: 'Inter', system-ui, sans-serif; color: var(--cx-text);
}
body.cx-public { --cx-me-o: #06303c; --cx-acc-o: #ee0000; background: #f0f4f6; margin: 0; font-family: 'Inter', system-ui, sans-serif; color: #0d1b24; overflow-x: hidden; }
body.cx-public a { text-decoration: none; color: inherit; }
body.cx-public h1, body.cx-public h2, body.cx-public h3 { font-family: 'Sora', 'Inter', sans-serif; margin: 0; }

/* ---- public page chrome (same look as the tracking page) ---- */
.cx-bar { background: #06303c; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.cx-bar .l { display: flex; align-items: center; gap: 10px; }
.cx-bar img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.cx-bar .brand { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 800; color: #fff; }
.cx-bar .back { background: #ee0000; color: #fff; padding: 8px 14px; font: 700 11px 'Sora', sans-serif; border-radius: 3px; }
.cx-hero { background: linear-gradient(160deg, #06303c 0%, #0a3a48 60%, #0f1f28 100%); padding: 30px 24px 90px; color: #fff; }
.cx-hero-in { max-width: 640px; margin: 0 auto; }
.cx-kicker { color: #ee0000; font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.cx-hero h1 { font-size: clamp(22px, 4vw, 28px); font-weight: 800; line-height: 1.2; }
.cx-hero p { font-size: 13px; color: #cfdde2; margin: 6px 0 0; line-height: 1.5; }
.cx-body { max-width: 640px; margin: -58px auto 0; padding: 0 16px 48px; position: relative; z-index: 5; }
.cx-foot { background: #06303c; color: #cfdde2; text-align: center; padding: 16px 24px; font-size: 11.5px; }

/* ---- cards / forms ---- */
.cx-card { background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.08); margin-bottom: 14px; overflow: hidden; border: 1px solid var(--cx-line); }
.cx-card .top { height: 4px; background: var(--cx-acc); }
.cx-pad { padding: 18px 20px; }
.cx-h { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--cx-muted); margin: 0 0 12px; font-family: 'Sora', sans-serif; }
.cx-flash { padding: 11px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; background: #FDECEC; color: #a02525; border-left: 3px solid #D13B3B; }
.cx-flash.ok { background: #E9F9EE; color: #17703d; border-color: #1E8E4F; }
.cx-f { margin-bottom: 14px; }
.cx-f label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.cx-f input[type=text], .cx-f input[type=email], .cx-f textarea, .cx-composer textarea {
  width: 100%; border: 1.5px solid #d9e1e5; border-radius: 8px; padding: 11px 12px; font: 400 15px 'Inter', system-ui, sans-serif; background: #fff; color: #0d1b24; outline: none;
}
.cx-f input:focus, .cx-f textarea:focus, .cx-composer textarea:focus { border-color: var(--cx-acc); box-shadow: 0 0 0 3px rgba(91,79,224,.12); }
.cx-f textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.cx-f .hint, .cx-hint { font-size: 12px; color: var(--cx-faint); margin-top: 5px; line-height: 1.45; }
.cx-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .cx-row2 { grid-template-columns: 1fr; } }
.cx-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.cx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; background: var(--cx-me); color: #fff; padding: 12px 18px; border-radius: 8px; font: 700 14px 'Sora', 'Inter', sans-serif; text-decoration: none; }
.cx-btn.full { width: 100%; }
.cx-btn.alt { background: #fff; color: var(--cx-text); border: 1.5px solid #d9e1e5; }
.cx-btn.red { background: #ee0000; }
.cx-btn.sm { padding: 8px 12px; font-size: 12.5px; border-radius: 6px; }
.cx-btn[disabled] { opacity: .55; cursor: default; }

/* ---- attachments picker ---- */
.cx-drop { position: relative; display: flex; align-items: center; gap: 12px; border: 2px dashed #c9d5db; border-radius: 10px; padding: 14px; background: #fafcfd; cursor: pointer; }
.cx-drop:hover { border-color: var(--cx-acc); }
.cx-drop .ico { font-size: 26px; }
.cx-drop strong { display: block; font-size: 14px; }
.cx-drop span { font-size: 12px; color: var(--cx-muted); }
.cx-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.cx-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cx-picks:empty { display: none; }
.cx-pick { position: relative; width: 74px; height: 74px; border-radius: 8px; overflow: hidden; background: #e8eef1; border: 1px solid var(--cx-line); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--cx-muted); text-align: center; }
.cx-pick img, .cx-pick video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cx-pick .rm { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 14px; line-height: 22px; padding: 0; cursor: pointer; }
.cx-pick .vid { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; }
.cx-err { color: #b32525; font-size: 13px; margin-top: 8px; display: none; }
.cx-err.on { display: block; }
.cx-prog { height: 6px; background: #e3eaee; border-radius: 99px; overflow: hidden; margin-top: 12px; display: none; }
.cx-prog.on { display: block; }
.cx-prog i { display: block; height: 100%; width: 0; background: var(--cx-acc); transition: width .15s; }

/* ---- ticket header / status ---- */
.cx-tid { font: 700 22px 'Courier New', monospace; letter-spacing: 1.5px; word-break: break-all; }
.cx-tidrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cx-subject { font: 700 16px 'Sora', 'Inter', sans-serif; margin: 10px 0 2px; word-break: break-word; }
.cx-meta { font-size: 12.5px; color: var(--cx-muted); line-height: 1.55; }
.cx-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: #eef1f3; color: #44525a; }
.cx-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .75; }
.cx-pill.tone-sent, .cx-pill.tone-waiting { background: #FFF3E6; color: #C2660A; }
.cx-pill.tone-needs { background: #FDECEC; color: #D13B3B; }
.cx-pill.tone-reviewed { background: #EAF0FE; color: #3B5BDB; }
.cx-pill.tone-replied { background: #E9F9EE; color: #1E8E4F; }
.cx-pill.tone-closed { background: #eceff1; color: #66757d; }
.cx-steps { display: flex; margin-top: 16px; }
.cx-step { flex: 1; text-align: center; position: relative; font-size: 11.5px; color: #9aa6ac; font-weight: 600; }
.cx-step::before { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 3px; background: #dde4e8; z-index: 0; }
.cx-step:first-child::before { display: none; }
.cx-step .b { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid #cdd7dc; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.cx-step.done { color: var(--cx-text); }
.cx-step.done::before { background: var(--cx-acc); }
.cx-step.done .b { background: var(--cx-acc); border-color: var(--cx-acc); }
.cx-step.cur .b { box-shadow: 0 0 0 4px rgba(238,0,0,.14); }

/* ---- thread ---- */
.cx-thread { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--cx-soft); min-height: 120px; }
.cx-msg { display: flex; }
.cx-msg.mine { justify-content: flex-end; }
.cx-bub { max-width: 86%; background: #fff; border: 1px solid var(--cx-line); border-radius: 16px 16px 16px 4px; padding: 10px 13px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.cx-msg.mine .cx-bub { background: var(--cx-me); color: #fff; border-color: transparent; border-radius: 16px 16px 4px 16px; }
.cx-who { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-bottom: 3px; flex-wrap: wrap; }
.cx-role { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: #eef1f3; color: #44525a; text-transform: uppercase; letter-spacing: .4px; }
.cx-msg.r-owner .cx-role { background: #E9F9EE; color: #1E8E4F; }
.cx-msg.r-admin .cx-role { background: #EFEDFE; color: #5B4FE0; }
.cx-msg.mine .cx-role { background: rgba(255,255,255,.22); color: #fff; }
.cx-text { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.5; }
.cx-files { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cx-files a.img { display: block; }
.cx-files img { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; background: #e8eef1; }
.cx-files video { display: block; width: 100%; max-height: 300px; border-radius: 10px; background: #000; }
.cx-time { font-size: 10.5px; opacity: .65; margin-top: 5px; text-align: right; }
.cx-empty { text-align: center; color: var(--cx-muted); font-size: 13px; padding: 30px 10px; }
.cx-closed { padding: 12px 16px; font-size: 13px; background: #eceff1; color: #55656d; text-align: center; }

.cx-composer { padding: 12px 14px 14px; border-top: 1px solid var(--cx-line); background: #fff; }
.cx-composer textarea { min-height: 46px; max-height: 160px; resize: none; padding: 11px 12px; }
.cx-comp-row { display: flex; align-items: flex-end; gap: 8px; }
.cx-comp-row .grow { flex: 1; }
.cx-clip { position: relative; flex: none; width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid #d9e1e5; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; cursor: pointer; }
.cx-clip input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.cx-send { flex: none; height: 44px; padding: 0 16px; }
.cx-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--cx-muted); }
.cx-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #1E8E4F; animation: cxp 2s infinite; }
@keyframes cxp { 50% { opacity: .3; } }

/* ---- inbox (owner + admin) ---- */
.cx-filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.cx-filters::-webkit-scrollbar { display: none; }
.cx-chip { flex: none; padding: 7px 13px; border-radius: 99px; border: 1.5px solid var(--cx-line); background: #fff; font-size: 13px; font-weight: 600; color: var(--cx-muted); text-decoration: none; }
.cx-chip.on { background: var(--cx-me); border-color: var(--cx-me); color: #fff; }
.cx-chip b { margin-left: 4px; opacity: .8; }
.cx-item { display: block; background: #fff; border: 1px solid var(--cx-line); border-radius: 14px; padding: 13px 14px; margin-bottom: 10px; text-decoration: none; color: inherit; position: relative; }
.cx-item.unread { border-color: var(--cx-acc); box-shadow: 0 0 0 3px rgba(91,79,224,.10); }
.cx-item .t { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cx-item .s { font-weight: 700; font-size: 14.5px; word-break: break-word; }
.cx-item .p { font-size: 13px; color: var(--cx-muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-item .m { font-size: 11.5px; color: var(--cx-faint); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.cx-udot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ee3b3b; margin-right: 6px; }
.cx-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cx-tools form { margin: 0; }

/* ---- small badges used in navs ---- */
.nav-dot { position: absolute; top: 6px; right: calc(50% - 20px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: #ee3b3b; color: #fff; font: 700 10px/16px Inter, sans-serif; text-align: center; }
.bottom-nav a { position: relative; }
.t-badge, .cx-count { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ee3b3b; color: #fff; font: 700 11px/18px Inter, sans-serif; text-align: center; vertical-align: middle; margin-left: 6px; }
.app-tile { position: relative; }
.app-tile .t-badge { position: absolute; top: 8px; right: 8px; margin: 0; }

/* ---- the public tracking page: support card + floating button ---- */
.cx-fab { position: fixed; right: 16px; bottom: 16px; z-index: 90; background: #ee0000; color: #fff !important; padding: 12px 16px; border-radius: 99px; font: 700 13px 'Sora', sans-serif; box-shadow: 0 6px 18px rgba(0,0,0,.28); display: inline-flex; gap: 8px; align-items: center; text-decoration: none; }
.cx-recent { margin-top: 12px; font-size: 12.5px; }
.cx-recent a { display: block; padding: 8px 10px; background: #f3f7f9; border-radius: 6px; margin-top: 6px; color: #06303c; font-weight: 600; }
.cx-recent a small { display: block; font-weight: 400; color: #6b7780; }
.cx-sep { border: 0; border-top: 1px solid #eef1f3; margin: 16px 0; }
@media print { .cx-fab, .cx-support { display: none !important; } }
.cx-closed[hidden] { display: none; }
