/* BizPilot Chat v2 — dedicated ChatGPT-style page, cream UI, responsive */
#ownerAiChat,#ownerAiChat *{box-sizing:border-box}
:root{--bp-cream:#fbf7ee;--bp-paper:#fffdf8;--bp-line:#e7e0d4;--bp-text:#0f172a;--bp-muted:#64748b;--bp-green:#22c55e;--bp-green-soft:#e8f8ec}

/* Route contract: this page must never paint itself on Home/other routes. */
html body #app #ownerAiChat.owner-ai-chat-page.owner-route-hidden{display:none!important}
html body #app #ownerAiChat.owner-ai-chat-page.owner-route-page{display:flex;flex-direction:column}
html[data-owner-page="chat"],html[data-owner-page="chat"] body{height:100%;overflow:hidden!important;background:var(--bp-cream)!important;color:var(--bp-text)!important}
html[data-owner-page="chat"] #app{height:100dvh!important;background:var(--bp-cream)!important}
html[data-owner-page="chat"] #app .main{height:100dvh!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;background:var(--bp-cream)!important}
html[data-owner-page="chat"] #app .content{flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;padding:0!important;background:var(--bp-cream)!important}
html[data-owner-page="chat"] #app .content>.grid{display:none!important}

/* Page 2 sidebar only. Page 1/master logo remains unchanged. */
html[data-owner-page="chat"] #app .sidebar{background:rgba(255,253,248,.98)!important;border-right:1px solid var(--bp-line)!important;box-shadow:8px 0 28px rgba(15,23,42,.05)!important;color:var(--bp-text)!important}
html[data-owner-page="chat"] #app .logoBox{display:flex!important;align-items:center!important;gap:10px!important;padding:8px 8px 16px!important;border-bottom:1px solid var(--bp-line)!important}
html[data-owner-page="chat"] #app .logoBox .owner-brand-master,html[data-owner-page="chat"] #app .logoBox .logoText{display:none!important}
html[data-owner-page="chat"] #app .logoBox:before{content:"";display:block;flex:0 0 48px;width:48px;height:48px;background:url('/owner/bizpilot-chat-logo-v2.svg') center/contain no-repeat}
html[data-owner-page="chat"] #app .logoBox:after{content:"BizPilot OS";display:block;font-size:22px;line-height:1;font-weight:800;letter-spacing:-.05em;color:var(--bp-text);white-space:nowrap}
html[data-owner-page="chat"] #app .nav{background:transparent!important;color:var(--bp-text)!important}
html[data-owner-page="chat"] #app .nav .owner-nav-section{color:#94a3b8!important}
html[data-owner-page="chat"] #app .nav .owner-nav-link{color:#334155!important;border-color:transparent!important;background:transparent!important;box-shadow:none!important}
html[data-owner-page="chat"] #app .nav .owner-nav-link:hover{background:#f3efe7!important;color:var(--bp-text)!important}
html[data-owner-page="chat"] #app .nav .owner-nav-link.active{background:var(--bp-green-soft)!important;border-color:#c7eecf!important;color:#166534!important;box-shadow:none!important}
html[data-owner-page="chat"] #app .owner-nav-icon{color:#475569!important;text-shadow:none!important}
html[data-owner-page="chat"] #app .owner-nav-link.active .owner-nav-icon{color:#15803d!important;text-shadow:none!important}
html[data-owner-page="chat"] #app .owner-nav-copy b{color:inherit!important}
html[data-owner-page="chat"] #app .owner-nav-copy small{color:#94a3b8!important}
html[data-owner-page="chat"] #app .promo{background:#fff!important;border:1px solid var(--bp-line)!important;box-shadow:none!important;color:var(--bp-text)!important}

/* Sidebar toggle is the existing Owner control; on Chat it collapses the labelled rail. */
@media(min-width:651px){
  html[data-owner-page="chat"] #app .shell{grid-template-columns:270px minmax(0,1fr)!important}
  html[data-owner-page="chat"] #app .sidebar{width:270px!important;min-width:270px!important;max-width:270px!important;transition:width .22s ease,min-width .22s ease!important}
  html[data-owner-page="chat"] #app.owner-sidebar-open .shell{grid-template-columns:76px minmax(0,1fr)!important}
  html[data-owner-page="chat"] #app.owner-sidebar-open .sidebar{width:76px!important;min-width:76px!important;max-width:76px!important;padding-left:10px!important;padding-right:10px!important}
  html[data-owner-page="chat"] #app.owner-sidebar-open .logoBox{justify-content:center!important;padding-left:4px!important;padding-right:4px!important}
  html[data-owner-page="chat"] #app.owner-sidebar-open .logoBox:after{display:none!important}
  html[data-owner-page="chat"] #app.owner-sidebar-open .logoBox:before{width:48px!important;flex-basis:48px!important}
  html[data-owner-page="chat"] #app.owner-sidebar-open .owner-nav-copy,html[data-owner-page="chat"] #app.owner-sidebar-open .owner-nav-arrow{display:none!important}
  html[data-owner-page="chat"] #app.owner-sidebar-open .nav .owner-nav-link{justify-content:center!important;padding-left:6px!important;padding-right:6px!important}
  html[data-owner-page="chat"] #app .owner-sidebar-toggle{display:grid!important;place-items:center!important;position:absolute!important;left:214px!important;top:14px!important;width:40px!important;height:40px!important;padding:0!important;border:1px solid var(--bp-line)!important;border-radius:12px!important;background:#fff!important;color:#334155!important;box-shadow:0 4px 14px rgba(15,23,42,.07)!important;font-size:20px!important;line-height:1!important}
  html[data-owner-page="chat"] #app.owner-sidebar-open .owner-sidebar-toggle{left:18px!important;opacity:0!important;pointer-events:auto!important}
  html[data-owner-page="chat"] #app .owner-sidebar-backdrop{display:none!important}
}

/* Page 2 header and title. */
html[data-owner-page="chat"] #app .hero{flex:0 0 auto!important;background:var(--bp-cream)!important;border-bottom:1px solid var(--bp-line)!important;box-shadow:none!important;padding:18px 28px 14px!important}
html[data-owner-page="chat"] #app .hero .eyebrow,html[data-owner-page="chat"] #app .hero h2,html[data-owner-page="chat"] #app .hero p{display:none!important}
html[data-owner-page="chat"] #app .hero h1{margin:0!important;font-size:0!important;line-height:1!important}
html[data-owner-page="chat"] #app .hero h1:after{content:"BizPilot Chat";display:inline-block;font-size:clamp(34px,4.2vw,54px);line-height:1;font-weight:850;letter-spacing:-.055em;color:var(--bp-text)}
html[data-owner-page="chat"] #app .topbar{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important}
html[data-owner-page="chat"] #app .controls .badge,html[data-owner-page="chat"] #app .controls button{background:#fff!important;border:1px solid var(--bp-line)!important;color:#334155!important;box-shadow:0 3px 12px rgba(15,23,42,.05)!important}
html[data-owner-page="chat"] #app .controls .badge.live{background:var(--bp-green-soft)!important;border-color:#c7eecf!important;color:#166534!important}

/* Dedicated ChatGPT-style workspace: one sidebar + one main conversation column. */
#app #ownerAiChat.owner-ai-chat-page{position:relative!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;overflow:hidden!important;background:var(--bp-cream)!important;box-shadow:none!important;flex:1 1 auto;min-height:0;max-height:none}
#app #ownerAiChat .owner-ai-chat-page-head,#app #ownerAiChat .owner-ai-chat-context-panel,#app #ownerAiChat .owner-ai-chat-history-panel{display:none!important}
#app #ownerAiChat .owner-ai-chat-layout{display:block!important;min-height:0!important;height:100%!important;overflow:hidden!important}
#app #ownerAiChat .owner-ai-chat-center{display:flex!important;flex-direction:column!important;width:100%!important;height:100%!important;min-height:0!important;border:0!important;border-radius:0!important;background:var(--bp-cream)!important;box-shadow:none!important;overflow:hidden!important}
#app #ownerAiChat .owner-ai-chat-thread-head{display:none!important}

/* Scrollable conversation; the composer stays at the bottom. */
#app #ownerAiChat .owner-ai-chat-messages{flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;touch-action:pan-y!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:thin!important;scrollbar-color:#cbd5e1 transparent!important;background:var(--bp-cream)!important;padding:26px clamp(16px,6vw,92px) 118px!important}
#app #ownerAiChat .owner-ai-chat-message{margin:0 auto 18px!important;max-width:900px!important}
#app #ownerAiChat .owner-ai-chat-message-main{display:flex!important;gap:10px!important;align-items:flex-start!important}
#app #ownerAiChat .owner-ai-chat-message.user .owner-ai-chat-message-main{flex-direction:row-reverse!important}
#app #ownerAiChat .owner-ai-chat-avatar{width:34px!important;height:34px!important;flex:0 0 34px!important;border-radius:50%!important;display:grid!important;place-items:center!important;box-shadow:none!important}
#app #ownerAiChat .owner-ai-chat-avatar-ai{background:#fff!important;border:1px solid var(--bp-line)!important}
#app #ownerAiChat .owner-ai-chat-avatar-owner{background:var(--bp-green-soft)!important;border:1px solid #c7eecf!important;color:#166534!important}
#app #ownerAiChat .owner-ai-chat-avatar-system{background:#fff8e8!important;border:1px solid #f3dfaa!important;color:#9a6b10!important}
#app #ownerAiChat .owner-ai-chat-message-stack{max-width:min(85%,820px)!important;align-items:flex-start!important}
#app #ownerAiChat .owner-ai-chat-message.user .owner-ai-chat-message-stack{align-items:flex-end!important}
#app #ownerAiChat .owner-ai-chat-message-label{margin:0 4px 5px!important;color:#64748b!important;font-size:12px!important;font-weight:750!important;text-shadow:none!important}
#app #ownerAiChat .owner-ai-chat-message.assistant .owner-ai-chat-message-label{color:#15803d!important}
#app #ownerAiChat .owner-ai-chat-message.user .owner-ai-chat-message-label{color:#166534!important}
#app #ownerAiChat .owner-ai-chat-bubble{padding:13px 16px!important;border:1px solid var(--bp-line)!important;border-radius:18px!important;background:#fff!important;color:var(--bp-text)!important;font-size:15px!important;line-height:1.62!important;box-shadow:0 5px 18px rgba(15,23,42,.045)!important}
#app #ownerAiChat .owner-ai-chat-message.user .owner-ai-chat-bubble{background:var(--bp-green-soft)!important;border-color:#c7eecf!important;color:#0f5132!important}
#app #ownerAiChat .owner-ai-chat-message.system .owner-ai-chat-bubble{background:#fff8e8!important;border-color:#f3dfaa!important;color:#5f4a1b!important}
#app #ownerAiChat .owner-ai-chat-message-foot{margin:5px 4px 0!important}
#app #ownerAiChat .owner-ai-chat-message-foot small{color:#94a3b8!important}
#app #ownerAiChat .owner-ai-chat-message-actions button{color:#64748b!important;background:transparent!important;box-shadow:none!important;border:0!important}
#app #ownerAiChat .owner-ai-chat-message-actions button:hover{background:#f3efe7!important;color:#0f172a!important;box-shadow:none!important}
#app #ownerAiChat .owner-ai-chat-quick-actions{display:flex!important;gap:8px!important;flex-wrap:wrap!important;max-width:900px!important;margin:0 auto!important;padding:0 0 12px!important}
#app #ownerAiChat .owner-ai-chat-quick-actions button{min-height:38px!important;padding:0 14px!important;border:1px solid var(--bp-line)!important;border-radius:999px!important;background:#fff!important;color:#334155!important;font-size:12px!important;font-weight:700!important;box-shadow:0 2px 9px rgba(15,23,42,.04)!important}
#app #ownerAiChat .owner-ai-chat-quick-actions button:hover{border-color:#b7d9bf!important;background:#f8fcf8!important;color:#166534!important}
#app #ownerAiChat .owner-ai-chat-command-preview{max-width:900px!important;margin:0 auto 10px!important;border:1px solid #ddd6fe!important;border-radius:14px!important;background:#faf7ff!important;padding:11px 13px!important}
#app #ownerAiChat .owner-ai-chat-command-preview span{color:#7c3aed!important}
#app #ownerAiChat .owner-ai-chat-command-preview strong{color:#1f2937!important}
#app #ownerAiChat .owner-ai-chat-command-preview em{color:#64748b!important}

/* Composer is locked to the bottom while .owner-ai-chat-messages scrolls. */
#app #ownerAiChat .owner-ai-chat-form{position:sticky!important;bottom:0!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important;margin:0!important;padding:12px max(16px,6vw) max(12px,env(safe-area-inset-bottom))!important;border-top:1px solid var(--bp-line)!important;background:rgba(251,247,238,.96)!important;backdrop-filter:blur(12px)!important;box-shadow:0 -8px 22px rgba(15,23,42,.05)!important}
#app #ownerAiChat .owner-ai-chat-form textarea{min-height:54px!important;max-height:150px!important;width:100%!important;padding:14px 15px!important;resize:none!important;border:1px solid #ddd8cd!important;border-radius:16px!important;outline:none!important;background:#fff!important;color:var(--bp-text)!important;font-size:15px!important;line-height:1.5!important;box-shadow:0 2px 10px rgba(15,23,42,.04)!important}
#app #ownerAiChat .owner-ai-chat-form textarea::placeholder{color:#94a3b8!important}
#app #ownerAiChat .owner-ai-chat-form textarea:focus{border-color:#9fd2ac!important;box-shadow:0 0 0 3px rgba(34,197,94,.10)!important}
#app #ownerAiChat .owner-ai-chat-send{min-width:72px!important;border:0!important;border-radius:14px!important;background:var(--bp-green)!important;color:#fff!important;font-size:13px!important;font-weight:800!important;box-shadow:0 4px 14px rgba(34,197,94,.22)!important}
#app #ownerAiChat .owner-ai-chat-send:disabled{opacity:.55!important}

/* No chat content on Owner Home; it remains a dedicated route only. */
html[data-owner-page="home"] #ownerAiChat{display:none!important}

/* iPad: preserve full chat height and make the composer ergonomic in portrait and landscape. */
@media(min-width:651px) and (max-width:1180px){
  html[data-owner-page="chat"] #app .hero{padding-left:20px!important;padding-right:20px!important}
  #app #ownerAiChat .owner-ai-chat-messages{padding-left:22px!important;padding-right:22px!important}
  #app #ownerAiChat .owner-ai-chat-form{padding-left:22px!important;padding-right:22px!important}
}

/* Mobile: sidebar is a drawer, chat is full-height, and the composer remains bottom-locked. */
@media(max-width:650px){
  html[data-owner-page="chat"] #app .main{height:100dvh!important}
  html[data-owner-page="chat"] #app .hero{padding:62px 14px 12px!important}
  html[data-owner-page="chat"] #app .hero h1:after{font-size:34px!important}
  html[data-owner-page="chat"] #app .owner-sidebar-toggle{top:12px!important;left:64px!important;width:42px!important;height:42px!important;background:#fff!important;border:1px solid var(--bp-line)!important;color:#334155!important;box-shadow:0 4px 12px rgba(15,23,42,.06)!important}
  html[data-owner-page="chat"] #app.owner-sidebar-open .owner-sidebar-toggle{left:12px!important}
  html[data-owner-page="chat"] #app .sidebar{width:min(88vw,320px)!important;background:#fffdf8!important;border-right:1px solid var(--bp-line)!important;box-shadow:22px 0 56px rgba(15,23,42,.16)!important}
  html[data-owner-page="chat"] #app .owner-sidebar-open .sidebar{transform:translateX(0)!important}
  html[data-owner-page="chat"] #app .owner-sidebar-backdrop{background:rgba(15,23,42,.18)!important;backdrop-filter:blur(3px)!important}
  html[data-owner-page="chat"] #app .logoBox:before{width:46px!important;height:46px!important;flex-basis:46px!important}
  html[data-owner-page="chat"] #app .logoBox:after{font-size:21px!important}
  #app #ownerAiChat .owner-ai-chat-messages{padding:18px 14px 112px!important}
  #app #ownerAiChat .owner-ai-chat-message{margin-bottom:14px!important}
  #app #ownerAiChat .owner-ai-chat-message-stack{max-width:88%!important}
  #app #ownerAiChat .owner-ai-chat-bubble{font-size:14px!important;padding:12px 14px!important}
  #app #ownerAiChat .owner-ai-chat-quick-actions{max-width:none!important;padding:0 0 10px!important;overflow-x:auto!important;flex-wrap:nowrap!important;scrollbar-width:none!important}
  #app #ownerAiChat .owner-ai-chat-quick-actions::-webkit-scrollbar{display:none!important}
  #app #ownerAiChat .owner-ai-chat-quick-actions button{flex:0 0 auto!important}
  #app #ownerAiChat .owner-ai-chat-form{grid-template-columns:minmax(0,1fr) auto!important;padding:9px 12px max(10px,env(safe-area-inset-bottom))!important}
  #app #ownerAiChat .owner-ai-chat-form textarea{min-height:50px!important;font-size:14px!important}
  #app #ownerAiChat .owner-ai-chat-send{min-width:58px!important}
}

@media(prefers-reduced-motion:reduce){#ownerAiChat *,#ownerAiChat *:before,#ownerAiChat *:after{animation:none!important;transition:none!important}}


/* v1.4 — approved ChatGPT-style conversation-history sidebar.
   Chat route only: Owner navigation stays untouched everywhere else. */
html[data-owner-page="chat"] #app>.shell>.sidebar{display:none!important}
html[data-owner-page="chat"] #app>.owner-sidebar-toggle,
html[data-owner-page="chat"] #app>.owner-sidebar-backdrop{display:none!important}
html[data-owner-page="chat"] #app .shell{display:block!important;grid-template-columns:1fr!important}
html[data-owner-page="chat"] #app .main{width:100%!important;max-width:none!important}
html[data-owner-page="chat"] #app .hero{display:none!important}
html[data-owner-page="chat"] #app .content{height:100dvh!important}

#app #ownerAiChat .owner-ai-chat-layout{
  display:grid!important;
  grid-template-columns:320px minmax(0,1fr)!important;
  width:100%!important;
  height:100dvh!important;
  background:#fff!important;
}
#app #ownerAiChat .owner-ai-chat-history-panel{
  display:flex!important;
  flex-direction:column!important;
  min-width:0!important;
  height:100dvh!important;
  padding:22px 16px 16px!important;
  overflow:hidden!important;
  background:linear-gradient(180deg,#061224 0%,#04101e 100%)!important;
  border:0!important;
  border-right:1px solid #18304b!important;
  color:#f8fafc!important;
  box-shadow:none!important;
}
#app #ownerAiChat .owner-ai-chat-history-brand{
  display:flex!important;align-items:center!important;gap:12px!important;
  padding:4px 6px 18px!important;
}
#app #ownerAiChat .owner-ai-chat-history-brand-icon{
  display:grid!important;place-items:center!important;width:48px!important;height:48px!important;flex:0 0 48px!important;
  border:1px solid #b04cff!important;border-radius:15px!important;background:#0a1630!important;
  color:#d96cff!important;box-shadow:0 0 12px #a020f088,0 0 26px #8b2cff55!important;
}
#app #ownerAiChat .owner-ai-chat-history-brand-icon svg{width:30px!important;height:30px!important;filter:drop-shadow(0 0 5px #d96cff)!important}
#app #ownerAiChat .owner-ai-chat-history-brand b{display:block!important;font-size:22px!important;line-height:1.15!important;color:#fff!important}
#app #ownerAiChat .owner-ai-chat-history-brand small{display:block!important;margin-top:3px!important;font-size:13px!important;color:#9fb0c5!important}
#app #ownerAiChat .owner-ai-chat-new{
  display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;
  width:100%!important;min-height:50px!important;margin:0 0 12px!important;padding:0 16px!important;
  border:1px solid #8247ff!important;border-radius:14px!important;background:linear-gradient(90deg,#132553,#271356)!important;
  color:#fff!important;font-size:17px!important;font-weight:800!important;box-shadow:0 0 18px #7c3aed33!important;
}
#app #ownerAiChat .owner-ai-chat-search{
  display:flex!important;align-items:center!important;gap:10px!important;min-height:46px!important;
  margin:0 0 14px!important;padding:0 13px!important;border:1px solid #263e58!important;border-radius:13px!important;background:#0b2034!important;
}
#app #ownerAiChat .owner-ai-chat-search span{font-size:24px!important;color:#dbeafe!important}
#app #ownerAiChat .owner-ai-chat-search input{
  width:100%!important;border:0!important;outline:0!important;background:transparent!important;color:#fff!important;
  font:600 15px/1.4 system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif!important;
}
#app #ownerAiChat .owner-ai-chat-search input::placeholder{color:#91a5bc!important}
#app #ownerAiChat .owner-ai-chat-history-caption{padding:2px 7px 8px!important;color:#8fa5bc!important;font-size:13px!important;font-weight:750!important}
#app #ownerAiChat .owner-ai-chat-history-list{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;padding:0 2px 10px!important}
#app #ownerAiChat .owner-ai-chat-history-item{
  display:grid!important;grid-template-columns:26px minmax(0,1fr)!important;align-items:center!important;gap:10px!important;
  width:100%!important;min-height:58px!important;margin:2px 0!important;padding:9px 10px!important;border:1px solid transparent!important;border-radius:12px!important;
  background:transparent!important;color:#e5edf7!important;text-align:left!important;box-shadow:none!important;
}
#app #ownerAiChat .owner-ai-chat-history-item:hover{background:#0b2034!important}
#app #ownerAiChat .owner-ai-chat-history-item.active{background:linear-gradient(90deg,#25205a,#351d69)!important;border-color:#6d3ee8!important}
#app #ownerAiChat .owner-ai-chat-history-icon{font-size:19px!important;color:#e5e7eb!important}
#app #ownerAiChat .owner-ai-chat-history-copy{min-width:0!important}
#app #ownerAiChat .owner-ai-chat-history-copy b{
  display:block!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  color:#fff!important;font-size:16px!important;line-height:1.35!important;font-weight:720!important;
}
#app #ownerAiChat .owner-ai-chat-history-copy small{
  display:block!important;margin-top:2px!important;color:#8fa5bc!important;font-size:12px!important;line-height:1.25!important;
}
#app #ownerAiChat .owner-ai-chat-history-empty{padding:18px 10px!important;color:#91a5bc!important;font-size:14px!important}
#app #ownerAiChat .owner-ai-chat-back-owner{
  display:flex!important;align-items:center!important;gap:9px!important;min-height:46px!important;padding:0 12px!important;
  border:1px solid #1e7490!important;border-radius:13px!important;background:#092137!important;color:#dffaff!important;text-decoration:none!important;
  font-size:14px!important;
}
#app #ownerAiChat .owner-ai-chat-back-owner span{font-size:21px!important;color:#5eead4!important}

