#ss-haiku-chat-root {
  position: fixed;
  right: 20px;
  bottom: 16px;
  z-index: 2147483000;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#ss-haiku-chat-root * {
  box-sizing: border-box;
}

.ss-haiku-launcher {
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 999px;
  background: #2f6ff0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(47, 111, 240, 0.42);
  transition: transform 0.16s ease, background 0.16s ease;
}

.ss-haiku-launcher:hover {
  background: #255fd6;
  transform: translateY(-2px) scale(1.04);
}

.ss-haiku-launcher svg {
  width: 26px;
  height: 26px;
}

.ss-haiku-unread {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #19a957;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
}

.ss-haiku-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: 360px;
  max-width: calc(100vw - 20px);
  height: min(590px, calc(100vh - 98px));
  padding: 0 !important;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dde6f8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(16, 26, 51, 0.12), 0 24px 56px rgba(16, 26, 51, 0.14);
}

.ss-haiku-panel.is-open {
  display: flex;
  animation: ss-haiku-panel-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ss-haiku-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ss-haiku-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 12px 12px 12px 13px;
  background: linear-gradient(135deg, #16243f 0%, #0a1124 72%);
  color: #fff;
}

.ss-haiku-header::after {
  content: "";
  position: absolute;
  top: -54px;
  right: -34px;
  width: 172px;
  height: 172px;
  border-radius: 999px;
  background: radial-gradient(circle, #2f6ff0 0%, rgba(47, 111, 240, 0) 66%);
  opacity: 0.34;
  pointer-events: none;
}

.ss-haiku-avatar-wrap {
  position: relative;
  z-index: 1;
  flex: none;
}

.ss-haiku-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #2f6ff0;
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  box-shadow: 0 3px 11px rgba(0, 0, 0, 0.32);
}

.ss-haiku-avatar.small {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 16px;
  box-shadow: 0 1px 3px rgba(16, 26, 51, 0.2);
}

.ss-haiku-status-dot {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  border: 2.5px solid #0c1430;
  background: #19a957;
}

.ss-haiku-heading {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ss-haiku-title {
  color: #fff;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.2;
}

.ss-haiku-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #aebbd6;
  font-size: 12px;
  font-weight: 500;
}

.ss-haiku-subtitle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #19a957;
}

.ss-haiku-header-actions {
  position: relative;
  z-index: 1;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ss-haiku-text-button,
.ss-haiku-close {
  cursor: pointer;
  font: inherit;
}

.ss-haiku-text-button {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #cbd6ec;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.12s ease, color 0.12s ease;
}

.ss-haiku-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd6ec;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.ss-haiku-text-button:hover,
.ss-haiku-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.ss-haiku-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, #fbfcfe 0%, #f6f8fc 100%);
}

.ss-haiku-messages::-webkit-scrollbar {
  width: 9px;
}

.ss-haiku-messages::-webkit-scrollbar-thumb {
  border: 2px solid #f7f9fc;
  border-radius: 999px;
  background: #c8d1e3;
}

.ss-haiku-day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 9px;
}

.ss-haiku-day::before,
.ss-haiku-day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #dde6f8;
}

