.luna-chat {
  --luna-ink:#102f37;
  --luna-accent:#00665d;
  box-sizing:border-box;position:fixed;inset:0 auto 0 max(3vw,calc((100vw - 1100px)/2));
  width:min(52vw,39rem);height:min(42rem,calc(100dvh - 3rem));max-width:none;max-height:none;
  margin:auto 0;padding:0;overflow:visible;border:0;color:var(--luna-ink);color-scheme:light;
  background:transparent;font:400 1rem/1.48 system-ui,sans-serif;
}
.luna-chat:not([open]), .luna-chat [hidden] {display:none;}
.luna-chat::backdrop {background:rgb(216 244 238 / 9%);}
.luna-chat * {box-sizing:border-box;}
.luna-screen {
  display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%;min-height:0;isolation:isolate;
  overflow:hidden;border:1px solid #71b9af;border-radius:1.2rem;
  background:linear-gradient(150deg,rgb(246 255 253 / 97%),rgb(235 250 247 / 97%) 45%,rgb(245 252 250 / 98%));
  box-shadow:0 0 0 3px #95f8df2b,0 15px 55px #17504d26,inset 0 1px 3px white;
  transform-origin:100% 40%;
}
.luna-chat-header {display:flex;align-items:center;gap:.65rem;padding:.7rem 1rem;
  color:#164441;border-bottom:1px solid #b1d8d2;background:linear-gradient(100deg,#d9f3edc9,#f2fbf9a6);}
.luna-chat-title {margin:0;font:700 1.05rem/1.2 ui-monospace,monospace;letter-spacing:.055em;outline:none;}
.luna-chat-lens {display:grid;place-items:center;width:2.25rem;height:2.25rem;border-radius:50%;
  color:#237568;background:#beebe0;box-shadow:inset 0 0 0 1px #93cebf;}
.luna-chat svg {width:1.25rem;height:1.25rem;display:block;fill:none;stroke:currentColor;
  stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;}
:where(.luna-chat) button {appearance:none;font:inherit;cursor:pointer;}
.luna-chat .luna-chat-speaker {margin-inline-start:auto;width:44px;height:44px;color:#326757;border:1px solid #afcfc3;
  background:#e9f8f1;box-shadow:none;}
.luna-chat .luna-chat-speaker[aria-pressed=false] {color:#576d66;background:#e6ede9;}
.luna-chat-close {color:#365b5a;border:1px solid transparent;background:transparent;
  border-radius:.65rem;width:44px;height:44px;display:grid;place-items:center;}
.luna-chat-close:hover {background:#dcefe9;border-color:#afcec4;}
.luna-chat-scroll {min-height:0;overflow-y:auto;padding:clamp(.85rem,2vw,1.5rem);
  scrollbar-width:thin;scrollbar-color:#9ac9be transparent;overscroll-behavior:contain;
  background-image:radial-gradient(#96c5bc32 .7px,transparent .8px);background-size:11px 11px;}
.luna-chat-greeting {margin:0;padding:.12rem 0 .12rem .85rem;border-inline-start:2px solid #459d8e;
  padding-inline-start:.85rem;padding-inline-end:0;font-size:clamp(.98rem,1.3vw,1.08rem);line-height:1.55;color:#173e42;white-space:pre-line;}
.luna-chat-suggestions {display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1.15rem;}
.luna-chat-chip {min-height:40px;padding:.47rem .7rem;border:1px solid #b4d2cb;border-radius:.72rem;
  color:#20574e;background:#f8fffd;text-align:start;font-size:.88rem;line-height:1.38;}
.luna-chat-chip:hover,.luna-chat-chip:focus-visible {background:#d9f4e9;border-color:#6fae9f;}
.luna-chat-log {display:flex;flex-direction:column;gap:.68rem;}
.luna-chat-log:not(:empty) {margin-top:1.15rem;}
.luna-chat-message {max-width:94%;margin:0;padding:.64rem .9rem;overflow-wrap:anywhere;white-space:pre-wrap;
  line-height:1.48;font-size:1rem;}
.luna-chat-luna {align-self:flex-start;border:1px solid #c1dfd8;border-radius:.95rem .95rem .95rem .25rem;background:#fbfffd;color:#1c3c42;}
.luna-chat-visitor {align-self:flex-end;border-radius:.95rem .95rem .25rem .95rem;color:#effff8;background:#224e50;}
.luna-chat[dir="rtl"] .luna-chat-luna {border-radius:.95rem .95rem .25rem .95rem;}
.luna-chat[dir="rtl"] .luna-chat-visitor {border-radius:.95rem .95rem .95rem .25rem;}
.luna-chat-footer {padding:.67rem clamp(.7rem,2vw,1.3rem) .38rem;background:#f1faf6;border-top:1px solid #bfded5;}
.luna-chat-feedback {display:flex;align-items:center;flex-wrap:wrap;gap:.4rem .7rem;margin:0 0 .55rem;font-size:.84rem;color:#385d5c;}
.luna-chat-status.is-pending::before {content:'';display:inline-block;width:.48rem;height:.48rem;margin-inline-end:.45rem;
  background:#259180;border-radius:50%;}
.luna-chat-retry {min-height:34px;background:transparent;border:0;color:var(--luna-accent);font-weight:650;
  text-decoration:underline;text-underline-offset:.17em;}
.luna-chat-form {display:flex;align-items:flex-end;gap:.45rem;padding:.32rem .35rem .32rem .7rem;border:1px solid #8bb8ae;
  border-radius:.83rem;background:#fff;box-shadow:inset 0 1px 3px #173e3810;}
.luna-chat-form:focus-within {border-color:#237d6d;box-shadow:0 0 0 2px #69b6a42e;}
.luna-chat-input {display:block;flex:1;min-width:0;min-height:42px;padding:.57rem 0;resize:none;
  overflow-y:auto;outline:none;background:transparent;color:#143237;border:0;font:inherit;line-height:1.4;scrollbar-width:thin;}
.luna-chat-input::placeholder {color:#55726d;}
.luna-chat-send {display:grid;place-items:center;flex:none;min-width:44px;height:44px;border:0;border-radius:.6rem;
  color:white;background:var(--luna-accent);}
.luna-chat-send:disabled {cursor:default;color:#66847b;background:#e1ece5;}
.luna-chat-engineer {display:inline-flex;align-items:center;gap:.4rem;min-height:42px;max-width:100%;padding:.15rem .25rem;
  background:transparent;border:0;color:#31675c;text-align:start;font-size:.88rem;}
.luna-chat-engineer svg {width:1rem;height:1rem;flex:none;}
.luna-chat-engineer:hover,.luna-chat-engineer.is-recommended {color:#074c3d;text-decoration:underline;text-underline-offset:.16em;}
.luna-chat button:focus-visible {outline:2px solid #0a8373;outline-offset:2px;}
@media (prefers-reduced-motion:no-preference) {
  .luna-chat[open] .luna-screen {animation:luna-project-in .24s ease-out both;}
  .luna-chat-status.is-pending::before {animation:luna-chat-pulse 1.4s ease-in-out infinite alternate;}
}
@keyframes luna-project-in {from {opacity:0;transform:translate(6px,-3px) scale(.985);}to{opacity:1;transform:none;}}
@keyframes luna-chat-pulse {from{opacity:.35}to{opacity:1}}
@media (max-width:700px) and (orientation:portrait) {
  .luna-chat {
    --edge:max(.5rem,env(safe-area-inset-bottom));
    --panel-height:min(77dvh,calc(var(--luna-vh,100dvh) - var(--edge) - max(.45rem,env(safe-area-inset-top))));
    left:max(.5rem,env(safe-area-inset-left));right:max(.5rem,env(safe-area-inset-right));
    top:calc(var(--luna-vtop,0px) + var(--luna-vh,100dvh) - var(--panel-height) - var(--edge));bottom:auto;
    width:auto;height:var(--panel-height);margin:0;
  }
  .luna-screen {border-radius:.95rem;}
  .luna-chat-header {padding:.28rem .65rem;}
  .luna-chat-greeting {font-size:1rem;}
  .luna-chat-input {font-size:16px;}
  .luna-chat-chip {min-height:44px;}
  .luna-chat-footer {padding:.5rem .65rem .1rem;}
}
@media (max-height:540px) and (orientation:landscape) {
  .luna-chat {width:min(59vw,38rem);height:calc(var(--luna-vh,100dvh) - 1rem);
    left:max(.5rem,env(safe-area-inset-left));top:calc(var(--luna-vtop,0px) + .5rem);bottom:auto;margin:0;}
  .luna-chat-header,.luna-chat-footer {padding:.2rem .7rem;}
  .luna-chat-scroll {padding:.7rem .9rem;}
}
