.smokey-launcher,
.smokey-chat {
  font-family: Geologica, Arial, sans-serif;
  color: var(--ink, #1a1d21);
}

.smokey-launcher {
  position: fixed;
  z-index: 60;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 9px 20px 9px 13px;
  border: 1px solid #1a1d2126;
  border-radius: 40px;
  background: var(--lime, #c5cf42);
  box-shadow: 0 5px 24px #1a1d212b;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.smokey-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px #1a1d2138;
}

.smokey-launcher-bear {
  display: block;
  width: 31px;
  height: 33px;
  object-fit: contain;
}

.smokey-chat {
  position: fixed;
  inset: auto max(22px, env(safe-area-inset-right)) max(92px, calc(env(safe-area-inset-bottom) + 74px)) auto;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 610px;
  max-height: calc(100vh - 116px);
  max-height: calc(100dvh - 116px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: 0;
  padding: 0;
  border: 1px solid #1a1d2126;
  border-radius: 22px;
  background: var(--cream, #f4f2e4);
  box-shadow: 0 16px 64px #0a253852;
  overflow: hidden;
  text-align: left;
}

.smokey-chat::backdrop { background: #10222b26; }
.smokey-chat:not([open]) { display: none; }
.smokey-chat *, .smokey-launcher { box-sizing: border-box; }
.smokey-chat button, .smokey-chat textarea { font: inherit; }
.smokey-chat button { cursor: pointer; }
.smokey-chat button:disabled { cursor: wait; opacity: .55; }
.smokey-chat button[hidden] { display: none; }
.smokey-chat :focus-visible, .smokey-launcher:focus-visible {
  outline: 3px solid var(--blue, #0a658a);
  outline-offset: 3px;
}

.smokey-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.smokey-header {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  padding: 17px 14px 17px 19px;
  background: var(--blue, #0a658a);
  color: var(--cream, #f4f2e4);
}

.smokey-header-bear {
  flex-shrink: 0;
  width: 43px;
  height: 47px;
  padding: 5px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--lime, #c5cf42);
}

.smokey-heading { flex: 1; min-width: 0; }
.smokey-heading h2 { margin: 0; font-size: 18px; line-height: 1.2; font-weight: 700; letter-spacing: -.035em; }
.smokey-heading p { margin: 5px 0 0; font-size: 10px; line-height: 1.4; font-weight: 400; }
.smokey-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #f4f2e450;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 26px !important;
  line-height: 1;
}
.smokey-close:hover { background: #f4f2e41a; }
.smokey-chat .smokey-close:focus-visible { outline-color: var(--lime, #c5cf42); outline-offset: 2px; }

.smokey-conversation {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  min-height: 60px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 19px;
  scrollbar-width: thin;
}
.smokey-chat .smokey-conversation:focus-visible { outline-offset: -4px; }
.smokey-message {
  flex-shrink: 0;
  max-width: 92%;
  padding: 12px 14px;
  border: 1px solid #1a1d2112;
  border-radius: 16px 16px 16px 4px;
  background: #fffdf6;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.smokey-message-user {
  align-self: flex-end;
  border-color: transparent;
  border-radius: 16px 16px 4px 16px;
  background: var(--sky, #cde5f7);
}
.smokey-speaker { display: block; margin-bottom: 5px; font-size: 10px; font-weight: 600; color: var(--blue, #0a658a); }
.smokey-message p { margin: 0; white-space: pre-wrap; }

.smokey-prompts { display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 7px; padding: 0 19px 12px; }
.smokey-prompt {
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid #0a658a40;
  border-radius: 20px;
  background: transparent;
  color: var(--blue, #0a658a);
  font-size: 10px !important;
  font-weight: 500 !important;
  line-height: 1.3;
}
.smokey-prompt:hover:not(:disabled) { background: var(--sky, #cde5f7); }
.smokey-feedback { flex-shrink: 0; margin: 0 19px; }
.smokey-status { margin: 0; font-size: 11px; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
.smokey-status:not(:empty) { margin-bottom: 10px; }
.smokey-feedback-error { color: #843e1a; }
.smokey-retry { margin: 0 0 10px; padding: 5px 10px; border: 1px solid currentColor; border-radius: 16px; background: transparent; color: inherit; font-size: 11px !important; font-weight: 500 !important; }

.smokey-form { flex-shrink: 0; margin: 0; padding: 12px 19px 0; border-top: 1px solid #1a1d2117; }
.smokey-label-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 10px; font-weight: 500; }
.smokey-count { color: #58626b; font-weight: 300; }
.smokey-compose { display: flex; align-items: flex-end; gap: 8px; }
.smokey-input {
  display: block;
  flex: 1;
  min-width: 0;
  width: 100%;
  max-height: 90px;
  resize: none;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #1a1d2138;
  border-radius: 12px;
  background: #fffdf6;
  color: var(--ink, #1a1d21);
  font-size: 13px !important;
  font-weight: 300 !important;
  line-height: 1.5;
}
.smokey-input::placeholder { color: #636d74; opacity: 1; }
.smokey-send {
  flex-shrink: 0;
  min-width: 59px;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--blue, #0a658a);
  color: #fff;
  font-size: 11px !important;
  font-weight: 500 !important;
}
.smokey-send:hover:not(:disabled) { background: #064c69; }
.smokey-input-hint { margin: 6px 0 0; font-size: 9px; line-height: 1.4; color: #636d74; }
.smokey-disclosure { flex-shrink: 0; margin: 0; padding: 10px 19px 15px; font-size: 9px; font-weight: 300; line-height: 1.5; color: #596269; }

@media (max-width: 480px) {
  .smokey-launcher { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); min-height: 53px; padding: 8px 16px 8px 12px; font-size: 14px; }
  .smokey-launcher-bear { width: 28px; height: 30px; }
  .smokey-chat { inset: auto max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) auto; width: calc(100vw - 24px); max-width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)); height: 610px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 20px; }
  .smokey-input { font-size: 16px !important; }
  .smokey-header { padding: 15px; }
  .smokey-heading h2 { font-size: 17px; }
}

@media (max-height: 520px) {
  .smokey-chat { bottom: max(10px, env(safe-area-inset-bottom)); max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .smokey-header { padding-block: 10px; }
  .smokey-header-bear { width: 34px; height: 37px; }
  .smokey-conversation { padding-block: 12px; }
  .smokey-prompts { padding-bottom: 8px; }
  .smokey-form { padding-top: 8px; }
  .smokey-disclosure { padding-block: 6px; }
  .smokey-input-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .smokey-launcher { transition: none; }
  .smokey-launcher:hover { transform: none; }
}
