#lch-elcy-root { position: fixed; z-index: 8500; right: max(18px, env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); }
:host { font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif; color: var(--lch-text, #eef2f3); letter-spacing: 0; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, textarea, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button:focus-visible, textarea:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--lch-info, #8edcff); outline-offset: 2px; }
.launcher { width: 62px; height: 62px; border-radius: 50%; border: 2px solid #55bfa5; padding: 4px; background: var(--lch-surface, #15191b); box-shadow: 0 4px 18px #0004; display: grid; place-items: center; }
.launcher img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.panel { position: absolute; bottom: 76px; right: 0; width: min(420px, calc(100vw - 24px)); height: min(650px, calc(100dvh - 120px)); min-height: 280px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--lch-line, #596469); border-radius: 8px; background: var(--lch-surface, #15191b); box-shadow: 0 12px 45px #0005; }
.header { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--lch-line, #596469); flex: 0 0 auto; }
.header > img { width: 36px; height: 36px; border-radius: 50%; }
.identity { flex: 1; min-width: 0; }
.identity strong { font-size: 16px; }
.identity small { display: block; color: var(--lch-muted, #a7b4ba); font-size: 11px; overflow-wrap: anywhere; }
.icon { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 44px; border: 1px solid var(--lch-line, #596469); border-radius: 5px; background: transparent; color: inherit; padding: 8px 12px; }
.icon img { width: 18px; height: 18px; filter: brightness(0) invert(.9); }
:host([data-light="true"]) .icon img { filter: none; }
.close { width: 40px; height: 40px; min-height: 40px; padding: 8px; border: 0; }
.modes { display: flex; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--lch-line, #596469); flex: 0 0 auto; }
.modes button { flex: 1; min-height: 36px; padding: 5px 10px; font-size: 13px; }
.modes [aria-pressed="true"] { color: var(--lch-text, #eef2f3); background: var(--lch-raised, #20272a); border-color: #39b69f; }
.messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px 16px; }
.message { margin: 12px 0 0; padding: 12px 0; border-bottom: 1px solid var(--lch-line, #596469); overflow-wrap: anywhere; }
.message.user { margin-left: 34px; padding: 10px 12px; background: var(--lch-raised, #20272a); border: 0; border-radius: 6px; }
.message p { margin: 5px 0; white-space: pre-wrap; }
.message .label { display: block; color: var(--lch-muted, #a7b4ba); font-size: 11px; margin-bottom: 5px; }
.message h3 { font-size: 15px; margin: 0 0 8px; }
.elcy-rich-text a { color: var(--lch-info, #8edcff); }
.elcy-rich-text ul, .elcy-rich-text ol { padding-left: 22px; }
.elcy-rich-text pre { overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.elcy-rich-text .elcy-rich-heading { font-weight: 700; }
.message small { display: block; color: var(--lch-muted, #a7b4ba); font-size: 11px; margin-top: 8px; }
.result-label { display: inline-block; color: #59d3ad; font-size: 12px; margin-bottom: 6px; }
:host([data-light="true"]) .result-label { color: #216b41; }
.warning { color: var(--lch-warning, #f1c778); }
.result-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 12px; margin: 10px 0; }
.result-table th, .result-table td { padding: 8px 5px; text-align: left; border-bottom: 1px solid var(--lch-line, #596469); vertical-align: top; overflow-wrap: anywhere; }
.result-table th { color: var(--lch-muted, #a7b4ba); font-weight: 500; }
.open-result { display: inline-flex; align-items: center; gap: 7px; color: var(--lch-info, #8edcff); padding: 10px 0; min-height: 44px; }
.request-fields { display: grid; gap: 10px; margin-top: 12px; }
.request-fields label { display: grid; gap: 5px; font-size: 12px; }
.request-fields select, .request-fields input { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; border: 1px solid var(--lch-line, #596469); border-radius: 4px; padding: 8px; color: var(--lch-text, #eef2f3); background: var(--lch-bg, #101315); }
.primary { background: #176e63; border-color: #39b69f; color: #fff; }
.primary img { filter: brightness(0) invert(1) !important; }
.suggestions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 16px; }
.suggestions button { justify-content: flex-start; text-align: left; font-size: 12px; }
.status { min-height: 26px; padding: 3px 16px; color: var(--lch-muted, #a7b4ba); font-size: 12px; flex: 0 0 auto; }
.status[data-busy="true"] { border-left: 3px solid #39b69f; color: var(--lch-text, #eef2f3); }
.compose { padding: 8px 12px 12px; border-top: 1px solid var(--lch-line, #596469); display: flex; align-items: flex-end; gap: 8px; flex: 0 0 auto; }
.compose textarea { flex: 1; min-width: 0; min-height: 52px; max-height: 120px; resize: vertical; padding: 10px; border: 1px solid var(--lch-line, #596469); border-radius: 5px; background: var(--lch-bg, #101315); color: var(--lch-text, #eef2f3); font-size: 16px; }
.send { width: 44px; height: 48px; padding: 10px; flex-shrink: 0; }
.retry { margin-top: 8px; }
@media (max-width: 600px) {
  #lch-elcy-root { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .launcher { width: 54px; height: 54px; }
  .panel { bottom: 66px; width: calc(100vw - 24px); height: min(650px, calc(100dvh - 174px - env(safe-area-inset-bottom))); }
}
@media (max-height: 480px) { .panel { position: fixed; inset: 8px 8px 8px auto; height: calc(100dvh - 16px); } }
@media print { #lch-elcy-root { display: none !important; } }
