#native-inbox[hidden], #native-inbox [hidden], #native-inbox-toggle[hidden] { display:none }
.native-inbox-active > .inbox-sidebar, .native-inbox-active > .inbox-content { display:none }
#native-inbox {
  grid-column:2 / -1; display:grid; grid-template-columns:250px minmax(0,1fr); min-width:0; min-height:0;
}
.native-dialogs, .native-chat { display:flex; flex-direction:column; min-height:0; min-width:0 }
.native-dialogs { background:white; border-right:1px solid #e4eae5 }
.native-dialogs header, #native-chat-title { padding:12px 14px; background:white; border-bottom:1px solid #e4eae5 }
.native-dialogs header { display:flex; align-items:center; justify-content:space-between; gap:6px }
#native-dialog-list { overflow:auto; flex:1 }
#native-list-status, #native-history-status { margin:0; padding:0 12px; color:#43584b }
#native-list-status:not(:empty), #native-history-status:not(:empty) { padding-block:10px }
.native-dialog { width:100%; display:flex; align-items:center; gap:8px; padding:10px 7px; background:white; color:#17271e; text-align:left; border:0; border-radius:0 }
.native-dialog:hover, .native-dialog[aria-pressed=true] { background:#e7f2ea }
.native-avatar { display:grid; place-items:center; border-radius:50%; background:#64ab75; color:white; width:38px; height:38px; flex:none }
.native-dialog-info { flex:1; min-width:0 }
.native-dialog-info > * { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis }
.native-dialog-info small { color:#53685b; margin-top:4px }
.native-dialog-meta { display:grid; gap:4px; justify-items:end; font-size:10px; color:#627267 }
.native-chat, #view-inbox #chat-panel:not(.hidden), #view-inbox #chat-placeholder {
  position:relative; background-color:#a7c68d;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='100' viewBox='0 0 112 100'%3E%3Cg fill='none' stroke='%233f7958' stroke-opacity='.18' stroke-width='1.1'%3E%3Cpath d='M13 23l20-9-8 20-4-9zM21 25l12-11M68 22c-7-9-20 1 0 14 20-13 7-23 0-14zM39 67h22v13H39zM39 67l11 8 11-8M85 70l6-8 3 10 10 2-9 5v10l-7-7-10 3 5-9z'/%3E%3Ccircle cx='12' cy='66' r='4'/%3E%3Ccircle cx='98' cy='45' r='3'/%3E%3C/g%3E%3C/svg%3E"), linear-gradient(125deg,#dce39a,#8ab991 48%,#b9ce96);
}
#native-chat-empty { align-self:center; margin:auto; padding:6px 12px; border-radius:20px; background:#3b704ca8; color:white; font-size:13px }
#native-history { flex:1; min-height:0; overflow:auto; padding:12px 22px }
#native-message-list article { white-space:pre-wrap; overflow-wrap:anywhere }
#native-message-list small { display:block; text-align:right }
@media(max-width:760px) {
  #native-inbox { grid-column:1; grid-template-columns:minmax(0,1fr) }
  .native-dialogs { max-height:280px }
  .native-chat { min-height:330px; max-height:65vh }
}
#native-compose { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:start; padding:12px; background:#fff }
#native-compose-body { width:100%; box-sizing:border-box; min-height:42px; resize:vertical }
#native-send-status { grid-column:1 / -1; margin:0; color:#52685a; font-size:12px }
#native-send-status:empty { display:none }
#native-message-list img { display:block; max-width:min(100%,420px); max-height:380px; object-fit:contain; border-radius:8px }
#native-message-list a { display:block; overflow-wrap:anywhere; color:#245c88 }
.native-translation-controls { grid-column:1 / -1; display:flex; flex-wrap:wrap; align-items:center; gap:10px; font-size:12px }

#view-inbox #inbox-list { padding:0 }
#view-inbox #inbox-list .inbox-conversation { margin:0; padding:10px 8px; border-radius:0 }
#view-inbox #inbox-list .inbox-conversation.selected { background:#e7f2ea }
#view-inbox #chat-messages .chat-bubble.out { background:#e7f7d8 }
#view-inbox #chat-placeholder h2 { padding:6px 12px; border-radius:20px; background:#3b704ca8; color:white; font-size:13px }
#view-inbox #chat-placeholder .inbox-empty-icon { display:none }
#chat-reply .native-translation-controls { margin-top:8px }
#customer-translation-home { grid-column:1; grid-row:2 }
#native-translation-controls, #customer-translation-controls { padding:7px 12px; background:#fff; flex:none }
.native-translation-controls fieldset { display:flex; flex-wrap:wrap; gap:8px; margin:0; border:0; padding:0 }
.native-translation-controls legend { float:left; margin-right:8px }
.native-translation-controls select { width:auto; padding:3px 6px }
.chat-inline-translation { margin-top:5px; padding-top:4px; border-top:1px solid #b5c8ba; color:#345b46 }
#view-inbox #chat-panel:not(.hidden) { grid-template-rows:auto auto minmax(0,1fr) auto }
#view-inbox #chat-panel .chat-customer { grid-row:1 / -1 }
#view-inbox #chat-messages { grid-row:3 }
#view-inbox #chat-reply { grid-row:4 }
@media(max-width:1100px) {
  #view-inbox #chat-panel:not(.hidden) { grid-template-rows:auto auto auto minmax(0,1fr) auto }
  #view-inbox #chat-panel .chat-customer { grid-row:2 }
  #customer-translation-home { grid-row:3 }
  #view-inbox #chat-messages { grid-row:4 }
  #view-inbox #chat-reply { grid-row:5 }
}

/* Shared conversation canvas */
#workspace #view-inbox :is(#chat-panel:not(.hidden),.native-chat) {
  background: radial-gradient(ellipse at 82% 13%, #74a78f 0, transparent 59%),
    radial-gradient(ellipse at 92% 99%, #d5d98c 0, transparent 56%),
    linear-gradient(147deg,#dee3c5 0,#a8c69b 43%,#8dbd90 78%);
}
#workspace #view-inbox :is(#chat-messages,#native-message-list) .chat-bubble {
  border:0;border-radius:6px;background:#fff;padding:10px 12px;color:#161d18;
}
#workspace #view-inbox :is(#chat-messages,#native-message-list) .chat-bubble.out {background:#a2ee77}
#workspace #view-inbox :is(#chat-messages,#native-message-list) .chat-message-time {color:#183c2d}
#workspace #view-inbox :is(#chat-reply,#native-compose) {
  margin:0 clamp(12px,3vw,54px) 18px;padding:10px 14px;border:0;border-radius:12px;background:#fff;
}
#workspace #chat-reply .tg-actions {display:flex;align-items:center;gap:10px;margin:0 0 5px}
#workspace #chat-reply .tg-actions .chat-compose-icon {background:transparent;border:0;color:#526c61;width:30px;height:30px;padding:6px;box-shadow:none}
#workspace #chat-reply .tg-actions .chat-compose-icon:hover {background:#edf4ef}
#workspace #chat-reply .chat-compose-icon svg {width:17px;height:17px}
#workspace #chat-reply #chat-body {padding:6px 0;min-height:64px;resize:none}
#workspace #chat-reply .chat-compose-footer .primary {border-radius:50%;width:36px;height:36px;padding:0;background:#287fcd;color:white;font-size:18px}
#workspace #view-inbox .chat-customer {min-width:0;border-radius:0}

/* Telegram desktop layout */
#workspace #view-inbox :is(#chat-reply,#native-compose) {
  margin:0;padding:7px 12px;border-radius:0;border-top:1px solid #e5e9ec;box-shadow:none;
}
#workspace #view-inbox #chat-reply {display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:end}
#workspace #chat-reply .tg-actions {margin:0;align-self:center}
#workspace #chat-reply #chat-body,#workspace #native-compose-body {min-height:36px;max-height:120px;border:0;border-radius:0;background:#fff;padding:8px 4px;resize:none}
#workspace #chat-reply .chat-compose-footer {margin:0;align-self:center}
#workspace #chat-reply .chat-compose-footer .primary {background:transparent;color:#268ac6;width:34px;height:34px;box-shadow:none}
#workspace #chat-reply .chat-compose-footer .error:empty {display:none}
#workspace #chat-reply > p {grid-column:1 / -1;margin:0}
#workspace #view-inbox .native-dialog[aria-pressed=true],
#workspace #view-inbox #inbox-list .inbox-conversation.selected {background:#419bcc;color:white;border-color:transparent;border-radius:0}
#workspace #view-inbox :is(.native-dialog[aria-pressed=true],.inbox-conversation.selected) :is(small,time) {color:#fff}
#workspace #view-inbox :is(.native-avatar,#inbox-list .inbox-avatar) {border-radius:50%}
#workspace #view-inbox :is(#chat-messages,#native-message-list) .chat-bubble {border-radius:11px;margin-top:8px;padding:7px 10px}
#workspace #view-inbox :is(#chat-messages,#native-message-list) .chat-bubble:has(.chat-message-time) {margin-bottom:22px}
#workspace #view-inbox :is(#chat-messages,#native-message-list) .chat-message-time {font-size:10px}
@media(max-width:640px) {
  #workspace #view-inbox #chat-reply {grid-template-columns:minmax(0,1fr) auto}
  #workspace #chat-reply .tg-actions {grid-column:1 / -1}
}

#workspace #view-inbox #chat-reply {grid-template-columns:minmax(0,1fr) auto;align-items:center}
#workspace #chat-reply > :is(.tg-actions,p) {grid-column:1 / -1}
#workspace #chat-reply > #chat-body {grid-column:1;width:100%;min-width:0;margin:0;outline-offset:-1px}
#workspace #chat-reply > .chat-compose-footer {grid-column:2}
#workspace #chat-reply > p:empty {display:none}
.chat-emoji {position:relative}
.chat-emoji summary {display:grid;place-items:center;width:30px;height:30px;border-radius:6px;color:#526c61;cursor:pointer;font-size:20px;list-style:none}
.chat-emoji summary:hover,.chat-emoji[open] summary {background:#edf4ef}
.chat-emoji-list {position:absolute;bottom:100%;left:0;z-index:5;display:grid;grid-template-columns:repeat(8,27px);gap:3px;padding:8px;background:white;border:1px solid #dfe8e2;border-radius:10px;box-shadow:0 4px 16px #263b3030}
#workspace #chat-reply .chat-emoji-list button {padding:2px;background:transparent;font-size:17px;border-radius:5px}
#workspace #chat-reply .chat-emoji-list button:hover {background:#edf4ef}

#chat-quote {grid-column:1 / -1;display:flex;justify-content:space-between;gap:8px;padding:6px 10px;background:#eaf4fb;border-left:3px solid #419bcc}
#chat-quote:empty {display:none}
#chat-quote span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#chat-messages .chat-reaction-picker {top:calc(100% - 4px);bottom:auto;left:100%}
#chat-messages .out .chat-reaction-picker {left:auto;right:4px}

#chat-messages .chat-bubble:not(.context-open) .chat-context-reply {display:none}
#chat-messages .chat-bubble.context-open .chat-reaction-picker {display:flex;opacity:1;pointer-events:auto}
#chat-messages .chat-bubble.context-open .chat-reaction-picker button {width:auto;padding:4px}

#workspace #view-inbox :is(#chat-messages,#native-message-list) .chat-bubble:has(.chat-message-time) {margin-bottom:8px;padding-right:49px}
#workspace #view-inbox :is(#chat-messages,#native-message-list) .chat-bubble .chat-message-time {position:absolute;inset:auto 8px 5px auto;margin:0;color:#5d716a;font-size:10px}
.chat-day-divider {width:max-content;margin:12px auto;padding:3px 12px;border-radius:14px;background:#3b654d;color:white;font-size:12px}

#customer-remark {margin:0 0 7px;color:#62746c;max-width:100%;white-space:normal;overflow-wrap:anywhere}
#customer-profile-translation {border-top:1px solid #ebeeec;margin-top:16px;text-align:left}
#customer-profile-translation select {width:100%}

#workspace #view-inbox :is(#chat-messages,#native-message-list) .chat-bubble.out {background:#e1f5d3}
#workspace #view-inbox #chat-messages .out:has(.chat-receipt) {padding-right:68px}
#workspace #view-inbox #chat-messages .out:has(.chat-receipt) .chat-message-time {right:29px}
#workspace #view-inbox #chat-messages .out .chat-receipt {top:auto;bottom:4px;right:8px;font-size:12px;color:#378940;margin:0;line-height:1}
#workspace #view-inbox #chat-messages .out .chat-receipt::after {content:none}
.chat-loading {text-align:center;color:#254837;font-size:12px}

#inbox-list .inbox-conversation {align-items:center;padding:9px 10px;gap:9px}
#inbox-list .inbox-person {gap:4px}
.inbox-preview {overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.inbox-conversation-meta {align-self:flex-start;display:grid;justify-items:end;gap:5px;color:#61716a;font-size:11px;white-space:nowrap}
#inbox-list .selected .inbox-conversation-meta {color:#fff}
#workspace #view-inbox #chat-messages .out .chat-receipt {width:17px;height:11px;font-size:0}
#workspace #view-inbox #chat-messages .out .chat-receipt::before,
#workspace #view-inbox #chat-messages .out .chat-receipt.receipt-read::after {content:'';position:absolute;bottom:3px;right:2px;width:8px;height:4px;border:solid currentColor;border-width:0 0 1.5px 1.5px;transform:rotate(-45deg)}
#workspace #view-inbox #chat-messages .out .chat-receipt.receipt-read::after {right:7px;width:6px}

#workspace #inbox-list .inbox-conversation {min-height:66px;padding:10px;gap:10px}
#workspace #inbox-list .inbox-avatar {width:42px;height:42px;font-size:16px}
#workspace #inbox-list .inbox-person strong {font-size:15px;line-height:1.25}
#workspace #inbox-list .inbox-person small {font-size:12px;line-height:1.35;color:#566860}
#workspace #inbox-list .inbox-conversation-meta {font-size:12px}
#workspace #inbox-list .inbox-conversation-meta small {font-size:inherit}
#workspace #inbox-list .inbox-conversation.selected small {color:#fff}
