.moko-launcher-zone {
  position: fixed;
  inset: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
    calc(72px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  z-index: 26;
  pointer-events: none;
}

.moko-launcher-zone .moko-launcher {
  position: absolute;
  inset: auto auto 20px 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid #a9c9ef;
  border-radius: 50%;
  background: #172b46;
  box-shadow: none;
  color: #f4f8ff;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.moko-launcher-zone .moko-launcher::before {
  content: "";
  position: absolute;
  inset: -6px;
  pointer-events: none;
  border: 1px solid #81a8d5;
  border-radius: inherit;
}

.moko-launcher-zone .moko-launcher svg { width: 25px; height: 25px; pointer-events: none; }
.moko-launcher-zone .moko-launcher:hover { background: #2e5687; }
.moko-launcher-zone .moko-launcher[aria-expanded="true"] { background: #e7f1ff; color: #172b46; }
.moko-launcher-zone .moko-launcher[data-dragging] { cursor: grabbing; }
.moko-launcher-zone .moko-launcher:focus-visible { outline: 2px solid #225c9c; outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .moko-launcher[aria-expanded="false"]:not([data-dragging])::before { animation: moko-beacon 1.6s ease-out 2; }
  @keyframes moko-beacon {
    0%, 100% { opacity: 1; transform: scale(1); }
    55% { opacity: .35; transform: scale(1.13); }
  }
}

#panel[data-view="assistant"] {
  position: fixed;
  inset: auto 20px 20px auto;
  z-index: 27;
  margin: 0;
  padding: 0;
  width: min(560px, calc(100% - 40px));
  height: min(680px, 72dvh);
  max-height: min(720px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid #415777;
  border-radius: 20px;
  background: #142b48;
  color: #f1f6ff;
  color-scheme: dark;
  box-shadow: 0 18px 48px #030a1c66;
}

#panel[data-view="assistant"][open] { display: flex; flex-direction: column; }
.moko-drawer-top, .moko-drawer-footer { flex: none; padding: 9px 12px; background: #203c60; }
#panel .moko-drawer-top { margin: 0; justify-content: start; gap: 12px; border-bottom: 1px solid #344b69; }
.moko-drawer-top h2 { margin: 0; font-family: inherit; font-size: 1rem; font-weight: 700; line-height: 1.35; color: #fff; }
.moko-drawer-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #2b5087; color: #fff; }
.moko-drawer-top .close { margin-left: auto; padding: 0; width: 38px; height: 38px; border: 1px solid #ffffff70; background: transparent; color: #fff; font-size: 22px; }
.moko-drawer-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-height: 0; overflow: auto; padding: 9px 12px; background: #0c1525; }
.moko-drawer-body p { max-width: 87%; margin: 0; padding: 10px 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.moko-drawer-body .moko-answer { border-radius: 16px 16px 16px 4px; background: #1a2c45; color: #f1f6ff; }
.moko-drawer-body .moko-user-text { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: #2b5087; color: #fff; }
.moko-drawer-footer { border-top: 1px solid #344b69; }
.moko-composer { display: flex; align-items: center; gap: 10px; }
.moko-composer input { flex: 1; min-width: 0; min-height: 48px; padding: 8px 14px; border: 1px solid #526985; border-radius: 22px; background: #16263d; color: #f1f6ff; font: inherit; font-size: 16px; }
.moko-composer input::placeholder { color: #aebed4; opacity: 1; }
.moko-composer button { flex: none; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid #a9c9ff; border-radius: 50%; background: #a9c9ff; color: #10213b; }
.moko-composer .moko-mic { width: 44px; height: 44px; border-color: #cddcf2; border-radius: 12px; background: #eef4ff; color: #2455a4; }
.moko-composer .moko-mic[aria-pressed="true"] { background: #ffe8eb; border-color: #e9a9b0; color: #a02532; }
.moko-composer svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.moko-composer button:hover { background: #d0e1ff; }
.moko-drawer-footer .moko-status { color: #dce9fc; }
.moko-drawer-footer .moko-listen { margin-top: 4px; padding: 3px 0; font: inherit; font-size: .82rem; color: #c8dbf8; background: transparent; border: 0; }
.moko-drawer-footer .moko-listen:disabled { display: none; }
.moko-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#panel[data-view="assistant"] :is(input,button,a,summary):focus-visible { outline: 2px solid #a9c9ff; outline-offset: 3px; }

@media (max-width: 600px) {
  #panel[data-view="assistant"] {
    inset: auto 8px calc(72px + env(safe-area-inset-bottom)) 8px;
    width: auto;
    max-width: none;
    height: min(520px, 60dvh);
    max-height: calc(100dvh - 88px - env(safe-area-inset-bottom));
  }
  .moko-composer { gap: 6px; }
}