.ss-haiku-day span {
  color: #6b7a9a;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.ss-haiku-welcome,
.ss-haiku-row.assistant,
.ss-haiku-typing-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.ss-haiku-welcome,
.ss-haiku-row,
.ss-haiku-typing-row {
  margin-top: 8px;
  animation: ss-haiku-message-in 0.26s ease both;
}

@keyframes ss-haiku-message-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ss-haiku-welcome-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.ss-haiku-bubble,
.ss-haiku-empty-bubble {
  max-width: calc(100% - 38px);
  border: 1px solid #dde6f8;
  border-radius: 4px 16px 16px 16px;
  background: #fff;
  color: #31405f;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(16, 26, 51, 0.06);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ss-haiku-empty-bubble strong {
  color: #0d1a3a;
  font-weight: 700;
}

.ss-haiku-meta {
  color: #8b98b4;
  font-size: 11px;
  padding-left: 4px;
}

.ss-haiku-quick {
  margin: 10px 0 0 37px;
}

.ss-haiku-quick-title {
  color: #6b7a9a;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.ss-haiku-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.ss-haiku-suggestion {
  border: 1px solid #c8d9ff;
  border-radius: 999px;
  background: #ebf2ff;
  color: #1b4fbd;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 10px;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.ss-haiku-suggestion:hover {
  border-color: #9fbeff;
  background: #dfeaff;
}

.ss-haiku-row.user {
  display: flex;
  justify-content: flex-end;
}

.ss-haiku-row.user .ss-haiku-bubble {
  max-width: 86%;
  border: 0;
  border-radius: 16px 4px 16px 16px;
  background: #2f6ff0;
  color: #fff;
  box-shadow: 0 6px 18px rgba(47, 111, 240, 0.3);
}

.ss-haiku-row.assistant .ss-haiku-bubble {
  max-width: calc(100% - 38px);
}

.ss-haiku-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border: 1px solid #dde6f8;
  border-radius: 4px 16px 16px 16px;
  background: #fff;
  padding: 14px 15px;
  box-shadow: 0 1px 2px rgba(16, 26, 51, 0.06);
}

.ss-haiku-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b98b4;
  animation: ss-haiku-bounce 0.85s infinite;
}

.ss-haiku-dot:nth-child(2) {
  animation-delay: 120ms;
}

.ss-haiku-dot:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes ss-haiku-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.55; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.ss-haiku-escalated {
  margin: 5px 0 0 37px;
  color: #087d47;
  font-size: 12px;
  font-weight: 800;
}

.ss-haiku-form {
  border-top: 1px solid #dde6f8;
  background: #fff;
  padding: 10px 12px 9px;
}

.ss-haiku-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ss-haiku-field {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid #d8e0ee;
  border-radius: 24px;
  background: #f3f6fb;
  padding: 0 13px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.ss-haiku-field:focus-within {
  border-color: #9fbeff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 111, 240, 0.14);
}

.ss-haiku-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 90px;
  resize: none;
  border: 0;
  background: transparent;
  color: #0d1a3a;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.35;
  outline: none;
  padding: 10px 0;
}

.ss-haiku-input::placeholder {
  color: #6b7a9a;
}

.ss-haiku-send,
.ss-haiku-rating-button,
.ss-haiku-secondary {
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.ss-haiku-send {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #2f6ff0;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(47, 111, 240, 0.3);
  transition: transform 0.12s ease, background 0.12s ease;
}

.ss-haiku-send:hover {
  background: #255fd6;
}

.ss-haiku-send:active {
  transform: scale(0.94);
}

.ss-haiku-send:disabled {
  cursor: not-allowed;
  background: #a8b5cf;
  box-shadow: none;
}

.ss-haiku-footnote {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding-left: 3px;
  color: #6b7a9a;
  font-size: 11px;
}

.ss-haiku-footnote .mark {
  color: #7c3aed;
  font-size: 12px;
}

.ss-haiku-footnote .muted {
  color: #8b98b4;
}

.ss-haiku-rating-bar {
  display: none;
  border-top: 1px solid #dde6f8;
  background: #fff;
  padding: 14px;
  text-align: center;
}

.ss-haiku-rating-bar.is-open {
  display: block;
}

.ss-haiku-rating-title {
  color: #0d1a3a;
  font-size: 14px;
  font-weight: 800;
}

.ss-haiku-rating-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.ss-haiku-rating-button {
  min-width: 70px;
  border: 1px solid #d8e0ee;
  border-radius: 14px;
  background: #fff;
  color: #0d1a3a;
  padding: 9px 12px;
}

.ss-haiku-secondary {
  margin-top: 10px;
  border: 1px solid #d8e0ee;
  border-radius: 14px;
  background: #fff;
  color: #31405f;
  padding: 8px 12px;
}

@media (max-width: 520px) {
  #ss-haiku-chat-root {
    right: 8px;
    bottom: 8px;
  }

  .ss-haiku-panel {
    position: fixed;
    inset: auto 6px 74px 6px;
    width: auto;
    max-width: none;
    height: min(590px, calc(100dvh - 82px));
  }
}
