:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#203a32;background:#eef3ef;font-synthesis:none;--green:#15734f;--muted:#6e8079;--line:#e2eae4;--soft:#f5f8f5}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,a:focus-visible{outline:3px solid #7ecc9b;outline-offset:3px}button{border:1px solid var(--line);border-radius:10px;padding:10px 14px;background:#fff;color:#244b3a;font-weight:600}button:hover:not(:disabled){background:#edf6ef}.primary{background:var(--green);color:#fff;border-color:var(--green)}.primary:hover:not(:disabled){background:#0e5c3d}.quiet{background:transparent}.danger{color:#a54634}.hidden,[hidden]{display:none!important}.brand{display:flex;gap:12px;align-items:center}.brand-mark{height:42px;width:42px;border-radius:14px;background:var(--green);display:grid;place-items:center;color:white;font-size:23px;font-weight:800;letter-spacing:-4px;padding-right:4px}.brand strong{font-size:18px;letter-spacing:-.6px}.brand small{display:block;font-size:11px;letter-spacing:1.7px;color:var(--muted);margin-top:2px}.eyebrow{text-transform:uppercase;letter-spacing:1.5px;font-size:10px;font-weight:750;color:var(--green)}.muted{color:var(--muted);font-size:13px;line-height:1.6}.dot{display:inline-block;width:8px;height:8px;background:#37a36d;border-radius:50%;margin-right:5px}.pill{display:inline-flex;align-items:center;gap:5px;background:#eef7ee;border:1px solid #d7e8d8;border-radius:30px;padding:6px 10px;color:#48764e;font-size:11px;white-space:nowrap}.avatar{flex-shrink:0;width:43px;height:43px;background:#e7f0e7;border-radius:15px;display:grid;place-items:center;color:#36734c;font-weight:700}.shell{height:100dvh;min-height:520px;display:grid;grid-template-columns:310px minmax(0,1fr);padding:18px;gap:0;max-width:1800px;margin:auto}.sidebar{background:#fbfdfb;border:1px solid var(--line);border-radius:18px 0 0 18px;display:flex;flex-direction:column;overflow:hidden}.sidebar-top{padding:24px 20px 18px;border-bottom:1px solid var(--line)}.sidebar-heading{display:flex;justify-content:space-between;align-items:center;margin-top:30px}.sidebar-heading h1{margin:0;font-size:23px;letter-spacing:-1px}.sidebar-heading button{padding:8px 12px}.search{width:100%;margin-top:18px;background:#f0f4f0;border:1px solid transparent;border-radius:9px;padding:11px 12px;outline:none}.search:focus{border-color:#93bd9b}.tabs{display:flex;gap:6px;margin-top:15px}.tabs button{flex:1;font-size:12px;padding:8px;border-color:transparent;background:transparent;color:var(--muted)}.tabs .selected{background:#e6f1e6;color:#276941}.conversation-list{flex:1;overflow-y:auto;padding:10px}.contact{display:flex;gap:11px;align-items:center;width:100%;text-align:left;border:1px solid transparent;padding:12px 10px;background:transparent;margin-bottom:3px;border-radius:12px}.contact.selected{background:#edf4eb;border-color:#d7e6d6}.contact-copy{min-width:0;flex:1}.contact strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.contact small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:11px;margin-top:5px;font-weight:400}.contact time{color:var(--muted);font-size:10px}.waiting-dot{width:8px;height:8px;border-radius:50%;background:#d7a34f;margin-top:8px;margin-left:auto}.team{border-top:1px solid var(--line);padding:15px 20px;max-height:170px;overflow:auto}.team h3{font-size:10px;letter-spacing:1.5px;text-transform:uppercase;color:var(--muted);margin:0 0 12px}.teammate{display:flex;gap:9px;align-items:center;font-size:12px;margin-top:9px}.teammate .dot{background:#a4b0a5}.teammate .dot.online{background:#3b9d69}.workspace{display:flex;flex-direction:column;overflow:hidden;background:white;border:1px solid var(--line);border-left:0;border-radius:0 18px 18px 0;position:relative}.topbar{height:79px;padding:18px 26px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);flex-shrink:0}.topbar h2{font-size:16px;margin:0 0 4px;letter-spacing:-.4px}.topbar .muted{font-size:11px}.topbar .identity{display:flex;gap:12px;align-items:center;min-width:0}.actions{display:flex;gap:8px;align-items:center}.actions button{font-size:12px}.conversation{flex:1;min-height:0;display:flex;flex-direction:column}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:35px}.empty-icon{width:98px;height:98px;display:grid;place-items:center;background:#edf5eb;border:1px solid #dbead7;border-radius:32px;font-size:40px;color:#4b8a56;position:relative;margin-bottom:25px}.empty-icon:after{content:'';position:absolute;bottom:7px;right:4px;width:17px;height:17px;border-radius:50%;background:#78ad66;border:4px solid white}.empty h2{font-size:27px;letter-spacing:-1px;margin:0 0 12px}.empty p{max-width:340px;margin:0 0 22px}.empty .eyebrow{margin-bottom:12px}.messages{flex:1;min-height:0;overflow:auto;padding:24px 28px;display:flex;flex-direction:column;gap:15px;background:radial-gradient(ellipse at top right,#f2f7f0,transparent 65%),#fafcf9}.message{align-self:flex-start;max-width:75%;background:#fff;border:1px solid #e2e9df;border-radius:3px 14px 14px 14px;padding:12px 15px;box-shadow:0 2px 3px #17352403;overflow-wrap:anywhere}.message.mine{align-self:flex-end;background:#e3f0dc;border-color:#d7e7cf;border-radius:14px 3px 14px 14px}.message .author{font-size:10px;font-weight:700;color:#51785b;margin-bottom:6px}.message p{margin:0;font-size:13px;line-height:1.65;white-space:pre-wrap}.message time{display:block;font-size:9px;text-align:right;color:#85907f;margin-top:6px}.message img{max-width:100%;max-height:260px;border-radius:8px;display:block;margin:6px 0}.message audio{max-width:100%;width:260px;height:40px}.message a{font-size:12px;color:#286747}.system{align-self:center;font-size:11px;text-align:center;color:#85917f;max-width:85%;line-height:1.6;margin:5px 0;white-space:pre-wrap}.composer{padding:15px 23px 12px;background:#fff;border-top:1px solid var(--line)}.compose-row{display:flex;align-items:flex-end;gap:9px}.compose-row textarea{flex:1;min-width:0;resize:none;max-height:130px;min-height:46px;padding:12px 14px;background:#f5f8f3;border:1px solid #e0e8dc;border-radius:11px;outline:none;font-size:13px}.compose-row textarea:focus{border-color:#8ab17e}.compose-row button{min-height:45px}.hint{font-size:10px;color:#8c9687;margin:8px 0 0;text-align:center}.attach-info{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;margin-bottom:10px;background:#f1f6ed;padding:8px 12px;border-radius:8px}.banner{padding:10px 20px;background:#faf6e8;color:#8a7442;font-size:11px;line-height:1.6;flex-shrink:0}.banner.error{background:#fff0ed;color:#a3493a}.footer{padding:11px 20px;border-top:1px solid var(--line);font-size:10px;color:var(--muted);display:flex;justify-content:space-between}.client-body{background:radial-gradient(ellipse at 10% 0,#e2eddc,transparent 55%),#f1f5ee;min-height:100dvh;padding:25px 18px}.client-wrap{max-width:810px;margin:auto}.client-brand{display:flex;align-items:center;justify-content:space-between;margin:0 0 20px}.client-card{height:calc(100dvh - 143px);min-height:480px;max-height:850px;border:1px solid #dbe5d7;border-radius:20px;box-shadow:0 20px 70px #284d2610;overflow:hidden;display:flex;flex-direction:column;background:white}.client-foot{text-align:center;font-size:10px;color:#8a9784;margin:16px 0}.client-card .empty h2{max-width:430px;font-size:32px}.client-card .empty p{max-width:390px}.client-card .topbar{padding:17px 24px}.client-card .messages{padding:25px}.client-card .message{max-width:85%}dialog{border:1px solid var(--line);border-radius:18px;box-shadow:0 20px 80px #102b2430;padding:26px;width:min(460px,92vw);color:#203a32}dialog::backdrop{background:#102a244f;backdrop-filter:blur(3px)}dialog h2{font-size:21px;margin:0 0 9px}dialog label{display:block;font-size:12px;margin:17px 0 7px}dialog input,dialog select{width:100%;padding:12px;border:1px solid #dbe4d8;border-radius:9px;background:#fafcf9}dialog .actions{justify-content:flex-end;margin-top:23px}dialog .result{margin-top:18px;background:#edf5e9;padding:14px;border-radius:10px}dialog .result input{font-size:11px;background:white}dialog .result a{display:block;margin-top:12px;color:#276b42}#older{align-self:center;font-size:11px;padding:7px 12px}.back{display:none}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#233e2b;color:#fff;padding:12px 20px;border-radius:12px;box-shadow:0 10px 40px #0002;z-index:10;font-size:12px;max-width:90vw}
@media(max-width:780px){.shell{padding:0;grid-template-columns:265px minmax(0,1fr);height:100dvh}.sidebar,.workspace{border-radius:0}.topbar{padding:12px 16px;height:auto;min-height:76px;flex-wrap:wrap}.actions{flex-wrap:wrap}.message{max-width:92%}.messages{padding:17px}.composer{padding:12px}.compose-row{gap:5px}.compose-row button{padding:10px}.client-body{padding:12px 10px}.client-card{height:calc(100dvh - 115px);min-height:390px}.client-brand{margin-bottom:12px}.client-card .empty{padding:22px}.client-card .empty h2{font-size:27px}}
@media(max-width:590px){.shell{display:block}.sidebar{height:100%;width:100%}.workspace{height:100%;display:none}.shell.has-selection .sidebar{display:none}.shell.has-selection .workspace{display:flex}.back{display:block}.actions button{font-size:11px;padding:8px}.topbar h2{font-size:14px}.client-brand .pill{font-size:9px;padding:6px}.brand strong{font-size:16px}.brand small{font-size:9px}.client-card .topbar{padding:14px}.client-card .messages{padding:15px}.compose-row .send-label{display:none}.message{padding:10px 12px}.client-card .message{max-width:94%}.hint{font-size:9px}}

