/* SvyaZ inbox colours; scoped so storefront controls keep their own styles. */
.ag-chat {
  --ag-chat-deep: #173e32;
  --ag-chat-green: #25664d;
  --ag-chat-line: #e8ece7;
  --ag-chat-muted: #697b5c;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  color: #26332e;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.ag-chat *, .ag-chat *::before, .ag-chat *::after { box-sizing: border-box; }
.ag-chat button, .ag-chat textarea { font: inherit; }
.ag-chat button { cursor: pointer; transition: background .15s, border-color .15s; }
.ag-chat button:focus-visible { outline: 2px solid #4f9a77; outline-offset: 3px; }
.ag-chat-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; border: 1px solid #325e4b; border-radius: 9px; padding: 12px 18px; background: var(--ag-chat-deep); color: #f3f6ed; box-shadow: 0 5px 24px #173e3224; font-weight: 550; }
.ag-chat-toggle:hover { background: #214f3f; }
.ag-chat-toggle svg { flex-shrink: 0; color: #c6dcc1; }
.ag-chat-dialog { position: absolute; right: 0; bottom: 62px; width: min(380px, calc(100vw - 30px)); height: min(550px, calc(100dvh - 120px)); border: 1px solid #dfe5dc; border-radius: 12px; background: #fff; box-shadow: 0 12px 48px #173e3229; overflow: hidden; display: flex; flex-direction: column; text-align: left; }
.ag-chat-dialog[hidden] { display: none; }
.ag-chat-dialog header { display: flex; align-items: center; gap: 11px; padding: 18px 16px; background: #173d32; color: #f3f6ed; border-bottom: 1px solid #ffffff12; }
.ag-chat-avatar { display: grid; place-items: center; width: 37px; height: 37px; flex-shrink: 0; background: #426352; color: #dbe7ce; border: 1px solid #ffffff17; border-radius: 10px; font-size: 19px; font-weight: 550; }
.ag-chat-dialog header>div { min-width: 0; flex: 1; }
.ag-chat-dialog header strong { display: block; font-size: 17px; line-height: 1.35; letter-spacing: -.3px; font-weight: 600; }
.ag-chat-dialog header .ag-chat-brand-dot { display: inline; color: #7eb584; font-size: inherit; }
.ag-chat-dialog header div>span { display: block; color: #bbcfc5; font-size: 11px; margin-top: 4px; line-height: 1.6; }
.ag-chat-close { display: grid; place-items: center; width: 33px; height: 33px; padding: 0; flex-shrink: 0; border: 0; border-radius: 5px; background: transparent; color: #c6dcc1; font-size: 26px !important; line-height: 1; }
.ag-chat-close:hover { background: #ffffff12; color: white; }
.ag-chat-messages { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px 15px; display: flex; flex-direction: column; gap: 12px; background: #fbfcf8; }
.ag-chat-greeting { max-width: 94%; padding: 12px 13px; border: 1px solid #e9eee3; border-radius: 0 9px 9px 9px; background: white; color: #53624a; font-size: 13px; line-height: 1.8; margin: 0 0 5px; }
.ag-chat-message { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.8; border: 1px solid #e9eee3; border-radius: 0 9px 9px 9px; padding: 10px 12px; max-width: 92%; margin: 0; background: white; color: #53624a; align-self: flex-start; box-shadow: 0 1px 2px #40513103; }
.ag-chat-message.mine { background: #edf2e4; color: #4f6541; border-color: #e4ebd9; border-radius: 9px 0 9px 9px; align-self: flex-end; }
.ag-chat-message a { color: #17623e; text-decoration: underline; text-underline-offset: 3px; }
.ag-chat-product { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ag-chat-line); white-space: normal; }
.ag-chat-product img { width: 96px; height: 96px; object-fit: contain; border-radius: 5px; background: white; flex-shrink: 0; }
.ag-chat-product span { font-size: 12px; line-height: 1.6; }
.ag-chat-unread { min-width: 23px; padding: 1px 6px; border-radius: 12px; background: #f5eee2; color: #173e32; font-size: 12px; font-weight: 700; }
.ag-chat-unread[hidden] { display: none; }
.ag-chat-dialog header, .ag-chat-status, .ag-chat-form { flex-shrink: 0; }
.ag-chat-messengers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.ag-chat-messengers a { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid #dce5d8; border-radius: 6px; color: #30583e; font-size: 12px; line-height: 1.4; text-decoration: none; }
.ag-chat-messengers a:hover { background: #edf2e4; border-color: #8ea58a; }
.ag-chat-messengers svg { width: 20px; height: 20px; flex-shrink: 0; }
.ag-chat-form { margin: 0; padding: 13px; border-top: 1px solid var(--ag-chat-line); background: white; }
.ag-chat-form label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.ag-chat-form textarea { display: block; width: 100%; border: 1px solid #dfe7d5; border-radius: 6px; background: #fefffd; color: #26332e; padding: 10px 11px; resize: vertical; font-size: 13px; line-height: 1.7; min-height: 67px; max-height: 130px; }
.ag-chat-form textarea::placeholder { color: #718267; }
.ag-chat-form textarea:focus { outline: 2px solid #7ebba466; outline-offset: 1px; }
.ag-chat-form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 9px; }
.ag-chat-form-bottom>span { font-size: 10px; color: var(--ag-chat-muted); line-height: 1.6; }
.ag-chat-form button { padding: 8px 12px; min-height: 35px; border: 1px solid #2b664d; border-radius: 6px; background: #2b664d; color: white; font-size: 12px; font-weight: 550; }
.ag-chat-form button:hover { background: #21553e; }
.ag-chat-form button:disabled { opacity: .55; cursor: not-allowed; }
.ag-chat-status { padding: 9px 13px; margin: 0; border-top: 1px solid var(--ag-chat-line); font-size: 11px; line-height: 1.7; color: #805c30; background: #fbf4e8; }
.ag-chat-status:empty { display: none; }
@media (max-width: 600px) {
  html.ag-chat-open, html.ag-chat-open body { overflow: hidden; overscroll-behavior: none; }
  .ag-chat-open .ag-chat-toggle { visibility: hidden; }
  .ag-chat { right: 12px; bottom: 14px; }
  .ag-chat-toggle { padding: 11px 14px; font-size: 13px; }
  .ag-chat-dialog { position: fixed; top: var(--ag-chat-top, 0px); left: 0; right: 0; bottom: auto; width: 100%; height: var(--ag-chat-height, 100dvh); max-height: none; border: 0; border-radius: 0; }
  .ag-chat-dialog header { padding: 12px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left)); padding-top: max(12px, env(safe-area-inset-top)); }
  .ag-chat-form { padding-bottom: max(13px, env(safe-area-inset-bottom)); }
  .ag-chat-form textarea { font-size: 16px; }
  .ag-chat-close { width: 40px; height: 40px; }
  .ag-chat-form button { min-height: 40px; }
}
@media (max-width: 600px) and (max-height: 500px) {
  .ag-chat-dialog header { padding-top: 7px; padding-bottom: 7px; }
  .ag-chat-form { padding-top: 8px; }
  .ag-chat-form textarea { min-height: 46px; max-height: 70px; }
}
@media (prefers-reduced-motion: reduce) { .ag-chat button { transition: none; } }
