:root{--aai-green:#0b6b45;--aai-green-soft:#eaf7f0;--aai-ink:#17231d;--aai-muted:#6f7e76;--aai-line:#e4ebe7;--aai-shadow:0 18px 50px rgba(18,53,38,.10)}
body.amarai-chat-ui-v11{overflow:hidden;background:#fff}body.amarai-chat-ui-v11 .amarai-ui-shell-app{min-height:0;background:#fff}body.amarai-chat-ui-v11 .amarai-chat-extension-root{position:relative;width:100%;height:calc(100dvh - var(--amarai-header-height,72px));min-height:520px;overflow:hidden;background:#fff}
.aai-chat-app,.aai-chat-app.amarai-app{display:flex;width:100%;height:100%;min-height:0;overflow:hidden;background:#fff;color:var(--aai-ink)}.aai-chat-app svg,.aai-sidebar-backdrop svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.aai-chat-app button{font:inherit}.aai-chat-app .amarai-main,.aai-chat-app .amarai-chat-main,.aai-chat-app>main{position:relative;display:flex;flex:1;flex-direction:column;min-width:0;min-height:0;background:#fff}
.aai-workspace-bar{height:58px;flex:0 0 58px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:0 18px;border-bottom:1px solid var(--aai-line);background:rgba(255,255,255,.94);backdrop-filter:blur(14px);z-index:22}.aai-workspace-left,.aai-workspace-actions,.aai-title-row{display:flex;align-items:center}.aai-workspace-left{gap:10px;min-width:0}.aai-workspace-actions{gap:8px}.aai-workspace-identity{min-width:0;line-height:1.05}.aai-workspace-identity strong{font-size:14px}.aai-workspace-identity small{display:block;margin-top:4px;color:var(--aai-muted);font-size:11px}.aai-title-row{gap:6px}.aai-ready{font-size:11px;color:var(--aai-muted);font-weight:600}.aai-ready-dot{width:6px;height:6px;border-radius:50%;background:#28a56c;box-shadow:0 0 0 3px #e7f7ef}.aai-icon-btn,.aai-tools-trigger,.aai-language-switch button{border:0;background:transparent;color:#33443b;cursor:pointer}.aai-icon-btn{width:38px;height:38px;border-radius:11px;display:grid;place-items:center}.aai-icon-btn:hover{background:#f0f5f2}.aai-mobile-menu{display:none}.aai-tools-trigger{height:38px;display:flex;align-items:center;gap:7px;padding:0 12px;border:1px solid var(--aai-line);border-radius:11px;background:#fff;font-size:12px;font-weight:700}.aai-language-switch{display:flex;align-items:center;padding:3px;border:1px solid var(--aai-line);border-radius:11px;background:#f7faf8}.aai-language-switch button{height:30px;padding:0 9px;border-radius:8px;font-size:11px;font-weight:800}.aai-language-switch button.active{background:#fff;color:var(--aai-green);box-shadow:0 2px 8px rgba(16,52,37,.08)}
.aai-sidebar,.aai-chat-app .amarai-sidebar,.aai-chat-app .amarai-chat-sidebar{width:288px;flex:0 0 288px;min-width:0;height:100%;padding:14px 12px;background:#f6f9f7;border-right:1px solid var(--aai-line);overflow-y:auto;overflow-x:hidden;transition:width .22s ease,flex-basis .22s ease,transform .22s ease}.aai-sidebar-mobile-head{display:none}.aai-new-chat,.aai-chat-app .amarai-new{width:100%;min-height:43px!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:9px!important;padding:9px 11px!important;border:1px solid #dbe7e0!important;border-radius:12px!important;background:#fff!important;color:var(--aai-ink)!important;font-weight:700!important}.aai-plus{width:22px;height:22px;display:grid;place-items:center;border-radius:7px;background:var(--aai-green-soft);color:var(--aai-green);font-size:18px}.aai-history-search{height:40px;display:flex;align-items:center;gap:8px;margin:10px 0 14px;padding:0 10px;border-radius:11px;color:#7a8981;background:#edf2ef}.aai-history-search:focus-within{background:#fff;box-shadow:0 0 0 3px rgba(11,107,69,.06)}.aai-history-search svg{width:16px;height:16px}.aai-history-search input{width:100%;min-width:0;border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;font-size:12px!important;padding:0!important}.aai-history-label{margin:4px 7px 7px;color:#849189;font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase}.aai-history{display:flex;flex-direction:column;gap:3px}.aai-history button,.aai-history a{width:100%;min-height:36px;display:flex;align-items:center;text-align:left;padding:8px 9px!important;border:0!important;border-radius:9px!important;background:transparent!important;color:#425149!important;font-size:12px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.aai-history button:hover,.aai-history a:hover,.aai-history .active{background:#eaf0ec!important;color:#1d3328!important}body.aai-sidebar-collapsed .aai-sidebar{width:0!important;flex-basis:0!important;padding-left:0!important;padding-right:0!important;border-right:0!important;overflow:hidden!important}
.aai-chat-app .amarai-messages,.aai-chat-app .amarai-chat-messages,.aai-chat-app [data-chat-messages]{position:relative;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scroll-behavior:smooth;padding:26px max(22px,calc((100% - 900px)/2)) 150px;scrollbar-width:thin;scrollbar-color:#d8e2dc transparent}.aai-welcome{width:min(760px,100%);margin:7vh auto 0;text-align:center}.aai-welcome-mark{width:54px;height:54px;margin:0 auto 18px;display:grid;place-items:center;border-radius:17px;background:linear-gradient(145deg,#e9f7f0,#f8fcfa);color:var(--aai-green);border:1px solid #d9ece2;box-shadow:0 12px 30px rgba(11,107,69,.08)}.aai-welcome-mark svg{width:27px;height:27px}.aai-welcome h1,.aai-welcome h2,.aai-welcome h3{margin:0;color:#183025;font-size:clamp(28px,4vw,40px);font-weight:750;letter-spacing:-.035em}.aai-welcome>p{margin:10px 0 0;color:var(--aai-muted);font-size:14px}.aai-quick-wrap{margin-top:34px;text-align:left}.aai-quick-label{margin:0 0 9px 3px;color:#7b8b82;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.aai-quick-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.aai-quick-card{min-height:82px;display:flex;align-items:flex-start;gap:10px;padding:13px!important;border:1px solid var(--aai-line)!important;border-radius:14px!important;background:#fff!important;color:var(--aai-ink)!important;text-align:left!important;cursor:pointer;transition:.16s ease}.aai-quick-card:hover{transform:translateY(-1px);border-color:#cee1d6!important;box-shadow:0 8px 24px rgba(18,53,38,.06)}.aai-quick-card>span:first-child{width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;border-radius:9px;background:#f0f7f3;color:var(--aai-green)}.aai-quick-card svg{width:17px;height:17px}.aai-quick-card strong{display:block;font-size:12px}.aai-quick-card small{display:block;margin-top:4px;color:#7a8981;font-size:10px;line-height:1.35}
.aai-message-actions{display:flex;align-items:center;gap:4px;margin-top:5px;opacity:0;transition:opacity .15s}.aai-message:hover .aai-message-actions,.aai-message:focus-within .aai-message-actions{opacity:1}.aai-message-actions button{display:flex;align-items:center;gap:5px;padding:5px 7px;border:0;border-radius:8px;background:transparent;color:#7a8981;font-size:10px;cursor:pointer}.aai-message-actions button:hover{background:#f1f5f2;color:#3f5147}.aai-message-actions svg{width:14px;height:14px}
.aai-composer,.aai-chat-app .amarai-composer,.aai-chat-app .amarai-chat-composer{position:relative!important;z-index:18;margin:0 auto 14px!important;width:min(900px,calc(100% - 32px))!important;flex:0 0 auto;background:#fff!important;border:1px solid #dce6e0!important;border-radius:20px!important;box-shadow:0 12px 38px rgba(20,55,39,.09)!important}.aai-composer textarea,.aai-composer input[type=text]{font-size:14px!important;line-height:1.5!important}.aai-composer-meta{position:absolute;left:8px;right:8px;top:calc(100% + 5px);display:flex;justify-content:space-between;gap:12px;padding:0 5px;color:#98a39d;font-size:9px;pointer-events:none}.aai-shortcut{white-space:nowrap}
.aai-tools-panel{position:absolute;right:18px;top:70px;width:min(390px,calc(100% - 36px));z-index:50;padding:14px;border:1px solid var(--aai-line);border-radius:18px;background:rgba(255,255,255,.98);box-shadow:var(--aai-shadow);opacity:0;visibility:hidden;transform:translateY(-6px) scale(.98);transition:.18s}.aai-tools-panel.is-open{opacity:1;visibility:visible;transform:none}.aai-tools-head{display:flex;align-items:center;justify-content:space-between;padding:3px 3px 11px}.aai-tools-head strong{display:block;font-size:14px}.aai-tools-head small{display:block;margin-top:3px;color:var(--aai-muted);font-size:10px}.aai-tools-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.aai-tool-card{display:flex;align-items:center;gap:10px;padding:11px!important;border:1px solid #e7ede9!important;border-radius:13px!important;background:#fafcfb!important;color:var(--aai-ink)!important;text-align:left!important;cursor:pointer}.aai-tool-icon{width:34px;height:34px;flex:0 0 34px;display:grid;place-items:center;border-radius:10px;background:#eaf7f0;color:var(--aai-green)}.aai-tool-card strong{display:block;font-size:11px}.aai-tool-card small{display:block;margin-top:3px;color:#7e8d85;font-size:9px;line-height:1.25}.aai-tool-soft{opacity:.78}.aai-tools-shade{display:none}.aai-scroll-latest{position:absolute;right:24px;bottom:112px;z-index:17;width:38px;height:38px;display:grid;place-items:center;border:1px solid var(--aai-line);border-radius:50%;background:#fff;color:#4f6258;box-shadow:0 8px 22px rgba(20,55,39,.1);cursor:pointer;opacity:0;visibility:hidden;transform:translateY(8px);transition:.18s}.aai-scroll-latest.is-visible{opacity:1;visibility:visible;transform:none}.aai-sidebar-backdrop{display:none}.amarai-chat-ui-missing{max-width:720px;margin:70px auto;padding:28px;border:1px solid var(--aai-line);border-radius:18px;background:#fff}
@media(max-width:1000px){.aai-quick-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:800px){body.amarai-chat-ui-v11 .amarai-chat-extension-root{height:calc(100dvh - var(--amarai-header-height,64px))}.aai-mobile-menu{display:grid}.aai-collapse-btn{display:none}.aai-workspace-bar{height:54px;flex-basis:54px;padding:0 10px}.aai-workspace-actions{gap:5px}.aai-tools-trigger{width:38px;padding:0;justify-content:center}.aai-tools-trigger span{display:none}.aai-language-switch button{padding:0 7px}.aai-sidebar,.aai-chat-app .amarai-sidebar,.aai-chat-app .amarai-chat-sidebar{position:fixed!important;left:0;top:0;bottom:0;z-index:1000;width:min(330px,88vw)!important;max-width:88vw!important;height:100dvh!important;flex-basis:auto!important;padding:12px!important;border-right:1px solid var(--aai-line)!important;transform:translateX(-104%);box-shadow:var(--aai-shadow);background:#f7faf8!important}.aai-sidebar.aai-sidebar-visible{transform:translateX(0)}.aai-sidebar-mobile-head{height:44px;display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;padding:0 3px}.aai-sidebar-backdrop{position:fixed;inset:0;z-index:999;border:0;background:rgba(12,26,19,.32);backdrop-filter:blur(2px)}body.aai-sidebar-open .aai-sidebar-backdrop{display:block}.aai-chat-app .amarai-messages,.aai-chat-app .amarai-chat-messages,.aai-chat-app [data-chat-messages]{padding:20px 14px 138px}.aai-welcome{margin-top:4vh}.aai-welcome-mark{width:48px;height:48px;border-radius:15px;margin-bottom:15px}.aai-welcome h1,.aai-welcome h2,.aai-welcome h3{font-size:29px}.aai-welcome>p{font-size:12px}.aai-quick-wrap{margin-top:26px}.aai-quick-grid{grid-template-columns:1fr 1fr;gap:7px}.aai-quick-card{min-height:75px;padding:11px!important}.aai-composer,.aai-chat-app .amarai-composer,.aai-chat-app .amarai-chat-composer{width:calc(100% - 20px)!important;margin:0 10px max(10px,env(safe-area-inset-bottom))!important;border-radius:18px!important;box-shadow:0 8px 28px rgba(20,55,39,.1)!important}.aai-composer-meta{display:none}.aai-tools-panel{position:fixed;left:8px;right:8px;top:auto;bottom:8px;width:auto;z-index:1002;padding:14px;border-radius:22px;transform:translateY(110%)}.aai-tools-panel.is-open{transform:none}.aai-tools-grid{grid-template-columns:1fr 1fr}.aai-tools-shade{position:fixed;inset:0;z-index:1001;border:0;background:rgba(12,26,19,.30);backdrop-filter:blur(2px)}.aai-tools-shade.is-open{display:block}.aai-scroll-latest{right:14px;bottom:104px}.aai-message-actions{opacity:1}}@media(max-width:520px){.aai-workspace-identity small,.aai-ready{display:none}.aai-workspace-left{gap:5px}.aai-language-switch{padding:2px}.aai-language-switch button{height:29px;font-size:10px;padding:0 6px}.aai-quick-grid{grid-template-columns:1fr}.aai-quick-card{min-height:64px;align-items:center}.aai-tools-grid{grid-template-columns:1fr}.aai-tool-card{min-height:58px}}@media(prefers-reduced-motion:reduce){.aai-chat-app *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
/* v1.1.1 — de-duplication: the Core/theme already owns these visual elements. */
.aai-workspace-bar{display:none!important}
.aai-welcome-mark{display:none!important}
.aai-redundant-sidebar-brand{display:none!important}

/* Keep one clean Chat toolbar: use the existing Core toolbar instead of stacking another one. */
.aai-chat-app .amarai-chat-header + .aai-workspace-bar,
.aai-chat-app .amarai-toolbar + .aai-workspace-bar,
.aai-chat-app .chat-toolbar + .aai-workspace-bar{display:none!important}

/* If an older cached v1.1.0 node survives a partial page transition, suppress it safely. */
.amarai-chat-extension-root .aai-workspace-bar{display:none!important}


/* v1.1.2 stability fix */
.aai-composer-meta{display:none!important}
.amarai-chat-extension-root .aai-workspace-bar,
.amarai-chat-extension-root .aai-welcome-mark,
.amarai-chat-extension-root .aai-redundant-sidebar-brand{display:none!important}


/* v1.1.3 — sidebar + composer polish */
.aai-redundant-sidebar-brand{display:none!important}
.aai-hidden-composer-bar,
.amarai-chat-extension-root .amarai-progress,
.amarai-chat-extension-root .amarai-progress-wrap,
.amarai-chat-extension-root .amarai-progress-bar,
.amarai-chat-extension-root .amarai-loading-bar,
.amarai-chat-extension-root .amarai-composer-progress,
.amarai-chat-extension-root .chat-progress,
.amarai-chat-extension-root [data-chat-progress],
.amarai-chat-extension-root [data-progress-bar]{display:none!important}

.aai-history-search{
  height:44px!important;margin:12px 0 18px!important;padding:0 12px!important;gap:9px!important;
  background:#fff!important;border:1px solid #dfe9e3!important;border-radius:13px!important;
  box-shadow:0 3px 12px rgba(18,53,38,.035)!important;
  transition:border-color .16s ease,box-shadow .16s ease!important
}
.aai-history-search:hover{border-color:#cfddd5!important}
.aai-history-search:focus-within{border-color:#b9d8c7!important;box-shadow:0 0 0 4px rgba(11,107,69,.07)!important}
.aai-history-search input{height:42px!important;font-size:12px!important;color:#25372e!important}
.aai-history-search svg{color:#718178!important}

.aai-sidebar-quick{margin:18px 0 8px;padding-top:14px;border-top:1px solid #e3ebe6}
.aai-sidebar-quick-title{margin:0 7px 9px;color:#849189;font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase}
.aai-sidebar-quick-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.aai-sidebar-quick-card{
  min-width:0!important;min-height:54px!important;display:flex!important;align-items:center!important;
  justify-content:flex-start!important;gap:8px!important;margin:0!important;padding:10px!important;
  border:1px solid #dfe9e3!important;border-radius:12px!important;background:#fff!important;
  color:#28543f!important;box-shadow:0 3px 12px rgba(18,53,38,.025)!important;
  font-size:11px!important;font-weight:750!important;text-align:left!important;line-height:1.2!important;
  white-space:normal!important;position:static!important;inset:auto!important
}
.aai-sidebar-quick-card:hover{border-color:#c8ded2!important;background:#f9fcfa!important;transform:translateY(-1px)}
.aai-sidebar-quick-card svg{width:16px!important;height:16px!important;flex:0 0 16px;color:#0b6b45}
.aai-added-quick{cursor:pointer}
@media(max-width:800px){.aai-sidebar-quick{margin-top:16px}.aai-sidebar-quick-grid{grid-template-columns:1fr 1fr}}
@media(max-width:390px){.aai-sidebar-quick-grid{grid-template-columns:1fr}}


/* v1.1.4 — fixed app viewport on desktop + mobile */
html.aai-chat-page-lock,
body.aai-chat-page-lock{
  width:100%!important;
  height:100%!important;
  max-height:100%!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
}

body.aai-chat-page-lock{
  position:relative!important;
  margin-bottom:0!important;
}

/* The Chat workspace itself is pinned between the site header and viewport bottom. */
body.aai-chat-page-lock .amarai-chat-extension-root{
  position:fixed!important;
  top:var(--aai-chat-fixed-top, var(--amarai-header-height,72px))!important;
  right:0!important;
  bottom:0!important;
  left:0!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
  background:#fff!important;
}

/* Nothing in the app shell can make the browser page taller. */
body.aai-chat-page-lock .amarai-chat-extension-root,
body.aai-chat-page-lock .aai-chat-app,
body.aai-chat-page-lock .aai-chat-app .amarai-main,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-main,
body.aai-chat-page-lock .aai-chat-app > main{
  min-height:0!important;
  max-height:100%!important;
}

/* Sidebar is fixed; only Recent Chats becomes independently scrollable. */
body.aai-chat-page-lock .aai-sidebar,
body.aai-chat-page-lock .aai-chat-app .amarai-sidebar,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-sidebar{
  display:flex!important;
  flex-direction:column!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
}

body.aai-chat-page-lock .aai-history{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  scrollbar-color:#cfd9d3 transparent;
}

body.aai-chat-page-lock .aai-history-label,
body.aai-chat-page-lock .aai-history-search,
body.aai-chat-page-lock .aai-new-chat,
body.aai-chat-page-lock .aai-sidebar-quick{
  flex:0 0 auto!important;
}

/* Conversation is the only vertical scroll area in the main workspace. */
body.aai-chat-page-lock .aai-chat-app .amarai-messages,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-messages,
body.aai-chat-page-lock .aai-chat-app [data-chat-messages]{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch;
}

/* Composer stays anchored at the bottom of the app workspace. */
body.aai-chat-page-lock .aai-composer,
body.aai-chat-page-lock .aai-chat-app .amarai-composer,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-composer{
  flex:0 0 auto!important;
}

/* Prevent wheel/touch chaining from internal scrollers into the page. */
body.aai-chat-page-lock .aai-history,
body.aai-chat-page-lock .aai-chat-app .amarai-messages,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-messages,
body.aai-chat-page-lock .aai-chat-app [data-chat-messages]{
  touch-action:pan-y;
}

@media(max-width:800px){
  html.aai-chat-page-lock,
  body.aai-chat-page-lock{
    height:100dvh!important;
    max-height:100dvh!important;
  }

  body.aai-chat-page-lock .amarai-chat-extension-root{
    top:var(--aai-chat-fixed-top, var(--amarai-header-height,64px))!important;
  }

  body.aai-chat-page-lock .aai-sidebar,
  body.aai-chat-page-lock .aai-chat-app .amarai-sidebar,
  body.aai-chat-page-lock .aai-chat-app .amarai-chat-sidebar{
    height:100dvh!important;
    max-height:100dvh!important;
  }

  body.aai-chat-page-lock .aai-composer,
  body.aai-chat-page-lock .aai-chat-app .amarai-composer,
  body.aai-chat-page-lock .aai-chat-app .amarai-chat-composer{
    margin-bottom:max(10px,env(safe-area-inset-bottom))!important;
  }
}


/* v1.1.5 — remove duplicate sidebar brand + center sidebar button labels */

/* The global site header is the only AmarAI wordmark on the Chat screen. */
.aai-sidebar .aai-redundant-sidebar-brand{
  display:none!important;
}

/* New Chat: keep the plus on the left while the label itself is truly centered. */
.aai-new-chat,
.aai-chat-app .amarai-new{
  position:relative!important;
  justify-content:center!important;
  text-align:center!important;
  padding-left:42px!important;
  padding-right:42px!important;
}
.aai-new-chat .aai-plus{
  position:absolute!important;
  left:11px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
}
.aai-new-chat .aai-new-label{
  width:100%!important;
  text-align:center!important;
}

/* Quick Access: every button label sits in the visual center. */
.aai-sidebar-quick-card{
  position:relative!important;
  justify-content:center!important;
  text-align:center!important;
  padding-left:34px!important;
  padding-right:34px!important;
}
.aai-sidebar-quick-card > span{
  width:100%!important;
  text-align:center!important;
}
.aai-sidebar-quick-card > svg{
  position:absolute!important;
  left:12px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  margin:0!important;
}
.aai-sidebar-quick-card:not(.aai-added-quick){
  padding-left:12px!important;
  padding-right:12px!important;
}

/* Mobile drawer header now only carries the close action; no second AmarAI name. */
.aai-sidebar-mobile-head{
  justify-content:flex-end!important;
}


/* =========================================================
   v1.1.6 — polished logged-out screen for /chat/
   This replaces the Core shortcode's tiny guest gate.
   ========================================================= */

body.aai-chat-guest-page .amarai-chat-extension-root.aai-chat-guest-root{
  background:
    radial-gradient(circle at 13% 20%,rgba(28,167,105,.10),transparent 29%),
    radial-gradient(circle at 88% 80%,rgba(139,210,169,.12),transparent 28%),
    #f8fbf9!important;
}

.aai-chat-guest-root,
.aai-chat-guest-root *{box-sizing:border-box}

.aai-chat-guest-root .aai-guest-auth{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
  padding:32px 24px!important;
  background:transparent!important;
}

.aai-chat-guest-root .aai-guest-panel{
  width:min(1060px,100%)!important;
  min-height:520px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1.08fr) minmax(360px,.92fr)!important;
  overflow:hidden!important;
  border:1px solid #dce9e2!important;
  border-radius:30px!important;
  background:#fff!important;
  box-shadow:0 30px 85px rgba(19,70,47,.10)!important;
}

.aai-chat-guest-root .aai-guest-copy{
  position:relative!important;
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  padding:58px 58px!important;
  overflow:hidden!important;
  background:
    radial-gradient(circle at 84% 14%,rgba(95,210,144,.19),transparent 30%),
    linear-gradient(145deg,#eef9f3 0%,#e7f6ed 55%,#f6fbf8 100%)!important;
  border-right:1px solid #dce9e2!important;
}

.aai-chat-guest-root .aai-guest-copy:after{
  content:""!important;
  position:absolute!important;
  width:280px!important;
  height:280px!important;
  right:-120px!important;
  bottom:-130px!important;
  border:1px solid rgba(6,133,86,.10)!important;
  border-radius:50%!important;
  box-shadow:0 0 0 48px rgba(255,255,255,.20),0 0 0 96px rgba(255,255,255,.12)!important;
  pointer-events:none!important;
}

.aai-chat-guest-root .aai-guest-badge{
  position:relative!important;
  z-index:1!important;
  width:max-content!important;
  max-width:100%!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:9px!important;
  margin:0 0 22px!important;
  padding:8px 11px!important;
  border:1px solid rgba(6,133,86,.12)!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.62)!important;
  color:#4d695b!important;
  font-size:10px!important;
  font-weight:850!important;
  letter-spacing:.12em!important;
  line-height:1!important;
}

.aai-chat-guest-root .aai-guest-badge i{
  width:7px!important;
  height:7px!important;
  flex:0 0 7px!important;
  border-radius:50%!important;
  background:#18a76b!important;
  box-shadow:0 0 0 4px rgba(24,167,107,.10)!important;
}

.aai-chat-guest-root .aai-guest-copy h1{
  position:relative!important;
  z-index:1!important;
  max-width:500px!important;
  margin:0 0 18px!important;
  color:#102019!important;
  font-size:clamp(46px,5vw,68px)!important;
  font-weight:850!important;
  letter-spacing:-3px!important;
  line-height:.98!important;
}

.aai-chat-guest-root .aai-guest-copy>p{
  position:relative!important;
  z-index:1!important;
  max-width:500px!important;
  margin:0!important;
  color:#61736a!important;
  font-size:15px!important;
  line-height:1.72!important;
}

.aai-chat-guest-root .aai-guest-features{
  position:relative!important;
  z-index:1!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:10px!important;
  margin:31px 0 0!important;
}

.aai-chat-guest-root .aai-guest-features>div{
  min-width:0!important;
  min-height:82px!important;
  display:grid!important;
  grid-template-columns:38px minmax(0,1fr)!important;
  align-items:center!important;
  gap:11px!important;
  padding:13px!important;
  border:1px solid rgba(6,133,86,.11)!important;
  border-radius:16px!important;
  background:rgba(255,255,255,.62)!important;
}

.aai-chat-guest-root .aai-guest-feature-icon{
  width:38px!important;
  height:38px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:12px!important;
  background:#e7f7ef!important;
  color:#087c52!important;
  font-size:17px!important;
  font-weight:900!important;
}

.aai-chat-guest-root .aai-guest-features strong,
.aai-chat-guest-root .aai-guest-features small{
  display:block!important;
}

.aai-chat-guest-root .aai-guest-features strong{
  color:#234637!important;
  font-size:12px!important;
  font-weight:800!important;
  line-height:1.3!important;
}

.aai-chat-guest-root .aai-guest-features small{
  margin-top:4px!important;
  color:#778981!important;
  font-size:10px!important;
  line-height:1.45!important;
}

.aai-chat-guest-root .aai-guest-language{
  position:relative!important;
  z-index:1!important;
  margin-top:26px!important;
  color:#72847b!important;
  font-size:11px!important;
  font-weight:650!important;
}

.aai-chat-guest-root .aai-guest-language b{
  padding:0 5px!important;
  color:#0b9360!important;
}

.aai-chat-guest-root .aai-guest-card-wrap{
  min-width:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:52px 50px!important;
  background:#fff!important;
}

.aai-chat-guest-root .aai-guest-card{
  width:100%!important;
  max-width:360px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

.aai-chat-guest-root .aai-guest-brand{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  margin:0 0 38px!important;
  color:#102019!important;
}

.aai-chat-guest-root .aai-guest-brand strong{
  font-size:22px!important;
  font-weight:850!important;
  letter-spacing:-.7px!important;
  line-height:1!important;
}

.aai-chat-guest-root .aai-guest-logo{
  width:40px!important;
  height:40px!important;
  flex:0 0 40px!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  border-radius:12px!important;
  background:#102019!important;
  color:#c9f400!important;
  font-size:23px!important;
  font-weight:900!important;
  line-height:1!important;
}

.aai-chat-guest-root .aai-guest-logo img{
  width:100%!important;
  height:100%!important;
  display:block!important;
  object-fit:cover!important;
}

.aai-chat-guest-root .aai-guest-card h2{
  margin:0 0 10px!important;
  color:#102019!important;
  font-size:32px!important;
  font-weight:850!important;
  letter-spacing:-1.35px!important;
  line-height:1.08!important;
}

.aai-chat-guest-root .aai-guest-card>p{
  margin:0 0 28px!important;
  color:#718078!important;
  font-size:14px!important;
  line-height:1.6!important;
}

.aai-chat-guest-root .aai-guest-actions{
  width:100%!important;
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
}

.aai-chat-guest-root .aai-guest-btn{
  width:100%!important;
  height:52px!important;
  min-height:52px!important;
  max-height:52px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  padding:0 18px!important;
  margin:0!important;
  border-radius:14px!important;
  font-size:14px!important;
  font-weight:800!important;
  line-height:1!important;
  text-align:center!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  writing-mode:horizontal-tb!important;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background .16s ease!important;
}

.aai-chat-guest-root .aai-guest-btn-primary{
  border:1px solid #078557!important;
  background:linear-gradient(180deg,#0a9663,#078557)!important;
  color:#fff!important;
  box-shadow:0 11px 24px rgba(7,133,87,.16)!important;
}

.aai-chat-guest-root .aai-guest-btn-primary:hover{
  transform:translateY(-1px)!important;
  background:linear-gradient(180deg,#078557,#056d49)!important;
  box-shadow:0 14px 29px rgba(7,133,87,.20)!important;
}

.aai-chat-guest-root .aai-guest-btn-primary span{
  font-size:18px!important;
  line-height:1!important;
}

.aai-chat-guest-root .aai-guest-btn-secondary{
  border:1px solid #d4e3db!important;
  background:#fff!important;
  color:#087b52!important;
}

.aai-chat-guest-root .aai-guest-btn-secondary:hover{
  border-color:#b9d6c7!important;
  background:#f8fcfa!important;
}

.aai-chat-guest-root .aai-guest-trust{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  margin:24px 0 0!important;
  padding:20px 0 0!important;
  border-top:1px solid #edf2ef!important;
  color:#8a9891!important;
  font-size:10px!important;
  font-weight:600!important;
}

.aai-chat-guest-root .aai-guest-trust svg{
  width:14px!important;
  height:14px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.8!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}

@media(max-width:820px){
  .aai-chat-guest-root .aai-guest-auth{
    align-items:flex-start!important;
    padding:18px 14px max(22px,env(safe-area-inset-bottom))!important;
  }
  .aai-chat-guest-root .aai-guest-panel{
    min-height:0!important;
    display:block!important;
    border-radius:23px!important;
  }
  .aai-chat-guest-root .aai-guest-copy{
    padding:32px 26px 30px!important;
    border-right:0!important;
    border-bottom:1px solid #dce9e2!important;
  }
  .aai-chat-guest-root .aai-guest-copy h1{
    max-width:430px!important;
    font-size:42px!important;
    letter-spacing:-2px!important;
  }
  .aai-chat-guest-root .aai-guest-features{
    margin-top:24px!important;
  }
  .aai-chat-guest-root .aai-guest-card-wrap{
    padding:34px 26px 30px!important;
  }
  .aai-chat-guest-root .aai-guest-card{
    max-width:440px!important;
  }
  .aai-chat-guest-root .aai-guest-brand{
    margin-bottom:26px!important;
  }
}

@media(max-width:520px){
  .aai-chat-guest-root .aai-guest-auth{
    padding:10px 9px max(16px,env(safe-area-inset-bottom))!important;
  }
  .aai-chat-guest-root .aai-guest-panel{
    border-radius:20px!important;
  }
  .aai-chat-guest-root .aai-guest-copy{
    padding:27px 20px 25px!important;
  }
  .aai-chat-guest-root .aai-guest-badge{
    margin-bottom:17px!important;
  }
  .aai-chat-guest-root .aai-guest-copy h1{
    font-size:36px!important;
    letter-spacing:-1.7px!important;
  }
  .aai-chat-guest-root .aai-guest-copy>p{
    font-size:13px!important;
  }
  .aai-chat-guest-root .aai-guest-features{
    grid-template-columns:1fr!important;
    gap:8px!important;
    margin-top:20px!important;
  }
  .aai-chat-guest-root .aai-guest-features>div{
    min-height:68px!important;
  }
  .aai-chat-guest-root .aai-guest-language{
    margin-top:19px!important;
  }
  .aai-chat-guest-root .aai-guest-card-wrap{
    padding:29px 20px 24px!important;
  }
  .aai-chat-guest-root .aai-guest-card h2{
    font-size:29px!important;
  }
}


/* =========================================================
   v1.2.0 — Premium workspace upgrade
   ========================================================= */

/* Sidebar collapse control */
.aai-sidebar-collapse{
  width:100%!important;height:34px!important;display:flex!important;align-items:center!important;justify-content:center!important;
  gap:7px!important;margin:0 0 8px!important;padding:0 10px!important;border:0!important;border-radius:10px!important;
  background:transparent!important;color:#718078!important;font-size:10px!important;font-weight:750!important;cursor:pointer!important
}
.aai-sidebar-collapse:hover{background:#edf3ef!important;color:#31503f!important}
.aai-sidebar-collapse svg{width:15px!important;height:15px!important}
@media(max-width:800px){.aai-sidebar-collapse{display:none!important}}

/* History rows + actions */
.aai-history-row{position:relative!important;display:flex!important;align-items:center!important;gap:2px!important;width:100%!important;min-width:0!important}
.aai-history-row>a,.aai-history-row>button:not(.aai-history-more){flex:1 1 auto!important;min-width:0!important;padding-right:32px!important}
.aai-history-title{display:block!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.aai-history-row.is-pinned:before{
  content:"";position:absolute;left:3px;top:50%;width:4px;height:4px;border-radius:50%;background:#159365;transform:translateY(-50%);z-index:2
}
.aai-history-row.is-pinned>a,.aai-history-row.is-pinned>button:not(.aai-history-more){padding-left:13px!important}
.aai-history-more{
  position:absolute!important;right:3px!important;top:50%!important;transform:translateY(-50%)!important;width:28px!important;height:28px!important;
  display:grid!important;place-items:center!important;padding:0!important;border:0!important;border-radius:8px!important;background:transparent!important;
  color:#809087!important;opacity:0!important;cursor:pointer!important;z-index:4!important
}
.aai-history-row:hover .aai-history-more,.aai-history-row:focus-within .aai-history-more{opacity:1!important}
.aai-history-more:hover{background:#e5eee9!important;color:#294b39!important}
.aai-history-more svg{width:16px!important;height:16px!important}
.aai-history-menu{
  position:absolute!important;right:2px!important;top:34px!important;z-index:80!important;width:178px!important;display:none!important;
  padding:6px!important;border:1px solid #dfe8e3!important;border-radius:12px!important;background:#fff!important;
  box-shadow:0 16px 42px rgba(18,53,38,.14)!important
}
.aai-history-menu.is-open{display:block!important}
.aai-history-menu button{
  width:100%!important;min-height:34px!important;display:flex!important;align-items:center!important;gap:8px!important;
  padding:7px 9px!important;border:0!important;border-radius:8px!important;background:transparent!important;color:#3c5045!important;
  font-size:11px!important;font-weight:650!important;text-align:left!important;cursor:pointer!important
}
.aai-history-menu button:hover{background:#f1f6f3!important}
.aai-history-menu button[data-hact="delete"]{color:#a33f3f!important}
.aai-history-menu svg{width:14px!important;height:14px!important}

/* Composer + button opens the existing tools sheet */
.aai-composer{isolation:isolate!important}
.aai-composer-tools-btn{
  position:absolute!important;left:10px!important;bottom:10px!important;z-index:25!important;width:38px!important;height:38px!important;
  display:grid!important;place-items:center!important;padding:0!important;border:1px solid #dbe8e1!important;border-radius:12px!important;
  background:#f3f8f5!important;color:#17724e!important;cursor:pointer!important;box-shadow:none!important
}
.aai-composer-tools-btn:hover{background:#eaf6ef!important;border-color:#cce0d5!important}
.aai-composer-tools-btn svg{width:18px!important;height:18px!important}
.aai-composer textarea{padding-left:54px!important}
@media(max-width:800px){.aai-composer-tools-btn{left:8px!important;bottom:8px!important;width:36px!important;height:36px!important}.aai-composer textarea{padding-left:50px!important}}

/* Activity indicator: subtle, non-blocking */
.aai-activity{
  position:absolute!important;left:50%!important;bottom:88px!important;z-index:19!important;display:flex!important;align-items:center!important;gap:7px!important;
  min-height:30px!important;padding:0 11px!important;border:1px solid #dfe8e3!important;border-radius:999px!important;background:rgba(255,255,255,.96)!important;
  color:#6c7c73!important;box-shadow:0 7px 20px rgba(18,53,38,.07)!important;font-size:10px!important;font-weight:700!important;
  opacity:0!important;visibility:hidden!important;transform:translate(-50%,5px)!important;transition:.18s!important;pointer-events:none!important
}
.aai-activity.is-visible{opacity:1!important;visibility:visible!important;transform:translate(-50%,0)!important}
.aai-activity-dot{width:6px!important;height:6px!important;border-radius:50%!important;background:#159365!important;animation:aaiPulse 1.05s ease-in-out infinite!important}
@keyframes aaiPulse{0%,100%{opacity:.35;transform:scale(.85)}50%{opacity:1;transform:scale(1.15)}}

/* Response actions */
.aai-message-actions{gap:2px!important;margin-top:7px!important}
.aai-message-actions button{min-height:29px!important;padding:5px 7px!important;border-radius:8px!important}
.aai-message-actions .aai-feedback{width:29px!important;justify-content:center!important;padding:5px!important}
.aai-message-actions .aai-feedback.is-active{background:#e8f5ee!important;color:#087d53!important}
.aai-message-actions [data-action="read"] span{display:none}
@media(max-width:600px){
  .aai-message-actions [data-action="regenerate"] span,.aai-message-actions [data-action="copy"] span{display:none}
  .aai-message-actions button{width:31px!important;justify-content:center!important;padding:5px!important}
}

/* Temporary chat banner */
.aai-temporary-banner{
  position:relative!important;z-index:30!important;flex:0 0 auto!important;min-height:48px!important;display:flex!important;align-items:center!important;
  gap:10px!important;padding:8px 14px!important;border-bottom:1px solid #d9e8e0!important;background:#f1faf5!important;color:#315342!important
}
.aai-temporary-banner[hidden]{display:none!important}
.aai-temporary-banner>svg{width:18px!important;height:18px!important;flex:0 0 18px!important;color:#12845a!important}
.aai-temporary-banner>span{min-width:0!important;flex:1!important}
.aai-temporary-banner strong{display:block!important;font-size:11px!important}
.aai-temporary-banner small{display:block!important;margin-top:2px!important;color:#75877d!important;font-size:9px!important;line-height:1.3!important}
.aai-temporary-banner button{width:30px!important;height:30px!important;display:grid!important;place-items:center!important;padding:0!important;border:0!important;border-radius:9px!important;background:transparent!important;color:#667a70!important;cursor:pointer!important}
.aai-temporary-banner button:hover{background:#e4f2ea!important}
.aai-temporary-banner button svg{width:15px!important;height:15px!important}

/* Tool sheet polish */
.aai-tools-panel{width:min(430px,calc(100% - 36px))!important}
.aai-tool-card{min-height:66px!important;transition:transform .14s ease,border-color .14s ease,background .14s ease!important}
.aai-tool-card:hover{transform:translateY(-1px)!important;border-color:#cfe1d7!important;background:#fff!important}
.aai-temporary-tool{background:#f6fbf8!important}

/* Overall message/readability polish */
.aai-chat-app .amarai-messages,.aai-chat-app .amarai-chat-messages,.aai-chat-app [data-chat-messages]{
  scrollbar-gutter:stable!important
}
.aai-message{max-width:900px!important;margin-left:auto!important;margin-right:auto!important}
.aai-chat-app button:focus-visible,.aai-chat-app a:focus-visible{
  outline:2px solid rgba(11,107,69,.32)!important;outline-offset:2px!important
}

@media(max-width:800px){
  .aai-history-more{opacity:1!important}
  .aai-history-menu{position:fixed!important;left:12px!important;right:12px!important;top:auto!important;bottom:16px!important;width:auto!important;z-index:1004!important;border-radius:18px!important;padding:9px!important}
  .aai-history-menu button{min-height:44px!important;font-size:12px!important}
  .aai-activity{bottom:82px!important}
  .aai-temporary-banner{padding:8px 10px!important}
}


/* Continue recent conversation on the empty welcome screen */
.aai-continue-card{
  width:min(470px,100%)!important;min-height:58px!important;display:grid!important;grid-template-columns:34px minmax(0,1fr) 22px!important;
  align-items:center!important;gap:10px!important;margin:16px auto 0!important;padding:10px 12px!important;border:1px solid #dfe9e3!important;
  border-radius:14px!important;background:#fbfdfc!important;color:#2c493a!important;text-align:left!important;cursor:pointer!important;
  transition:border-color .15s ease,background .15s ease,transform .15s ease!important
}
.aai-continue-card:hover{transform:translateY(-1px)!important;border-color:#c9ddd2!important;background:#fff!important}
.aai-continue-card>svg{width:17px!important;height:17px!important;margin:auto!important;color:#0b7c52!important}
.aai-continue-card>span{min-width:0!important}
.aai-continue-card small{display:block!important;margin-bottom:3px!important;color:#8a9890!important;font-size:8px!important;font-weight:850!important;letter-spacing:.08em!important}
.aai-continue-card strong{display:block!important;overflow:hidden!important;color:#2d4639!important;font-size:11px!important;font-weight:750!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.aai-continue-card>b{color:#7b8c83!important;font-size:16px!important;font-weight:500!important}


/* v1.2.1 — persistent sidebar restore control */
.aai-sidebar-restore{
  position:absolute!important;
  left:14px!important;
  top:12px!important;
  z-index:95!important;
  width:38px!important;
  height:38px!important;
  display:none!important;
  place-items:center!important;
  padding:0!important;
  border:1px solid #dbe7e0!important;
  border-radius:11px!important;
  background:#fff!important;
  color:#315342!important;
  box-shadow:0 7px 20px rgba(18,53,38,.08)!important;
  cursor:pointer!important;
}
.aai-sidebar-restore:hover{
  background:#f1f7f3!important;
  border-color:#cadfd4!important;
  color:#087b52!important;
}
.aai-sidebar-restore svg{width:18px!important;height:18px!important}
body.aai-sidebar-collapsed .aai-sidebar-restore{display:grid!important}

/* Mobile already uses the drawer/menu control; don't add a second floating control. */
@media(max-width:800px){
  .aai-sidebar-restore{display:none!important}
  body.aai-sidebar-collapsed .aai-sidebar-restore{display:none!important}
}


/* =========================================================
   v1.2.2 — response actions below assistant message
   ========================================================= */

/* Some Core message rows are horizontal flex containers. Stack the enhanced
   assistant content + action row vertically. */
.aai-message.aai-assistant-message{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
}

/* Put Copy / Regenerate / feedback directly under the assistant bubble. */
.aai-message.aai-assistant-message>.aai-message-actions{
  position:static!important;
  inset:auto!important;
  align-self:flex-start!important;
  width:auto!important;
  max-width:100%!important;
  margin:7px 0 0 8px!important;
  transform:none!important;
  flex-wrap:wrap!important;
}

/* Defensive rule for cached markup from the previous version. */
.aai-message-actions [data-action="read"]{
  display:none!important;
}

@media(max-width:800px){
  .aai-message.aai-assistant-message>.aai-message-actions{
    margin-left:4px!important;
    margin-top:6px!important;
  }
}


/* =========================================================
   v1.2.3 — single minimal sidebar open/close control
   ========================================================= */
.aai-sidebar-collapse,
.aai-sidebar-restore{
  display:none!important;
}

.aai-sidebar-corner-toggle{
  position:absolute!important;
  left:246px!important;
  bottom:10px!important;
  z-index:120!important;
  width:32px!important;
  height:32px!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  color:#72827a!important;
  box-shadow:none!important;
  cursor:pointer!important;
  transition:left .22s ease,background .15s ease,color .15s ease!important;
}
.aai-sidebar-corner-toggle:hover{
  background:#e8f0eb!important;
  color:#28503c!important;
}
.aai-sidebar-corner-toggle svg{
  width:17px!important;
  height:17px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.7!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
body.aai-sidebar-collapsed .aai-sidebar-corner-toggle{
  left:10px!important;
}
@media(max-width:800px){
  .aai-sidebar-corner-toggle{display:none!important}
}


/* =========================================================
   v1.2.4 — remove reserved bottom strip on /chat/
   ========================================================= */

/* Page UI / theme shells can keep a small footer or app-bottom reserve even
   when the footer itself is hidden. On Chat, the workspace owns the viewport. */
html.aai-chat-page-lock,
body.aai-chat-page-lock{
  margin:0!important;
  padding-bottom:0!important;
  background:#fff!important;
}

/* Do not leave any footer placeholder in the fixed Chat workspace. */
body.aai-chat-page-lock footer,
body.aai-chat-page-lock .site-footer,
body.aai-chat-page-lock #colophon,
body.aai-chat-page-lock .amarai-footer,
body.aai-chat-page-lock [data-site-footer]{
  display:none!important;
  height:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
}

/* Neutralise bottom spacing that may come from the theme/Page UI app shell. */
body.aai-chat-page-lock .amarai-ui-shell-app,
body.aai-chat-page-lock .amarai-ui-shell,
body.aai-chat-page-lock .site-content,
body.aai-chat-page-lock #content{
  margin-bottom:0!important;
  padding-bottom:0!important;
}

/* Use an explicit viewport-derived height instead of relying on a parent
   containing block's bottom edge. This also behaves correctly with WP admin bar. */
body.aai-chat-page-lock .amarai-chat-extension-root{
  top:var(--aai-chat-fixed-top,72px)!important;
  bottom:auto!important;
  height:var(--aai-chat-viewport-height,calc(100dvh - var(--aai-chat-fixed-top,72px)))!important;
  min-height:0!important;
  max-height:none!important;
}

/* Ensure the app/sidebar paint all the way to the real workspace bottom. */
body.aai-chat-page-lock .aai-chat-app{
  position:relative!important;
  height:100%!important;
  min-height:0!important;
}
body.aai-chat-page-lock .aai-sidebar,
body.aai-chat-page-lock .aai-chat-app .amarai-sidebar,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-sidebar{
  height:100%!important;
  min-height:0!important;
  padding-bottom:48px!important; /* room for the minimal toggle inside sidebar */
  background:#f6f9f7!important;
}

/* Keep the minimal toggle visually inside the sidebar, not in a separate strip. */
.aai-sidebar-corner-toggle{
  bottom:9px!important;
}

@media(max-width:800px){
  body.aai-chat-page-lock .aai-sidebar,
  body.aai-chat-page-lock .aai-chat-app .amarai-sidebar,
  body.aai-chat-page-lock .aai-chat-app .amarai-chat-sidebar{
    padding-bottom:12px!important;
  }
}


/* v1.2.5 — move transient thinking/status pill slightly upward */
.aai-thinking-pill,
.aai-runtime-thinking,
.aai-thinking-status{
  transform:translateY(-18px)!important;
}

@media(max-width:800px){
  .aai-thinking-pill,
  .aai-runtime-thinking,
  .aai-thinking-status{
    transform:translateY(-14px)!important;
  }
}


/* =========================================================
   v1.2.6 — actual AmarAI thinking pill position fix
   ========================================================= */

/* .aai-activity is the real runtime status pill used by Chat UI.
   Move it clearly above the composer while preserving its centering animation. */
.aai-activity{
  bottom:124px!important;
}

/* Remove the ineffective v1.2.5 transform overrides if those fallback classes
   ever appear; the actual pill's own translate(-50%, ...) must remain intact. */
.aai-thinking-pill,
.aai-runtime-thinking,
.aai-thinking-status{
  transform:none!important;
}

@media(max-width:800px){
  .aai-activity{
    bottom:112px!important;
  }
}


/* =========================================================
   v1.2.7 — centered premium Tools modal
   ========================================================= */

/* Dim the Chat workspace and center the dialog. */
.aai-tools-shade{
  position:absolute!important;
  inset:0!important;
  z-index:1000!important;
  display:block!important;
  border:0!important;
  background:rgba(17,34,26,.30)!important;
  -webkit-backdrop-filter:blur(3px)!important;
  backdrop-filter:blur(3px)!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  transition:opacity .18s ease,visibility .18s ease!important;
}
.aai-tools-shade.is-open{
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
}

/* Desktop + mobile use the same centered modal language. */
.aai-tools-panel{
  position:absolute!important;
  left:50%!important;
  right:auto!important;
  top:50%!important;
  bottom:auto!important;
  z-index:1001!important;
  width:min(610px,calc(100% - 40px))!important;
  max-height:min(620px,calc(100% - 48px))!important;
  overflow:auto!important;
  padding:18px!important;
  border:1px solid #dce7e1!important;
  border-radius:22px!important;
  background:#fff!important;
  box-shadow:0 28px 80px rgba(18,45,32,.22)!important;
  opacity:0!important;
  visibility:hidden!important;
  transform:translate(-50%,-47%) scale(.97)!important;
  transform-origin:center!important;
  transition:opacity .18s ease,visibility .18s ease,transform .18s ease!important;
}
.aai-tools-panel.is-open{
  opacity:1!important;
  visibility:visible!important;
  transform:translate(-50%,-50%) scale(1)!important;
}

/* Header and visible close button. */
.aai-tools-head{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:16px!important;
  padding:2px 2px 15px!important;
}
.aai-tools-head strong{
  display:block!important;
  color:#17382a!important;
  font-size:17px!important;
  font-weight:800!important;
  line-height:1.2!important;
}
.aai-tools-head small{
  display:block!important;
  margin-top:5px!important;
  color:#819087!important;
  font-size:10px!important;
  font-weight:600!important;
}
.aai-tools-close{
  flex:0 0 36px!important;
  width:36px!important;
  height:36px!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  border:1px solid #e0e9e4!important;
  border-radius:11px!important;
  background:#f7faf8!important;
  color:#53675d!important;
}
.aai-tools-close:hover{
  background:#edf5f0!important;
  color:#0b7b52!important;
}
.aai-tools-close svg{
  width:17px!important;
  height:17px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}

/* Uniform cards. */
.aai-tools-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
}
.aai-tool-card{
  position:relative!important;
  min-height:82px!important;
  display:grid!important;
  grid-template-columns:44px minmax(0,1fr) 16px!important;
  align-items:center!important;
  gap:12px!important;
  padding:13px 12px!important;
  border:1px solid #e0e9e4!important;
  border-radius:15px!important;
  background:#fbfdfc!important;
  color:#19382a!important;
  text-align:left!important;
  box-shadow:none!important;
  cursor:pointer!important;
  opacity:1!important;
  transition:transform .14s ease,border-color .14s ease,background .14s ease,box-shadow .14s ease!important;
}
.aai-tool-card:hover{
  transform:translateY(-1px)!important;
  border-color:#c9ddd2!important;
  background:#fff!important;
  box-shadow:0 8px 22px rgba(20,55,39,.06)!important;
}
.aai-tool-card:active{
  transform:translateY(0)!important;
}
.aai-tool-soft{
  opacity:.72!important;
}

/* Every tool uses the exact same icon container and SVG treatment. */
.aai-tool-icon{
  width:44px!important;
  height:44px!important;
  flex:0 0 44px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:13px!important;
  background:#eaf6ef!important;
  color:#0a8157!important;
}
.aai-tool-icon svg{
  width:21px!important;
  height:21px!important;
  display:block!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.75!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
.aai-tool-copy{
  min-width:0!important;
}
.aai-tool-card strong{
  display:block!important;
  color:#203c2e!important;
  font-size:12px!important;
  font-weight:800!important;
  line-height:1.25!important;
}
.aai-tool-card small{
  display:block!important;
  margin-top:4px!important;
  color:#839188!important;
  font-size:9.5px!important;
  font-weight:500!important;
  line-height:1.35!important;
}
.aai-tool-arrow{
  color:#a0ada6!important;
  font-size:20px!important;
  font-weight:400!important;
  line-height:1!important;
  transition:transform .14s ease,color .14s ease!important;
}
.aai-tool-card:hover .aai-tool-arrow{
  color:#0a8157!important;
  transform:translateX(2px)!important;
}

/* Temporary chat should visually match the rest instead of being a special card. */
.aai-temporary-tool{
  background:#fbfdfc!important;
}

/* Keep the modal compact and centered on phones too. */
@media(max-width:800px){
  .aai-tools-shade{
    position:fixed!important;
    inset:0!important;
    z-index:1001!important;
  }
  .aai-tools-panel{
    position:fixed!important;
    left:50%!important;
    right:auto!important;
    top:50%!important;
    bottom:auto!important;
    z-index:1002!important;
    width:min(560px,calc(100% - 24px))!important;
    max-height:calc(100dvh - 40px)!important;
    padding:15px!important;
    border-radius:20px!important;
    transform:translate(-50%,-47%) scale(.97)!important;
  }
  .aai-tools-panel.is-open{
    transform:translate(-50%,-50%) scale(1)!important;
  }
  .aai-tools-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .aai-tool-card{
    min-height:76px!important;
    grid-template-columns:40px minmax(0,1fr)!important;
    gap:10px!important;
    padding:11px!important;
  }
  .aai-tool-icon{
    width:40px!important;
    height:40px!important;
  }
  .aai-tool-icon svg{
    width:19px!important;
    height:19px!important;
  }
  .aai-tool-arrow{
    display:none!important;
  }
}

@media(max-width:520px){
  .aai-tools-grid{
    grid-template-columns:1fr!important;
  }
  .aai-tool-card{
    min-height:68px!important;
  }
}


/* =========================================================
   v1.2.8 — ChatGPT-inspired polished Chat top bar
   ========================================================= */

.aai-core-topbar{
  position:relative!important;
  z-index:24!important;
  min-height:58px!important;
  height:58px!important;
  flex:0 0 58px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  padding:0 18px 0 20px!important;
  border:0!important;
  border-bottom:1px solid #edf2ef!important;
  background:rgba(255,255,255,.96)!important;
  -webkit-backdrop-filter:blur(14px)!important;
  backdrop-filter:blur(14px)!important;
  box-shadow:0 1px 0 rgba(22,49,35,.015)!important;
}

/* Left identity: cleaner than the old boxed Ready pill. */
.aai-core-topbar .aai-top-identity{
  display:flex!important;
  align-items:center!important;
  min-width:0!important;
  gap:8px!important;
}
.aai-core-topbar .aai-core-title{
  color:#17271f!important;
  font-size:15px!important;
  font-weight:780!important;
  letter-spacing:-.015em!important;
  line-height:1!important;
}
.aai-core-topbar .aai-core-status-source{
  display:none!important;
}
.aai-core-topbar .aai-top-status{
  display:inline-flex!important;
  align-items:center!important;
  gap:6px!important;
  min-height:24px!important;
  margin-left:7px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:#819087!important;
  font-size:10.5px!important;
  font-weight:650!important;
  line-height:1!important;
  white-space:nowrap!important;
}
.aai-core-topbar .aai-top-status>i{
  width:6px!important;
  height:6px!important;
  flex:0 0 6px!important;
  border-radius:50%!important;
  background:#27a66d!important;
  box-shadow:0 0 0 3px #e9f7ef!important;
}
.aai-core-topbar .aai-top-status[data-state="thinking"]{
  color:#617269!important;
}
.aai-core-topbar .aai-top-status[data-state="thinking"]>i{
  background:#0b8b5d!important;
  box-shadow:0 0 0 3px #e3f4eb!important;
  animation:aaiTopPulse 1.05s ease-in-out infinite!important;
}
@keyframes aaiTopPulse{
  0%,100%{opacity:.45;transform:scale(.86)}
  50%{opacity:1;transform:scale(1.12)}
}

/* Right actions: icon-only, consistent, smooth and useful. */
.aai-core-topbar .aai-top-actions{
  display:flex!important;
  align-items:center!important;
  gap:4px!important;
}
.aai-core-topbar .aai-top-action{
  position:relative!important;
  width:36px!important;
  min-width:36px!important;
  height:36px!important;
  min-height:36px!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:10px!important;
  background:transparent!important;
  color:#405248!important;
  box-shadow:none!important;
  font-size:0!important;
  line-height:1!important;
  cursor:pointer!important;
  transition:background .15s ease,color .15s ease,transform .15s ease!important;
}
.aai-core-topbar .aai-top-action:hover{
  background:#f1f5f3!important;
  color:#163b2a!important;
}
.aai-core-topbar .aai-top-action:active{
  transform:scale(.94)!important;
}
.aai-core-topbar .aai-top-action:focus-visible{
  outline:2px solid rgba(11,107,69,.24)!important;
  outline-offset:2px!important;
}
.aai-core-topbar .aai-top-action svg{
  width:18px!important;
  height:18px!important;
  display:block!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.75!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
.aai-core-topbar .aai-top-clear{
  margin-left:6px!important;
}
.aai-core-topbar .aai-top-clear:before{
  content:""!important;
  position:absolute!important;
  left:-5px!important;
  top:8px!important;
  width:1px!important;
  height:20px!important;
  background:#e7ede9!important;
}
.aai-core-topbar .aai-top-clear:hover{
  background:#fff2f1!important;
  color:#b44942!important;
}

/* Lightweight tooltips instead of visible labels. */
.aai-core-topbar .aai-top-action:after{
  content:attr(data-aai-tooltip)!important;
  position:absolute!important;
  right:0!important;
  top:calc(100% + 8px)!important;
  z-index:200!important;
  width:max-content!important;
  max-width:180px!important;
  padding:6px 8px!important;
  border:1px solid #e3eae6!important;
  border-radius:8px!important;
  background:#1e2d25!important;
  color:#fff!important;
  box-shadow:0 8px 22px rgba(18,42,30,.16)!important;
  font-size:9.5px!important;
  font-weight:650!important;
  line-height:1!important;
  opacity:0!important;
  visibility:hidden!important;
  transform:translateY(-2px)!important;
  pointer-events:none!important;
  transition:opacity .12s ease,visibility .12s ease,transform .12s ease!important;
}
.aai-core-topbar .aai-top-action:hover:after,
.aai-core-topbar .aai-top-action:focus-visible:after{
  opacity:1!important;
  visibility:visible!important;
  transform:translateY(0)!important;
}

/* Remove old boxed treatment from any toolbar controls we successfully enhanced. */
.aai-core-topbar button.aai-top-action{
  border-color:transparent!important;
}

/* Mobile stays minimal and touch-friendly. */
@media(max-width:800px){
  .aai-core-topbar{
    min-height:54px!important;
    height:54px!important;
    flex-basis:54px!important;
    padding:0 10px 0 14px!important;
  }
  .aai-core-topbar .aai-core-title{
    font-size:14px!important;
  }
  .aai-core-topbar .aai-top-status{
    margin-left:6px!important;
    font-size:9.5px!important;
  }
  .aai-core-topbar .aai-top-action{
    width:34px!important;
    min-width:34px!important;
    height:34px!important;
    min-height:34px!important;
    border-radius:9px!important;
  }
  .aai-core-topbar .aai-top-action:after{
    display:none!important;
  }
}

@media(max-width:430px){
  .aai-core-topbar .aai-top-status span{
    display:none!important;
  }
  .aai-core-topbar .aai-top-status{
    margin-left:5px!important;
  }
}


/* =========================================================
   v1.2.9 — Recent Chats search reliability
   ========================================================= */

/* Search hides the entire row (including the three-dot actions), not only
   the inner chat button. This also avoids conflicts with flex/display rules. */
.aai-history-row.aai-search-hidden,
.aai-history > .aai-search-hidden{
  display:none!important;
}

.aai-search-empty{
  padding:18px 10px!important;
  color:#8a9890!important;
  font-size:11px!important;
  font-weight:600!important;
  text-align:center!important;
}
.aai-search-empty[hidden]{
  display:none!important;
}

/* Keep the search field clearly interactive. */
.aai-history-search input[type="search"]{
  cursor:text!important;
}


/* =========================================================
   v1.3.0 — mobile usability + accessibility hardening
   ========================================================= */

/* WordPress admin-bar / fixed site-header coordination, scoped to Chat only. */
body.aai-chat-page-lock.aai-chat-offset-site-header .site-header,
body.aai-chat-page-lock.aai-chat-offset-site-header .amarai-header,
body.aai-chat-page-lock.aai-chat-offset-site-header header[role="banner"]{
  top:var(--aai-wp-admin-height,0px)!important;
}
body.aai-chat-page-lock .amarai-chat-extension-root{
  height:var(--aai-chat-viewport-height,calc(100vh - var(--aai-chat-fixed-top,72px)))!important;
  height:var(--aai-chat-viewport-height,calc(100dvh - var(--aai-chat-fixed-top,72px)))!important;
}

/* The app must be allowed to shrink inside the visual viewport. */
.aai-chat-app,
.aai-chat-app .amarai-main,
.aai-chat-app .amarai-chat-main,
.aai-chat-app>main,
.aai-chat-app .amarai-messages,
.aai-chat-app .amarai-chat-messages,
.aai-chat-app [data-chat-messages]{min-width:0!important;min-height:0!important}

/* Mobile history opener in the existing chat header. */
.aai-mobile-history{display:none!important}

/* Safe Markdown output. All nodes are created with textContent / validated URLs. */
.aai-markdown{max-width:100%!important;overflow-wrap:anywhere!important;word-break:normal!important;line-height:1.62!important}
.aai-markdown p{margin:.25em 0 .8em!important}
.aai-markdown p:last-child{margin-bottom:0!important}
.aai-markdown strong{font-weight:760!important;color:inherit!important}
.aai-markdown em{font-style:italic!important}
.aai-markdown ul,.aai-markdown ol{margin:.35em 0 .85em!important;padding-left:1.45em!important}
.aai-markdown li{margin:.24em 0!important}
.aai-markdown a{color:#087b52!important;text-decoration:underline!important;text-underline-offset:2px!important;overflow-wrap:anywhere!important;word-break:break-word!important}
.aai-markdown code{padding:.12em .35em!important;border-radius:5px!important;background:#f1f5f3!important;font:500 .9em/1.5 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace!important}
.aai-code-scroll,.aai-table-scroll{width:100%!important;max-width:100%!important;overflow:auto!important;overscroll-behavior-x:contain!important;-webkit-overflow-scrolling:touch!important}
.aai-code-scroll{margin:.55em 0 .9em!important;border:1px solid #dfe7e2!important;border-radius:12px!important;background:#f7f9f8!important}
.aai-code-scroll pre{min-width:max-content!important;margin:0!important;padding:13px 14px!important;background:transparent!important;white-space:pre!important}
.aai-code-scroll pre code{padding:0!important;background:transparent!important;font-size:12px!important}
.aai-table-scroll{margin:.55em 0 .9em!important}
.aai-table-scroll table,.aai-markdown table{min-width:520px!important;border-collapse:collapse!important;font-size:12px!important}
.aai-table-scroll th,.aai-table-scroll td,.aai-markdown th,.aai-markdown td{padding:8px 10px!important;border:1px solid #dfe7e2!important;text-align:left!important;vertical-align:top!important}
.aai-markdown blockquote{margin:.55em 0!important;padding:.15em 0 .15em 12px!important;border-left:3px solid #b9d8c7!important;color:#53675d!important}

/* Larger, consistent touch targets without oversized icons. */
.aai-message-actions{gap:5px!important}
.aai-message-actions button,
.aai-message-actions .aai-feedback{
  min-width:44px!important;width:auto!important;min-height:44px!important;height:44px!important;padding:0 10px!important;justify-content:center!important;border-radius:10px!important;font-size:11px!important;white-space:nowrap!important
}
.aai-message-actions svg{width:16px!important;height:16px!important;flex:0 0 16px!important}
.aai-message-actions .aai-use-again{padding:0 12px!important;font-size:12px!important;font-weight:650!important}
.aai-message.aai-user-message>.aai-message-actions{width:100%!important;justify-content:flex-end!important;margin:6px 0 0!important;flex-wrap:nowrap!important}
.aai-scroll-latest{width:44px!important;height:44px!important}
.aai-scroll-latest[aria-hidden="true"]{pointer-events:none!important}

/* Visible focus treatment for keyboard/switch users. */
.aai-chat-app button:focus-visible,.aai-chat-app a:focus-visible,.aai-chat-app input:focus-visible,.aai-chat-app textarea:focus-visible,
.aai-sidebar-backdrop:focus-visible,.aai-tools-shade:focus-visible{
  outline:3px solid rgba(11,107,69,.30)!important;outline-offset:2px!important
}

@media(max-width:800px){
  /* Mobile header controls meet the 44px target and include a history opener. */
  .aai-core-topbar{min-height:56px!important;height:56px!important;flex-basis:56px!important;padding:0 8px!important;gap:4px!important}
  .aai-mobile-history{display:grid!important;place-items:center!important;width:44px!important;min-width:44px!important;height:44px!important;padding:0!important;border:0!important;border-radius:11px!important;background:transparent!important;color:#405248!important;cursor:pointer!important}
  .aai-mobile-history:hover{background:#f1f5f3!important}
  .aai-mobile-history svg{width:19px!important;height:19px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.75!important;stroke-linecap:round!important;stroke-linejoin:round!important}
  .aai-core-topbar .aai-top-action{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;border-radius:11px!important}
  .aai-core-topbar .aai-top-actions{gap:1px!important}
  .aai-core-topbar .aai-top-clear{margin-left:1px!important}
  .aai-core-topbar .aai-top-clear:before{display:none!important}

  /* Accessible history drawer: starts below the admin bar so WP controls remain reachable. */
  .aai-sidebar,.aai-chat-app .amarai-sidebar,.aai-chat-app .amarai-chat-sidebar{
    top:var(--aai-wp-admin-height,0px)!important;
    bottom:0!important;
    width:min(340px,90vw)!important;max-width:90vw!important;
    height:calc(100dvh - var(--aai-wp-admin-height,0px))!important;max-height:calc(100dvh - var(--aai-wp-admin-height,0px))!important;
    padding:10px 12px max(12px,env(safe-area-inset-bottom))!important;
    overflow:hidden!important;overscroll-behavior:none!important;
    transition:transform .2s ease!important
  }
  .aai-sidebar-mobile-head{height:48px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;margin:0 0 8px!important;padding:0 1px!important}
  .aai-sidebar-mobile-title{display:block!important;color:#20372b!important;font-size:15px!important;font-weight:780!important}
  .aai-sidebar-close{width:44px!important;height:44px!important;border-radius:11px!important}
  .aai-sidebar-close svg{width:18px!important;height:18px!important}
  .aai-sidebar-backdrop{top:var(--aai-wp-admin-height,0px)!important;bottom:0!important;height:auto!important}
  body.aai-sidebar-open .aai-sidebar-backdrop{display:block!important}
  .aai-history{overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important}

  /* Mobile composer: one tools/attach entry point, readable textarea, no overlap. */
  .aai-composer,.aai-chat-app .amarai-composer,.aai-chat-app .amarai-chat-composer{
    width:calc(100% - 16px)!important;margin:0 8px max(8px,env(safe-area-inset-bottom))!important;
    min-height:60px!important;padding:7px 102px 7px 52px!important;border-radius:19px!important;
    display:block!important;box-sizing:border-box!important
  }
  .aai-composer textarea,.aai-composer input[type=text]{
    display:block!important;width:100%!important;min-width:0!important;min-height:44px!important;max-height:144px!important;
    margin:0!important;padding:10px 4px!important;border:0!important;outline:0!important;box-shadow:none!important;
    background:transparent!important;color:#20372b!important;font-size:16px!important;line-height:1.45!important;resize:none!important;box-sizing:border-box!important
  }
  .aai-composer textarea::placeholder,.aai-composer input[type=text]::placeholder{color:#7f8c85!important;opacity:1!important}
  .aai-composer-tools-btn{left:7px!important;bottom:8px!important;width:44px!important;height:44px!important;border-radius:12px!important}
  .aai-composer-tools-btn svg{width:19px!important;height:19px!important}
  .aai-composer .aai-composer-native-attach,.aai-composer .aai-composer-native-tools{display:none!important}
  .aai-composer .aai-composer-mic,.aai-composer .aai-composer-send{
    position:absolute!important;bottom:8px!important;width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;
    display:grid!important;place-items:center!important;padding:0!important;margin:0!important;border-radius:12px!important
  }
  .aai-composer .aai-composer-send{right:7px!important}
  .aai-composer .aai-composer-mic{right:55px!important}
  .aai-composer .aai-composer-mic svg,.aai-composer .aai-composer-send svg{width:19px!important;height:19px!important}
  .aai-chat-app .amarai-messages,.aai-chat-app .amarai-chat-messages,.aai-chat-app [data-chat-messages]{padding:16px 10px 18px!important;scroll-padding-bottom:18px!important}
  .aai-scroll-latest{right:12px!important;bottom:calc(var(--aai-composer-height,60px) + max(20px,env(safe-area-inset-bottom)))!important}
  .aai-activity{bottom:calc(var(--aai-composer-height,60px) + max(34px,env(safe-area-inset-bottom)))!important}

  /* Readable action rows on touch screens. */
  .aai-message-actions{opacity:1!important;flex-wrap:wrap!important;margin-top:6px!important}
  .aai-message-actions [data-action="copy"] span,.aai-message-actions [data-action="regenerate"] span{display:none!important}
  .aai-message-actions button{width:44px!important;padding:0!important}
  .aai-message-actions .aai-use-again{width:auto!important;min-width:44px!important;padding:0 12px!important}
  .aai-message-actions .aai-use-again span{display:inline!important;font-size:12px!important;white-space:nowrap!important}

  /* Tools modal remains usable above the software keyboard / safe area. */
  .aai-tools-panel{max-height:calc(100dvh - var(--aai-wp-admin-height,0px) - 28px)!important;padding-bottom:max(15px,env(safe-area-inset-bottom))!important}
}

@media(max-width:430px){
  .aai-core-topbar .aai-top-status{display:none!important}
  .aai-core-topbar .aai-core-title{font-size:14px!important}
}

@media(max-width:360px){
  .aai-core-topbar{padding-left:4px!important;padding-right:4px!important}
  .aai-core-topbar .aai-top-action,.aai-mobile-history{width:44px!important;min-width:44px!important}
  .aai-composer,.aai-chat-app .amarai-composer,.aai-chat-app .amarai-chat-composer{width:calc(100% - 12px)!important;margin-left:6px!important;margin-right:6px!important;padding-right:100px!important;padding-left:51px!important}
  .aai-message-actions{gap:4px!important}
}

@media(max-width:330px){
  .aai-core-topbar .aai-top-sound{display:none!important}
  .aai-composer,.aai-chat-app .amarai-composer,.aai-chat-app .amarai-chat-composer{padding-right:55px!important}
  .aai-composer .aai-composer-mic{display:none!important}
}

@media(max-width:800px){
  body.aai-sidebar-open .amarai-chat-extension-root{z-index:1001!important}
}


/* =========================================================
   v1.3.1 — single mobile layout calculation / header fix
   ========================================================= */

/* JS marks the actual site header it finds, so this no longer depends on a
   theme-specific class name. Only headers that really collide with WP Admin
   are shifted. The chat top is then measured from the header's real bottom. */
body.aai-chat-page-lock .aai-chat-site-header.aai-chat-header-admin-offset[data-aai-header-position="fixed"]{
  top:var(--aai-chat-header-shift,0px)!important;
}
body.aai-chat-page-lock .aai-chat-site-header.aai-chat-header-admin-offset[data-aai-header-position="flow"]{
  margin-top:var(--aai-chat-header-shift,0px)!important;
}

/* One source of truth for the fixed chat shell: --aai-chat-fixed-top and
   --aai-chat-viewport-height are measured from the actual rendered header. */
body.aai-chat-page-lock .amarai-chat-extension-root{
  top:var(--aai-chat-fixed-top,0px)!important;
  right:0!important;
  bottom:auto!important;
  left:0!important;
  width:100%!important;
  height:var(--aai-chat-viewport-height,100vh)!important;
  height:var(--aai-chat-viewport-height,100dvh)!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
}
body.aai-chat-page-lock .amarai-ui-shell-app,
body.aai-chat-page-lock .amarai-ui-shell,
body.aai-chat-page-lock .site-content,
body.aai-chat-page-lock #content,
body.aai-chat-page-lock main.site-main{
  margin-top:0!important;
  padding-top:0!important;
}

/* Reliable header / scroller / composer flex chain. */
body.aai-chat-page-lock .aai-chat-app,
body.aai-chat-page-lock .aai-chat-app .amarai-main,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-main,
body.aai-chat-page-lock .aai-chat-app>main{
  height:100%!important;
  max-height:100%!important;
  min-height:0!important;
  min-width:0!important;
}
body.aai-chat-page-lock .aai-chat-app .amarai-main,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-main,
body.aai-chat-page-lock .aai-chat-app>main{
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
body.aai-chat-page-lock .aai-core-topbar{
  flex:0 0 auto!important;
}
body.aai-chat-page-lock .aai-chat-app .amarai-messages,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-messages,
body.aai-chat-page-lock .aai-chat-app [data-chat-messages]{
  flex:1 1 auto!important;
  min-height:0!important;
  min-width:0!important;
  max-width:100%!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
body.aai-chat-page-lock .aai-composer,
body.aai-chat-page-lock .aai-chat-app .amarai-composer,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-composer{
  flex:0 0 auto!important;
  min-width:0!important;
}

/* Empty-chat content starts inside the scroller instead of drifting behind the
   chat toolbar. This also keeps the Core welcome mark/logo fully visible. */
body.aai-chat-page-lock .aai-welcome,
body.aai-chat-page-lock .amarai-welcome,
body.aai-chat-page-lock [data-chat-welcome]{
  width:min(760px,100%)!important;
  max-width:100%!important;
  margin:0 auto!important;
  padding-top:clamp(20px,4vh,38px)!important;
  overflow:visible!important;
  box-sizing:border-box!important;
}
body.aai-chat-page-lock .aai-welcome img,
body.aai-chat-page-lock .aai-welcome [class*="welcome-logo"],
body.aai-chat-page-lock .aai-welcome [class*="welcome-icon"],
body.aai-chat-page-lock .aai-welcome [class*="welcome-mark"],
body.aai-chat-page-lock .amarai-welcome img,
body.aai-chat-page-lock .amarai-welcome [class*="welcome-logo"],
body.aai-chat-page-lock .amarai-welcome [class*="welcome-icon"]{
  top:auto!important;
  transform:none!important;
  max-width:100%!important;
}

/* Long content never widens the page shell. */
body.aai-chat-page-lock .aai-message,
body.aai-chat-page-lock .amarai-message,
body.aai-chat-page-lock .aai-markdown,
body.aai-chat-page-lock .amarai-bubble,
body.aai-chat-page-lock .message-content{
  min-width:0!important;
  max-width:100%!important;
}
body.aai-chat-page-lock .aai-markdown,
body.aai-chat-page-lock .amarai-bubble,
body.aai-chat-page-lock .message-content{
  overflow-wrap:anywhere!important;
}

@media(max-width:800px){
  /* Header navigation remains reachable and meets the 44px touch target on the
     Chat page without changing the theme globally. */
  body.aai-chat-page-lock .aai-chat-site-header a,
  body.aai-chat-page-lock .aai-chat-site-header button,
  body.aai-chat-page-lock .aai-chat-site-header [role="button"]{
    min-height:44px!important;
    box-sizing:border-box!important;
  }
  body.aai-chat-page-lock .aai-chat-site-header button,
  body.aai-chat-page-lock .aai-chat-site-header [role="button"]{
    min-width:44px!important;
  }
  body.aai-chat-page-lock .aai-chat-site-header :is(.menu-toggle,.nav-toggle,.mobile-menu-toggle,.language-switch,.lang-switch,.amarai-language-switch,[class*="language"],[class*="lang-switch"]) :is(a,button,[role="button"]),
  body.aai-chat-page-lock .aai-chat-site-header :is(.menu-toggle,.nav-toggle,.mobile-menu-toggle,[aria-controls*="menu"]){
    min-width:44px!important;
    min-height:44px!important;
  }

  body.aai-chat-page-lock .aai-chat-app .amarai-messages,
  body.aai-chat-page-lock .aai-chat-app .amarai-chat-messages,
  body.aai-chat-page-lock .aai-chat-app [data-chat-messages]{
    padding-top:12px!important;
    padding-bottom:18px!important;
    scroll-padding-top:12px!important;
    scroll-padding-bottom:calc(var(--aai-composer-height,60px) + max(18px,env(safe-area-inset-bottom)))!important;
  }
  body.aai-chat-page-lock .aai-welcome,
  body.aai-chat-page-lock .amarai-welcome,
  body.aai-chat-page-lock [data-chat-welcome]{
    padding-top:12px!important;
  }
  body.aai-chat-page-lock .aai-composer,
  body.aai-chat-page-lock .aai-chat-app .amarai-composer,
  body.aai-chat-page-lock .aai-chat-app .amarai-chat-composer{
    margin-bottom:max(8px,env(safe-area-inset-bottom))!important;
  }
}


/* =========================================================
   v1.3.2 — message alignment regression fix
   Keep each message bubble and its actions in one vertical stack. This avoids
   action controls taking horizontal flex space beside the bubble. */
.aai-message.aai-user-message,
.aai-message.aai-assistant-message{
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
.aai-message.aai-user-message{align-items:flex-end!important}
.aai-message.aai-assistant-message{align-items:flex-start!important}
.aai-message.aai-user-message>.bubble,
.aai-message.aai-user-message>.amarai-bubble,
.aai-message.aai-user-message>.message-content,
.aai-message.aai-user-message>[data-message-content]{align-self:flex-end!important;max-width:min(82%,760px)!important}
.aai-message.aai-assistant-message>.bubble,
.aai-message.aai-assistant-message>.amarai-bubble,
.aai-message.aai-assistant-message>.message-content,
.aai-message.aai-assistant-message>[data-message-content]{align-self:flex-start!important;max-width:100%!important}
.aai-message.aai-user-message>.aai-message-actions{
  align-self:flex-end!important;width:auto!important;max-width:100%!important;
  justify-content:flex-end!important;margin:6px 0 0!important;flex:0 0 auto!important
}
.aai-message.aai-assistant-message>.aai-message-actions{
  align-self:flex-start!important;width:auto!important;max-width:100%!important;
  justify-content:flex-start!important;flex:0 0 auto!important
}
@media(max-width:800px){
  .aai-message.aai-user-message>.bubble,
  .aai-message.aai-user-message>.amarai-bubble,
  .aai-message.aai-user-message>.message-content,
  .aai-message.aai-user-message>[data-message-content]{max-width:88%!important}
}
@media(max-width:430px){
  .aai-message.aai-user-message>.bubble,
  .aai-message.aai-user-message>.amarai-bubble,
  .aai-message.aai-user-message>.message-content,
  .aai-message.aai-user-message>[data-message-content]{max-width:90%!important}
}

/* v1.3.3 — mobile editability, modal reachability, and restored-content containment */
.aai-markdown .aai-code-scroll,.aai-markdown .aai-table-scroll{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}
.aai-markdown pre,.aai-markdown table{max-width:none!important}
.aai-tools-close{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
.aai-tools-panel{overflow:auto!important;overscroll-behavior:contain!important}
@media(max-width:800px){
  .aai-chat-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  .aai-chat-app textarea,.aai-chat-app select,
  .aai-tools-panel input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  .aai-tools-panel textarea,.aai-tools-panel select{
    font-size:16px!important;
  }
  .aai-history-search input[type="search"]{font-size:16px!important}
  .aai-tools-panel{
    top:calc(var(--aai-wp-admin-height,0px) + 10px)!important;
    bottom:max(10px,env(safe-area-inset-bottom))!important;
    max-height:none!important;
    overflow-y:auto!important;
  }
}

/* v1.3.4 — clean field focus treatment
   Form controls already have component-level focus borders/shadows. Avoid the
   generic rectangular accessibility ring around inputs/textareas while keeping
   keyboard focus rings on buttons and links intact. */
.aai-chat-app input:focus,
.aai-chat-app input:focus-visible,
.aai-chat-app textarea:focus,
.aai-chat-app textarea:focus-visible,
.aai-chat-app select:focus,
.aai-chat-app select:focus-visible,
.aai-tools-panel input:focus,
.aai-tools-panel input:focus-visible,
.aai-tools-panel textarea:focus,
.aai-tools-panel textarea:focus-visible,
.aai-tools-panel select:focus,
.aai-tools-panel select:focus-visible{
  outline:none!important;
  outline-offset:0!important;
}

/* =========================================================
   v1.3.5 — keep the transient thinking pill anchored to composer
   ========================================================= */
@media(max-width:800px){
  /* Composer height is measured by JS. Keep the pill in the small visual
     gap immediately above it; safe-area is already accounted for by the
     composer's own bottom margin, so do not add it again here. */
  .amarai-chat-extension-root .aai-activity{
    left:50%!important;
    bottom:calc(var(--aai-composer-height,60px) + 12px)!important;
    transform:translate(-50%,5px)!important;
    max-width:calc(100% - 32px)!important;
    white-space:nowrap!important;
  }
  .amarai-chat-extension-root .aai-activity.is-visible{
    transform:translate(-50%,0)!important;
  }
}


/* v1.3.6 — visible attachment state */
.aai-attachment-tray{display:flex!important;flex-wrap:wrap!important;gap:8px!important;width:100%!important;padding:0 4px 8px!important;box-sizing:border-box!important}
.aai-attachment-tray[hidden]{display:none!important}
.aai-attachment-chip{display:flex!important;align-items:center!important;gap:9px!important;max-width:min(100%,360px)!important;min-width:0!important;padding:8px 9px!important;border:1px solid #d8e5de!important;border-radius:12px!important;background:#f7fbf9!important;color:#18382b!important;box-shadow:0 1px 2px rgba(16,24,40,.03)!important}
.aai-attachment-icon{display:grid!important;place-items:center!important;width:30px!important;height:30px!important;flex:0 0 30px!important;border-radius:9px!important;background:#e8f6ef!important;color:#087b52!important}
.aai-attachment-icon svg{width:16px!important;height:16px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}
.aai-attachment-meta{display:flex!important;flex-direction:column!important;min-width:0!important;line-height:1.25!important}
.aai-attachment-meta strong{display:block!important;max-width:250px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:12px!important;font-weight:700!important;color:inherit!important}
.aai-attachment-meta small{margin-top:2px!important;font-size:10px!important;color:#6f8178!important}
.aai-attachment-remove{display:grid!important;place-items:center!important;width:28px!important;height:28px!important;min-width:28px!important;margin-left:auto!important;border:0!important;border-radius:8px!important;background:transparent!important;color:#65766d!important;padding:0!important;cursor:pointer!important}
.aai-attachment-remove:hover{background:#e7f0eb!important;color:#18382b!important}
.aai-attachment-remove svg{width:14px!important;height:14px!important;fill:none!important;stroke:currentColor!important;stroke-width:2!important}


/* v1.3.7 — mobile Tools modal: center inside the actual chat viewport, not the full browser viewport. */
@media(max-width:800px){
  .aai-tools-shade{
    top:var(--aai-chat-fixed-top,0px)!important;
    right:0!important;
    bottom:var(--aai-visual-bottom,0px)!important;
    left:0!important;
    height:auto!important;
  }
  .aai-tools-panel{
    top:var(--aai-tools-center-y,50%)!important;
    max-height:calc(var(--aai-chat-viewport-height,100dvh) - 24px)!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
  }
}

/* =========================================================
   v1.3.8 — minimal floating chat controls
   Keep every control in its existing position while removing the toolbar
   chrome, title/status copy and divider. All visible toolbar icons share the
   same hit area and SVG size on desktop and mobile.
   ========================================================= */
.aai-core-topbar{
  border:0!important;
  border-bottom:0!important;
  background:transparent!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  box-shadow:none!important;
}
.aai-core-topbar .aai-top-identity,
.aai-core-topbar .aai-core-title,
.aai-core-topbar .aai-top-status,
.aai-core-topbar .aai-core-status-source{
  display:none!important;
}
.aai-core-topbar .aai-top-actions{
  gap:6px!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
.aai-core-topbar .aai-top-action,
.aai-core-topbar .aai-mobile-history{
  width:38px!important;
  min-width:38px!important;
  height:38px!important;
  min-height:38px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#263b31!important;
  display:grid!important;
  place-items:center!important;
}
.aai-core-topbar .aai-top-action svg,
.aai-core-topbar .aai-mobile-history svg{
  width:19px!important;
  height:19px!important;
  min-width:19px!important;
  min-height:19px!important;
  display:block!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.75!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
.aai-core-topbar .aai-top-clear{
  margin-left:0!important;
}
.aai-core-topbar .aai-top-clear:before{
  display:none!important;
}
.aai-core-topbar .aai-top-action:hover,
.aai-core-topbar .aai-mobile-history:hover{
  background:rgba(20,65,43,.055)!important;
  color:#123d2a!important;
}
@media(max-width:800px){
  .aai-core-topbar{
    min-height:54px!important;
    height:54px!important;
    flex-basis:54px!important;
    padding:0 10px!important;
  }
  .aai-core-topbar .aai-top-action,
  .aai-core-topbar .aai-mobile-history{
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    border-radius:9px!important;
  }
  .aai-core-topbar .aai-top-action svg,
  .aai-core-topbar .aai-mobile-history svg{
    width:19px!important;
    height:19px!important;
    min-width:19px!important;
    min-height:19px!important;
  }
  .aai-core-topbar .aai-top-sound{
    display:grid!important;
  }
}
@media(max-width:430px){
  .aai-core-topbar{padding-left:8px!important;padding-right:8px!important}
}


/* v1.3.9 — desktop uses the permanent sidebar; drawer trigger is mobile-only. */
@media(min-width:801px){
  .aai-core-topbar .aai-mobile-history{display:none!important;}
}

/* v1.3.10 — keep minimal action icons anchored to the right on desktop.
   Mobile layout remains unchanged. */
@media(min-width:801px){
  .aai-core-topbar .aai-top-actions{
    margin-left:auto!important;
    margin-right:0!important;
    justify-content:flex-end!important;
  }
}

/* =========================================================
   v1.4.0 — final interaction polish
   ========================================================= */
@media(min-width:801px){
  body.aai-chat-page-lock .aai-chat-app .amarai-messages,
  body.aai-chat-page-lock .aai-chat-app .amarai-chat-messages,
  body.aai-chat-page-lock .aai-chat-app [data-chat-messages]{padding-left:max(24px,calc((100% - 860px)/2))!important;padding-right:max(24px,calc((100% - 860px)/2))!important}
  body.aai-chat-page-lock .aai-welcome,body.aai-chat-page-lock .amarai-welcome,body.aai-chat-page-lock [data-chat-welcome]{padding-top:clamp(28px,7vh,72px)!important}
}
/* Keep message actions quiet until the message is intentionally hovered/focused. */
@media(hover:hover) and (pointer:fine){
  .aai-message-actions{opacity:0!important;transform:translateY(-2px);pointer-events:none;transition:opacity .14s ease,transform .14s ease!important}
  .aai-message:hover>.aai-message-actions,.aai-message:focus-within>.aai-message-actions{opacity:1!important;transform:none;pointer-events:auto}
}
/* Composer feedback: neutral when empty, clearly ready when there is text. */
.aai-composer .aai-composer-send{transition:background-color .15s ease,color .15s ease,transform .12s ease,opacity .15s ease!important;opacity:.58}
.aai-composer.aai-has-text .aai-composer-send{opacity:1!important;transform:scale(1.02)}
.aai-composer .aai-composer-send:active{transform:scale(.96)!important}
/* Native stop/cancel controls, when exposed by Core while streaming. */
.aai-composer button[data-stop],.aai-composer button[aria-label*="Stop" i],.aai-composer button[title*="Stop" i]{min-width:44px!important;min-height:44px!important;border-radius:12px!important}
/* Minimal accessible tooltips for the floating top controls; no permanent chrome. */
.aai-core-topbar .aai-top-action[title],.aai-core-topbar .aai-mobile-history[title]{position:relative!important}
@media(hover:hover) and (pointer:fine){
 .aai-core-topbar .aai-top-action[title]:hover:after,.aai-core-topbar .aai-mobile-history[title]:hover:after{content:attr(title);position:absolute;top:calc(100% + 6px);right:0;z-index:80;padding:5px 7px;border-radius:7px;background:#173b2b;color:#fff;font-size:10px;font-weight:600;line-height:1;white-space:nowrap;box-shadow:0 5px 16px rgba(14,42,29,.13);pointer-events:none}
}
/* Recent-chat loading placeholder; removed automatically when real rows appear. */
.aai-history-skeleton{display:grid;gap:8px;padding:4px 2px;pointer-events:none}
.aai-history-skeleton i{display:block;height:34px;border-radius:9px;background:linear-gradient(90deg,#edf3ef 25%,#f7faf8 50%,#edf3ef 75%);background-size:200% 100%;animation:aaiSkeleton 1.2s linear infinite}
.aai-history-skeleton i:nth-child(2){width:86%}.aai-history-skeleton i:nth-child(3){width:72%}
@keyframes aaiSkeleton{to{background-position:-200% 0}}
/* Visual viewport/keyboard stability. */
@media(max-width:800px){
 body.aai-chat-page-lock .amarai-chat-extension-root{max-height:var(--aai-chat-viewport-height,100dvh)!important}
 .aai-composer:focus-within{box-shadow:0 9px 30px rgba(20,55,39,.12)!important}
}

/* v1.4.2 — Recent Chat actions must remain discoverable after Core rerenders history. */
.aai-history-more{opacity:.72!important}
.aai-history-row:hover .aai-history-more,.aai-history-row:focus-within .aai-history-more{opacity:1!important}
@media(max-width:800px){.aai-history-more{opacity:.82!important}}

/* v1.4.4 — Mobile Recent Chat action menu stays attached to its tapped row.
   Absolute row anchoring avoids the transformed-drawer offset that made the popup appear too low. */
@media(max-width:800px){
  .aai-history-more{opacity:1!important}
  .aai-history-menu.aai-mobile-anchored{
    position:absolute!important;
    top:calc(100% + 5px)!important;
    right:0!important;
    left:auto!important;
    bottom:auto!important;
    width:min(178px,calc(100vw - 24px))!important;
    max-height:min(190px,calc(100dvh - 24px))!important;
    overflow:auto!important;
    z-index:1205!important;
    margin:0!important;
  }
  .aai-history-menu.aai-mobile-anchored.aai-open-up{
    top:auto!important;
    bottom:calc(100% + 5px)!important;
  }
}

/* v1.4.6 — Mobile scroll-to-bottom button: increase clearance above composer. */
@media(max-width:800px){
  .aai-scroll-latest{
    bottom:calc(var(--aai-composer-height,60px) + max(50px,env(safe-area-inset-bottom)))!important;
  }
}


/* v1.4.7 — Desktop composer/scroll control slightly higher.
   Scroll button visibility is recalculated by JS whenever a conversation rerenders. */
@media(min-width:801px){
  .aai-composer,.aai-chat-app .amarai-composer,.aai-chat-app .amarai-chat-composer{
    margin-bottom:24px!important;
  }
  .aai-scroll-latest{
    bottom:122px!important;
  }
}


/* v1.4.7 — assistant response formatting polish */
.aai-assistant-message .aai-markdown{font-size:15px!important;line-height:1.72!important;letter-spacing:0!important}
.aai-assistant-message .aai-markdown p{margin:0 0 .82em!important}
.aai-assistant-message .aai-markdown ul,.aai-assistant-message .aai-markdown ol{margin:.48em 0 .9em!important;padding-left:1.35em!important}
.aai-assistant-message .aai-markdown li{margin:.34em 0!important;padding-left:.12em!important}
.aai-assistant-message .aai-markdown li::marker{color:#16845d}
.aai-assistant-message .aai-markdown strong{font-weight:750!important}
@media(max-width:800px){.aai-assistant-message .aai-markdown{font-size:14.5px!important;line-height:1.68!important}}

/* v1.4.8 — mobile thinking indicator spacing fix
   Keep the runtime status centered with a clear gap above the live composer.
   Desktop positioning is intentionally unchanged. */
@media(max-width:800px){
  .amarai-chat-extension-root .aai-activity{
    left:50%!important;
    bottom:calc(var(--aai-composer-height,60px) + 28px)!important;
    transform:translate(-50%,5px)!important;
    max-width:calc(100% - 32px)!important;
    white-space:nowrap!important;
  }
  .amarai-chat-extension-root .aai-activity.is-visible{
    transform:translate(-50%,0)!important;
  }
}

/* v1.4.9 — mobile runtime thinking pill: clear composer separation
   Mobile only. Anchor above the measured composer with a visible 16px+ gap. */
@media(max-width:800px){
  .amarai-chat-extension-root .aai-chat-app .aai-activity{
    left:50%!important;
    bottom:calc(var(--aai-composer-height,60px) + 52px)!important;
    transform:translate(-50%,5px)!important;
    max-width:calc(100% - 32px)!important;
    white-space:nowrap!important;
  }
  .amarai-chat-extension-root .aai-chat-app .aai-activity.is-visible{
    transform:translate(-50%,0)!important;
  }
}

/* v1.5.6 desktop native Recent Chat actions: no wrapper/re-parenting */
@media(min-width:801px){
  .aai-history>.aai-desktop-history-item{position:relative!important;padding-right:34px!important}
  .aai-history>.aai-desktop-history-item>.aai-history-title{display:block!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;pointer-events:none!important}
  .aai-history>.aai-desktop-history-item>.aai-history-more-desktop{position:absolute!important;right:7px!important;top:50%!important;transform:translateY(-50%)!important;display:flex!important;align-items:center!important;justify-content:center!important;width:26px!important;height:26px!important;border-radius:7px!important;z-index:4!important;cursor:pointer!important;opacity:.58!important}
  .aai-history>.aai-desktop-history-item:hover>.aai-history-more-desktop,.aai-history>.aai-desktop-history-item:focus-within>.aai-history-more-desktop{opacity:1!important}
  .aai-history>.aai-desktop-history-item>.aai-history-more-desktop:hover{background:#e5eee9!important}
  .aai-history>.aai-desktop-history-item>.aai-desktop-history-menu{position:fixed!important;top:var(--aai-menu-top)!important;left:var(--aai-menu-left)!important;right:auto!important;bottom:auto!important;width:180px!important;z-index:10020!important}
  .aai-history>.aai-desktop-history-item.is-pinned:before{content:'';position:absolute;left:5px;top:50%;width:5px;height:5px;border-radius:50%;background:currentColor;opacity:.38;transform:translateY(-50%)}
  .aai-history>.aai-desktop-history-item.is-pinned{padding-left:15px!important}
}

/* v2.1 — Premium 3-zone workspace */
:root{--aai-rail:270px;--aai-premium-green:#087a50;--aai-soft:#f6faf8}
@media(min-width:1101px){
 .amarai-chat-extension-root .aai-chat-app{padding-right:var(--aai-rail)!important;background:#fff!important}
 .amarai-chat-extension-root .aai-tools-panel{display:flex!important;position:absolute!important;z-index:14!important;right:0!important;top:0!important;bottom:0!important;left:auto!important;width:var(--aai-rail)!important;transform:none!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;padding:22px 16px!important;border:0!important;border-left:1px solid #e8efeb!important;border-radius:0!important;background:#fbfdfc!important;box-shadow:none!important;flex-direction:column;overflow:auto}
 .amarai-chat-extension-root .aai-tools-close,.amarai-chat-extension-root .aai-tools-shade{display:none!important}
 .amarai-chat-extension-root .aai-tools-grid{display:flex!important;flex-direction:column!important;gap:9px!important}
 .amarai-chat-extension-root .aai-tool-card{min-height:64px!important;background:#fff!important;border:1px solid #e5ece8!important;border-radius:15px!important;padding:10px 11px!important;box-shadow:0 3px 12px rgba(20,55,39,.035)!important}
 .amarai-chat-extension-root .aai-tool-card:hover{border-color:#c9ddd2!important;box-shadow:0 8px 24px rgba(20,55,39,.07)!important;transform:translateY(-1px)}
 .amarai-chat-extension-root .aai-tool-icon{width:38px!important;height:38px!important;flex-basis:38px!important;border-radius:11px!important}
 .amarai-chat-extension-root .aai-tool-copy strong{font-size:12px!important}.amarai-chat-extension-root .aai-tool-copy small{font-size:10px!important}
 .amarai-chat-extension-root .aai-tools-head{padding:3px 2px 14px!important}.amarai-chat-extension-root .aai-tools-head strong{font-size:16px!important}
 .amarai-chat-extension-root .aai-tools-more{display:block;margin-top:12px;padding:11px;text-align:center;border:1px solid #e4ece7;border-radius:12px;background:#fff;color:#087a50;font-size:11px;font-weight:800;text-decoration:none}
 .amarai-chat-extension-root .aai-composer{max-width:760px!important;margin-left:auto!important;margin-right:auto!important;border:1px solid #dfe9e3!important;border-radius:22px!important;box-shadow:0 10px 35px rgba(17,63,43,.09)!important;background:#fff!important}
 .amarai-chat-extension-root .amarai-messages,.amarai-chat-extension-root .amarai-chat-messages,.amarai-chat-extension-root [data-chat-messages]{max-width:900px!important;margin:0 auto!important;padding-left:42px!important;padding-right:42px!important}
}
.amarai-chat-extension-root .aai-tools-more{display:block;margin-top:10px;padding:10px;text-align:center;color:#087a50;font-weight:800;font-size:11px;text-decoration:none}
.amarai-chat-extension-root .aai-tool-arrow{margin-left:auto;color:#9aa8a0;font-size:18px}
.amarai-chat-extension-root .aai-composer textarea{font-size:14px!important;line-height:1.55!important}
.amarai-chat-extension-root .aai-composer-tools-btn{background:#f2f7f4!important;border:0!important;color:#335b48!important}
.amarai-chat-extension-root .aai-composer-send{background:#078455!important;color:#fff!important;box-shadow:0 5px 15px rgba(7,132,85,.2)!important}
@media(max-width:1100px){.amarai-chat-extension-root .aai-tools-panel{max-height:min(680px,82dvh)!important;overflow:auto!important}.amarai-chat-extension-root .aai-tools-grid{grid-template-columns:1fr 1fr!important}}
@media(max-width:520px){.amarai-chat-extension-root .aai-tools-grid{grid-template-columns:1fr 1fr!important}.amarai-chat-extension-root .aai-tool-card{min-height:70px!important;padding:9px!important}.amarai-chat-extension-root .aai-tool-copy small{display:none!important}}

/* v2.2 — Mobile tools bottom sheet + active tool chip */
.aai-active-tool-chip{display:none}
@media(max-width:1100px){
  .amarai-chat-extension-root .aai-tools-panel{
    display:flex!important;position:fixed!important;z-index:10020!important;
    left:8px!important;right:8px!important;top:auto!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    width:auto!important;max-width:none!important;max-height:min(72dvh,620px)!important;
    padding:8px 14px max(14px,env(safe-area-inset-bottom))!important;
    border:1px solid #e3ebe6!important;border-radius:24px!important;
    background:rgba(255,255,255,.98)!important;
    box-shadow:0 -12px 42px rgba(18,53,38,.16)!important;
    transform:translateY(calc(100% + 30px))!important;opacity:0!important;
    visibility:hidden!important;pointer-events:none!important;
    transition:transform .22s ease,opacity .18s ease,visibility .18s ease!important;
    flex-direction:column!important;overflow:hidden!important;
  }
  .amarai-chat-extension-root .aai-tools-panel:before{
    content:"";display:block;width:38px;height:4px;border-radius:99px;background:#d9e2dd;
    margin:1px auto 8px;flex:0 0 auto;
  }
  .amarai-chat-extension-root .aai-tools-panel.is-open{
    transform:translateY(0)!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;
  }
  .amarai-chat-extension-root .aai-tools-shade{display:block!important;position:fixed!important;inset:0!important;z-index:10019!important;background:rgba(16,30,23,.24)!important;backdrop-filter:blur(2px);opacity:0;visibility:hidden;pointer-events:none;transition:.18s ease}
  .amarai-chat-extension-root .aai-tools-shade.is-open{opacity:1;visibility:visible;pointer-events:auto}
  .amarai-chat-extension-root .aai-tools-head{padding:2px 2px 10px!important;flex:0 0 auto}
  .amarai-chat-extension-root .aai-tools-head strong{font-size:17px!important}.amarai-chat-extension-root .aai-tools-head small{font-size:11px!important;color:#718078!important}
  .amarai-chat-extension-root .aai-tools-close{display:inline-flex!important;width:44px!important;height:44px!important;border-radius:13px!important}
  .amarai-chat-extension-root .aai-tools-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;overflow:auto!important;padding:2px 1px!important}
  .amarai-chat-extension-root .aai-tool-card{min-height:76px!important;padding:11px!important;border:1px solid #e6ede9!important;border-radius:16px!important;background:#fff!important;box-shadow:none!important;grid-template-columns:40px minmax(0,1fr)!important;gap:9px!important}
  .amarai-chat-extension-root .aai-tool-icon{width:40px!important;height:40px!important;flex-basis:40px!important;border-radius:12px!important}
  .amarai-chat-extension-root .aai-tool-copy strong{font-size:12px!important;line-height:1.25!important}.amarai-chat-extension-root .aai-tool-copy small{font-size:10px!important;line-height:1.25!important;margin-top:3px!important;display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .amarai-chat-extension-root .aai-tool-arrow{display:none!important}
  .amarai-chat-extension-root .aai-tools-more{flex:0 0 auto;margin-top:10px!important;border:0!important;background:#f1f7f4!important;border-radius:13px!important;padding:12px!important}
  .amarai-chat-extension-root .aai-active-tool-chip{display:flex!important;position:absolute!important;left:58px!important;bottom:58px!important;max-width:calc(100% - 74px)!important;height:30px!important;align-items:center!important;gap:6px!important;padding:0 9px!important;border:1px solid #dce9e2!important;border-radius:10px!important;background:#f3f8f5!important;color:#17603f!important;box-shadow:none!important;z-index:4!important}
  .amarai-chat-extension-root .aai-active-tool-chip span{display:flex;width:15px;height:15px}.amarai-chat-extension-root .aai-active-tool-chip svg{width:15px;height:15px}.amarai-chat-extension-root .aai-active-tool-chip strong{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.amarai-chat-extension-root .aai-active-tool-chip i{font-style:normal;font-size:15px;line-height:1;color:#668176}
  .amarai-chat-extension-root .aai-composer.aai-has-active-tool textarea{padding-top:34px!important}
}
@media(max-width:520px){
  .amarai-chat-extension-root .aai-tools-panel{left:6px!important;right:6px!important;border-radius:22px!important;max-height:76dvh!important}
  .amarai-chat-extension-root .aai-tools-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .amarai-chat-extension-root .aai-tool-card{min-height:72px!important;padding:9px!important}
  .amarai-chat-extension-root .aai-tool-copy small{display:none!important}
}


/* v2.2.1 — mobile Tools: centered close control + eight primary actions */
@media(max-width:1100px){
  .amarai-chat-extension-root .aai-tools-head{
    position:relative!important;
    min-height:58px!important;
    padding:8px 2px 10px!important;
  }
  .amarai-chat-extension-root .aai-tools-head>div{
    padding-top:2px!important;
    padding-right:0!important;
  }
  .amarai-chat-extension-root .aai-tools-close{
    position:absolute!important;
    left:50%!important;
    top:0!important;
    right:auto!important;
    margin:0!important;
    transform:translateX(-50%)!important;
    z-index:2!important;
  }
  .amarai-chat-extension-root .aai-tools-head>div{margin-top:48px!important;}
  .amarai-chat-extension-root .aai-tools-grid>.aai-tool-card:nth-child(n+9){display:none!important;}
}


/* =========================================================
   v2.3.0 — responsive shell, readable type, measured composer reserve
   Scoped to the AmarAI Chat extension only.
   ========================================================= */
body.aai-chat-page-lock .amarai-chat-extension-root{
  --aai-text:#172b21;
  --aai-muted:#52665b;
  --aai-subtle:#6a7b72;
  --aai-surface:#ffffff;
  --aai-surface-soft:#f6faf8;
  --aai-border:#dce7e1;
  --aai-primary:#087a50;
  --aai-primary-hover:#066942;
  --aai-focus:rgba(8,122,80,.28);
  --aai-radius:16px;
  --aai-shadow-soft:0 8px 28px rgba(18,53,38,.07);
  color:var(--aai-text)!important;
  font-family:Inter,"Noto Sans Bengali","Noto Sans",system-ui,-apple-system,"Segoe UI",sans-serif!important;
}
body.aai-chat-page-lock .amarai-chat-extension-root :lang(bn),
body.aai-chat-page-lock .amarai-chat-extension-root [lang="bn"]{
  font-family:"Noto Sans Bengali",Inter,"Noto Sans",system-ui,sans-serif!important;
  line-height:1.65!important;
}
body.aai-chat-page-lock .aai-chat-app,
body.aai-chat-page-lock .aai-chat-app .amarai-main,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-main,
body.aai-chat-page-lock .aai-chat-app>main{
  min-height:0!important;
}
body.aai-chat-page-lock .aai-chat-app .amarai-main,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-main,
body.aai-chat-page-lock .aai-chat-app>main{
  display:flex!important;flex-direction:column!important;overflow:hidden!important;
}
body.aai-chat-page-lock .aai-chat-app .amarai-messages,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-messages,
body.aai-chat-page-lock .aai-chat-app [data-chat-messages]{
  flex:1 1 auto!important;min-height:0!important;overflow:auto!important;
  padding-bottom:calc(var(--aai-composer-reserve,76px) + 24px)!important;
  scroll-padding-bottom:calc(var(--aai-composer-reserve,76px) + 24px)!important;
  overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
}
/* Keep the empty state below the Core toolbar and leave enough scroll room for
   the last suggestion above an expanded composer/tool chip. */
body.aai-chat-page-lock .aai-welcome,
body.aai-chat-page-lock .amarai-welcome,
body.aai-chat-page-lock [data-chat-welcome]{
  margin:0 auto!important;padding-top:clamp(18px,3.5vh,40px)!important;
  padding-bottom:calc(var(--aai-composer-reserve,76px) + 18px)!important;
  overflow:visible!important;
}
body.aai-chat-page-lock .aai-welcome img,
body.aai-chat-page-lock .amarai-welcome img,
body.aai-chat-page-lock [data-chat-welcome] img{
  max-height:64px!important;height:auto!important;object-fit:contain!important;
}
/* Suggestion grid: 3 / 2 / 1 without squeezing Bangla labels. */
body.aai-chat-page-lock .aai-quick-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important}
body.aai-chat-page-lock .aai-quick-card{min-width:0!important;min-height:92px!important;padding:15px!important;border-radius:15px!important}
body.aai-chat-page-lock .aai-quick-card strong{font-size:15px!important;line-height:1.4!important;color:var(--aai-text)!important}
body.aai-chat-page-lock .aai-quick-card small{font-size:14px!important;line-height:1.5!important;color:var(--aai-muted)!important}
body.aai-chat-page-lock .aai-quick-label{font-size:13px!important;line-height:1.45!important;color:var(--aai-muted)!important;letter-spacing:.02em!important;text-transform:none!important}
/* General readable supporting copy. */
body.aai-chat-page-lock .aai-history-label,
body.aai-chat-page-lock .aai-sidebar-quick-title{font-size:12px!important;color:var(--aai-muted)!important;letter-spacing:.035em!important}
body.aai-chat-page-lock .aai-history button,
body.aai-chat-page-lock .aai-history a{font-size:14px!important;line-height:1.4!important;min-height:40px!important}
body.aai-chat-page-lock .aai-history-search input{font-size:14px!important}
body.aai-chat-page-lock .aai-tool-copy strong{font-size:14px!important;line-height:1.35!important}
body.aai-chat-page-lock .aai-tool-copy small{font-size:12px!important;line-height:1.45!important;color:var(--aai-muted)!important}
body.aai-chat-page-lock .aai-tools-head small{font-size:13px!important;color:var(--aai-muted)!important}
body.aai-chat-page-lock .aai-disclaimer,
body.aai-chat-page-lock [class*="disclaimer"]{font-size:12px!important;line-height:1.55!important;color:var(--aai-muted)!important}
/* Sidebar shell: only history consumes remaining height. */
body.aai-chat-page-lock .aai-sidebar,
body.aai-chat-page-lock .aai-chat-app .amarai-sidebar,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-sidebar{overflow:hidden!important;min-height:0!important}
body.aai-chat-page-lock .aai-history{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding-bottom:12px!important;scrollbar-gutter:stable!important}
/* Composer is a flex sibling, never an overlay; JS publishes its measured height. */
body.aai-chat-page-lock .aai-composer,
body.aai-chat-page-lock .aai-chat-app .amarai-composer,
body.aai-chat-page-lock .aai-chat-app .amarai-chat-composer{
  position:relative!important;inset:auto!important;flex:0 0 auto!important;z-index:20!important;
}
body.aai-chat-page-lock .aai-composer textarea,
body.aai-chat-page-lock .aai-composer input[type="text"]{font-size:16px!important;line-height:1.5!important;color:var(--aai-text)!important}
/* Selected tool chip: icon + readable label + 44px remove target. */
body.aai-chat-page-lock .aai-active-tool-chip{
  min-height:36px!important;height:auto!important;max-width:min(360px,calc(100% - 72px))!important;
  padding:0 2px 0 10px!important;gap:8px!important;border-color:#cfe3d8!important;
  background:#eef8f3!important;color:#125c3c!important;
}
body.aai-chat-page-lock .aai-active-tool-chip strong{display:block!important;min-width:0!important;font-size:13px!important;line-height:1.35!important;font-weight:750!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
body.aai-chat-page-lock .aai-active-tool-chip i{display:grid!important;place-items:center!important;width:44px!important;height:44px!important;margin:-4px -2px -4px 0!important;font-size:19px!important;cursor:pointer!important}
/* AA-friendly primary controls and focus treatment. */
body.aai-chat-page-lock .aai-composer-send,
body.aai-chat-page-lock .aai-new-chat{background:var(--aai-primary)!important;color:#fff!important;border-color:var(--aai-primary)!important}
body.aai-chat-page-lock .aai-composer-send:hover,
body.aai-chat-page-lock .aai-new-chat:hover{background:var(--aai-primary-hover)!important}
body.aai-chat-page-lock .amarai-chat-extension-root button:focus-visible,
body.aai-chat-page-lock .amarai-chat-extension-root a:focus-visible,
body.aai-chat-page-lock .amarai-chat-extension-root [role="button"]:focus-visible{outline:3px solid var(--aai-focus)!important;outline-offset:2px!important}
/* Current-page header state replaces redundant Chat Now, JS adds this class. */
body.aai-chat-page-lock .aai-current-chat-state{pointer-events:none!important;cursor:default!important;background:#eef8f3!important;color:#0a6f49!important;border-color:#cfe5d9!important;font-weight:750!important}
@media(max-width:1279px){body.aai-chat-page-lock .aai-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:599px){body.aai-chat-page-lock .aai-quick-grid{grid-template-columns:1fr!important}}
@media(max-width:800px){
  body.aai-chat-page-lock .aai-chat-app .amarai-messages,
  body.aai-chat-page-lock .aai-chat-app .amarai-chat-messages,
  body.aai-chat-page-lock .aai-chat-app [data-chat-messages]{
    padding-top:10px!important;padding-left:12px!important;padding-right:12px!important;
    padding-bottom:calc(var(--aai-composer-reserve,68px) + max(18px,env(safe-area-inset-bottom)))!important;
    scroll-padding-bottom:calc(var(--aai-composer-reserve,68px) + max(18px,env(safe-area-inset-bottom)))!important;
  }
  body.aai-chat-page-lock .aai-welcome,
  body.aai-chat-page-lock .amarai-welcome,
  body.aai-chat-page-lock [data-chat-welcome]{
    padding-top:10px!important;padding-bottom:calc(var(--aai-composer-reserve,68px) + 14px)!important;
  }
  body.aai-chat-page-lock .aai-welcome img,
  body.aai-chat-page-lock .amarai-welcome img,
  body.aai-chat-page-lock [data-chat-welcome] img{max-height:52px!important}
  body.aai-chat-page-lock .aai-composer textarea{font-size:16px!important;max-height:min(144px,34dvh)!important}
  body.aai-chat-page-lock .aai-active-tool-chip{left:56px!important;bottom:60px!important;max-width:calc(100% - 68px)!important}
  body.aai-chat-page-lock .aai-active-tool-chip strong{font-size:13px!important}
  body.aai-chat-page-lock .aai-sidebar,
  body.aai-chat-page-lock .aai-chat-app .amarai-sidebar,
  body.aai-chat-page-lock .aai-chat-app .amarai-chat-sidebar{
    top:var(--aai-wp-admin-height,0px)!important;height:calc(100dvh - var(--aai-wp-admin-height,0px))!important;
  }
}
@media(max-width:430px){
  body.aai-chat-page-lock .aai-quick-card{min-height:78px!important;padding:13px!important}
  body.aai-chat-page-lock .aai-quick-card strong{font-size:15px!important}
  body.aai-chat-page-lock .aai-quick-card small{font-size:14px!important}
}
@media(max-width:360px){
  body.aai-chat-page-lock .aai-composer{padding-right:56px!important;padding-left:52px!important}
  body.aai-chat-page-lock .aai-composer .aai-composer-mic{display:none!important}
}

/* v2.3.1 — Mobile Tools sheet: top-right transparent close, no grey page shade */
@media(max-width:1100px){
  .amarai-chat-extension-root .aai-tools-head{
    position:relative!important;
    min-height:0!important;
    padding:12px 54px 14px 2px!important;
  }
  .amarai-chat-extension-root .aai-tools-head>div{
    margin-top:0!important;
    padding-top:0!important;
    padding-right:0!important;
  }
  .amarai-chat-extension-root .aai-tools-close{
    position:absolute!important;
    top:2px!important;
    right:0!important;
    left:auto!important;
    margin:0!important;
    transform:none!important;
    width:44px!important;
    min-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    color:#42584d!important;
    -webkit-tap-highlight-color:transparent!important;
  }
  .amarai-chat-extension-root .aai-tools-close:hover,
  .amarai-chat-extension-root .aai-tools-close:active{
    background:transparent!important;
    box-shadow:none!important;
  }
  .amarai-chat-extension-root .aai-tools-close:focus-visible{
    outline:2px solid #0b7a4b!important;
    outline-offset:2px!important;
  }
  .amarai-chat-extension-root .aai-tools-shade,
  .amarai-chat-extension-root .aai-tools-shade.is-open{
    background:transparent!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }
}

/* v2.3.2 — Composer + opens the native AmarAI attachment picker menu. */
.amarai-chat-extension-root .aai-attach-menu{
  position:absolute!important;
  left:8px!important;
  bottom:calc(100% + 10px)!important;
  z-index:80!important;
  display:none!important;
  width:min(310px,calc(100vw - 32px))!important;
  padding:7px!important;
  border:1px solid #d9e5de!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:0 16px 44px rgba(18,54,38,.14)!important;
}
.amarai-chat-extension-root .aai-attach-menu.is-open{display:grid!important;gap:4px!important}
.amarai-chat-extension-root .aai-attach-menu-item{
  width:100%!important;min-height:58px!important;display:flex!important;align-items:center!important;gap:11px!important;
  padding:8px 10px!important;border:0!important;border-radius:12px!important;background:transparent!important;color:#173b2c!important;text-align:left!important;cursor:pointer!important;
}
.amarai-chat-extension-root .aai-attach-menu-item:hover,.amarai-chat-extension-root .aai-attach-menu-item:focus-visible{background:#f0f8f4!important;outline:none!important}
.amarai-chat-extension-root .aai-attach-menu-icon{width:40px!important;height:40px!important;flex:0 0 40px!important;display:grid!important;place-items:center!important;border-radius:11px!important;background:#e9f7f0!important;color:#078657!important}
.amarai-chat-extension-root .aai-attach-menu-icon svg{width:19px!important;height:19px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}
.amarai-chat-extension-root .aai-attach-menu-item>span:last-child{display:flex!important;min-width:0!important;flex-direction:column!important;gap:2px!important}
.amarai-chat-extension-root .aai-attach-menu-item strong{font-size:14px!important;line-height:1.35!important;font-weight:750!important;color:#173b2c!important}
.amarai-chat-extension-root .aai-attach-menu-item small{font-size:12px!important;line-height:1.4!important;color:#60766b!important}
@media(max-width:800px){.amarai-chat-extension-root .aai-attach-menu{left:6px!important;bottom:calc(100% + 8px)!important;width:min(300px,calc(100vw - 24px))!important}}

/* v2.4 — capability UX: context actions, multi-file previews, drag/drop, rich results */
.amarai-chat-extension-root .aai-context-actions{display:flex;gap:7px;flex-wrap:wrap;padding:5px 8px 1px}
.amarai-chat-extension-root .aai-context-actions[hidden]{display:none!important}
.amarai-chat-extension-root .aai-context-action{min-height:36px;padding:7px 11px;border:1px solid #d8e6de;border-radius:999px;background:#f7fbf9;color:#174331;font:700 13px/1.2 inherit;cursor:pointer}
.amarai-chat-extension-root .aai-context-action:hover{background:#edf8f2;border-color:#bcdac9}
.amarai-chat-extension-root .aai-context-action:focus-visible{outline:2px solid #087a50;outline-offset:2px}
.amarai-chat-extension-root .aai-attachment-thumb{width:100%;height:100%;object-fit:cover;border-radius:9px;display:block}
.amarai-chat-extension-root .aai-composer.aai-drag-active,.amarai-chat-extension-root .amarai-composer.aai-drag-active{outline:2px dashed #078657!important;outline-offset:3px!important;background:#f5fcf8!important}
.amarai-chat-extension-root .aai-active-tool-chip.aai-auto-tool:before{content:'Auto';font-size:10px;line-height:1;padding:3px 5px;border-radius:999px;background:#dff5e9;color:#086a46;font-weight:800}
.amarai-chat-extension-root .aai-rich-result{width:min(760px,calc(100% - 32px));margin:12px auto;padding:16px;border:1px solid #dbe8e1;border-radius:18px;background:#fff;box-shadow:0 8px 28px rgba(18,54,38,.07);color:#173b2c}
.amarai-chat-extension-root .aai-rich-head{display:flex;gap:11px;align-items:center;margin-bottom:12px}.amarai-chat-extension-root .aai-rich-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:12px;background:#e9f7f0;color:#078657;flex:0 0 42px}.amarai-chat-extension-root .aai-rich-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8}.amarai-chat-extension-root .aai-rich-head>div{display:flex;min-width:0;flex-direction:column;gap:2px}.amarai-chat-extension-root .aai-rich-head strong{font-size:16px;line-height:1.35}.amarai-chat-extension-root .aai-rich-head small{font-size:13px;line-height:1.4;color:#5b7166}.amarai-chat-extension-root .aai-rich-verdict{padding:11px 13px;margin:0 0 10px;border-radius:12px;background:#eef8f3;color:#0a6d49;font-weight:800}.amarai-chat-extension-root .aai-rich-summary{font-size:15px;line-height:1.65;margin:8px 0 12px}.amarai-chat-extension-root .aai-rich-items{display:grid;gap:8px}.amarai-chat-extension-root .aai-rich-item{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid #e2ebe6;border-radius:13px}.amarai-chat-extension-root .aai-rich-item>img{width:48px;height:48px;border-radius:9px;object-fit:cover}.amarai-chat-extension-root .aai-rich-item-copy{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}.amarai-chat-extension-root .aai-rich-item-copy strong{font-size:14px}.amarai-chat-extension-root .aai-rich-item-copy small{font-size:12px;line-height:1.4;color:#60766b}.amarai-chat-extension-root .aai-rich-price{white-space:nowrap;font-size:14px}.amarai-chat-extension-root .aai-rich-link{min-height:36px;display:inline-flex;align-items:center;padding:0 11px;border-radius:9px;background:#078657;color:#fff!important;text-decoration:none;font-weight:750;font-size:12px}.amarai-chat-extension-root .aai-rich-sources{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-top:12px;padding-top:12px;border-top:1px solid #e4ece8}.amarai-chat-extension-root .aai-rich-sources strong{font-size:12px}.amarai-chat-extension-root .aai-rich-sources a{font-size:12px;color:#087a50;text-decoration:none;padding:5px 8px;border-radius:999px;background:#f0f8f4}
@media(max-width:600px){.amarai-chat-extension-root .aai-rich-result{width:calc(100% - 20px);padding:13px;border-radius:15px}.amarai-chat-extension-root .aai-rich-item{align-items:flex-start;flex-wrap:wrap}.amarai-chat-extension-root .aai-rich-link{margin-left:auto}.amarai-chat-extension-root .aai-context-actions{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.amarai-chat-extension-root .aai-context-actions::-webkit-scrollbar{display:none}.amarai-chat-extension-root .aai-context-action{white-space:nowrap;min-height:38px}}

/* v2.4.1 — mobile + opens Tools; upload status UI and extension-ready capability bridge */
.amarai-chat-extension-root .aai-upload-actions{display:flex;align-items:center;gap:4px;margin-left:auto}
.amarai-chat-extension-root .aai-upload-retry{min-height:30px;padding:0 8px;border:1px solid #cfe0d7;border-radius:8px;background:#fff;color:#0b6e49;font:700 11px/1 inherit;cursor:pointer}
.amarai-chat-extension-root .aai-upload-retry[hidden]{display:none!important}
.amarai-chat-extension-root .aai-upload-status{font-size:11px!important;color:#60766b!important}
.amarai-chat-extension-root .aai-upload-progress{display:none;width:min(180px,100%);height:4px;margin-top:4px;overflow:hidden;border-radius:999px;background:#e4ece8}
.amarai-chat-extension-root .aai-upload-progress.is-active{display:block}
.amarai-chat-extension-root .aai-upload-progress>i{display:block;width:0;height:100%;border-radius:inherit;background:#078657;transition:width .18s ease}
.amarai-chat-extension-root .aai-attachment-chip.is-upload-error{border-color:#e9c8c8!important;background:#fffafa!important}
@media(max-width:800px){
  .amarai-chat-extension-root .aai-attach-menu{display:none!important}
  .amarai-chat-extension-root .aai-composer-tools-btn{min-width:44px!important;width:44px!important;height:44px!important;min-height:44px!important}
  .amarai-chat-extension-root .aai-tools-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}


/* v2.4.2 — assistant response readability / open-content treatment */
body.aai-chat-page-lock .aai-message.aai-assistant-message > .bubble,
body.aai-chat-page-lock .aai-message.aai-assistant-message > .amarai-bubble,
body.aai-chat-page-lock .aai-message.aai-assistant-message > .message-content,
body.aai-chat-page-lock .aai-message.aai-assistant-message > [data-message-content],
body.aai-chat-page-lock .aai-message.aai-assistant-message > .amarai-message-content,
body.aai-chat-page-lock .aai-message.aai-assistant-message > .amarai-response,
body.aai-chat-page-lock .aai-message.aai-assistant-message > .response-content{
  width:100%!important;max-width:100%!important;
  padding:0!important;margin:0!important;
  border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;
  color:var(--aai-text,#173c2d)!important;
  font-size:16px!important;line-height:1.72!important;
  overflow:visible!important;
}
body.aai-chat-page-lock .aai-assistant-message .aai-markdown,
body.aai-chat-page-lock .aai-assistant-message .aai-assistant-plain{
  width:100%!important;font-size:16px!important;line-height:1.72!important;
  color:var(--aai-text,#173c2d)!important;overflow-wrap:break-word!important;word-break:normal!important;
}
body.aai-chat-page-lock .aai-assistant-message .aai-markdown p{margin:0 0 .9em!important}
body.aai-chat-page-lock .aai-assistant-message .aai-markdown p:last-child{margin-bottom:0!important}
body.aai-chat-page-lock .aai-assistant-message .aai-markdown h3,
body.aai-chat-page-lock .aai-assistant-message .aai-markdown h4,
body.aai-chat-page-lock .aai-assistant-message .aai-markdown h5,
body.aai-chat-page-lock .aai-assistant-message .aai-markdown h6{margin:1.1em 0 .45em!important;line-height:1.35!important;color:var(--aai-text,#173c2d)!important}
body.aai-chat-page-lock .aai-assistant-message .aai-markdown ul,
body.aai-chat-page-lock .aai-assistant-message .aai-markdown ol{margin:.45em 0 1em!important;padding-inline-start:1.45em!important}
body.aai-chat-page-lock .aai-assistant-message .aai-markdown li{margin:.32em 0!important}
body.aai-chat-page-lock .aai-assistant-message .aai-table-scroll{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}
body.aai-chat-page-lock .aai-assistant-message table{width:100%!important;border-collapse:separate!important;border-spacing:0!important;font-size:14px!important}
body.aai-chat-page-lock .aai-assistant-message th,
body.aai-chat-page-lock .aai-assistant-message td{padding:10px 12px!important;border-bottom:1px solid var(--aai-border,#dce8e1)!important;text-align:start!important;vertical-align:top!important}
body.aai-chat-page-lock .aai-assistant-message th{font-weight:750!important;background:#f6faf8!important}
@media(max-width:800px){
 body.aai-chat-page-lock .aai-message.aai-assistant-message > .bubble,
 body.aai-chat-page-lock .aai-message.aai-assistant-message > .amarai-bubble,
 body.aai-chat-page-lock .aai-message.aai-assistant-message > .message-content,
 body.aai-chat-page-lock .aai-message.aai-assistant-message > [data-message-content],
 body.aai-chat-page-lock .aai-assistant-message .aai-markdown,
 body.aai-chat-page-lock .aai-assistant-message .aai-assistant-plain{font-size:16px!important;line-height:1.68!important}
}


/* v2.4.3 — robust assistant content target after Core streaming */
body.aai-chat-page-lock .aai-assistant-message .aai-markdown,
body.aai-chat-page-lock .aai-assistant-message .aai-assistant-plain{
  display:block!important;width:100%!important;max-width:100%!important;
  padding:0!important;margin:0!important;border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;
}
body.aai-chat-page-lock .aai-assistant-message:has(.aai-markdown),
body.aai-chat-page-lock .aai-assistant-message:has(.aai-assistant-plain){
  background:transparent!important;border:0!important;box-shadow:none!important;
}


/* v2.4.4 — definitive assistant surface reset + readable fallback for flattened output */
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message > *,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .bubble,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .amarai-bubble,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .message-content,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message [data-message-content],
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .amarai-message-content,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .amarai-response,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .response-content{
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
}
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message > .bubble,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message > .amarai-bubble,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message > .message-content,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message > [data-message-content],
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message > .amarai-message-content,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message > .amarai-response,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message > .response-content{
  padding:0!important;border:0!important;border-radius:0!important;
}
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .aai-markdown,
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .aai-assistant-plain{
  font-size:16px!important;line-height:1.72!important;color:#173c2d!important;
  white-space:normal!important;
}
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .aai-markdown p{
  margin:0 0 12px!important;
}
body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .aai-markdown p:last-child{margin-bottom:0!important}
@media(max-width:800px){
 body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .aai-markdown,
 body.aai-chat-page-lock .amarai-chat-extension-root .aai-assistant-message .aai-assistant-plain{font-size:16px!important;line-height:1.68!important}
}

/* v2.4.6 — desktop conversation width only.
   Keep mobile/tablet unchanged; let the desktop center workspace use its available width. */
@media(min-width:1101px){
  body.aai-chat-page-lock .amarai-chat-extension-root .amarai-messages,
  body.aai-chat-page-lock .amarai-chat-extension-root .amarai-chat-messages,
  body.aai-chat-page-lock .amarai-chat-extension-root [data-chat-messages]{
    width:100%!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    padding-left:clamp(36px,5vw,72px)!important;
    padding-right:clamp(36px,5vw,72px)!important;
    box-sizing:border-box!important;
  }
  body.aai-chat-page-lock .amarai-chat-extension-root .aai-message{
    width:100%!important;
    max-width:none!important;
  }
  body.aai-chat-page-lock .amarai-chat-extension-root .aai-composer{
    width:min(920px,calc(100% - 72px))!important;
    max-width:920px!important;
  }
}
/* v2.4.7 tool-page-like rich results inside chat */
.amarai-chat-extension-root .aai-rich-result{width:min(100%,980px);margin:14px auto 22px;padding:18px;border:1px solid #dce9e2;border-radius:20px;background:#fff;box-shadow:0 10px 30px rgba(18,71,48,.06)}
.amarai-chat-extension-root .aai-rich-head{display:flex;gap:12px;align-items:center;margin-bottom:14px}.amarai-chat-extension-root .aai-rich-head>div{display:grid;gap:2px}.amarai-chat-extension-root .aai-rich-head strong{font-size:17px}.amarai-chat-extension-root .aai-rich-head small{color:#6b7d73}.amarai-chat-extension-root .aai-rich-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:#edf8f2;color:#078554}.amarai-chat-extension-root .aai-rich-icon svg{width:22px;height:22px}
.amarai-chat-extension-root .aai-rich-verdict{display:inline-flex;padding:7px 11px;border-radius:999px;background:#eaf7f0;color:#08764d;font-weight:700;margin-bottom:10px}.amarai-chat-extension-root .aai-rich-summary{white-space:pre-wrap;line-height:1.65;margin:5px 0 14px}.amarai-chat-extension-root .aai-rich-items{display:grid;gap:10px}.amarai-chat-extension-root .aai-rich-item{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:14px;align-items:center;padding:14px;border:1px solid #e3ece7;border-radius:15px;background:#fbfdfc}.amarai-chat-extension-root .aai-rich-item-copy{min-width:0;display:grid;gap:4px}.amarai-chat-extension-root .aai-rich-item-copy small{color:#617268;line-height:1.45}.amarai-chat-extension-root .aai-rich-price{white-space:nowrap;font-size:16px;color:#075f40}.amarai-chat-extension-root .aai-rich-link{white-space:nowrap;text-decoration:none;border:1px solid #bcdccd;border-radius:10px;padding:8px 11px;color:#08764d;font-weight:650}.amarai-chat-extension-root .aai-rich-sources{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:14px}.amarai-chat-extension-root .aai-rich-sources a{font-size:13px;padding:6px 9px;border-radius:9px;background:#f1f7f4;color:#126347;text-decoration:none}
@media(max-width:700px){.amarai-chat-extension-root .aai-rich-result{margin:10px 0 18px;padding:14px;border-radius:16px}.amarai-chat-extension-root .aai-rich-item{grid-template-columns:1fr auto}.amarai-chat-extension-root .aai-rich-link{grid-column:1/-1;text-align:center}.amarai-chat-extension-root .aai-rich-price{align-self:start}}
