/* Server-rendered launcher: visible immediately while the assistant module loads. */
.marsata-ai-fab{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:2147483001;
  display:grid;
  place-items:center;
  width:60px;
  height:60px;
  padding:0;
  border:1px solid rgba(255,255,255,.42);
  border-radius:50%;
  background:linear-gradient(145deg,#174e47,#0b675a 67%,#f47f67 160%);
  color:#fff;
  box-shadow:0 16px 38px rgba(12,69,59,.34);
  cursor:pointer;
  transition:transform .2s ease,box-shadow .2s ease;
}
.marsata-ai-fab:hover{transform:translateY(-3px);box-shadow:0 20px 46px rgba(12,69,59,.42)}
.marsata-ai-fab:focus-visible{outline:4px solid rgba(244,127,103,.4);outline-offset:3px}
.marsata-ai-fab svg{width:29px;height:29px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.marsata-ai-fab::after{
  content:'AI';
  position:absolute;
  right:-3px;
  top:-4px;
  display:grid;
  place-items:center;
  min-width:24px;
  height:24px;
  padding:0 5px;
  border:2px solid #fff;
  border-radius:999px;
  background:#f47f67;
  color:#fff;
  font:800 9px/1 'DM Sans',Inter,sans-serif;
  letter-spacing:.04em;
}
.marsata-ai-fab[data-assistant-error='true']::after{content:'!';background:#b42318}

body:is(.ui-home,.ui-customer) .ts-agent{
  --ts-accent:#f47f67;
  --ts-ink:#173f38;
  --ts-muted:#71877f;
  --ts-line:#dce9e3;
  --ts-surface:#fff;
  --ts-soft:#f4f9f5;
  right:20px;
  bottom:20px;
  font-family:'DM Sans',Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}
body:is(.ui-home,.ui-customer) .ts-agent .ts-launcher{
  border:1px solid rgba(255,255,255,.28);
  background:linear-gradient(135deg,#174e47,#0b675a 68%,#f47f67 160%);
  box-shadow:0 16px 38px rgba(12,69,59,.28);
  padding:13px 18px;
}
body:is(.ui-home,.ui-customer) .ts-agent .ts-launcher:hover{box-shadow:0 19px 44px rgba(12,69,59,.35)}
body:is(.ui-home,.ui-customer) .ts-agent .ts-launcher-pulse{background:#ffd2c7;box-shadow:0 0 0 4px rgba(255,255,255,.18)}
body:is(.ui-home,.ui-customer) .ts-agent .ts-panel{
  width:min(420px,calc(100vw - 32px));
  height:min(660px,calc(100dvh - 40px));
  border:1px solid #d8e8e1;
  border-radius:24px;
  box-shadow:0 24px 85px rgba(18,62,56,.25),0 5px 18px rgba(18,62,56,.09);
}
body:is(.ui-home,.ui-customer) .ts-agent .ts-header{background:linear-gradient(125deg,#123f39,#17665a);min-height:78px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-avatar{background:rgba(244,127,103,.2);border-color:rgba(255,204,194,.55);color:#ffd8cf}
body:is(.ui-home,.ui-customer) .ts-agent .ts-heading small{color:#d7ebe5}
body:is(.ui-home,.ui-customer) .ts-agent .ts-online-dot{background:#f7a58f}
body:is(.ui-home,.ui-customer) .ts-agent .ts-settings-button{display:none}
body:is(.ui-home,.ui-customer) .ts-agent .ts-messages{background:linear-gradient(#f8fbf8,#fff)}
body:is(.ui-home,.ui-customer) .ts-agent .ts-msg-avatar{background:#fee9e4;color:#db6d56}
body:is(.ui-home,.ui-customer) .ts-agent .ts-msg-user .ts-bubble{background:#17675b}
body:is(.ui-home,.ui-customer) .ts-agent .ts-bubble{background:#eef6f1;color:#244a42}
body:is(.ui-home,.ui-customer) .ts-agent .ts-compose{border-color:#d7e7df;background:#f6faf7}
body:is(.ui-home,.ui-customer) .ts-agent .ts-send{background:#f47f67}
body:is(.ui-home,.ui-customer) .ts-agent .ts-send:hover{background:#d96852}
body:is(.ui-home,.ui-customer) .ts-agent .ts-privacy-mark{color:#f47f67}
body:is(.ui-home,.ui-customer) .ts-agent .ts-readonly-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:5px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-readonly-action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  max-width:100%;
  padding:7px 11px;
  border:1px solid #efb5a8;
  border-radius:999px;
  background:#fff5f2;
  color:#b95542;
  font-size:11px;
  font-weight:800;
  line-height:1.25;
  text-decoration:none;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body:is(.ui-home,.ui-customer) .ts-agent .ts-readonly-action:hover{background:#f47f67;border-color:#f47f67;color:#fff}
body:is(.ui-home,.ui-customer) .ts-agent .ts-readonly-action:focus-visible{outline:3px solid rgba(244,127,103,.35);outline-offset:2px}

@media (prefers-color-scheme:dark){
  body:is(.ui-home,.ui-customer):not([data-theme="light"]) .ts-agent{--ts-ink:#edf7f3;--ts-muted:#a9bdb6;--ts-line:#34594f;--ts-surface:#153a34;--ts-soft:#1b453e}
  body:is(.ui-home,.ui-customer):not([data-theme="light"]) .ts-agent .ts-panel{background:#153a34;border-color:#34594f}
  body:is(.ui-home,.ui-customer):not([data-theme="light"]) .ts-agent .ts-messages{background:linear-gradient(#173d36,#12332e)}
  body:is(.ui-home,.ui-customer):not([data-theme="light"]) .ts-agent .ts-bubble{background:#244d45;color:#edf7f3}
  body:is(.ui-home,.ui-customer):not([data-theme="light"]) .ts-agent .ts-compose{background:#21483f;border-color:#3d655b}
  body:is(.ui-home,.ui-customer):not([data-theme="light"]) .ts-agent .ts-compose input{color:#f3faf7}
  body:is(.ui-home,.ui-customer):not([data-theme="light"]) .ts-agent .ts-footer,body:is(.ui-home,.ui-customer):not([data-theme="light"]) .ts-agent .ts-suggestions{background:#153a34}
  body:is(.ui-home,.ui-customer):not([data-theme="light"]) .ts-agent .ts-readonly-action{background:#3b352f;border-color:#8f5e51;color:#ffc5b7}
}
body:is(.ui-home,.ui-customer)[data-theme="dark"] .ts-agent{--ts-ink:#edf7f3;--ts-muted:#a9bdb6;--ts-line:#34594f;--ts-surface:#153a34;--ts-soft:#1b453e}
body:is(.ui-home,.ui-customer)[data-theme="dark"] .ts-agent .ts-panel{background:#153a34;border-color:#34594f}
body:is(.ui-home,.ui-customer)[data-theme="dark"] .ts-agent .ts-messages{background:linear-gradient(#173d36,#12332e)}
body:is(.ui-home,.ui-customer)[data-theme="dark"] .ts-agent .ts-bubble{background:#244d45;color:#edf7f3}

@media(max-width:540px){
  .marsata-ai-fab{right:14px;bottom:14px;width:56px;height:56px}
  body:is(.ui-home,.ui-customer) .ts-agent{right:10px;bottom:10px}
  body:is(.ui-home,.ui-customer) .ts-agent .ts-panel{width:calc(100vw - 20px);height:calc(100dvh - 20px);border-radius:20px}
  body:is(.ui-home,.ui-customer) .ts-agent .ts-launcher{padding:12px 15px}
  body:is(.ui-home,.ui-customer) .ts-agent .ts-readonly-actions{display:grid;grid-template-columns:1fr}
  body:is(.ui-home,.ui-customer) .ts-agent .ts-readonly-action{width:100%}
}

/* Phase 124: one launcher only, with the host button synchronized to panel visibility. */
.marsata-ai-fab[hidden],body:has(.ts-agent .ts-panel:not([hidden])) .marsata-ai-fab[data-marsata-ai-launcher]{display:none!important}
body:is(.ui-home,.ui-customer) .ts-agent.ts-is-open{right:clamp(12px,2vw,28px);bottom:clamp(12px,2vh,24px)}
body:is(.ui-home,.ui-customer) .ts-agent.ts-travel-enabled .ts-panel{
  width:min(480px,calc(100vw - 28px));
  height:min(710px,calc(100dvh - 28px));
  max-height:calc(100dvh - 28px);
  min-height:0;
}
body:is(.ui-home,.ui-customer) .ts-agent .ts-header{min-height:64px;padding:9px 12px;gap:8px;flex-shrink:0}
body:is(.ui-home,.ui-customer) .ts-agent .ts-avatar{height:37px;width:37px;border-radius:12px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-heading strong{font-size:14px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-heading small{font-size:11px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-icon-button{min-width:40px;min-height:40px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-messages{min-height:0;padding:13px 12px 10px;gap:10px;scrollbar-gutter:stable}
body:is(.ui-home,.ui-customer) .ts-agent .ts-bubble{font-size:14px;line-height:1.5}
body:is(.ui-home,.ui-customer) .ts-agent .ts-msg-meta{font-size:11px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-compose{flex-shrink:0;margin:0 10px 3px;padding:5px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-compose input{font-size:14px;min-height:42px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-send{min-width:44px;min-height:44px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-footer{flex-shrink:0;min-height:27px;padding:4px 10px 7px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-clear{min-height:30px;padding:4px 6px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-suggestions{flex-shrink:0;padding:6px 12px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-travel-tabs{padding:6px 10px;gap:4px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-travel-tab{min-height:40px;padding:7px 4px;font-size:12px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-travel-team-host{padding:4px 9px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-travel-body{min-height:0;scrollbar-gutter:stable;padding:12px}
body:is(.ui-home,.ui-customer) .ts-agent .ts-travel-hero{min-height:104px}
body:is(.ui-home,.ui-customer) .ts-agent :is(button,input,select,textarea):focus-visible{outline:3px solid #f47f67;outline-offset:2px}
@media(max-width:600px){
  body:is(.ui-home,.ui-customer) .ts-agent.ts-is-open{left:0;right:0;bottom:0;top:0;}
  body:is(.ui-home,.ui-customer) .ts-agent.ts-travel-enabled .ts-panel,
  body:is(.ui-home,.ui-customer) .ts-agent.ts-travel-enabled[data-travel-mode=explore] .ts-panel,
  body:is(.ui-home,.ui-customer) .ts-agent.ts-travel-enabled[data-travel-mode=plan] .ts-panel{
    width:100vw;height:100dvh;max-height:100dvh;border-radius:0;border:0;
  }
  body:is(.ui-home,.ui-customer) .ts-agent .ts-header{padding-top:max(9px,env(safe-area-inset-top))}
  body:is(.ui-home,.ui-customer) .ts-agent .ts-footer{padding-bottom:max(7px,env(safe-area-inset-bottom))}
}

/* TinySite public header cleanup (2026-11-21): keep title and close action only.
   Retain hidden language and settings controls in the DOM so existing JS can
   continue its language synchronization without any engine changes. */
body:is(.ui-home,.ui-customer) .ts-agent .ts-header .ts-heading small,
body:is(.ui-home,.ui-customer) .ts-agent .ts-header .ts-mode,
body:is(.ui-home,.ui-customer) .ts-agent .ts-header .ts-language-select,
body:is(.ui-home,.ui-customer) .ts-agent .ts-header .ts-settings-button {
  display: none !important;
}