#app #ownerAiChat .owner-ai-chat-center{background:#fff!important;color:#111827!important}
#app #ownerAiChat .owner-ai-chat-messages{background:#fff!important;padding-top:34px!important}
#app #ownerAiChat .owner-ai-chat-message{max-width:960px!important}
#app #ownerAiChat .owner-ai-chat-message-label{font-size:14px!important}
#app #ownerAiChat .owner-ai-chat-bubble{
  font-family:system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif!important;
  font-size:18px!important;line-height:1.68!important;color:#111827!important;
}
#app #ownerAiChat .owner-ai-chat-message.user .owner-ai-chat-bubble{background:#eee7ff!important;border-color:#ddd0ff!important;color:#24124d!important}
#app #ownerAiChat .owner-ai-chat-message.system .owner-ai-chat-bubble{background:#fffaf0!important;color:#4b3a15!important}
#app #ownerAiChat .owner-ai-chat-quick-actions button{font-size:14px!important}
#app #ownerAiChat .owner-ai-chat-form{background:rgba(255,255,255,.97)!important}
#app #ownerAiChat .owner-ai-chat-form textarea{
  font-family:system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif!important;
  font-size:17px!important;line-height:1.55!important;color:#111827!important;background:#fff!important;
}
#app #ownerAiChat .owner-ai-chat-send{font-size:15px!important}