.entry-form{width:min(340px,100%);text-align:left}.entry-form label{display:block;font-size:12px;font-weight:600;margin:12px 0 6px}.entry-form input{width:100%;padding:12px;border:1px solid #dbe4d8;border-radius:9px;background:#fafcf9}.entry-form button{width:100%;margin-top:18px}.entry-form small{display:block;font-size:10px;line-height:1.5;color:#8a9784;text-align:center;margin-top:12px}.client-card:has(.entry-form:not(.hidden)) .empty-icon{width:58px;height:58px;font-size:27px;border-radius:20px;margin-bottom:15px}.client-card:has(.entry-form:not(.hidden)) .empty{overflow:auto;justify-content:flex-start;padding-top:25px}.client-card:has(.entry-form:not(.hidden)) .empty p{margin-bottom:4px}

.history-day{font-size:10px;text-transform:uppercase;letter-spacing:.8px;color:#7a8b79;margin:16px 10px 8px;font-weight:650}

/* Use the visible viewport, including the space left above a mobile keyboard. */
.client-body{height:var(--chat-viewport-height,100dvh);min-height:0;overflow:hidden}
.client-wrap{height:100%;min-height:0;display:flex;flex-direction:column}
.client-brand,.client-foot{flex-shrink:0}
.client-card{flex:1;min-height:0;height:auto;max-height:none;width:100%}
.client-card .empty{min-height:0;overflow-y:auto;flex-shrink:1}
.client-card .empty>*{flex-shrink:0}
.conversation,.workspace,.messages{min-width:0}
.composer{flex-shrink:0;max-width:100%}
.compose-row{min-width:0}
.topbar .identity>div:last-child{min-width:0}
.client-card .topbar h2{overflow-wrap:anywhere}
@media(max-width:950px){
  .client-body{position:fixed;left:0;right:0;top:var(--chat-viewport-top,0px);padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
  .client-card .topbar{flex-wrap:nowrap;min-height:64px;padding:10px 12px;gap:8px}
  .client-card .topbar .identity{flex:1;gap:8px}
  .client-card .topbar .avatar{width:32px;height:32px;border-radius:10px;font-size:12px}
  .client-card .topbar h2{font-size:14px;margin-bottom:2px}
  .client-card .topbar .muted{font-size:10px;line-height:1.35}
  .client-card .topbar .pill{font-size:9px;padding:5px 7px}
  .client-brand{gap:8px;margin-bottom:8px}
  .client-brand .brand{gap:7px;min-width:0}
  .client-brand .brand-mark{width:34px;height:34px;border-radius:11px}
  .client-brand .pill{white-space:normal;max-width:125px;font-size:9px}
  .client-foot{margin:8px 0 0;font-size:9px}
  .client-card .composer{padding:8px}
  .client-card input,.client-card textarea{font-size:16px}
  .client-card .compose-row textarea{padding:10px;min-height:42px}
  .client-card .compose-row button{min-height:42px;padding:8px 10px}
  .client-card .messages{padding:12px;gap:10px}
  .client-card .message audio{max-width:100%;min-width:0}
  .client-card .message{max-width:95%}
  .client-card .message a{overflow-wrap:anywhere}
  .shell{min-height:0;height:var(--chat-viewport-height,100dvh)}
  .compose-row .send-label{display:none}
}
@media(max-height:500px){
  .client-brand,.client-foot{display:none}
  .client-card .topbar{min-height:48px;padding:6px 10px}
  .client-card .composer .hint{display:none}
  .client-card .empty{justify-content:flex-start;padding:14px}
  .client-card .empty-icon{display:none}
}

/* Conversation layout inspired by the supplied mobile messenger reference. */
.has-conversation.client-body{background:#f3f0ea}
.has-conversation .client-brand,.has-conversation .client-foot{display:none}
.has-conversation .client-card{border-radius:14px;border-color:#deded7;box-shadow:none}
.client-card .topbar,.workspace>.topbar{background:#f3f0eb;color:#172321}
.client-card .topbar .avatar{border-radius:50%;background:#dce9dd;color:#317650}
.client-card .topbar .muted{color:#6e7371}
.client-back{border:0;background:transparent;padding:4px;color:#172321;flex-shrink:0}
.client-back svg{width:26px;height:26px;display:block}
.messages{background-color:#f5f1e8;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23e7e0d2' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 18h22a6 6 0 0 1 6 6v13a6 6 0 0 1-6 6H31l-9 7v-7a6 6 0 0 1-6-6V24a6 6 0 0 1 6-6Z'/%3E%3Cpath d='m113 16 8 13-6 9-13-1-5-13Z M102 83c12-13 28-13 40 0m-34 7c8-8 20-8 28 0m-20 8c4-4 8-4 12 0'/%3E%3Ccircle cx='121' cy='107' r='2'/%3E%3Cpath d='m24 111 31-13-10 32-7-11-14-8Zm14 8 17-21m48 50 8-5 8 5v9l-8 5-8-5Zm-53-1 4 6-4 6-4-6Zm108-108 5 5-5 5-5-5Z'/%3E%3Cpath d='M18 72h7m-3-3v6m138 53h7m-3-3v6'/%3E%3C/g%3E%3C/svg%3E");background-size:180px 180px;gap:8px;padding:18px 22px}
.message{position:relative;border:0;background:#fff;border-radius:0 12px 12px 12px;padding:8px 11px;box-shadow:0 1px 1px #152a2020;max-width:80%}
.message.mine{background:#dcf8c6;border:0;border-radius:12px 0 12px 12px}
.message:before{content:'';position:absolute;top:0;left:-7px;border-top:9px solid white;border-left:8px solid transparent}
.message.mine:before{left:auto;right:-7px;border-left:0;border-right:8px solid transparent;border-top-color:#dcf8c6}
.message p{font-size:15px;line-height:1.45;color:#14221b}
.message .author{font-size:11px;margin-bottom:4px;color:#318054}
.message.mine .author{display:none}
.message time{font-size:10px;color:#718473;margin:3px 0 0 18px}
.message a{font-size:12px}
.message img{max-height:360px;border-radius:7px;margin:2px 0 6px}
.system{background:#fff9;border-radius:8px;padding:5px 9px;font-size:10px;color:#6f766f;margin:3px 0;box-shadow:0 1px 1px #152a2009}
.date-chip{align-self:center;flex-shrink:0;background:#fff;border-radius:8px;padding:5px 11px;font-size:11px;font-weight:650;color:#5b6660;box-shadow:0 1px 2px #172c2218;margin:8px 0}
.composer{background:#f5f2ec;border-top:0;padding:9px 13px}
.compose-row{align-items:center;gap:8px}
.compose-input{min-width:0;flex:1;display:flex;align-items:center;border:1px solid #deded8;border-radius:24px;background:#fff;overflow:hidden;padding:0 13px}
.compose-row .compose-input textarea{width:100%;min-height:40px;max-height:110px;background:transparent;border:0;border-radius:0;padding:10px 0;line-height:20px;font-size:16px;margin:0;outline:none;box-shadow:none}
.compose-row .compose-icon{border:0;background:transparent;padding:4px;min-height:40px;width:32px;flex:0 0 32px;color:#26352b;display:grid;place-items:center}
.compose-icon svg{width:26px;height:26px;display:block}
.compose-row .round-action{border:0;border-radius:50%;width:42px;height:42px;min-height:42px;flex:0 0 42px;background:#1baa61;color:white;padding:10px;display:grid;place-items:center}
.round-action svg{display:block;width:23px;height:23px}
.compose-row .round-action.recording{background:#cf5b4c;animation:record-pulse 1.3s ease-in-out infinite}
.composer .hint{margin:5px 0 0;font-size:9px;color:#899184}
.attach-info{background:#e6eee0;font-size:11px;margin-bottom:8px}
@keyframes record-pulse{50%{box-shadow:0 0 0 4px #cf5b4c25}}
@media(prefers-reduced-motion:reduce){.compose-row .round-action.recording{animation:none}}
@media(max-width:950px){
  .has-conversation.client-body{padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}
  .has-conversation .client-card{border:0;border-radius:0}
  .client-card .topbar{gap:5px;min-height:68px;padding:9px 10px}
  .client-card .topbar .avatar{width:38px;height:38px;font-size:13px}
  .client-card .topbar h2{font-size:16px;line-height:1.2}
  .client-card .topbar .muted{font-size:12px}
  .has-conversation #status-pill{display:none}
  .client-card .messages{padding:12px 15px;gap:8px}
  .client-card .message{max-width:87%;padding:8px 10px}
  .client-card .message p{font-size:16px}
  .client-card .composer{padding:8px 7px 9px}
  .client-card .compose-row{gap:5px}
  .client-card .compose-row .compose-icon{width:30px;flex-basis:30px;min-height:40px;padding:3px}
  .client-card .compose-row .round-action{width:40px;height:40px;min-height:40px;flex-basis:40px;padding:9px}
  .client-card .compose-row .compose-input textarea{padding:9px 0;min-height:38px;font-size:16px}
  .client-card .composer .hint{display:none}
  .client-card .message audio{width:235px}
}
.compose-row .round-action:hover:not(:disabled){background:#168e50}
.compose-row .round-action.recording:hover:not(:disabled){background:#bb4d40}
#toast{bottom:calc(76px + env(safe-area-inset-bottom));pointer-events:none}
.attachment-menu{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:20px 7px 12px;border-top:1px solid #e0dfdb;margin-top:10px}
.attachment-menu button{display:flex;align-items:center;flex-direction:column;gap:8px;border:0;background:transparent;font-size:12px;font-weight:450;color:#1e2b23;min-width:0;padding:4px}
.attachment-menu-icon{background:white;border-radius:50%;width:54px;height:54px;display:grid;place-items:center;box-shadow:0 1px 3px #23372c0c}
.attachment-menu-icon svg{width:28px;height:28px}
.attachment-menu-icon.photos{color:#2696ed}.attachment-menu-icon.camera{color:#647477}.attachment-menu-icon.document{color:#14a9bd}
@media(max-width:950px){.attachment-menu{background:#e4e5e8;border-radius:18px;padding:19px 8px 20px;margin-top:10px;gap:8px}.attachment-menu button{font-size:11px}.attachment-menu-icon{width:49px;height:49px}}
@media(max-height:400px){.attachment-menu{padding:7px;margin-top:5px}.attachment-menu-icon{width:34px;height:34px}.attachment-menu-icon svg{width:23px;height:23px}.attachment-menu button{gap:3px}}
#record{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
/* Client scrolling is managed after message/viewport layout, not by browser anchoring. */
.client-card .messages{overflow-anchor:none;scroll-behavior:auto}

.delivery-state { display: inline-flex; float: right; margin-left: 4px; color: #8696a0; vertical-align: middle; }
.delivery-state svg { width: 24px; height: 18px; }
.delivery-state[data-delivery="read"] { color: #34b7f1; }
.delivery-state[data-delivery="failed"], .delivery-state[data-delivery="uncertain"] { color: #b54736; }

.message .image-preview { display: block; padding: 0; border: 0; background: transparent; max-width: 100%; cursor: zoom-in; border-radius: 8px; }
.message .image-preview img { margin: 0; }
.chat-image-viewer { width: min(1100px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 12px; border: 1px solid #dce5df; border-radius: 14px; background: #f7faf8; }
.chat-image-viewer[open] { display: flex; flex-direction: column; gap: 12px; }
.chat-image-viewer::backdrop { background: #10251ed9; backdrop-filter: blur(3px); }
.image-viewer-header { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.image-viewer-header h2 { min-width: 0; flex: 1; margin: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-viewer-header a { color: #008069; font-size: 12px; white-space: nowrap; }
.image-viewer-header button { width: 36px; height: 36px; padding: 0; font-size: 26px; border-radius: 50%; background: #e5ede8; }
.chat-image-viewer > img { display: block; min-height: 0; max-width: 100%; max-height: calc(100dvh - 100px); object-fit: contain; align-self: center; }
@media (max-width:590px) { .chat-image-viewer { padding: 8px; } .image-viewer-header { gap: 8px; } }

.message .image-preview { min-width: 44px; min-height: 44px; }
.chat-image-viewer [hidden] { display: none !important; }
.chat-image-viewer.is-pdf { height: calc(100dvh - 24px); }
.chat-image-viewer .pdf-preview { width: 100%; flex: 1; min-height: 180px; border: 0; background: #e8ece9; }
.pdf-fallback { margin: 0; font-size: 11px; color: #61746a; }
.pdf-file-preview { display: block; max-width: 100%; overflow-wrap: anywhere; color: #176f53; background: #edf4ef; border: 1px solid #d8e4dc; border-radius: 8px; padding: 12px; text-align: left; }
.pdf-preview { overflow: auto; padding: 12px; text-align: center; }
.pdf-preview canvas { display: block; margin: 0 auto; background: white; }
.pdf-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pdf-toolbar button { min-width: 36px; padding: 6px 10px; }
.pdf-toolbar span { font-size: 12px; margin-left: 8px; }

.brand-mark,.brand-avatar{background:transparent;padding:0;letter-spacing:normal}.brand-mark img,.brand-avatar img{display:block;width:100%;height:100%;object-fit:contain}

/* Client proportions follow the supplied iPhone conversation reference. */
@media (max-width:950px) {
  .has-conversation.client-body .client-card .topbar { min-height:56px; padding:6px 12px; gap:8px; }
  .has-conversation.client-body .topbar .identity { gap:9px; }
  .has-conversation.client-body .topbar .avatar { width:40px; height:40px; }
  .has-conversation.client-body .topbar h2 { font-size:17px; font-weight:600; line-height:1.2; }
  .has-conversation.client-body .topbar .muted { font-size:13px; line-height:1.25; }
  .has-conversation.client-body .client-back { width:44px; height:44px; display:grid; place-items:center; padding:0; border:1px solid #deded8; border-radius:50%; background:#fff; }
  .has-conversation.client-body .client-back svg { width:28px; height:28px; }
  .has-conversation.client-body .messages { padding:12px 16px; gap:6px; }
  .has-conversation.client-body .message { min-width:96px; max-width:90%; padding:7px 12px 6px; border-radius:18px; }
  .has-conversation.client-body .message.mine { border-radius:18px; }
  .has-conversation.client-body .message:before { top:auto; bottom:0; left:-5px; border-top:0; border-bottom:12px solid #fff; border-left:10px solid transparent; }
  .has-conversation.client-body .message.mine:before { left:auto; right:-5px; border-left:0; border-right:10px solid transparent; border-bottom-color:#dcf8c6; }
  .has-conversation.client-body .message p { font-size:20px; line-height:1.3; }
  .has-conversation.client-body .message .author { display:none; }
  .has-conversation.client-body .message time { font-size:16px; line-height:20px; margin:1px 0 0 20px; }
  .has-conversation.client-body .message .delivery-state { float:none; margin-left:3px; vertical-align:middle; }
  .has-conversation.client-body .message .delivery-state svg { width:22px; height:16px; }
  .has-conversation.client-body .system { font-size:12px; line-height:1.35; }
  .has-conversation.client-body .date-chip { font-size:12px; }
  .has-conversation.client-body .composer { padding:8px 10px; }
  .has-conversation.client-body .compose-row { gap:7px; }
  .has-conversation.client-body .compose-row .compose-input textarea { font-size:18px; line-height:22px; min-height:40px; padding:8px 0; }
  .has-conversation.client-body .compose-icon svg { width:28px; height:28px; }
}
.capture-dialog { width:min(560px,calc(100vw - 24px)); max-height:90dvh; padding:20px; box-sizing:border-box; border:0; border-radius:20px; }
.capture-dialog::backdrop { background:#0009; }
.capture-dialog video { display:block; width:100%; max-height:60dvh; object-fit:contain; background:#111; border-radius:12px; }
.capture-dialog p { line-height:1.4; }
.capture-dialog img[data-preview] { width:100%; max-height:60dvh; object-fit:contain; border-radius:12px; }
.capture-dialog [hidden] { display:none !important; }
/* A conversation opened directly on desktop fills the browser content area. */
@media (min-width:951px) {
  .client-body.standalone-client.has-conversation { padding:0; }
  .standalone-client.has-conversation .client-wrap { width:100%; max-width:none; margin:0; }
  .standalone-client.has-conversation .client-card { border:0; border-radius:0; }
}
/* Keep only the conversation header on mobile, including the welcome screen. */
@media (max-width:950px) {
  .client-body .client-brand { display:none; }
}
.client-body .client-brand { display:none; }
@media (min-width:951px) {
  .client-body.standalone-client { padding:12px 18px; }
  .standalone-client .client-wrap { max-width:1100px; width:100%; }
  .standalone-client .client-card .empty { padding:20px 28px; }
  .standalone-client .client-card .empty h2 { max-width:760px; }
  .standalone-client .client-card .empty p { max-width:720px; }
  .standalone-client .client-foot { margin:8px 0 0; }
  .client-body.standalone-client.has-conversation { padding:0; }
  .standalone-client.has-conversation .client-wrap { max-width:none; }
}
#toast { opacity:1; transition:opacity 1s ease; }
#toast.toast-fading { opacity:0; pointer-events:none; }
@media(prefers-reduced-motion:reduce) { #toast { transition:none; } }

.greeting-choices{display:flex;flex-wrap:wrap;gap:8px;padding:12px;background:#f3f6f3}.greeting-choices button{background:white;color:#176344;border:1px solid #b8d8c5;border-radius:20px;padding:9px 14px;font-size:13px}.greeting-choices button:hover{background:#e7f6ec}

.message-choices{display:flex;flex-direction:column;gap:7px;margin-top:14px;border-top:1px solid #dce8df;padding-top:12px}.message-choices button{background:#fff;color:#16704b;border:1px solid #bcd9c8;border-radius:10px;padding:10px 14px;text-align:center;font-size:13px}.message-choices button:hover:not(:disabled){background:#e7f6ec}.message-choices button:disabled{opacity:.55;cursor:default}

#attachment-preview{width:88px;height:72px;object-fit:contain;border-radius:8px;background:#fff;margin-right:10px;vertical-align:middle}#attachment-preview[hidden]{display:none}.image-drop-target{outline:3px dashed #008069;outline-offset:-5px}

.quoted-message{position:relative;display:flex;flex-direction:column;gap:4px;margin:6px 0;padding:10px 34px 10px 12px;border-left:4px solid #008069;border-radius:7px;background:#edf2f0;color:#52635e;font-size:13px}.quoted-message strong{color:#008069}.quoted-message span{white-space:pre-wrap;overflow-wrap:anywhere;max-height:70px;overflow:hidden}#reply-preview button{position:absolute;right:5px;top:5px;border:0;background:transparent;font-size:22px}.message{position:relative}.message:has(.reply-message){padding-right:38px}.message .reply-message{position:absolute;right:5px;top:5px;display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:#52665b;cursor:pointer}.message .reply-message:hover{background:#dbe9e2}

.deleted-message-note{display:block;color:#936334;font-size:11px;margin:6px 0;font-style:italic}.conversation-context-menu button{display:block;width:100%;text-align:left}

#recorded-audio-preview{display:flex;align-items:center;gap:10px;flex-wrap:wrap;width:100%;padding:10px;background:#edf5f1;border-radius:12px}#recorded-audio-preview.hidden{display:none}#recorded-audio-preview audio{max-width:100%;flex:1;min-width:180px}#recorded-audio-preview button{white-space:nowrap}#recorded-audio-preview [data-send]{background:#008069;color:white}

#transfer-dialog .avatar{outline:3px solid;outline-offset:2px;margin:3px}#transfer-dialog .transfer-avatar-online{outline-color:#008775}#transfer-dialog .transfer-avatar-offline{outline-color:#c52b3a}#transfer-dialog .transfer-person-copy .offline{color:#c52b3a}#transfer-dialog .transfer-person-copy .online{color:#008775}

/* Keep close icons and their focus ring within the button bounds. */
:is(dialog button[aria-label^="Fechar"], [role="dialog"] button[aria-label^="Fechar"], .agenda-detail-close, .agenda-editor-heading > button, .customer-profile-heading > button, .finance-heading > button, .presence-heading > button, #presence-logs-close, #lunch-team-close, .drawer-close, .equipment-history-close, .dashboard-return-close, .ai-assistant-close, .olt-branch-status-modal-close){display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 40px!important;width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;box-sizing:border-box!important;padding:0!important;line-height:1!important;vertical-align:middle;overflow:visible}
:is(dialog button[aria-label^="Fechar"], [role="dialog"] button[aria-label^="Fechar"], .agenda-detail-close, .agenda-editor-heading > button, .customer-profile-heading > button, .finance-heading > button, .presence-heading > button, #presence-logs-close, #lunch-team-close, .drawer-close, .equipment-history-close, .dashboard-return-close, .ai-assistant-close, .olt-branch-status-modal-close) svg{display:block;flex:none;width:20px;height:20px;margin:0}
:is(dialog button[aria-label^="Fechar"], [role="dialog"] button[aria-label^="Fechar"], .agenda-detail-close, .agenda-editor-heading > button, .customer-profile-heading > button, .finance-heading > button, .presence-heading > button, #presence-logs-close, #lunch-team-close, .drawer-close, .equipment-history-close, .dashboard-return-close, .ai-assistant-close, .olt-branch-status-modal-close):focus-visible{outline:2px solid #57c4a6!important;outline-offset:-4px!important}

.payment-copy-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0}
.message .payment-copy{min-height:44px;padding:8px 16px;border:1px solid #087b65;border-radius:9px;background:#fff;color:#08634f;font:inherit;font-weight:600;cursor:pointer}
.message .payment-copy:focus-visible{outline:3px solid #087b65;outline-offset:2px}
.payment-copy-status{font-size:13px}
.message p{overflow-wrap:anywhere}

.chat-push-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 16px;border-top:1px solid #dce8e2;background:#f5faf7;color:#284b3d;font-size:13px}
.chat-push-controls[hidden]{display:none}
.chat-push-controls button{border:1px solid #16815d;border-radius:8px;padding:8px 12px;background:#fff;color:#126745;font:inherit;cursor:pointer}
.chat-push-controls button:disabled{opacity:.6;cursor:default}
.chat-push-controls small{flex:1;min-width:180px;line-height:1.4}
.push-intro{padding:24px;line-height:1.5}.push-intro h1{font-size:22px}.push-intro .chat-push-controls{padding:12px 0}

/* Customer chat installation controls. */
.chat-install{padding:12px 16px;background:#f5faf7;color:#284b3d;border-top:1px solid #dce8e2;font:14px/1.4 system-ui;flex-shrink:0}.chat-install[hidden]{display:none}.chat-install p{margin:0 0 8px}.chat-install button,.chat-install a{display:inline-block;font:inherit;border:1px solid #15734f;border-radius:8px;padding:8px 12px;margin:0 8px 0 0;background:white;color:#126745;text-decoration:none;cursor:pointer}.chat-install small{display:block;margin-top:8px}
:is(.chat-install,.chat-install-invite) .chat-install-primary{display:inline-flex!important;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;padding:11px 18px!important;border:1px solid #0b5138!important;border-radius:10px!important;background:#0b5138!important;color:#fff!important;font-weight:600!important;text-decoration:none!important;line-height:1.3;text-align:center;vertical-align:middle}:is(.chat-install,.chat-install-invite) .chat-install-primary:hover{background:#073d2a!important}:is(.chat-install,.chat-install-invite) .chat-install-primary:focus-visible{outline:3px solid #57b99b;outline-offset:3px}

/* Keep installation dialog copy readable against its light surface. */
.chat-install-invite,.chat-install-invite h2,.chat-install-invite p{color:#203c30!important}.chat-install-invite{background:#f5faf7!important}

.chat-install-actions{display:flex;align-items:stretch;gap:10px;margin-top:16px}.chat-install-actions>button{display:flex!important;align-items:center;justify-content:center;min-height:46px;box-sizing:border-box;margin:0!important;padding:11px 14px!important;line-height:1.3!important;border-radius:10px!important}.chat-install-actions>button:first-child{flex:1;min-width:0}.chat-install-actions>button:last-child{flex:0 0 auto;white-space:nowrap}
