/* AgenticCore assistants — windows (shared by both sites). The floating button's
   styles are injected by ac-assistant-boot.js so it renders before this file loads.
   guide  = small white window with the logo's green (quick questions)
   amaan  = full-window dark green chat with its own header, attachments, voice
            typing and "send to team" (on Estate: its own page, amaan.html) */

/* ---------- shared bits ---------- */
.aca-panel, .aca-full { font-size: .95rem; line-height: 1.5; -webkit-text-size-adjust: 100%; }
.aca-panel[hidden], .aca-full[hidden], .aca-sheet[hidden], .aca-tray[hidden], .aca-handoff-row[hidden] { display: none !important; }
.aca-title { margin: 0; font-size: 1.02rem; font-weight: 700; line-height: 1.25; }
.aca-sub { margin: .1rem 0 0; font-size: .76rem; }
.aca-log { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: .7rem 1rem; display: flex; flex-direction: column; gap: .6rem; overscroll-behavior: contain; }
.aca-msg { display: flex; flex-direction: column; gap: .4rem; max-width: 88%; }
.aca-user { align-self: flex-end; align-items: flex-end; }
.aca-assistant { align-self: flex-start; }
html[dir="rtl"] .aca-user { align-self: flex-start; align-items: flex-start; }
html[dir="rtl"] .aca-assistant { align-self: flex-end; }
.aca-bubble { padding: .6rem .85rem; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.aca-bubble[dir="rtl"] { font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', serif; line-height: 2; }
.aca-wait .aca-bubble { font-style: italic; opacity: .75; }
.aca-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.aca-act { display: inline-flex; align-items: center; min-height: 40px; padding: .3rem .8rem; border-radius: 999px; font: inherit; font-size: .85rem; text-decoration: none; cursor: pointer; }
.aca-cards { display: flex; flex-direction: column; gap: .4rem; }
.aca-card { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .75rem; border-radius: 12px; text-decoration: none; }
.aca-card strong { font-size: .9rem; }
.aca-card-price { font-size: .85rem; font-weight: 600; }
.aca-card-where, .aca-card-diff { font-size: .8rem; opacity: .8; }
.aca-quick { display: flex; flex-wrap: wrap; gap: .4rem; padding: .2rem 1rem .5rem; }
.aca-quick:empty { display: none; }
.aca-chip { min-height: 40px; padding: .3rem .75rem; border-radius: 999px; font: inherit; font-size: .84rem; cursor: pointer; }
.aca-form { display: flex; align-items: flex-end; gap: .45rem; padding: .55rem .8rem; }
.aca-form textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: .62rem .8rem; border-radius: 14px; font: inherit; font-size: 16px; }
.aca-form textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aca-send { min-height: 44px; padding: 0 1.05rem; border: 0; border-radius: 14px; font: inherit; font-weight: 700; cursor: pointer; }
.aca-send:disabled { opacity: .55; cursor: default; }
.aca-foot { padding: .15rem 1rem .6rem; font-size: .78rem; }
.aca-foot a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 .35rem; font-weight: 600; }
.aca-note { margin: .1rem 0 0; font-size: .7rem; opacity: .75; }
.aca-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.aca-reset, .aca-close { min-height: 40px; min-width: 40px; border-radius: 10px; background: transparent; cursor: pointer; font: inherit; font-size: .8rem; padding: 0 .6rem; }
.aca-close { font-size: 1.45rem; line-height: 1; }

