.team-tools {display:flex;gap:8px;margin-bottom:12px}.team-tools button,#employee-dialog button {border:1px solid #bac6b7;border-radius:7px;padding:6px 10px}#employee-dialog label,#employee-dialog input {display:block;width:100%;margin:.6rem 0}#employee-dialog input {font:inherit;padding:6px}#employee-list>div {display:flex;gap:10px;justify-content:space-between;border-top:1px solid #ddd;padding:8px 0;overflow-wrap:anywhere}#employee-dialog p {margin:.9rem 0}
body:has(dialog[open]) { overflow:hidden; }
.ticket .wait-over,.ticket .wait-time {display:block;font-weight:700;color:#8e461c}.ticket .wait-over {color:#a22f1f}
.quality-page h3 {margin-top:1rem}.quality-page p {margin:.6rem 0;overflow-wrap:anywhere}#quality-top {padding-left:1.5rem;overflow-wrap:anywhere}#quality-filter {display:flex;gap:8px;align-items:end;flex-wrap:wrap;margin-top:12px}#quality-filter input,#quality-filter select {display:block;font:inherit;max-width:100%;padding:5px}.quality-page button {padding:5px 10px;border:1px solid #bac6b7;border-radius:7px}
#reply-library {width:min(92vw,590px);padding:1.4rem;overflow:auto}
#reply-library label {display:block;margin:.75rem 0}
#reply-library input,#reply-library textarea,#reply-library select {display:block;margin-top:4px;width:100%;font:inherit;padding:7px;border:1px solid #bcc5b9;border-radius:6px}
#reply-library button,#reply-manage {border:1px solid #c6cec2;border-radius:7px;padding:5px 10px;margin:3px}
.reply-card {padding:12px 0;border-top:1px solid #d5dbd1;overflow-wrap:anywhere}
.reply-card h3 {font-size:1rem}.reply-card small {color:#5c6559}.reply-card p {white-space:pre-wrap;margin:5px 0}
.chat-launch { position:fixed; z-index:4; right:clamp(16px,3vw,44px); bottom:max(18px,env(safe-area-inset-bottom)); background:#242a25; color:white; display:flex; align-items:center; gap:10px; border:1px solid #485147; border-radius:30px; padding:12px 20px; min-height:48px; box-shadow:0 6px 22px #1d2a2026; font-size:.95rem; font-weight:700; }
.chat-icon { display:inline-block; position:relative; height:17px; width:21px; border:2px solid currentColor; border-radius:6px; color:#ff9c61; }
.chat-icon::after { content:""; position:absolute; left:3px; bottom:-5px; width:6px; height:5px; border-left:2px solid currentColor; transform:skewY(-35deg); }
.chat-dialog { margin:auto 20px max(15px,env(safe-area-inset-bottom)) auto; padding:0; width:min(410px,calc(100vw - 24px)); max-height:none; height:min(668px,88dvh); overflow:hidden; border-radius:18px; }
.chat-dialog[open] { display:flex; flex-direction:column; }
.chat-dialog::backdrop { background:#18231a40; }
.chat-bar { display:flex; gap:12px; align-items:center; background:#252a26; color:#fff; padding:16px 18px; }
.chat-bar h2,.room-top h2 { font-size:1.12rem; letter-spacing:0; line-height:1.4; }
.chat-bar p,.room-top p { margin:2px 0 0; color:#d7ded7; font-size:.87rem; }
.support-mark { background:#374039; display:grid; place-items:center; height:42px; width:42px; border-radius:12px; }
.chat-dismiss { color:#fff; font-size:1.65rem; line-height:1; width:36px; height:40px; flex-shrink:0; border-radius:8px; }
.chat-dismiss:hover { background:#414840; }
.sound-toggle { flex-shrink:0; white-space:nowrap; }
.staff-sound { margin:.4rem 0; }
.staff-sound summary { cursor:pointer; }
.staff-sound label { display:inline-flex; align-items:center; gap:.35rem; margin:.4rem .5rem .2rem 0; }
.staff-sound input { max-width:7rem; }
@keyframes ticket-arrival { 50% { background:#fff0cf; } }
.ticket.new-arrival { border-inline-start:4px solid #ae6120; animation:ticket-arrival .8s ease-in-out 3; }
@media(prefers-reduced-motion:reduce){.ticket.new-arrival { animation:none; background:#fff4dc; }}
.chat-bar .sound-toggle { margin-left:auto; padding:7px 9px; border:1px solid #68756a; border-radius:8px; color:#fff; font-size:.85rem; }
.chat-bar .sound-toggle:hover,.chat-bar .sound-toggle[aria-pressed="false"] { background:#414840; }
.inbox-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.inbox-actions .sound-toggle[aria-pressed="false"] { color:#5c6559; }
#chat-room,#staff-room,.chat-body { min-height:0; min-width:0; flex:1; display:flex; flex-direction:column; overflow:hidden; }
.thread-feed { flex:1; overflow:auto; overscroll-behavior:contain; padding:16px; min-height:60px; background:#f6f6f1; }
.msg { display:flex; flex-direction:column; align-items:flex-start; gap:4px; margin:0 0 13px; }
.msg.mine { align-items:flex-end; }
.speaker { font-size:.78rem; color:#586157; }
.bubble { white-space:pre-wrap; overflow-wrap:anywhere; background:#fff; border:1px solid #dee2d8; border-radius:4px 13px 13px; color:#212821; padding:10px 13px; max-width:90%; font-size:1rem; line-height:1.6; }
.mine .bubble { border-radius:13px 4px 13px 13px; background:#ecf2e9; border-color:#d8e2d3; }
.message-note { margin:12px auto; font-size:.87rem; text-align:center; color:#50594f; background:#e9ece4; border-radius:8px; padding:7px 10px; }
.bubble img,.bubble video { display:block; max-width:100%; max-height:230px; height:auto; border-radius:6px; }
.bubble .media-caption { margin:6px 0 0; }
.welcome { background:white; border:1px solid #e1e4da; border-radius:12px; padding:15px; }
.welcome strong { display:block; margin-bottom:5px; }
.welcome p { color:#535c52; font-size:.95rem; }
.quick-choices { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.quick-choices button,.older { border:1px solid #cdd5c9; border-radius:15px; color:#374534; padding:5px 11px; font-size:.87rem; background:#fbfcf9; }
.older { display:block; margin:0 auto 12px; }
.compose { padding:11px 14px 13px; background:#fffefa; border-top:1px solid #d9ddd3; }
.compose textarea { width:100%; min-height:52px; max-height:110px; resize:vertical; border:1px solid #cdd3c9; border-radius:9px; font:inherit; padding:9px 10px; color:#202820; background:white; display:block; }
.compose-row { display:flex; gap:8px; align-items:center; margin-top:7px; flex-wrap:wrap; }
.compose-row button,.room-top button,.inbox-top button,.page-buttons button,.file-info button { min-height:35px; font-size:.88rem; padding:5px 9px; border-radius:7px; background:#eef0e9; color:#334232; }
.compose-row .send { color:#fff; background:#263928; font-weight:700; padding-inline:16px; margin-left:auto; }
.compose-row button:disabled,.compose textarea:disabled,.desk button:disabled { opacity:.55; cursor:default; }
.compose-notice,.file-info { font-size:.85rem; color:#934313; line-height:1.5; overflow-wrap:anywhere; }
.compose-notice:empty,.file-info:empty,#list-error:empty { display:none; }
.file-info:not(:empty),.compose-notice:not(:empty) { margin:0 0 7px; }
.file-info button { font-size:.8rem; margin-left:6px; }
.desk { background:#f5f5f0; }
.desk-top { display:flex; align-items:center; gap:24px; padding:12px clamp(15px,3vw,48px); background:#fffefa; border-bottom:1px solid #d9ded2; }
.desk-top h1 { font-size:1.25rem; letter-spacing:0; line-height:1.4; margin:0; border-left:1px solid #d5d9d0; padding-left:24px; }
.desk-top > a:last-child { margin-left:auto; font-size:.9rem; }
.desk-layout { margin:clamp(12px,2vw,28px) auto; width:min(95%,1400px); display:grid; grid-template-columns:minmax(260px,32%) 1fr; height:calc(100dvh - 120px); min-height:440px; border:1px solid #d6dbd0; border-radius:15px; overflow:hidden; background:#fffefa; }
.desk-inbox { padding:17px 14px; border-right:1px solid #d9ddd3; display:flex; flex-direction:column; min-height:0; }
.inbox-top,.room-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.inbox-top h2 { font-size:1.18rem; }
.queue-tabs { display:flex; gap:4px; margin:16px 0 10px; flex-wrap:wrap; }
.queue-tabs button { padding:6px 9px; border-radius:8px; background:#f1f2ec; font-size:.87rem; }
.queue-tabs button[aria-pressed="true"] { background:#29372c; color:white; }
#queue-list { overflow:auto; flex:1; }
.ticket { display:block; width:100%; text-align:left; border:1px solid #dee1d8; background:#fff; border-radius:9px; padding:10px 12px; margin-bottom:6px; }
.ticket[aria-current="true"] { border-color:#9baf99; background:#eef3e9; }
.ticket strong,.ticket span { display:block; }.ticket span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#566055; font-size:.87rem; }
.ticket small { color:#646d61; font-size:.78rem; }
.desk-conversation { display:flex; flex-direction:column; min-height:0; min-width:0; }
.room-top { padding:15px 19px; border-bottom:1px solid #d9ddd3; }
.room-top p { color:#657060; }
.empty-room,#list-error { margin:16px; color:#596456; font-size:.95rem; }
.page-buttons { display:flex; gap:8px; }.desk [hidden],.chat-dialog [hidden] { display:none; }
@media(max-width:720px) {
  .chat-dialog { margin:auto auto 0; width:100%; max-width:100%; height:min(740px,93dvh); border-radius:16px 16px 0 0; padding-bottom:env(safe-area-inset-bottom); }
  .chat-bar { gap:8px; padding-inline:12px; }
  .chat-launch { right:12px; padding:10px 14px; min-height:44px; }
  nav { gap:.55rem; } nav > * { font-size:.84rem; }
  .desk-top { gap:10px; }.desk-top h1 { padding-left:10px; font-size:1rem; }
  .desk-layout { display:flex; flex-direction:column; height:auto; min-height:0; }
  .desk-inbox { max-height:265px; border-right:0; border-bottom:1px solid #d9ddd3; }
  .desk-conversation { height:70dvh; min-height:400px; }
  .queue-tabs { margin:8px 0; }
}

.quality-page {max-width:64rem;margin:auto;padding:1.5rem;background:white}.quality-page .reply-card{margin-block:.6rem}

@keyframes message-arrived { 50% { box-shadow:inset 0 0 0 4px #f28b43; } }
.incoming-message :is(.chat-bar,.chat-launch,.desk-top) { outline:2px solid #d97c39; outline-offset:-2px; animation:message-arrived 1.1s ease-in-out 6; }
@media (prefers-reduced-motion:reduce) { .incoming-message :is(.chat-bar,.chat-launch,.desk-top) { animation:none; } }

.mobile-only {display:none}
@media(max-width:720px){
 .desk {margin:0;background:#fff;color:#23352f;height:100dvh;display:flex;flex-direction:column}
 .desk .desk-top {background:#153e35;color:#fff;flex-wrap:wrap;padding:calc(13px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left));gap:10px;border:0}
 .desk-top .brand span,.desk-top>a:last-child,.desk:not(.show-tools) #install-app,.desk:not(.show-tools) #install-help {display:none}
 .desk-top .brand img {width:32px;height:32px;border-radius:9px}
 .desk .desk-top h1 {font-size:20px;padding:0;border:0;color:inherit}
 .desk .mobile-only {display:block}
 .desk-top #mobile-tools {color:white;background:transparent;border:1px solid #698a80;border-radius:10px;margin-left:auto;padding:8px 13px;min-height:40px}
 .desk .desk-layout {flex:1;display:flex;margin:0;width:100%;max-width:none;min-height:0;border:0;border-radius:0;background:white;padding-bottom:env(safe-area-inset-bottom)}
 .desk .desk-inbox {flex:1;min-height:0;max-height:none;border:0;padding:0 max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left))}
 .desk .staff-strip {display:flex;align-items:center;gap:8px;padding:14px 0;color:#30463e;font-size:14px}
 #staff-online {color:#28654f;background:#ebf4ee;border-radius:12px;font-size:12px;padding:2px 8px}
 #sync-state {margin-left:auto;color:#63746c;font-size:12px}
 .desk:not(.show-tools) :is(.team-tools,#reply-manage,[data-sound-toggle="staff"]){display:none}
 .desk .team-tools {flex-wrap:wrap}
 .desk .desk-inbox .inbox-top {padding:10px 0 4px}
 .desk .inbox-top h2 {font-size:24px;letter-spacing:-.03em}
 .desk #reload-list {min-height:40px;background:transparent;color:#386650}
 .desk .queue-tabs {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;background:#f0f4f1;padding:4px;border-radius:12px;margin:8px 0 5px}
 .desk .queue-tabs button {padding:6px 0;font-size:13px;min-height:40px;background:transparent;white-space:nowrap}
 .desk .queue-tabs button[aria-pressed="true"] {background:white;color:#185744;box-shadow:0 1px 4px #183e321a}
 .desk [data-filter="all"],.desk #list-error:empty {display:none}
 .desk #queue-list {overscroll-behavior-y:contain;min-height:0;scrollbar-width:thin}
 .desk .mobile-ticket {display:grid;align-items:center;grid-template-columns:44px minmax(0,1fr) auto;gap:3px 11px;margin:0;border:0;border-bottom:1px solid #e5ebe7;border-radius:0;padding:15px 0;background:white}
 .mobile-ticket .visitor-avatar {grid-row:1/4;grid-column:1;background:#deede4;color:#285c46;width:44px;height:44px;display:grid;place-items:center;font:600 16px system-ui;border-radius:14px}
 .mobile-ticket:nth-child(3n+2) .visitor-avatar {background:#e5ebf4;color:#3a5578}
 .mobile-ticket:nth-child(3n) .visitor-avatar {background:#f4e9dc;color:#775730}
 .mobile-ticket .visitor-name {grid-column:2;grid-row:1;font-size:16px}
 .mobile-ticket .ticket-time {grid-column:3;grid-row:1;justify-self:end;font-size:11px}
 .mobile-ticket .preview {grid-column:2;grid-row:2;font-size:14px;color:#43564d}
 .mobile-ticket .ticket-meta {grid-column:2;grid-row:3;font-size:12px;color:#6b7972}
 .mobile-ticket .unread-pill {grid-column:3;grid-row:2;justify-self:end;background:#21644b;color:white;border-radius:12px;min-width:22px;text-align:center;padding:1px 6px;font-size:12px}
 .mobile-ticket .pending-label {grid-column:3;grid-row:3;justify-self:end;color:#805723;font-size:11px}
 .desk .page-buttons button,.room-top #back-inbox {min-height:44px}
 .desk .desk-conversation {display:none}
 .desk.show-room .desk-inbox {display:none}
 .desk.show-room .desk-conversation {display:flex;flex:1;height:auto;min-height:0}
}
@media(max-width:720px){
  .desk.show-room {position:fixed;inset:var(--chat-top,0px) 0 auto;height:var(--chat-height,100dvh);overflow:hidden}
  .desk.show-room .desk-top,.desk.show-room #resolve,.desk.show-room .desktop-attachment {display:none}
  .desk.show-room .desk-layout {padding:0}
  .desk.show-room .room-top {background:white;align-items:center;padding:calc(8px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left))}
  .desk.show-room .room-top>div {text-align:center;min-width:0}
  .desk.show-room .room-top h2 {font-size:17px}
  .desk.show-room .thread-feed {background:#f1f5f3;min-height:0;padding:16px max(14px,env(safe-area-inset-right)) 12px max(14px,env(safe-area-inset-left))}
  .desk.show-room .bubble {max-width:86%;background:white;border-radius:4px 15px 15px;padding:10px 13px}
  .desk.show-room .mine .bubble {background:#d5eddf;border-color:#bfdccc;border-radius:15px 4px 15px 15px}
  .desk.show-room .compose {flex:none;background:white;padding:8px max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
  .desk.show-room .compose textarea {font-size:16px;min-height:42px;height:44px;max-height:68px;resize:none}
  .desk.show-room .compose-row {flex-wrap:nowrap;gap:5px}
  .desk.show-room .compose-row button,.desk.show-room .room-top button {min-height:44px}
  .desk.show-room .compose-row .send {background:#21644b;color:white}
  #room-menu {width:min(86vw,360px);border:0;border-radius:16px;padding:22px;color:#203c30}
  #room-menu button,#room-menu select {min-height:44px;margin-block:5px;padding:8px 12px;font:inherit}
  #room-transfer label {display:grid}
}
.attachment-preview {border:0;border-radius:14px;padding:12px;max-width:min(95vw,900px);max-height:90dvh;background:white}
.attachment-preview img {display:block;max-width:100%;max-height:70dvh;object-fit:contain;margin:auto}
.attachment-preview a,.attachment-preview button {display:inline-block;margin:8px 8px 0 0;padding:10px;color:#22523f}
.attachment-preview::backdrop,#room-menu::backdrop {background:#14251dcc}
@media(max-width:720px){.desk.show-room .mobile-only[hidden]{display:none}}