@media(max-width:1100px){
  #app #ownerAiChat .owner-ai-chat-layout{display:block!important;position:relative!important}
  #app #ownerAiChat .owner-ai-chat-history-toggle{display:grid!important}
  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-backdrop{display:block!important}
  #app #ownerAiChat .owner-ai-chat-history-panel{
    position:absolute!important;left:0!important;top:0!important;bottom:0!important;z-index:20!important;
    width:min(84vw,340px)!important;transform:translateX(-104%)!important;transition:transform .2s ease!important;
    box-shadow:20px 0 55px #0006!important;
  }
  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-panel{transform:translateX(0)!important}
  #app #ownerAiChat .owner-ai-chat-center:before{display:grid!important}
  #app #ownerAiChat .owner-ai-chat-messages{padding-top:72px!important}
}

/* Real Chat history drawer control — same contract on iPhone and iPad. */
#app #ownerAiChat .owner-ai-chat-history-toggle{
  display:none!important;position:absolute!important;left:14px!important;top:14px!important;z-index:31!important;
  width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;
  border:1px solid #d8dee8!important;border-radius:13px!important;background:#fff!important;color:#172033!important;
  box-shadow:0 5px 18px #0f172a12!important;cursor:pointer!important;
}
#app #ownerAiChat .owner-ai-chat-history-toggle span,
#app #ownerAiChat .owner-ai-chat-history-toggle span:before,
#app #ownerAiChat .owner-ai-chat-history-toggle span:after{
  display:block;width:18px;height:2px;border-radius:99px;background:currentColor;content:"";
}
#app #ownerAiChat .owner-ai-chat-history-toggle span{position:relative;margin:auto}
#app #ownerAiChat .owner-ai-chat-history-toggle span:before{position:absolute;left:0;top:-6px}
#app #ownerAiChat .owner-ai-chat-history-toggle span:after{position:absolute;left:0;top:6px}
#app #ownerAiChat .owner-ai-chat-history-backdrop{
  display:none!important;position:absolute!important;inset:0!important;z-index:18!important;padding:0!important;border:0!important;
  background:rgba(15,23,42,.28)!important;backdrop-filter:blur(2px)!important;
}


/* v1.6 — persistent return-to-home control on AI Chat. */
#app #ownerAiChat .owner-ai-chat-home{
  position:absolute!important;
  left:68px!important;
  top:14px!important;
  z-index:31!important;
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  min-height:44px!important;
  padding:0 14px!important;
  border:1px solid #d8dee8!important;
  border-radius:13px!important;
  background:#fff!important;
  color:#172033!important;
  text-decoration:none!important;
  box-shadow:0 5px 18px #0f172a12!important;
  font-family:system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif!important;
  font-size:15px!important;
  font-weight:750!important;
}
#app #ownerAiChat .owner-ai-chat-home span{
  font-size:20px!important;
  line-height:1!important;
}
#app #ownerAiChat .owner-ai-chat-home b{
  display:block!important;
  font-size:15px!important;
  line-height:1!important;
  white-space:nowrap!important;
}
@media(max-width:650px){
  #app #ownerAiChat .owner-ai-chat-home{
    left:64px!important;
    padding:0 12px!important;
  }
}


/* v1.7 — authoritative iPad/iPhone Chat history drawer.
   Loaded last to override older hidden/pseudo control rules. */