/* ---------- guide: small white window with the logo's green ---------- */
.aca-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 1000;
  width: min(380px, calc(100vw - 32px)); max-height: min(600px, calc(100vh - 32px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #FFFFFF; color: #111A10; border: 2px solid #68F830; border-radius: 18px;
  box-shadow: 0 24px 60px rgba(17, 26, 16, .28), 0 0 0 4px rgba(104, 248, 48, .16);
}
html[dir="rtl"] .aca-panel { right: auto; left: 16px; }
.aca-head { display: flex; align-items: center; gap: .55rem; padding: .7rem .7rem .7rem .9rem; background: #EEF9E6; color: #0A1F05; border-bottom: 1px solid #D3EBC4; }
.aca-head-t { flex: 1; min-width: 0; }
.aca-head .aca-sub { color: #1F4A12; }
.aca-gdot { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #FFFFFF; color: #23820E; font-size: 1rem; flex: 0 0 auto; }
.aca-head .aca-reset, .aca-head .aca-close { border: 1px solid rgba(10, 31, 5, .35); color: #0A1F05; }
.aca-head .aca-reset:hover, .aca-head .aca-close:hover { background: rgba(255, 255, 255, .4); }
.aca-to-amaan { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 .5rem; margin: .7rem .9rem .2rem; padding: .65rem .85rem; border: 0; border-radius: 14px;
  background: #68F830; color: #0A1F05; text-align: start; font: inherit; cursor: pointer; }
.aca-to-amaan strong { font-size: .92rem; }
.aca-to-amaan small { grid-column: 1; color: #1F4A12; font-size: .75rem; }
.aca-to-amaan span { grid-row: 1 / span 2; grid-column: 2; font-size: 1.6rem; color: #0A1F05; }
html[dir="rtl"] .aca-to-amaan span { transform: scaleX(-1); }
.aca-to-amaan:hover, .aca-to-amaan:focus-visible { background: #5BEA24; }
.aca-panel .aca-user .aca-bubble { background: #E6FBDB; color: #111A10; }
.aca-panel .aca-assistant .aca-bubble { background: #F5F8F3; border: 1px solid #DDE6D9; }
.aca-panel .aca-act { border: 1px solid #23820E; background: #FFFFFF; color: #1B5E0B; }
.aca-panel .aca-act:hover, .aca-panel .aca-act:focus-visible { background: #EBF9E3; }
.aca-panel .aca-card { background: #FFFFFF; border: 1px solid #DDE6D9; color: #111A10; }
.aca-panel .aca-chip { border: 1px solid #CFE0C8; background: #FFFFFF; color: #111A10; }
.aca-panel .aca-chip:hover, .aca-panel .aca-chip:focus-visible { border-color: #23820E; }
.aca-panel .aca-form { border-top: 1px solid #DDE6D9; background: #F5F8F3; }
.aca-panel .aca-form textarea { border: 1px solid #CFE0C8; background: #FFFFFF; color: #111A10; }
.aca-panel .aca-form textarea:focus-visible { outline: none; border-color: #23820E; box-shadow: 0 0 0 3px rgba(104, 248, 48, .3); }
.aca-panel .aca-send { background: #68F830; color: #0A1F05; }
.aca-panel .aca-foot { color: #4A5848; background: #F5F8F3; }
.aca-panel .aca-foot a { color: #23820E; }
.aca-panel button:focus-visible, .aca-panel a:focus-visible, .aca-panel .aca-log:focus-visible { outline: 3px solid #23820E; outline-offset: 2px; }

/* phones: a compact bottom card, not a takeover */
@media (max-width: 600px) {
  .aca-panel { left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 72vh; max-height: 72dvh; }
  html[dir="rtl"] .aca-panel { left: 10px; right: 10px; }
  body.has-mobile-bar .aca-panel { bottom: calc(var(--mobile-bar-h, 56px) + 10px); max-height: calc(72dvh - var(--mobile-bar-h, 56px)); }
  .aca-panel .aca-foot .aca-note { display: none; }
}

/* ---------- Amaan: full-window chat, white with the logo green ---------- */
body.aca-full-open { overflow: hidden; }
.aca-full {
  position: fixed; inset: 0; z-index: 1001;
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  background: radial-gradient(ellipse 900px 420px at 85% -10%, rgba(104, 248, 48, .10), transparent), #FFFFFF; color: #111A10;
  --aca-col: 820px;   /* the chat column, centred on wide screens */
}
.aca-fhead { display: flex; align-items: center; gap: .65rem; padding: .6rem max(.8rem, calc((100% - var(--aca-col)) / 2)); padding-top: max(.6rem, env(safe-area-inset-top)); background: rgba(255, 255, 255, .96); color: #111A10; border-bottom: 1px solid #D3EBC4; }
.aca-back { display: inline-flex; align-items: center; gap: .25rem; min-height: 44px; padding: 0 .65rem 0 .4rem; border: 1px solid #D3EBC4; border-radius: 12px; background: #FFFFFF; color: #111A10; font: inherit; font-size: .85rem; cursor: pointer; }
.aca-back > span:first-child { font-size: 1.7rem; line-height: 1; color: #23820E; }
.aca-back:hover { border-color: #68F830; }
html[dir="rtl"] .aca-back > span:first-child { transform: scaleX(-1); }
.aca-avatar { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  background: #68F830; color: #0A1F05; font-weight: 800; font-size: 1.15rem; box-shadow: 0 0 0 3px rgba(104, 248, 48, .22), 0 0 18px rgba(104, 248, 48, .45); }
.aca-fhead-t { flex: 1; min-width: 0; }
.aca-fhead .aca-title { font-size: 1.08rem; }
.aca-fhead .aca-sub { color: #4A5848; }
.aca-fhead .aca-reset { border: 1px solid #D3EBC4; color: #2C4723; }
.aca-fhead .aca-reset:hover { color: #0A1F05; border-color: #68F830; }
.aca-full .aca-log { padding: 1.2rem max(1rem, calc((100% - var(--aca-col)) / 2)); background: transparent; gap: .8rem; }
.aca-full .aca-msg { max-width: min(82%, 640px); }
.aca-full .aca-bubble { padding: .7rem 1rem; border-radius: 18px; }
.aca-full .aca-user .aca-bubble { background: #D9F7C6; color: #0A1F05; border: 1px solid #B6EA97; border-bottom-right-radius: 6px; }
html[dir="rtl"] .aca-full .aca-user .aca-bubble { border-bottom-right-radius: 18px; border-bottom-left-radius: 6px; }
.aca-full .aca-assistant .aca-bubble { background: #EEF9E6; color: #111A10; border: 1px solid #D3EBC4; border-bottom-left-radius: 6px; }
.aca-full .aca-act { border: 1px solid #68F830; background: #FFFFFF; color: #1B5E0B; font-weight: 600; }
.aca-full .aca-act:hover, .aca-full .aca-act:focus-visible { background: #68F830; border-color: #68F830; color: #0A1F05; }
.aca-full .aca-card { background: #FFFFFF; border: 1px solid #D3EBC4; color: #111A10; }
.aca-full .aca-card:hover, .aca-full .aca-card:focus-visible { border-color: #68F830; }
.aca-full .aca-card-price { color: #1F7A0C; }
.aca-full .aca-quick { padding: .3rem max(1rem, calc((100% - var(--aca-col)) / 2)) .7rem; background: transparent; }
.aca-full .aca-chip { border: 1px solid #C5E3B3; background: #EEF9E6; color: #111A10; }
.aca-full .aca-chip:hover, .aca-full .aca-chip:focus-visible { border-color: #68F830; background: #E3F5D7; color: #0A1F05; }
.aca-msg-files { display: flex; flex-wrap: wrap; gap: .3rem; }
.aca-fchip { display: inline-flex; align-items: center; max-width: 240px; padding: .25rem .6rem; border-radius: 999px; background: #D9F7C6; color: #1B5E0B; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aca-tray { display: flex; gap: .4rem; overflow-x: auto; padding: .45rem max(.8rem, calc((100% - var(--aca-col)) / 2)); background: transparent; }
.aca-tchip { display: inline-flex; align-items: center; gap: .4rem; flex: 0 0 auto; max-width: 260px; padding: .3rem .4rem .3rem .65rem; border-radius: 12px; background: #EEF9E6; border: 1px solid #D3EBC4; color: #111A10; font-size: .8rem; }
.aca-tchip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aca-tchip small { color: #1F7A0C; font-weight: 600; }
.aca-t-uploading small { color: #8A6A00; }
.aca-t-failed small { color: #B3261E; }
.aca-tx { min-width: 32px; min-height: 32px; border: 0; border-radius: 50%; background: transparent; color: #4A5848; font-size: 1.1rem; cursor: pointer; }
.aca-handoff-row { padding: .45rem max(.8rem, calc((100% - var(--aca-col)) / 2)) 0; background: transparent; }
.aca-handoff { width: 100%; min-height: 46px; border: 0; border-radius: 14px; background: #68F830; color: #0A1F05; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px rgba(104, 248, 48, .3); }
.aca-handoff:hover, .aca-handoff:focus-visible { background: #5BEA24; }

/* the message box: one large rounded box, attach · voice · send inside (like Forge) */
.aca-cwrap { padding: .6rem max(.8rem, calc((100% - var(--aca-col)) / 2)) max(.5rem, env(safe-area-inset-bottom)); }
.aca-full .aca-compose { display: flex; flex-direction: column; align-items: stretch; gap: .2rem; padding: .55rem .6rem .5rem; border: 1px solid #C5E3B3; border-radius: 22px; background: #FFFFFF; box-shadow: 0 6px 22px rgba(17, 26, 16, .08); transition: border-color .15s, box-shadow .15s; }
.aca-full .aca-compose:focus-within { border-color: #68F830; box-shadow: 0 0 0 3px rgba(104, 248, 48, .18), 0 0 24px rgba(104, 248, 48, .15); }
.aca-full .aca-compose textarea { min-height: 52px; max-height: 220px; padding: .45rem .5rem; border: 0; border-radius: 0; background: transparent; color: #111A10; resize: none; overflow-y: auto; }
.aca-full .aca-compose textarea::placeholder { color: #6F7C6D; }
.aca-full .aca-compose textarea:focus-visible { outline: none; box-shadow: none; }
.aca-cbar { display: flex; align-items: center; gap: .4rem; }
.aca-listen { flex: 1; min-width: 0; font-size: .8rem; color: #1F7A0C; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aca-clip, .aca-mic { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: 0 0 auto; padding: 0; border: 1px solid #C5E3B3; border-radius: 50%; background: #EEF9E6; color: #2C4723; cursor: pointer; }
.aca-clip svg, .aca-mic svg { width: 21px; height: 21px; }
.aca-clip:hover, .aca-clip:focus-visible, .aca-mic:hover, .aca-mic:focus-visible { border-color: #68F830; color: #1B5E0B; }
.aca-mic[hidden] { display: none; }
.aca-mic.is-on { background: #68F830; border-color: #68F830; color: #0A1F05; box-shadow: 0 0 0 4px rgba(104, 248, 48, .25); }
.aca-full .aca-compose .aca-send { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 0; padding: 0; flex: 0 0 auto; border-radius: 50%; background: #68F830; color: #0A1F05; box-shadow: 0 0 16px rgba(104, 248, 48, .45); }
.aca-full .aca-compose .aca-send svg { width: 22px; height: 22px; }
.aca-full .aca-compose .aca-send:hover:not(:disabled) { background: #8CFF5C; }
.aca-hint { margin: .35rem 0 0; text-align: center; font-size: .72rem; color: #6F7C6D; }
.aca-full .aca-foot { padding: .1rem max(1rem, calc((100% - var(--aca-col)) / 2)) .55rem; background: transparent; color: #4A5848; text-align: center; }
.aca-full .aca-foot a { color: #1F7A0C; }
.aca-full button:focus-visible, .aca-full a:focus-visible, .aca-full .aca-log:focus-visible { outline: 3px solid #23820E; outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .aca-mic.is-on { animation: aca-pulse 1.4s ease-in-out infinite; } }
@keyframes aca-pulse { 50% { box-shadow: 0 0 0 8px rgba(104, 248, 48, .12); } }

/* send-to-team sheet */
.aca-sheet { position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: center; background: rgba(4, 18, 13, .7); }
.aca-sheet-card { width: 100%; max-width: 560px; max-height: 92%; overflow-y: auto; display: flex; flex-direction: column; gap: .55rem;
  padding: 1.1rem 1.1rem max(1.1rem, env(safe-area-inset-bottom)); background: #FFFFFF; color: #1E2A24; border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, .3); }
.aca-sheet-card h3 { margin: 0; font-size: 1.1rem; }
.aca-sheet-info { margin: 0; font-size: .82rem; color: #5D6B63; }
.aca-sheet-card label, .aca-sheet-label { display: flex; flex-direction: column; gap: .25rem; margin: 0; font-size: .85rem; font-weight: 600; }
.aca-sheet-card textarea { padding: .55rem .7rem; border: 1px solid #CFC7B0; border-radius: 12px; background: #FFFFFF; color: #1E2A24; font: inherit; font-size: 16px; font-weight: 400; resize: vertical; }
.aca-sheet-card textarea:focus-visible { outline: none; border-color: #0C3324; box-shadow: 0 0 0 3px rgba(12, 51, 36, .18); }
.aca-sheet-none { font-size: .82rem; color: #5D6B63; }
.aca-sheet-msg { margin: 0; min-height: 1.2em; font-size: .85rem; color: #B3261E; }
.aca-sheet-row { display: flex; gap: .5rem; justify-content: flex-end; }
.aca-sheet-cancel { min-height: 44px; padding: 0 1rem; border: 1px solid #CFC7B0; border-radius: 14px; background: #FFFFFF; color: #1E2A24; font: inherit; cursor: pointer; }
.aca-sheet .aca-send { background: #68F830; color: #0A1F05; }
.aca-sheet-card textarea:focus-visible, .aca-sheet-card button:focus-visible { outline: 3px solid #23820E; outline-offset: 2px; }

/* desktop: a large centred chat over a dimmed page */
@media (min-width: 900px) {
  body.aca-full-open::after { content: ''; position: fixed; inset: 0; z-index: 1000; background: rgba(4, 18, 13, .6); }
  .aca-full { inset: 4vh auto 4vh 50%; transform: translateX(-50%); width: min(880px, 92vw); height: auto; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
  .aca-sheet { align-items: center; }
  .aca-sheet-card { border-radius: 20px; }
  body.aca-page.aca-full-open::after { display: none; }
  body.aca-page .aca-full { inset: 0; transform: none; width: auto; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; }
}
/* on Amaan's page the guide (if asked for) opens above him */
body.aca-page .aca-panel { z-index: 1002; }
@media (prefers-reduced-motion: no-preference) {
  .aca-act, .aca-chip, .aca-to-amaan { transition: border-color .15s, background-color .15s; }
}
@media print { .aca-panel, .aca-full { display: none !important; } }

/* while Amaan is open, the page's own floating buttons step aside */
body.aca-full-open .ac-wa-float, body.aca-full-open .wa-float, body.aca-full-open .mobile-bar { visibility: hidden; }
/* file-only message: just the file chips, no empty bubble */
.aca-files-only .aca-bubble { display: none; }

/* phones: compact headers */
@media (max-width: 600px) {
  .aca-back-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .aca-back { padding: 0 .55rem; }
  .aca-fhead { gap: .5rem; }
  .aca-avatar { width: 36px; height: 36px; font-size: 1rem; }
  .aca-fhead .aca-sub, .aca-head .aca-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .aca-fhead .aca-reset, .aca-head .aca-reset { font-size: .75rem; padding: 0 .5rem; }
  .aca-full .aca-msg { max-width: 86%; }
}

/* Language choice at the start of a chat */
.aca-langpick .aca-bubble { max-width: 100%; }
.aca-lp-t { margin: 0 0 .25rem; font-weight: 600; }
.aca-lp-t[dir="rtl"] { font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Noto Naskh Arabic', serif; font-weight: 500; font-size: 1.05rem; line-height: 2; }
.aca-lp-row { display: flex; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }
.aca-lp-btn { flex: 1 1 120px; min-height: 48px; padding: .4rem 1rem; border-radius: 12px; border: 2px solid #68F830; background: #FFFFFF; color: #111A10; font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer; }
.aca-lp-btn[lang="ur"] { font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', serif; font-size: 1.2rem; }
.aca-lp-btn:hover, .aca-lp-btn:focus-visible { background: #68F830; color: #0A1F05; border-color: #68F830; outline: none; }
.aca-full .aca-lp-btn { border-color: #68F830; background: #FFFFFF; color: #111A10; }
.aca-full .aca-lp-btn:hover, .aca-full .aca-lp-btn:focus-visible { background: #68F830; color: #0A1F05; border-color: #68F830; }

/* Amaan: the message box is the last thing on screen — nothing written below it */
.aca-full .aca-hint, .aca-full .aca-foot { display: none; }
.aca-full .aca-cwrap { padding-bottom: max(.8rem, env(safe-area-inset-bottom)); }
