.osw-root {
  --osw-edge: clamp(14px, 2.2vw, 26px);
  --osw-font: "Geist", "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --osw-mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --osw-ink: #ededeb;
  --osw-ink-2: #c8c8ce;
  --osw-muted: #8f8f98;
  --osw-faint: #62626b;
  --osw-line: rgba(255, 255, 255, 0.08);
  --osw-blue: #2456e6;
  --osw-glow: #91aaff;
  --osw-cream: #ffeaab;
  --osw-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: fixed;
  right: max(var(--osw-edge), env(safe-area-inset-right));
  bottom: max(var(--osw-edge), env(safe-area-inset-bottom));
  z-index: 120;
  font-family: var(--osw-font);
  color: var(--osw-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.osw-root *,
.osw-root *::before,
.osw-root *::after {
  box-sizing: border-box;
}

.osw-root p,
.osw-root h2,
.osw-root h3 {
  margin: 0;
}

.osw-root :where(button) {
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.osw-root a {
  text-decoration: none;
}

.osw-launcher {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background:
    radial-gradient(120% 120% at 30% 16%, #7d95ff 0%, #315ff0 30%, #214acb 62%, #15318e 100%);
  color: #fff;
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.52),
    0 0 0 5px rgba(36, 86, 230, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 180ms var(--osw-ease), box-shadow 180ms var(--osw-ease);
}

.osw-launcher::before {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(125, 157, 255, 0.24);
  border-radius: 50%;
  transform: scale(0.97);
  pointer-events: none;
}

.osw-launcher:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.56),
    0 0 0 6px rgba(36, 86, 230, 0.12),
    0 0 30px rgba(61, 105, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.osw-launcher:active {
  transform: translateY(0) scale(0.97);
}

.osw-launcher:focus-visible {
  outline: 2px solid var(--osw-glow);
  outline-offset: 4px;
}

.osw-launcher-icon {
  display: block;
  width: 31px;
  height: 31px;
}

.osw-launcher-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border: 2px solid #17358f;
  border-radius: 50%;
  background: #6fd08c;
  box-shadow: 0 0 9px rgba(111, 208, 140, 0.5);
}

.osw-root.is-open .osw-launcher-badge {
  opacity: 0;
}

.osw-panel {
  position: fixed;
  right: max(var(--osw-edge), env(safe-area-inset-right));
  bottom: calc(max(var(--osw-edge), env(safe-area-inset-bottom)) + 72px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  width: min(386px, calc(100vw - 28px));
  height: min(628px, calc(100dvh - 112px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 20px;
  background:
    radial-gradient(115% 75% at 100% 0%, rgba(36, 86, 230, 0.14), transparent 48%),
    linear-gradient(180deg, #121317 0%, #0b0c0f 100%);
  box-shadow:
    0 36px 90px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform-origin: calc(100% - 30px) 100%;
  animation: osw-panel-in 240ms var(--osw-ease) both;
}

.osw-panel[hidden] {
  display: none !important;
}

.osw-panel:focus {
  outline: none;
}

.osw-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 22%;
  left: 22%;
  z-index: 2;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  pointer-events: none;
}

.osw-panel::after {
  content: "";
  position: absolute;
  bottom: -214px;
  left: -152px;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(125, 157, 255, 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 46px rgba(125, 157, 255, 0.018),
    0 0 0 92px rgba(125, 157, 255, 0.009);
  pointer-events: none;
}

.osw-head {
  position: relative;
  z-index: 3;
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-bottom: 1px solid var(--osw-line);
  background: rgba(255, 255, 255, 0.014);
}

.osw-brandmark {
  display: block;
  flex: none;
  width: 32px;
  height: 32px;
}

.osw-brandmark svg {
  display: block;
  width: 32px;
  height: 32px;
}

.osw-head-copy {
  flex: 1;
  min-width: 0;
}

.osw-wordmark {
  color: var(--osw-ink);
  font-size: 14.5px;
  font-weight: 560;
  letter-spacing: -0.028em;
  line-height: 1.1;
}

.osw-wordmark-sub {
  display: inline-block;
  margin-left: 6px;
  padding-left: 7px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--osw-muted);
  font-family: var(--osw-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  vertical-align: 1px;
}

.osw-kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: #7e7e88;
  font-family: var(--osw-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.osw-live {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: #6fd08c;
  box-shadow: 0 0 8px rgba(111, 208, 140, 0.55);
}

.osw-head-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 1px;
  margin: -2px -3px 0 0;
}

.osw-iconbtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #8d8d96;
  transition: color 140ms var(--osw-ease), background 140ms var(--osw-ease);
}

.osw-iconbtn:hover {
  color: var(--osw-ink);
  background: rgba(255, 255, 255, 0.06);
}

.osw-iconbtn:focus-visible {
  outline: 2px solid var(--osw-glow);
  outline-offset: 1px;
}

.osw-iconbtn svg {
  width: 15px;
  height: 15px;
}

.osw-scroll {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.osw-scroll::-webkit-scrollbar {
  width: 6px;
}

.osw-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.osw-intro,
.osw-thread,
.osw-suggests,
.osw-human {
  flex: none;
}

.osw-intro {
  padding: 2px 1px 0;
}

.osw-gap {
  flex: 1 1 auto;
  min-height: 14px;
}

.osw-lead {
  max-width: 27ch;
  color: var(--osw-ink);
  font-size: 20.5px;
  font-weight: 560;
  letter-spacing: -0.032em;
  line-height: 1.12;
}

.osw-greeting {
  max-width: 40ch;
  margin-top: 9px;
  color: var(--osw-muted);
  font-size: 12.5px;
  letter-spacing: -0.006em;
  line-height: 1.55;
}

.osw-thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.osw-thread:not(:empty) {
  margin-top: 18px;
}

.osw-msg {
  animation: osw-item-in 220ms var(--osw-ease) both;
}

.osw-msg--assistant {
  display: block;
  padding-left: 12px;
  border-left: 1px solid rgba(125, 157, 255, 0.24);
}

.osw-msg--user {
  display: flex;
  justify-content: flex-end;
}

.osw-msg-body {
  min-width: 0;
  max-width: 100%;
}

.osw-msg--user .osw-msg-body {
  max-width: 86%;
}

.osw-msg-name {
  margin-bottom: 5px;
  color: #8492b8;
  font-family: var(--osw-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.osw-msg-text {
  color: #c9c9cf;
  font-size: 13px;
  letter-spacing: -0.006em;
  line-height: 1.62;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.osw-msg--user .osw-msg-text {
  padding: 8px 11px;
  border-radius: 12px 12px 4px 12px;
  background: linear-gradient(180deg, #2c5cf0, #2148c2);
  color: #fff;
  box-shadow: 0 7px 18px rgba(21, 50, 145, 0.24);
}

.osw-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  margin-top: 10px;
}

.osw-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(125, 157, 255, 0.28);
  border-radius: 0;
  background: none;
  color: #9fb4ff;
  font-family: var(--osw-mono);
  font-size: 9.5px;
  letter-spacing: 0.015em;
  line-height: 1.25;
  transition: border-color 140ms var(--osw-ease), color 140ms var(--osw-ease);
}

.osw-source:hover {
  border-color: rgba(125, 157, 255, 0.62);
  background: none;
  color: #c4d1ff;
  text-decoration: none;
}

.osw-source:focus-visible {
  outline: 2px solid var(--osw-glow);
  outline-offset: 3px;
}

.osw-source svg {
  width: 9px;
  height: 9px;
  opacity: 0.75;
}

.osw-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding-top: 3px;
}

.osw-typing i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8a8a93;
  animation: osw-typing-dot 1.15s infinite ease-in-out;
}

.osw-typing i:nth-child(2) {
  animation-delay: 120ms;
}

.osw-typing i:nth-child(3) {
  animation-delay: 240ms;
}

.osw-suggests {
  margin-top: 18px;
}

.osw-suggests[hidden] {
  display: none !important;
}

.osw-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 8px;
  color: #64646d;
  font-family: var(--osw-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.osw-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent);
}

.osw-suggest-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.osw-suggest {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 10px 4px 10px 7px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0;
  background: transparent;
  color: #b9b9c0;
  font-size: 12.3px;
  letter-spacing: -0.005em;
  line-height: 1.35;
  text-align: left;
  transition: background 140ms var(--osw-ease), color 140ms var(--osw-ease), box-shadow 140ms var(--osw-ease);
}

.osw-suggest:hover {
  background: linear-gradient(90deg, rgba(36, 86, 230, 0.1), transparent 78%);
  color: var(--osw-ink);
  box-shadow: inset 2px 0 0 rgba(125, 157, 255, 0.55);
}

.osw-suggest:focus-visible {
  outline: 2px solid var(--osw-glow);
  outline-offset: -2px;
}

.osw-suggest-n {
  color: #5d5d67;
  font-family: var(--osw-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  transition: color 140ms var(--osw-ease);
}

.osw-suggest:hover .osw-suggest-n {
  color: #91aaff;
}

.osw-suggest-arrow {
  opacity: 0.28;
  transition: opacity 140ms var(--osw-ease), transform 140ms var(--osw-ease);
}

.osw-suggest-arrow svg {
  display: block;
  width: 13px;
  height: 13px;
}

.osw-suggest:hover .osw-suggest-arrow {
  opacity: 0.72;
  transform: translateX(2px);
}

.osw-human {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff1c2 0%, #ffe79b 100%);
  color: #1a1608;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.osw-human-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(26, 22, 8, 0.08);
}

.osw-human-icon svg {
  width: 14px;
  height: 14px;
}

.osw-human-copy {
  flex: 1;
  min-width: 0;
}

.osw-human-title {
  font-size: 11.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.osw-human-sub {
  margin-top: 2px;
  color: rgba(26, 22, 8, 0.64);
  font-size: 10px;
  line-height: 1.35;
}

.osw-human-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  min-height: 29px;
  padding: 0 10px;
  border-radius: 999px;
  background: #1a1608;
  color: var(--osw-cream);
  font-size: 10px;
  font-weight: 560;
  letter-spacing: -0.005em;
  line-height: 1;
  transition: background 140ms var(--osw-ease);
}

.osw-human-link:hover {
  background: #2c2510;
  text-decoration: none;
}

.osw-human-link:focus-visible {
  outline: 2px solid #1a1608;
  outline-offset: 2px;
}

.osw-human-link svg {
  width: 10px;
  height: 10px;
}

.osw-compose-wrap {
  position: relative;
  z-index: 2;
  flex: none;
  padding: 10px 13px 11px;
  border-top: 1px solid var(--osw-line);
  background: linear-gradient(180deg, rgba(10, 10, 13, 0.15), rgba(10, 10, 13, 0.72));
}

.osw-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 5px 5px 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #15161a;
  transition: border-color 160ms var(--osw-ease), box-shadow 160ms var(--osw-ease);
}

.osw-compose:focus-within {
  border-color: rgba(125, 157, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(36, 86, 230, 0.13);
}

.osw-input {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  max-height: 92px;
  padding: 7px 0 6px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--osw-ink);
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: -0.005em;
  line-height: 1.45;
  resize: none;
}

.osw-input::placeholder {
  color: #6b6b74;
}

.osw-send {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 54px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--osw-blue);
  color: #fff;
  font-size: 10.5px;
  font-weight: 560;
  letter-spacing: -0.005em;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(36, 86, 230, 0.25);
  transition: background 140ms var(--osw-ease), opacity 140ms var(--osw-ease), box-shadow 140ms var(--osw-ease);
}

.osw-send:hover:not(:disabled) {
  background: #3c6df2;
}

.osw-send:disabled {
  cursor: not-allowed;
  opacity: 0.35;
  box-shadow: none;
}

.osw-send:focus-visible {
  outline: 2px solid var(--osw-glow);
  outline-offset: 2px;
}

.osw-send svg {
  width: 12px;
  height: 12px;
}

.osw-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  padding: 0 2px;
  color: #585861;
  font-family: var(--osw-mono);
  font-size: 8.5px;
  letter-spacing: 0.015em;
  line-height: 1.4;
}

.osw-foot a {
  flex: none;
  color: #6d6d77;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.osw-foot a:hover {
  color: var(--osw-ink-2);
}

.osw-scrim {
  display: none;
}

@keyframes osw-panel-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes osw-item-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes osw-typing-dot {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (max-width: 640px) {
  .osw-root {
    --osw-edge: 12px;
  }

  .osw-launcher {
    width: 54px;
    height: 54px;
  }

  .osw-launcher-icon {
    width: 26px;
    height: 26px;
  }

  .osw-panel {
    position: fixed;
    top: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    height: min(560px, calc(100dvh - max(16px, env(safe-area-inset-top))));
    max-height: none;
    border-radius: 18px;
    transform-origin: 50% 100%;
  }

  .osw-head {
    padding-top: 14px;
  }

  .osw-iconbtn {
    width: 40px;
    height: 40px;
  }

  .osw-head-actions {
    margin: 0 -3px 0 0;
  }

  .osw-scroll {
    padding: 16px 16px 6px;
  }

  .osw-msg-text {
    font-size: 13.5px;
  }

  .osw-suggest {
    min-height: 42px;
    font-size: 12.5px;
  }

  .osw-send {
    min-width: 58px;
    height: 38px;
    padding: 0 11px;
    font-size: 11px;
  }

  .osw-input {
    min-height: 36px;
    font-size: 16px;
  }

  .osw-scrim {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms var(--osw-ease);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .osw-root.is-open .osw-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  body.osw-locked {
    overflow: hidden;
  }
}

@media (max-width: 380px) {
  .osw-human {
    flex-wrap: wrap;
  }

  .osw-human-link {
    margin-left: 38px;
  }

  .osw-foot {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .osw-root *,
  .osw-root *::before,
  .osw-root *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (forced-colors: active) {
  .osw-launcher,
  .osw-panel,
  .osw-suggest,
  .osw-source,
  .osw-send {
    border: 1px solid ButtonText;
  }
}
