/* Blobby corner launcher + chat panel - Figma "blobby chat" (node 19069:52761). */

.blobby-launcher {
  position: fixed;
  right: 23px;
  bottom: 33px;
  z-index: 1000;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  transition: transform 0.15s ease;
}

/* The 112px canvas overhangs the 62px button by 25px a side, which put its
   transparent right edge 2px past the viewport. The wrapper crops that 2px
   (ending at the viewport edge); the canvas and its art don't move. */
.blobby-launcher .groove-rive {
  width: 110px !important;
  margin: -25px -23px -25px -25px;
  overflow: hidden;
  pointer-events: none;
}

.blobby-launcher:hover {
  transform: scale(1.06);
}

.blobby-launcher-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 25px;
  height: 25px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--figma-green);
  border-radius: 13px;
  background: var(--navy-mid);
  color: var(--green-light);
  font-size: 12px;
  font-weight: 700;
}

/* --- Panel --- */

.blobby-panel {
  position: fixed;
  right: 49px;
  bottom: 64px;
  z-index: 1001;
  width: 475px;
  height: min(824px, calc(100vh - 128px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--navy-border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--navy-start) 0%, var(--navy-mid) 45%, var(--navy-end) 100%);
  box-shadow: 8px 8px 8px rgba(22, 41, 74, 0.5);
}

/* Small screens: span the viewport (less a 16px gutter) and sit above the
   launcher instead of overlapping it. */
@media (max-width: 767.98px) {
  .blobby-panel {
    left: 16px;
    right: 16px;
    bottom: 104px;
    width: auto;
    height: min(824px, calc(100vh - 176px));
  }
}

.blobby-panel.hidden {
  display: none;
}

.blobby-header {
  position: relative;
  flex-shrink: 0;
  height: 94px;
  border-bottom: 2px solid var(--navy-border);
  background: linear-gradient(180deg, var(--navy-start) 0%, var(--navy-mid) 45%, var(--navy-end) 100%);
}

.blobby-close {
  position: absolute;
  top: 17px;
  right: 15px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
}

.blobby-close img {
  display: block;
}

.blobby-tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 27px;
  display: flex;
}

.blobby-tab {
  position: relative;
  flex: 1 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--light-gray);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.blobby-tab.active {
  color: var(--white);
}

.blobby-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 8px;
  background: var(--gold);
}

.blobby-tab-label {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.blobby-tab-badge {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--green-strong);
  color: var(--white);
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

/* Wraps whichever tab is showing; lays its children out as the panel did. */
.blobby-tabpanel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* --- Chat --- */

.blobby-chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 40px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blobby-bubble {
  padding: 12px;
  border-radius: 16px 16px 16px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--white);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.blobby-bubble p {
  margin: 0;
}

.blobby-bubble.bot {
  align-self: stretch;
  background: var(--navy-card);
}

.blobby-bubble.reply {
  align-self: flex-start;
  max-width: 95%;
  padding: 12px 16px;
}

.blobby-bubble.user {
  align-self: flex-end;
  max-width: 76%;
  background: var(--navy-border);
  border-radius: 16px 16px 0 16px;
}

.blobby-prompts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.blobby-prompt {
  padding: 8px 16px;
  border: 2px solid var(--navy-border);
  border-radius: 24px;
  background: var(--navy-border);
  color: var(--white);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
}

.blobby-prompt:hover {
  border-color: var(--light-gray);
}

.blobby-sources {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  white-space: normal;
}

.blobby-source {
  font-size: 12px;
  text-decoration: underline;
}

.blobby-typing {
  margin: 0;
  color: var(--light-gray);
  font-size: 14px;
  font-style: italic;
}

.blobby-composer {
  flex-shrink: 0;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--navy-mid);
}

.blobby-disabled-note {
  margin-bottom: 4px;
}

.blobby-settings-link {
  color: var(--gold);
  text-decoration: underline;
}

.blobby-input {
  height: 48px;
  padding: 0 4px 0 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 40px;
  background: var(--navy-card-secondary);
}

.blobby-input-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blobby-input-avatar .groove-rive {
  margin: -13px;
}

.blobby-input input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}

.blobby-input input::placeholder {
  color: var(--white);
  font-weight: 700;
}

.blobby-input.disabled input,
.blobby-input.disabled input::placeholder {
  color: var(--light-gray);
}

.blobby-send {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 40px;
  background: var(--figma-green);
}

.blobby-send:disabled {
  opacity: 0.4;
  cursor: default;
}

.blobby-disclaimer {
  margin: 0;
  color: var(--light-gray);
  font-size: 12px;
  line-height: 1.4;
}

/* --- Notifications --- */

.blobby-notifications {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.blobby-notifications-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 40px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.blobby-notification-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blobby-notification-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blobby-notification-heading {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.blobby-notification {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 8px 12px 16px;
  border: 1px solid var(--navy-border);
  border-radius: 8px;
  background: var(--navy-card);
}

.blobby-notification.unread {
  background: var(--navy-card-secondary);
}

.blobby-notification-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}

.blobby-notification-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--white);
}

.blobby-notification-icon.orange {
  background: #FD8A51;
}

.blobby-notification-icon.purple {
  background: #D27AFF;
}

.blobby-notification-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.blobby-notification-title {
  color: var(--gold);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.blobby-notification-subtitle,
.blobby-notification-time {
  font-size: 12px;
  line-height: 1.4;
}

.blobby-notification-time {
  color: var(--light-gray);
}

.blobby-notification-menu {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
}

.blobby-clear-all {
  flex-shrink: 0;
  margin: 0 16px 16px;
  padding: 16px;
  border: 0;
  background: none;
  color: #D1817E;
  font-size: 16px;
  font-weight: 600;
}

.blobby-notifications-empty {
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.3);
}

.blobby-empty-title {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  font-weight: 500;
}

.blobby-empty-sub {
  margin: 0;
  color: var(--light-gray);
  font-size: 14px;
}

.blobby-dialog-scrim {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 31, 56, 0.7);
}

.blobby-dialog {
  width: 280px;
  max-width: calc(100% - 32px);
  padding: 24px;
  border: 1px solid var(--navy-border);
  border-radius: 12px;
  background: var(--navy-card);
}

.blobby-dialog-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 500;
}

.blobby-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.blobby-dialog-actions button {
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--gold);
  font-size: 14px;
  font-weight: 500;
}

.blobby-bubble code {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--navy-card-secondary);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
}