@media(max-width:1100px){
  #app #ownerAiChat .owner-ai-chat-history-toggle{
    display:grid!important;
    place-items:center!important;
    position:fixed!important;
    left:max(14px,env(safe-area-inset-left))!important;
    top:max(14px,env(safe-area-inset-top))!important;
    z-index:34!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
  }
  #app #ownerAiChat .owner-ai-chat-center:before{display:none!important}

  #app #ownerAiChat .owner-ai-chat-history-backdrop{
    position:fixed!important;
    inset:0!important;
    z-index:32!important;
  }
  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-backdrop{
    display:block!important;
  }

  #app #ownerAiChat .owner-ai-chat-history-panel{
    display:flex!important;
    position:fixed!important;
    left:0!important;
    top:0!important;
    bottom:0!important;
    z-index:33!important;
    width:min(84vw,340px)!important;
    min-width:min(84vw,340px)!important;
    max-width:min(84vw,340px)!important;
    height:100dvh!important;
    transform:translateX(-104%)!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    transition:transform .2s ease!important;
    box-shadow:20px 0 55px #0008!important;
  }
  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-panel{
    transform:translateX(0)!important;
  }

  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-brand,
  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-new,
  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-search,
  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-caption,
  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-list,
  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-back-owner{
    visibility:visible!important;
    opacity:1!important;
  }

  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-copy,
  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-copy b,
  #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-copy small{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    max-width:none!important;
  }

  #app #ownerAiChat .owner-ai-chat-home{
    position:fixed!important;
    left:68px!important;
    top:max(14px,env(safe-area-inset-top))!important;
    z-index:34!important;
  }
}

/* v1.8 — hide data freshness strip on AI Chat only. */
html[data-owner-page="chat"] #app #ownerDataFreshnessLegend{
  display:none!important;
}


/* v1.8 — dedicated chat shell: never stack the Owner sidebar on AI Chat.
   AI Chat owns its own history rail + two compact controls only. */
html[data-owner-page="chat"] body #app .shell{
  display:block!important;
  grid-template-columns:1fr!important;
  width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
}
html[data-owner-page="chat"] body #app>.owner-sidebar-toggle,
html[data-owner-page="chat"] body #app>.owner-sidebar-backdrop,
html[data-owner-page="chat"] body #app .sidebar{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
html[data-owner-page="chat"] body #app .main{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
}
html[data-owner-page="chat"] body #app .hero{
  display:none!important;
}
html[data-owner-page="chat"] body #app .content{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
}

/* Two chat controls: history hamburger + compact home icon. */
html[data-owner-page="chat"] #app #ownerAiChat .owner-ai-chat-history-toggle{
  display:grid!important;
}
html[data-owner-page="chat"] #app #ownerAiChat .owner-ai-chat-home{
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  border-radius:13px!important;
}
html[data-owner-page="chat"] #app #ownerAiChat .owner-ai-chat-home b{
  display:none!important;
}
html[data-owner-page="chat"] #app #ownerAiChat .owner-ai-chat-home span{
  display:grid!important;
  place-items:center!important;
  width:100%!important;
  height:100%!important;
  font-size:0!important;
}
html[data-owner-page="chat"] #app #ownerAiChat .owner-ai-chat-home span:before{
  content:"⌂";
  font-size:22px!important;
  line-height:1!important;
}


/* v1.9 — hard dedicated chat shell.
   Class is owned by owner-ai-chat-v1.js so the page cannot fall back to the Owner sidebar. */
#app.owner-chat-route-active .sidebar,
#app.owner-chat-route-active > .owner-sidebar-toggle,
#app.owner-chat-route-active > .owner-sidebar-backdrop{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
#app.owner-chat-route-active .shell{
  display:block!important;
  grid-template-columns:1fr!important;
  width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
}
#app.owner-chat-route-active .main{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
}
#app.owner-chat-route-active .hero{
  display:none!important;
}


/* v2.0 — cache-safe Chat-only isolation.
   Higher specificity than every Owner responsive sidebar rule; Home is untouched. */
html[data-owner-page="chat"][data-owner-sidebar-mode] body #app.owner-chat-route-active .shell > .sidebar,
html[data-owner-page="chat"][data-owner-sidebar-mode] body #app.owner-chat-route-active > .owner-sidebar-toggle,
html[data-owner-page="chat"][data-owner-sidebar-mode] body #app.owner-chat-route-active > .owner-sidebar-backdrop{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
  width:0!important;
  min-width:0!important;
  max-width:0!important;
}
html[data-owner-page="chat"][data-owner-sidebar-mode] body #app.owner-chat-route-active .shell{
  display:block!important;
  grid-template-columns:1fr!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  overflow:hidden!important;
}
html[data-owner-page="chat"][data-owner-sidebar-mode] body #app.owner-chat-route-active .main{
  display:flex!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
}
html[data-owner-page="chat"][data-owner-sidebar-mode] body #app.owner-chat-route-active .content{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:100dvh!important;
  overflow:hidden!important;
}
html[data-owner-page="chat"][data-owner-sidebar-mode] body #app.owner-chat-route-active #ownerAiChat.owner-ai-chat-page.owner-route-page{
  display:flex!important;
  width:100%!important;
  min-width:0!important;
  height:100%!important;
  visibility:visible!important;
  opacity:1!important;
}


/* v2.0 — final ChatGPT-like Owner AI Chat.
   Chat route only. Home/other Owner pages are untouched. */
html[data-owner-page="chat"] body #app .content > :not(#ownerAiChat){
  display:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat{
  --bp-chat-bg:#f7faf7;
  --bp-chat-paper:#ffffff;
  --bp-chat-rail:#f1f6f1;
  --bp-chat-line:#dfe8df;
  --bp-chat-text:#202521;
  --bp-chat-muted:#667068;
  --bp-chat-green:#3f7d5b;
  --bp-chat-green-soft:#e7f3ea;
  display:flex!important;
  width:100%!important;
  height:100dvh!important;
  min-height:0!important;
  overflow:hidden!important;
  background:var(--bp-chat-bg)!important;
  color:var(--bp-chat-text)!important;
  font-family:system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-page-head,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-context-panel,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-backdrop{
  display:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-layout{
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  background:var(--bp-chat-bg)!important;
  transition:grid-template-columns .18s ease!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-layout{
  grid-template-columns:min(78vw,320px) minmax(0,1fr)!important;
}

/* Closed: only the borderless AI head control is visible. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-toggle{
  display:grid!important;
  place-items:center!important;
  position:absolute!important;
  left:max(14px,env(safe-area-inset-left))!important;
  top:max(14px,env(safe-area-inset-top))!important;
  z-index:34!important;
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--bp-chat-green)!important;
  cursor:pointer!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-toggle:hover,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-toggle:focus-visible{
  background:var(--bp-chat-green-soft)!important;
  outline:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-toggle-ai{
  display:grid!important;
  place-items:center!important;
  width:38px!important;
  height:38px!important;
  background:transparent!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-toggle-ai:before,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-toggle-ai:after{
  display:none!important;
  content:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-toggle-ai svg{
  display:block!important;
  width:38px!important;
  height:38px!important;
}

/* Home icon appears only while Chat History is expanded. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-home{
  display:none!important;
  position:absolute!important;
  left:max(62px,calc(env(safe-area-inset-left) + 62px))!important;
  top:max(14px,env(safe-area-inset-top))!important;
  z-index:34!important;
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--bp-chat-green)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-home{
  display:grid!important;
  place-items:center!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-home:hover,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-home:focus-visible{
  background:var(--bp-chat-green-soft)!important;
  outline:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-home b{
  display:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-home span{
  display:grid!important;
  place-items:center!important;
  width:100%!important;
  height:100%!important;
  font-size:24px!important;
  line-height:1!important;
}

/* History rail pushes chat content; it never overlays it. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-panel{
  display:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-panel{
  display:flex!important;
  position:relative!important;
  left:auto!important;
  top:auto!important;
  bottom:auto!important;
  z-index:auto!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:100%!important;
  min-height:0!important;
  padding:70px 12px 14px!important;
  transform:none!important;
  opacity:1!important;
  visibility:visible!important;
  overflow:hidden!important;
  background:var(--bp-chat-rail)!important;
  border-right:1px solid var(--bp-chat-line)!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand{
  color:var(--bp-chat-text)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-new,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-search{
  border-color:var(--bp-chat-line)!important;
  background:var(--bp-chat-paper)!important;
  color:var(--bp-chat-text)!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-list{
  min-height:0!important;
  overflow:auto!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 34px!important;
  align-items:center!important;
  gap:4px!important;
  border-radius:12px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-row:hover,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-row.active{
  background:var(--bp-chat-green-soft)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-item{
  width:100%!important;
  min-width:0!important;
  border:0!important;
  background:transparent!important;
  color:var(--bp-chat-text)!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-delete{
  display:grid!important;
  place-items:center!important;
  width:30px!important;
  height:30px!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  background:transparent!important;
  color:#788078!important;
  font-size:23px!important;
  line-height:1!important;
  cursor:pointer!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-delete:hover{
  background:#fff!important;
  color:#a33a3a!important;
}

/* Main conversation: clean, readable, ChatGPT-like spacing. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-center{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:100%!important;
  min-height:0!important;
  background:var(--bp-chat-paper)!important;
  border:0!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-thread-head{
  padding-left:72px!important;
  border-bottom:1px solid var(--bp-chat-line)!important;
  background:rgba(255,255,255,.96)!important;
  color:var(--bp-chat-text)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-thread-head{
  padding-left:18px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-messages{
  width:100%!important;
  max-width:none!important;
  padding:30px max(18px,calc((100% - 900px)/2)) 180px!important;
  background:var(--bp-chat-paper)!important;
  color:var(--bp-chat-text)!important;
  scroll-behavior:smooth!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message{
  max-width:900px!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message-label{
  color:#59615b!important;
  font-size:13px!important;
  font-weight:700!important;
  letter-spacing:.02em!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-bubble{
  border:0!important;
  border-radius:18px!important;
  background:transparent!important;
  color:var(--bp-chat-text)!important;
  font-family:system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif!important;
  font-size:18px!important;
  line-height:1.72!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message.user .owner-ai-chat-bubble{
  background:var(--bp-chat-green-soft)!important;
  color:var(--bp-chat-text)!important;
  padding:12px 16px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message.assistant .owner-ai-chat-bubble{
  padding:6px 2px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message.system .owner-ai-chat-bubble{
  background:#f6f8f6!important;
  color:#475049!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-form{
  left:0!important;
  right:0!important;
  bottom:0!important;
  max-width:900px!important;
  margin:0 auto!important;
  background:linear-gradient(180deg,rgba(255,255,255,0),#fff 24%)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-form textarea{
  border:1px solid #d7e2d8!important;
  border-radius:20px!important;
  background:#fff!important;
  color:var(--bp-chat-text)!important;
  font-size:17px!important;
  line-height:1.55!important;
  box-shadow:0 5px 20px rgba(49,78,58,.08)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-send{
  background:var(--bp-chat-green)!important;
  color:#fff!important;
  border:0!important;
}

/* Visible thinking state: animated text + moving dots. */
html[data-owner-page="chat"] body #app #ownerAiChat #ownerAiChatTyping .owner-ai-chat-bubble>span:first-child{
  display:inline-block!important;
  font-weight:650!important;
  background:linear-gradient(90deg,#667068 0%,#3f7d5b 42%,#86a58e 60%,#667068 100%)!important;
  background-size:220% 100%!important;
  -webkit-background-clip:text!important;
  background-clip:text!important;
  color:transparent!important;
  animation:ownerAiThinkingSweep 1.35s linear infinite!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-typing-dots{
  display:inline-flex!important;
  gap:4px!important;
  margin-left:8px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-typing-dots i{
  width:6px!important;
  height:6px!important;
  border-radius:50%!important;
  background:var(--bp-chat-green)!important;
  animation:ownerAiThinkingDot .9s ease-in-out infinite!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-typing-dots i:nth-child(2){animation-delay:.15s!important}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-typing-dots i:nth-child(3){animation-delay:.3s!important}
@keyframes ownerAiThinkingSweep{to{background-position:-220% 0}}
@keyframes ownerAiThinkingDot{0%,60%,100%{transform:translateY(0);opacity:.35}30%{transform:translateY(-4px);opacity:1}}

@media(max-width:650px){
  html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-layout{
    grid-template-columns:min(82vw,300px) minmax(0,1fr)!important;
  }
  html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-messages{
    padding-left:16px!important;
    padding-right:16px!important;
  }
  html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-bubble{
    font-size:17px!important;
  }
}


/* v2.1 — full-height rail + right-side collapse control.
   Chat route only; Owner Home is untouched. */
html[data-owner-page="chat"] body #app #ownerAiChat{
  height:100dvh!important;
  min-height:100dvh!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-layout{
  height:100dvh!important;
  min-height:100dvh!important;
  align-items:stretch!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-layout{
  grid-template-columns:min(78vw,320px) minmax(0,1fr)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-panel{
  display:flex!important;
  flex-direction:column!important;
  align-self:stretch!important;
  width:100%!important;
  min-width:0!important;
  height:100dvh!important;
  min-height:100dvh!important;
  max-height:100dvh!important;
  margin:0!important;
  padding:72px 14px 14px!important;
  overflow:hidden!important;
  background:var(--bp-chat-rail)!important;
  border-right:1px solid var(--bp-chat-line)!important;
  box-shadow:none!important;
}

/* Collapsed = only borderless AI head. Expanded = hamburger moves to rail top-right. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-toggle{
  z-index:34!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-toggle-ai{
  display:grid!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-toggle-bars{
  display:none!important;
  width:20px!important;
  height:18px!important;
  place-items:center!important;
  gap:4px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-toggle-bars i{
  display:block!important;
  width:20px!important;
  height:2px!important;
  border-radius:99px!important;
  background:currentColor!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-toggle{
  left:calc(min(78vw,320px) - 56px)!important;
  top:max(14px,env(safe-area-inset-top))!important;
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  min-height:42px!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-toggle-ai{
  display:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-toggle-bars{
  display:grid!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-home{
  left:max(14px,env(safe-area-inset-left))!important;
  top:max(14px,env(safe-area-inset-top))!important;
  z-index:34!important;
}

/* Natural white/green history header and full-height visual balance. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  padding:0 6px 18px!important;
  color:var(--bp-chat-text)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand-icon{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--bp-chat-green)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand b{
  color:var(--bp-chat-text)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand small{
  color:var(--bp-chat-muted)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-back-owner{
  margin-top:auto!important;
  border:0!important;
  background:transparent!important;
  color:var(--bp-chat-muted)!important;
}

/* Chat body typography + distinct robot avatar for AI replies. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-bubble{
  font-size:18px!important;
  line-height:1.7!important;
  color:var(--bp-chat-text)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-avatar-ai{
  width:38px!important;
  height:38px!important;
  flex:0 0 38px!important;
  border:0!important;
  border-radius:10px!important;
  background:transparent!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-avatar-ai svg{
  width:34px!important;
  height:34px!important;
  display:block!important;
}

/* Compact modern send control. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-form{
  grid-template-columns:minmax(0,1fr) 42px!important;
  gap:8px!important;
  align-items:end!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-send{
  display:grid!important;
  place-items:center!important;
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  min-height:42px!important;
  padding:0!important;
  align-self:end!important;
  border:0!important;
  border-radius:50%!important;
  background:var(--bp-chat-green)!important;
  color:#fff!important;
  box-shadow:0 5px 14px rgba(63,125,91,.18)!important;
  font-size:0!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-send span{
  display:block!important;
  font-size:24px!important;
  line-height:1!important;
  transform:translateY(-1px)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-send:hover:not(:disabled),
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-send:focus-visible{
  background:#346a4d!important;
  outline:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-send:disabled{
  opacity:.45!important;
}

@media(max-width:650px){
  html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-layout{
    grid-template-columns:min(82vw,300px) minmax(0,1fr)!important;
  }
  html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-toggle{
    left:calc(min(82vw,300px) - 54px)!important;
  }
  html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-bubble{
    font-size:17px!important;
  }
}


/* v2.2 — screenshot correction. AI Chat only; Owner Home remains untouched. */

/* One Home icon only: remove the old generated duplicate and hide the old bottom text link. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-home span:before{
  content:none!important;
  display:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-back-owner{
  display:none!important;
}

/* Expanded collapse control: draw a real clean hamburger at the rail's top-right. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-toggle-bars{
  width:22px!important;
  height:16px!important;
  padding:0!important;
  background:
    linear-gradient(to bottom,
      currentColor 0 2px,
      transparent 2px 7px,
      currentColor 7px 9px,
      transparent 9px 14px,
      currentColor 14px 16px)!important;
  border:0!important;
  border-radius:0!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-toggle-bars i{
  display:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-toggle{
  color:var(--bp-chat-green)!important;
}

/* Readable dark history text on the natural light-green rail. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-caption{
  color:#6b786f!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-icon{
  color:#7f9385!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-copy b{
  color:#27302a!important;
  font-size:16px!important;
  font-weight:700!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-copy small{
  color:#74847a!important;
  font-size:12px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-row:hover,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-row.active{
  background:#e2efe5!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-row.active .owner-ai-chat-history-copy b{
  color:#245d3c!important;
}

/* Keep the rail visually continuous to the bottom edge. */
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-panel{
  height:100dvh!important;
  min-height:100dvh!important;
  max-height:100dvh!important;
  padding-bottom:max(16px,env(safe-area-inset-bottom))!important;
  background:#f0f6f1!important;
}

/* Give the collapsed AI head its own clear header lane instead of visually merging with SYSTEM. */
html[data-owner-page="chat"] body #app #ownerAiChat:not(.owner-chat-history-open) .owner-ai-chat-thread-head{
  min-height:64px!important;
  padding-left:72px!important;
}


/* v2.3 — ChatGPT-reference rail. AI Chat only; Owner Home remains untouched. */
html[data-owner-page="chat"] body #app #ownerAiChat{
  --bp-chat-message-size:20px;
  --bp-chat-rail-width:min(38vw,380px);
  --bp-chat-bg:#f8faf8;
  --bp-chat-paper:#ffffff;
  --bp-chat-rail:#f4f7f4;
  --bp-chat-line:#dde6df;
  --bp-chat-text:#1f2521;
  --bp-chat-muted:#667168;
  --bp-chat-green:#3e7655;
  --bp-chat-green-soft:#e8f2ea;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-layout{
  grid-template-columns:var(--bp-chat-rail-width) minmax(0,1fr)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-panel{
  width:100%!important;
  height:100dvh!important;
  min-height:100dvh!important;
  max-height:100dvh!important;
  padding:68px 12px max(12px,env(safe-area-inset-bottom))!important;
  background:var(--bp-chat-rail)!important;
  border-right:1px solid var(--bp-chat-line)!important;
  color:var(--bp-chat-text)!important;
  overflow:hidden!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand{
  min-height:58px!important;
  padding:0 8px 10px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand>div{
  min-width:0!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand b{
  display:block!important;
  color:#181d19!important;
  font-size:25px!important;
  font-weight:790!important;
  line-height:1.05!important;
  letter-spacing:-.035em!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand small{
  display:block!important;
  margin-top:4px!important;
  color:#728078!important;
  font-size:12px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-search-mark{
  display:grid!important;
  place-items:center!important;
  width:42px!important;
  height:42px!important;
  flex:0 0 42px!important;
  border-radius:50%!important;
  color:#1f2521!important;
  font-size:27px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-search{
  min-height:46px!important;
  margin:2px 6px 12px!important;
  padding:0 13px!important;
  border:1px solid var(--bp-chat-line)!important;
  border-radius:14px!important;
  background:#fff!important;
  color:#27302a!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-search span{
  color:#647168!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-search input{
  color:#202621!important;
  font:650 16px/1.35 system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-search input::placeholder{
  color:#8a948d!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-list{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:0 3px 10px!important;
  scrollbar-width:thin!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-section{
  padding:14px 10px 7px!important;
  color:#2b332e!important;
  font-size:16px!important;
  font-weight:800!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-row{
  position:relative!important;
  display:block!important;
  width:100%!important;
  min-height:58px!important;
  margin:1px 0!important;
  overflow:hidden!important;
  border-radius:13px!important;
  background:transparent!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-actions{
  position:absolute!important;
  inset:0 0 0 auto!important;
  z-index:1!important;
  display:grid!important;
  grid-template-columns:72px 62px!important;
  width:134px!important;
  height:100%!important;
  align-items:stretch!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-actions button{
  border:0!important;
  border-radius:0!important;
  padding:0 6px!important;
  color:#fff!important;
  font:750 13px/1.1 system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-pin{
  background:#587b64!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-delete{
  display:block!important;
  width:auto!important;
  height:auto!important;
  min-width:0!important;
  border-radius:0!important;
  background:#b34b4b!important;
  color:#fff!important;
  font-size:13px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-item{
  position:relative!important;
  z-index:2!important;
  display:grid!important;
  grid-template-columns:30px minmax(0,1fr)!important;
  align-items:center!important;
  gap:10px!important;
  width:100%!important;
  min-height:58px!important;
  margin:0!important;
  padding:9px 11px!important;
  border:0!important;
  border-radius:13px!important;
  background:var(--bp-chat-rail)!important;
  color:#202621!important;
  text-align:left!important;
  box-shadow:none!important;
  transition:transform .18s ease,background .15s ease!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-history-actions-open .owner-ai-chat-history-item{
  transform:translateX(-134px)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-row.active .owner-ai-chat-history-item,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-item:hover{
  background:#e9eeea!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-icon{
  display:grid!important;
  place-items:center!important;
  width:28px!important;
  height:28px!important;
  color:#516057!important;
  font-size:19px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-copy{
  min-width:0!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-copy b{
  display:block!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  color:#202621!important;
  font-size:17px!important;
  font-weight:720!important;
  line-height:1.25!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-copy small{
  display:block!important;
  margin-top:3px!important;
  color:#758178!important;
  font-size:12px!important;
}

/* Bottom controls like ChatGPT: New Chat + Settings stay pinned to the rail bottom. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-footer{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 46px!important;
  gap:8px!important;
  align-items:center!important;
  padding:10px 5px 2px!important;
  border-top:1px solid var(--bp-chat-line)!important;
  background:var(--bp-chat-rail)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-new{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  width:100%!important;
  min-height:46px!important;
  margin:0!important;
  padding:0 14px!important;
  border:0!important;
  border-radius:14px!important;
  background:var(--bp-chat-green)!important;
  color:#fff!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-new span{
  font-size:23px!important;
  line-height:1!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-new b{
  font-size:16px!important;
  font-weight:800!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-settings{
  display:grid!important;
  place-items:center!important;
  width:46px!important;
  height:46px!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  background:#fff!important;
  color:#27302a!important;
  box-shadow:none!important;
  font-size:23px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-settings-panel{
  flex:0 0 auto!important;
  margin:8px 5px 2px!important;
  padding:12px!important;
  border:1px solid var(--bp-chat-line)!important;
  border-radius:14px!important;
  background:#fff!important;
  color:#252c27!important;
  box-shadow:0 8px 22px rgba(45,68,52,.08)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-settings-panel[hidden]{
  display:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-settings-panel>b,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-settings-panel>span,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-settings-panel>small{
  display:block!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-settings-panel>span{
  margin:10px 0 6px!important;
  color:#667168!important;
  font-size:13px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-font-options{
  display:grid!important;
  grid-template-columns:repeat(3,1fr)!important;
  gap:6px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-font-options button{
  min-height:34px!important;
  border:1px solid var(--bp-chat-line)!important;
  border-radius:10px!important;
  background:#f8faf8!important;
  color:#29312b!important;
  font-size:13px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-font-options button.active{
  border-color:#83a68e!important;
  background:var(--bp-chat-green-soft)!important;
  color:#245d3c!important;
  font-weight:800!important;
}

/* Collapse control stays at rail top-right; Home stays top-left only while expanded. */
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-history-toggle{
  left:calc(var(--bp-chat-rail-width) - 55px)!important;
  top:max(14px,env(safe-area-inset-top))!important;
  z-index:34!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat.owner-chat-history-open .owner-ai-chat-home{
  left:max(14px,env(safe-area-inset-left))!important;
  top:max(14px,env(safe-area-inset-top))!important;
  z-index:34!important;
}

/* Chat content gets the rest of the width and the composer spans the right pane. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-center{
  min-width:0!important;
  width:100%!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-messages{
  padding:26px max(22px,4vw) 126px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message{
  max-width:1080px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-bubble{
  font-size:var(--bp-chat-message-size)!important;
  line-height:1.68!important;
  color:#202621!important;
  font-weight:450!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message-label{
  color:#39443d!important;
  font-size:14px!important;
  font-weight:800!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-avatar-system{
  width:42px!important;
  height:42px!important;
  flex:0 0 42px!important;
  border:0!important;
  background:transparent!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-avatar-system img{
  display:block!important;
  width:38px!important;
  height:38px!important;
  object-fit:contain!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-thread-logo{
  border:0!important;
  background:transparent!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-thread-logo img{
  display:block!important;
  width:36px!important;
  height:36px!important;
  object-fit:contain!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-form{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:12px max(18px,3vw) max(14px,env(safe-area-inset-bottom))!important;
  border-top:0!important;
  background:linear-gradient(180deg,rgba(255,255,255,0),#fff 30%)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-form textarea{
  min-height:58px!important;
  max-height:160px!important;
  width:100%!important;
  padding:16px 18px!important;
  border-radius:22px!important;
  font-size:18px!important;
  line-height:1.5!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-send{
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
}

/* Requested cleanup: no task-status / incident quick chips in Chat. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-quick-actions{
  display:none!important;
}

@media(max-width:650px){
  html[data-owner-page="chat"] body #app #ownerAiChat{
    --bp-chat-rail-width:min(84vw,340px);
  }
  html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-messages{
    padding-left:16px!important;
    padding-right:16px!important;
  }
  html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-bubble{
    font-size:var(--bp-chat-message-size)!important;
  }
}


/* v2.4 — ten visual worlds.
   Theme changes background, typography, icon language and component treatment.
   Contrast stays intentionally high for long-form reading. */
html[data-owner-page="chat"] body #app #ownerAiChat{
  --bp-chat-font-body:system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif;
  --bp-chat-font-heading:system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif;
  --bp-chat-page-bg:#f8faf8;
  --bp-chat-rail-bg:#f4f7f4;
  --bp-chat-panel:#ffffff;
  --bp-chat-border:#dce6df;
  --bp-chat-accent:#3e7655;
  --bp-chat-accent-2:#7da48a;
  --bp-chat-text:#1f2521;
  --bp-chat-muted:#68736b;
  --bp-chat-user-bubble:#e8f2ea;
  --bp-chat-system-bubble:#f2f5f2;
  --bp-chat-hover:#e9eeea;
  --bp-chat-danger:#b34b4b;
  --bp-chat-pattern:none;
  --bp-chat-radius:16px;
  background:var(--bp-chat-page-bg)!important;
  background-image:var(--bp-chat-pattern)!important;
  color:var(--bp-chat-text)!important;
  font-family:var(--bp-chat-font-body)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="nature"]{
  --bp-chat-font-body:system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif;
  --bp-chat-font-heading:"Avenir Next",system-ui,-apple-system,"Noto Sans Thai",sans-serif;
  --bp-chat-page-bg:#f8faf8;
  --bp-chat-rail-bg:#f1f6f2;
  --bp-chat-panel:#ffffff;
  --bp-chat-border:#dce6df;
  --bp-chat-accent:#3e7655;
  --bp-chat-accent-2:#85a98f;
  --bp-chat-text:#202621;
  --bp-chat-muted:#657168;
  --bp-chat-user-bubble:#e8f2ea;
  --bp-chat-system-bubble:#f3f6f3;
  --bp-chat-hover:#e5eee7;
  --bp-chat-pattern:
    radial-gradient(circle at 12% 18%,rgba(78,126,91,.08),transparent 22%),
    radial-gradient(circle at 88% 78%,rgba(128,166,139,.07),transparent 26%);
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="neon"]{
  --bp-chat-font-body:"Avenir Next","Helvetica Neue",system-ui,"Noto Sans Thai",sans-serif;
  --bp-chat-font-heading:"Avenir Next","Helvetica Neue",system-ui,sans-serif;
  --bp-chat-page-bg:#f7f9ff;
  --bp-chat-rail-bg:rgba(247,249,255,.92);
  --bp-chat-panel:rgba(255,255,255,.88);
  --bp-chat-border:#d9def5;
  --bp-chat-accent:#4b63ff;
  --bp-chat-accent-2:#00a98f;
  --bp-chat-text:#1c2030;
  --bp-chat-muted:#62697d;
  --bp-chat-user-bubble:#edf0ff;
  --bp-chat-system-bubble:#f4f3ff;
  --bp-chat-hover:#eef0fb;
  --bp-chat-radius:20px;
  --bp-chat-pattern:
    radial-gradient(circle at 10% 15%,rgba(95,255,210,.16),transparent 24%),
    radial-gradient(circle at 82% 8%,rgba(109,85,255,.14),transparent 26%),
    radial-gradient(circle at 75% 88%,rgba(0,198,255,.11),transparent 24%);
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="genz"]{
  --bp-chat-font-body:ui-rounded,"SF Pro Rounded","Avenir Next",system-ui,"Noto Sans Thai",sans-serif;
  --bp-chat-font-heading:ui-rounded,"SF Pro Rounded","Avenir Next",system-ui,sans-serif;
  --bp-chat-page-bg:#fffaf3;
  --bp-chat-rail-bg:#fff6e9;
  --bp-chat-panel:#fffdf9;
  --bp-chat-border:#eadfcf;
  --bp-chat-accent:#6b5cff;
  --bp-chat-accent-2:#e46e3f;
  --bp-chat-text:#28252e;
  --bp-chat-muted:#6f6874;
  --bp-chat-user-bubble:#efffcf;
  --bp-chat-system-bubble:#fff1df;
  --bp-chat-hover:#f3eaff;
  --bp-chat-radius:24px;
  --bp-chat-pattern:
    radial-gradient(circle at 8% 12%,rgba(190,255,70,.22),transparent 16%),
    radial-gradient(circle at 92% 18%,rgba(111,92,255,.14),transparent 18%),
    radial-gradient(circle at 84% 86%,rgba(255,128,87,.13),transparent 20%);
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="minimal"]{
  --bp-chat-font-body:"Helvetica Neue",Arial,system-ui,"Noto Sans Thai",sans-serif;
  --bp-chat-font-heading:"Helvetica Neue",Arial,system-ui,sans-serif;
  --bp-chat-page-bg:#ffffff;
  --bp-chat-rail-bg:#fafafa;
  --bp-chat-panel:#ffffff;
  --bp-chat-border:#e5e5e5;
  --bp-chat-accent:#171717;
  --bp-chat-accent-2:#6b7280;
  --bp-chat-text:#171717;
  --bp-chat-muted:#6b6b6b;
  --bp-chat-user-bubble:#f1f1f1;
  --bp-chat-system-bubble:#f7f7f7;
  --bp-chat-hover:#f0f0f0;
  --bp-chat-radius:10px;
  --bp-chat-pattern:none;
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="glass"]{
  --bp-chat-font-body:"SF Pro Display","Avenir Next",system-ui,"Noto Sans Thai",sans-serif;
  --bp-chat-font-heading:"SF Pro Display","Avenir Next",system-ui,sans-serif;
  --bp-chat-page-bg:#eef4f8;
  --bp-chat-rail-bg:rgba(244,249,252,.78);
  --bp-chat-panel:rgba(255,255,255,.70);
  --bp-chat-border:rgba(127,154,174,.28);
  --bp-chat-accent:#326f88;
  --bp-chat-accent-2:#6985b9;
  --bp-chat-text:#1e2930;
  --bp-chat-muted:#60717b;
  --bp-chat-user-bubble:rgba(218,238,243,.80);
  --bp-chat-system-bubble:rgba(245,248,250,.76);
  --bp-chat-hover:rgba(223,236,243,.78);
  --bp-chat-radius:22px;
  --bp-chat-pattern:
    linear-gradient(135deg,rgba(255,255,255,.76),rgba(225,238,245,.45)),
    radial-gradient(circle at 90% 10%,rgba(106,163,190,.15),transparent 30%);
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="editorial"]{
  --bp-chat-font-body:"Avenir Next","Helvetica Neue",system-ui,"Noto Sans Thai",sans-serif;
  --bp-chat-font-heading:Georgia,"Times New Roman",serif;
  --bp-chat-page-bg:#fbf6ec;
  --bp-chat-rail-bg:#f4ecdc;
  --bp-chat-panel:#fffdf8;
  --bp-chat-border:#d8ccb8;
  --bp-chat-accent:#7a5138;
  --bp-chat-accent-2:#a47755;
  --bp-chat-text:#2b2520;
  --bp-chat-muted:#71675e;
  --bp-chat-user-bubble:#f0e5d6;
  --bp-chat-system-bubble:#f7efe4;
  --bp-chat-hover:#ede2d2;
  --bp-chat-radius:4px;
  --bp-chat-pattern:
    repeating-linear-gradient(to bottom,rgba(111,83,59,.035) 0 1px,transparent 1px 34px);
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="y2k"]{
  --bp-chat-font-body:"Trebuchet MS","Avenir Next",system-ui,"Noto Sans Thai",sans-serif;
  --bp-chat-font-heading:"Trebuchet MS","Avenir Next",system-ui,sans-serif;
  --bp-chat-page-bg:#f7f7fb;
  --bp-chat-rail-bg:#f0f0f7;
  --bp-chat-panel:#ffffff;
  --bp-chat-border:#cfd1dd;
  --bp-chat-accent:#7157ff;
  --bp-chat-accent-2:#78a800;
  --bp-chat-text:#20212a;
  --bp-chat-muted:#626471;
  --bp-chat-user-bubble:#efffc1;
  --bp-chat-system-bubble:#eeeaff;
  --bp-chat-hover:#e9e8f4;
  --bp-chat-radius:18px;
  --bp-chat-pattern:
    linear-gradient(120deg,rgba(213,218,230,.42),transparent 34%),
    radial-gradient(circle at 90% 16%,rgba(118,91,255,.14),transparent 22%),
    radial-gradient(circle at 12% 82%,rgba(199,255,51,.16),transparent 18%);
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="earth"]{
  --bp-chat-font-body:"Gill Sans","Avenir Next",system-ui,"Noto Sans Thai",sans-serif;
  --bp-chat-font-heading:Georgia,"Times New Roman",serif;
  --bp-chat-page-bg:#f5f0e5;
  --bp-chat-rail-bg:#ece5d6;
  --bp-chat-panel:#fbf8f0;
  --bp-chat-border:#d6ccb8;
  --bp-chat-accent:#66704c;
  --bp-chat-accent-2:#9a7657;
  --bp-chat-text:#302c25;
  --bp-chat-muted:#726a5e;
  --bp-chat-user-bubble:#e4e6cf;
  --bp-chat-system-bubble:#efe8db;
  --bp-chat-hover:#e5dece;
  --bp-chat-radius:18px;
  --bp-chat-pattern:
    radial-gradient(ellipse at 18% 12%,rgba(126,139,94,.10),transparent 26%),
    radial-gradient(ellipse at 82% 84%,rgba(155,118,81,.09),transparent 28%);
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="cyber"]{
  --bp-chat-font-body:system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif;
  --bp-chat-font-heading:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  --bp-chat-page-bg:#f4f9fb;
  --bp-chat-rail-bg:#edf5f7;
  --bp-chat-panel:#fbfeff;
  --bp-chat-border:#c8dde3;
  --bp-chat-accent:#067a76;
  --bp-chat-accent-2:#3f65b5;
  --bp-chat-text:#13272b;
  --bp-chat-muted:#557077;
  --bp-chat-user-bubble:#dff4f0;
  --bp-chat-system-bubble:#edf5ff;
  --bp-chat-hover:#dfeef1;
  --bp-chat-radius:8px;
  --bp-chat-pattern:
    linear-gradient(rgba(52,112,124,.055) 1px,transparent 1px),
    linear-gradient(90deg,rgba(52,112,124,.055) 1px,transparent 1px);
  background-size:24px 24px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="luxury"]{
  --bp-chat-font-body:"Helvetica Neue","Avenir Next",system-ui,"Noto Sans Thai",sans-serif;
  --bp-chat-font-heading:Georgia,"Times New Roman",serif;
  --bp-chat-page-bg:#f7f3e9;
  --bp-chat-rail-bg:#eee9dd;
  --bp-chat-panel:#fcfaf4;
  --bp-chat-border:#d3c8ae;
  --bp-chat-accent:#4a4031;
  --bp-chat-accent-2:#9b8353;
  --bp-chat-text:#24211c;
  --bp-chat-muted:#6d6659;
  --bp-chat-user-bubble:#ebe4d2;
  --bp-chat-system-bubble:#f3eee3;
  --bp-chat-hover:#e7e0d1;
  --bp-chat-radius:2px;
  --bp-chat-pattern:
    linear-gradient(90deg,transparent 0 8%,rgba(155,131,83,.05) 8% 8.15%,transparent 8.15% 91.85%,rgba(155,131,83,.05) 91.85% 92%,transparent 92%);
}

/* Shared theme application */
html[data-owner-page="chat"] body #app #ownerAiChat,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-bubble,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-item,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-search input,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-form textarea,
html[data-owner-page="chat"] body #app #ownerAiChat button{
  font-family:var(--bp-chat-font-body)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand b,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-thread-head b,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-section,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-settings-panel>b{
  font-family:var(--bp-chat-font-heading)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-layout,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-center,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-messages{
  background:var(--bp-chat-page-bg)!important;
  background-image:var(--bp-chat-pattern)!important;
  color:var(--bp-chat-text)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-panel,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-footer{
  background:var(--bp-chat-rail-bg)!important;
  color:var(--bp-chat-text)!important;
  border-color:var(--bp-chat-border)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-thread-head,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-form{
  background:color-mix(in srgb,var(--bp-chat-panel) 94%,transparent)!important;
  border-color:var(--bp-chat-border)!important;
  color:var(--bp-chat-text)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-item{
  background:var(--bp-chat-rail-bg)!important;
  color:var(--bp-chat-text)!important;
  border-radius:var(--bp-chat-radius)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-row.active .owner-ai-chat-history-item,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-item:hover{
  background:var(--bp-chat-hover)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-copy b,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-section,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message-label,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-bubble{
  color:var(--bp-chat-text)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-copy small,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand small,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-thread-head small{
  color:var(--bp-chat-muted)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message.user .owner-ai-chat-bubble{
  background:var(--bp-chat-user-bubble)!important;
  color:var(--bp-chat-text)!important;
  border-color:var(--bp-chat-border)!important;
  border-radius:var(--bp-chat-radius)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message.system .owner-ai-chat-bubble{
  background:var(--bp-chat-system-bubble)!important;
  color:var(--bp-chat-text)!important;
  border-color:var(--bp-chat-border)!important;
  border-radius:var(--bp-chat-radius)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-new,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-send{
  background:var(--bp-chat-accent)!important;
  color:#fff!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-toggle,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-home,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-settings{
  color:var(--bp-chat-accent)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-search,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-settings-panel,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-form textarea{
  background:var(--bp-chat-panel)!important;
  color:var(--bp-chat-text)!important;
  border-color:var(--bp-chat-border)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-icon{
  color:var(--bp-chat-accent)!important;
}

/* Glass/Neon get subtle 2026 translucency without reducing text contrast. */
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="neon"] .owner-ai-chat-history-panel,
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="glass"] .owner-ai-chat-history-panel,
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="neon"] .owner-ai-chat-thread-head,
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="glass"] .owner-ai-chat-thread-head{
  backdrop-filter:blur(18px)!important;
  -webkit-backdrop-filter:blur(18px)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="neon"] .owner-ai-chat-new{
  box-shadow:0 0 0 1px rgba(75,99,255,.15),0 0 26px rgba(75,99,255,.18)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="y2k"] .owner-ai-chat-new{
  background:linear-gradient(135deg,#6854ff,#8c5cff 50%,#8ba900)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="luxury"] .owner-ai-chat-new{
  background:#332f28!important;
  color:#f8f0df!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="editorial"] .owner-ai-chat-new{
  background:#724d38!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat[data-chat-theme="cyber"] .owner-ai-chat-new{
  background:#0b7775!important;
}

/* Theme picker */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-settings-panel{
  max-height:min(62vh,560px)!important;
  overflow:auto!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-theme-options{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:7px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-theme-options button{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr)!important;
  align-items:center!important;
  gap:8px!important;
  min-height:58px!important;
  padding:7px 9px!important;
  border:1px solid var(--bp-chat-border)!important;
  border-radius:12px!important;
  background:var(--bp-chat-panel)!important;
  color:var(--bp-chat-text)!important;
  text-align:left!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-theme-options button.active{
  border-color:var(--bp-chat-accent)!important;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--bp-chat-accent) 16%,transparent)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-theme-options button>i{
  display:block!important;
  width:30px!important;
  height:30px!important;
  border-radius:9px!important;
  border:1px solid rgba(0,0,0,.08)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-theme-options button span,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-theme-options button b,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-theme-options button small{
  display:block!important;
  min-width:0!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-theme-options button b{
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:12px!important;
  color:inherit!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-theme-options button small{
  margin-top:2px!important;
  font-size:10px!important;
  line-height:1.25!important;
  color:var(--bp-chat-muted)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat [data-owner-chat-theme="nature"]>i{background:linear-gradient(135deg,#ffffff,#b8d9c0)!important}
html[data-owner-page="chat"] body #app #ownerAiChat [data-owner-chat-theme="neon"]>i{background:linear-gradient(135deg,#eafff6,#81f1d7 35%,#7f73ff 70%,#d8c8ff)!important}
html[data-owner-page="chat"] body #app #ownerAiChat [data-owner-chat-theme="genz"]>i{background:linear-gradient(135deg,#f5ff9b,#8d78ff 55%,#ff9a75)!important}
html[data-owner-page="chat"] body #app #ownerAiChat [data-owner-chat-theme="minimal"]>i{background:linear-gradient(135deg,#fff 0 50%,#222 50%)!important}
html[data-owner-page="chat"] body #app #ownerAiChat [data-owner-chat-theme="glass"]>i{background:linear-gradient(135deg,#f9fdff,#b7d8e7,#dce6ff)!important}
html[data-owner-page="chat"] body #app #ownerAiChat [data-owner-chat-theme="editorial"]>i{background:linear-gradient(135deg,#fbf0db,#8d654e)!important}
html[data-owner-page="chat"] body #app #ownerAiChat [data-owner-chat-theme="y2k"]>i{background:linear-gradient(135deg,#eef0f5,#9a86ff 45%,#c9ff4a)!important}
html[data-owner-page="chat"] body #app #ownerAiChat [data-owner-chat-theme="earth"]>i{background:linear-gradient(135deg,#f1e7ce,#77815c,#aa8061)!important}
html[data-owner-page="chat"] body #app #ownerAiChat [data-owner-chat-theme="cyber"]>i{background:linear-gradient(135deg,#eefcff,#63bdb7,#5a79bd)!important}
html[data-owner-page="chat"] body #app #ownerAiChat [data-owner-chat-theme="luxury"]>i{background:linear-gradient(135deg,#fbf6e9,#2d2922 55%,#b79b62)!important}

@media(max-width:650px){
  html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-theme-options{
    grid-template-columns:1fr!important;
  }
}


/* v2.5 — reliable swipe actions on History rows. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-actions{
  z-index:3!important;
  pointer-events:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-history-actions-open .owner-ai-chat-history-actions{
  pointer-events:auto!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-item{
  z-index:2!important;
  will-change:transform!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-history-actions-open .owner-ai-chat-history-item{
  transform:translate3d(-134px,0,0)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-history-actions-open .owner-ai-chat-history-pin,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-history-actions-open .owner-ai-chat-history-delete{
  position:relative!important;
  z-index:4!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
}


/* v2.6 — hidden history actions until explicit swipe. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-actions{
  opacity:0!important;
  visibility:hidden!important;
  transform:translateX(100%)!important;
  pointer-events:none!important;
  transition:transform .18s ease,opacity .14s ease!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-history-actions-open .owner-ai-chat-history-actions{
  opacity:1!important;
  visibility:visible!important;
  transform:translateX(0)!important;
  pointer-events:auto!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-row:not(.owner-history-actions-open) .owner-ai-chat-history-item{
  transform:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-history-actions-open .owner-ai-chat-history-item{
  transform:translate3d(-134px,0,0)!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-actions[aria-hidden="true"] button{
  pointer-events:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-history-actions-open .owner-ai-chat-history-actions[aria-hidden="false"] button{
  pointer-events:auto!important;
}


/* v2.7 — message delete + larger BIZPILOT AI brand. */
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand b{
  font-size:32px!important;
  line-height:1!important;
  font-weight:850!important;
  letter-spacing:-.045em!important;
  text-transform:uppercase!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-history-brand small{
  margin-top:6px!important;
  font-size:13px!important;
  font-weight:650!important;
  letter-spacing:.02em!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:6px!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message-delete{
  min-height:30px!important;
  padding:4px 9px!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  color:#8d4a4a!important;
  font-size:12px!important;
  font-weight:700!important;
  box-shadow:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message-delete:hover,
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message-delete:focus-visible{
  background:rgba(179,75,75,.09)!important;
  color:#9f3434!important;
  outline:none!important;
}
html[data-owner-page="chat"] body #app #ownerAiChat .owner-ai-chat-message-delete:disabled{
  opacity:.45!important;
}


/* Owner Agent approval decision surface v1 */
#app #ownerAiChat .owner-ai-chat-approval-card{
  max-width:900px!important;
  margin:0 auto 14px!important;
  padding:14px 16px!important;
  border:1px solid #d8c9ff!important;
  border-radius:16px!important;
  background:#fbf8ff!important;
  color:#1f2937!important;
  box-shadow:0 5px 18px rgba(76,29,149,.06)!important;
}
#app #ownerAiChat .owner-ai-chat-approval-card>strong{
  display:block!important;
  font-size:14px!important;
  color:#5b21b6!important;
}
#app #ownerAiChat .owner-ai-chat-approval-detail,
#app #ownerAiChat .owner-ai-chat-approval-result{
  margin-top:7px!important;
  font-size:12px!important;
  line-height:1.5!important;
  color:#64748b!important;
  overflow-wrap:anywhere!important;
}
#app #ownerAiChat .owner-ai-chat-approval-actions{
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  margin-top:12px!important;
}
#app #ownerAiChat .owner-ai-chat-approval-actions button{
  min-width:112px!important;
  min-height:44px!important;
  padding:9px 16px!important;
  border-radius:12px!important;
  font-size:13px!important;
  font-weight:850!important;
  cursor:pointer!important;
}
#app #ownerAiChat .owner-ai-chat-approve{
  border:1px solid #15803d!important;
  background:#dcfce7!important;
  color:#166534!important;
}
#app #ownerAiChat .owner-ai-chat-reject{
  border:1px solid #b91c1c!important;
  background:#fef2f2!important;
  color:#991b1b!important;
}
#app #ownerAiChat .owner-ai-chat-approval-actions button:disabled{
  opacity:.55!important;
  cursor:wait!important;
}
@media(max-width:650px){
  #app #ownerAiChat .owner-ai-chat-approval-card{margin-left:14px!important;margin-right:14px!important}
  #app #ownerAiChat .owner-ai-chat-approval-actions{display:grid!important;grid-template-columns:1fr 1fr!important}
  #app #ownerAiChat .owner-ai-chat-approval-actions button{min-width:0!important;width:100%!important}
}
