:root {
  --jbs-ai-green: #176b3a;
  --jbs-ai-green-dark: #0f4f2a;
  --jbs-ai-green-soft: #edf7f0;
  --jbs-ai-gold: #d6a928;
  --jbs-ai-gold-light: #f3d77a;
  --jbs-ai-gold-dark: #8e6810;
  --jbs-ai-ink: #16211b;
  --jbs-ai-muted: #647069;
  --jbs-ai-line: #dce5df;
  --jbs-ai-surface: #ffffff;
  --jbs-ai-canvas: #f5f8f6;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.jbs-ai,
.jbs-ai * { box-sizing: border-box; }

.jbs-ai {
  position: fixed;
  z-index: 2147482000;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  color: var(--jbs-ai-ink);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.jbs-ai button,
.jbs-ai textarea { font: inherit; }

.jbs-ai__launcher {
  display: grid;
  place-items: center;
  align-items: center;
  width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 7px;
  border: 1px solid rgba(214, 169, 40, .72) !important;
  border-radius: 999px !important;
  color: #fff;
  background: linear-gradient(135deg, #176b3a, #083d24) !important;
  box-shadow: inset 0 1px 0 rgba(255, 231, 150, .18), 0 14px 34px rgba(10, 54, 29, .34), 0 0 0 1px rgba(142, 104, 16, .12);
  cursor: pointer;
  transition: transform .24s cubic-bezier(.22, 1, .36, 1), box-shadow .24s ease, opacity .2s ease;
}

.jbs-ai__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(10, 54, 29, .34);
}

.jbs-ai.is-opening .jbs-ai__launcher { transform: scale(.955); }
.jbs-ai.is-closing .jbs-ai__launcher { transform: scale(.975); }

.jbs-ai__launcher:focus-visible,
.jbs-ai button:focus-visible,
.jbs-ai textarea:focus-visible {
  outline: 3px solid rgba(41, 167, 96, .35);
  outline-offset: 3px;
}

.jbs-ai__launcher-mark,
.jbs-ai__avatar,
.jbs-ai__message-avatar {
  --jbs-ai-mark-inset: 5px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--jbs-ai-gold-light);
  border: 1px solid rgba(243, 215, 122, .82);
  border-radius: 50%;
  background: linear-gradient(145deg, #176b3d 0%, #0a4729 58%, #052f1b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 244, 198, .24), inset 0 -5px 9px rgba(0, 0, 0, .18), 0 3px 9px rgba(4, 34, 19, .3);
  font-family: "Palatino Linotype", Georgia, serif;
  font-size: 0;
  font-weight: 800;
  letter-spacing: .025em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .32);
}

.jbs-ai__launcher-mark::before,
.jbs-ai__avatar::before,
.jbs-ai__message-avatar::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: var(--jbs-ai-mark-inset);
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 27%, rgba(174, 242, 196, .3) 0 6%, rgba(81, 171, 111, .13) 22%, transparent 39%),
    linear-gradient(145deg, #267d4a 0%, #105d37 50%, #073b23 78%, #042b19 100%);
  box-shadow:
    inset 0 2px 2px rgba(226, 255, 236, .18),
    inset 0 -5px 8px rgba(0, 22, 12, .32),
    0 3px 5px rgba(0, 30, 16, .36);
  transform: translateY(-1px);
}

.jbs-ai__launcher-mark::after,
.jbs-ai__avatar::after,
.jbs-ai__message-avatar::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: calc(var(--jbs-ai-mark-inset) + 3px);
  right: calc(var(--jbs-ai-mark-inset) + 8px);
  left: calc(var(--jbs-ai-mark-inset) + 8px);
  height: 10%;
  border-radius: 999px;
  background: rgba(230, 255, 238, .18);
  filter: blur(.5px);
  pointer-events: none;
}

.jbs-ai__launcher-mark {
  width: 42px;
  height: 42px;
}

.jbs-ai__panel {
  --jbs-ai-panel-open-y: 18px;
  --jbs-ai-panel-open-scale: .972;
  --jbs-ai-panel-close-y: 10px;
  --jbs-ai-panel-close-scale: .985;
  position: absolute;
  right: 0;
  bottom: 66px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(410px, calc(100vw - 28px));
  height: min(650px, calc(100dvh - 104px));
  min-height: 480px;
  overflow: hidden;
  border: 1px solid rgba(16, 58, 34, .12);
  border-radius: 22px;
  background: var(--jbs-ai-surface);
  box-shadow: 0 28px 80px rgba(12, 38, 24, .28), 0 6px 18px rgba(12, 38, 24, .12);
  transform-origin: right bottom;
}

.jbs-ai__panel[hidden] { display: none; }

.jbs-ai__panel.is-opening {
  animation: jbs-ai-panel-open .52s cubic-bezier(.22, 1, .36, 1) both;
}

.jbs-ai__panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.jbs-ai__panel.is-closing {
  pointer-events: none;
  animation: jbs-ai-panel-close .46s cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes jbs-ai-panel-open {
  from { opacity: 0; transform: translateY(var(--jbs-ai-panel-open-y)) scale(var(--jbs-ai-panel-open-scale)); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes jbs-ai-panel-close {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(var(--jbs-ai-panel-close-y)) scale(var(--jbs-ai-panel-close-scale)); }
}

@keyframes jbs-ai-panel-content-settle {
  from { opacity: .72; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes jbs-ai-header-sheen {
  0% { opacity: 0; transform: translateX(-140%) skewX(-16deg); }
  24% { opacity: .52; }
  70%, 100% { opacity: 0; transform: translateX(440%) skewX(-16deg); }
}

.jbs-ai__panel.is-opening .jbs-ai__messages,
.jbs-ai__panel.is-opening .jbs-ai__error,
.jbs-ai__panel.is-opening .jbs-ai__composer {
  animation: jbs-ai-panel-content-settle .4s cubic-bezier(.22, 1, .36, 1) .08s both;
}

.jbs-ai__header {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 12px 14px 12px 16px;
  color: #fff;
  border-bottom: 1px solid rgba(214, 169, 40, .52);
  background: linear-gradient(115deg, #07351f 0%, #0e5b31 58%, #176b3a 100%);
  box-shadow: inset 0 -1px 0 rgba(255, 230, 140, .08);
}

.jbs-ai__header::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -30%;
  width: 24%;
  pointer-events: none;
  content: "";
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(243, 215, 122, .16), transparent);
}

.jbs-ai__panel.is-opening .jbs-ai__header::after {
  animation: jbs-ai-header-sheen .7s ease-out .05s both;
}

.jbs-ai__identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.jbs-ai__avatar {
  width: 46px;
  height: 46px;
}

.jbs-ai__identity strong,
.jbs-ai__identity small { display: block; }

.jbs-ai__identity strong {
  color: #fff8df;
  font-size: 16px;
  font-weight: 740;
  letter-spacing: .01em;
  line-height: 1.25;
}

.jbs-ai__identity small {
  margin-top: 3px;
  color: rgba(255,255,255,.78);
  font-size: 12px;
}

.jbs-ai__identity small i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #6ee7a0;
  box-shadow: 0 0 0 3px rgba(110,231,160,.13);
}

.jbs-ai__header-actions { display: flex; gap: 4px; }

.jbs-ai__header-actions button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: transparent;
  cursor: pointer;
}

.jbs-ai__header-actions button:hover { background: rgba(255,255,255,.12); }

.jbs-ai svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jbs-ai__messages {
  min-height: 0;
  padding: 20px 16px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  background: var(--jbs-ai-canvas);
}

.jbs-ai__welcome { padding: 24px 12px 18px; text-align: center; }

.jbs-ai__welcome-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 16px;
  color: var(--jbs-ai-green);
  background: var(--jbs-ai-green-soft);
  font-size: 24px;
}

.jbs-ai__welcome h2 {
  margin: 0;
  color: var(--jbs-ai-ink);
  font-size: 19px;
  font-weight: 690;
  letter-spacing: -.02em;
}

.jbs-ai__welcome p {
  max-width: 320px;
  margin: 8px auto 18px;
  color: var(--jbs-ai-muted);
  font-size: 14px;
}

.jbs-ai__suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.jbs-ai__suggestions button {
  padding: 8px 12px;
  border: 1px solid #cfe0d5;
  border-radius: 999px;
  color: var(--jbs-ai-green-dark);
  background: #fff;
  font-size: 12.5px;
  cursor: pointer;
}

.jbs-ai__suggestions button:hover {
  border-color: #9fc6ad;
  background: var(--jbs-ai-green-soft);
}

.jbs-ai__message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 14px;
}

.jbs-ai__message-row--user { justify-content: flex-end; }

.jbs-ai__message-avatar {
  --jbs-ai-mark-inset: 4px;
  flex-basis: 32px;
  width: 32px;
  height: 32px;
}

/* Suppress legacy lettering if hosting cache serves older component markup. */
.jbs-ai__launcher-mark,
.jbs-ai__avatar,
.jbs-ai__message-avatar { font-size: 0; }
.jbs-ai__launcher-label { display: none !important; }

.jbs-ai__message-stack { max-width: 86%; }

.jbs-ai__bubble {
  padding: 11px 13px;
  border: 1px solid var(--jbs-ai-line);
  border-radius: 16px 16px 16px 5px;
  color: var(--jbs-ai-ink);
  background: #fff;
  box-shadow: 0 3px 12px rgba(20, 51, 33, .05);
  font-size: 14.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.jbs-ai__message-row--user .jbs-ai__bubble {
  color: #fff;
  border-color: var(--jbs-ai-green);
  border-radius: 16px 16px 5px 16px;
  background: var(--jbs-ai-green);
  box-shadow: none;
}

.jbs-ai__bubble p,
.jbs-ai__bubble ul,
.jbs-ai__bubble ol { margin: 0 0 9px; }
.jbs-ai__bubble > :last-child { margin-bottom: 0; }
.jbs-ai__bubble ul,
.jbs-ai__bubble ol { padding-left: 20px; }
.jbs-ai__bubble li + li { margin-top: 5px; }

.jbs-ai__bubble a {
  color: var(--jbs-ai-green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.jbs-ai__table-wrap {
  max-width: 100%;
  margin: 8px 0;
  overflow-x: auto;
  border: 1px solid var(--jbs-ai-line);
  border-radius: 10px;
}

.jbs-ai__bubble table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.jbs-ai__bubble th,
.jbs-ai__bubble td {
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--jbs-ai-line);
}

.jbs-ai__bubble th { background: var(--jbs-ai-green-soft); font-weight: 650; }

.jbs-ai__message-tools { display: flex; gap: 5px; margin-top: 5px; }

.jbs-ai__message-tools button {
  padding: 3px 7px;
  border: 0;
  border-radius: 7px;
  color: var(--jbs-ai-muted);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.jbs-ai__message-tools button:hover { color: var(--jbs-ai-green-dark); background: #eaf2ed; }

.jbs-ai__artifacts {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.jbs-ai__artifact {
  overflow: hidden;
  border: 1px solid rgba(15, 79, 42, .16);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(12, 57, 33, .1);
  animation: jbs-ai-artifact-arrive .52s cubic-bezier(.22, 1, .36, 1) both;
}

.jbs-ai__artifact-media {
  position: relative;
  min-height: 146px;
  overflow: hidden;
  background: linear-gradient(135deg, #e7f0eb, #f8faf9);
}

.jbs-ai__artifact--image .jbs-ai__artifact-media { aspect-ratio: 1.217 / 1; }

.jbs-ai__artifact--image .jbs-ai__artifact-media--fallback {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 16px;
  aspect-ratio: auto;
  color: #fff;
  border-bottom: 1px solid rgba(214, 169, 40, .5);
  background: radial-gradient(circle at 80% 20%, rgba(214,169,40,.22), transparent 32%), linear-gradient(135deg, #063c27, #11713f);
}

.jbs-ai__artifact--image .jbs-ai__artifact-media--fallback small,
.jbs-ai__artifact--image .jbs-ai__artifact-media--fallback strong { display: block; }
.jbs-ai__artifact--image .jbs-ai__artifact-media--fallback small { color: #efd67b; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.jbs-ai__artifact--image .jbs-ai__artifact-media--fallback strong { margin-top: 4px; color: #fff; font-size: 16px; }

.jbs-ai__artifact--image .jbs-ai__artifact-media > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity .45s ease, transform .7s cubic-bezier(.22, 1, .36, 1);
}

.jbs-ai__artifact.is-loaded .jbs-ai__artifact-media > img { opacity: 1; transform: scale(1); }

.jbs-ai__artifact-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, #e2ebe6 12%, #f8fbf9 32%, #e2ebe6 52%);
  background-size: 220% 100%;
  animation: jbs-ai-artifact-shimmer 1.65s ease-in-out infinite;
}

.jbs-ai__artifact.is-loaded .jbs-ai__artifact-skeleton { opacity: 0; transition: opacity .25s ease; }

.jbs-ai__artifact--pdf .jbs-ai__artifact-media {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 18px;
  color: #fff;
  border-bottom: 1px solid rgba(214, 169, 40, .5);
  background: radial-gradient(circle at 80% 20%, rgba(214,169,40,.22), transparent 32%), linear-gradient(135deg, #063c27, #11713f);
}

.jbs-ai__artifact--pdf .jbs-ai__artifact-media small,
.jbs-ai__artifact--pdf .jbs-ai__artifact-media strong { display: block; }
.jbs-ai__artifact--pdf .jbs-ai__artifact-media small { color: #efd67b; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.jbs-ai__artifact--pdf .jbs-ai__artifact-media strong { margin-top: 4px; color: #fff; font-size: 16px; }

.jbs-ai__pdf-emblem {
  display: grid;
  place-items: center;
  width: 52px;
  height: 62px;
  border: 1px solid rgba(243, 215, 122, .74);
  border-radius: 8px 8px 14px 8px;
  background: linear-gradient(145deg, rgba(255,255,255,.17), rgba(255,255,255,.05));
  box-shadow: inset 0 1px rgba(255,255,255,.2), 0 8px 18px rgba(0,0,0,.18);
}

.jbs-ai__pdf-emblem i { color: #f4dc82; font-size: 11px; font-style: normal; font-weight: 800; letter-spacing: .08em; }

.jbs-ai__artifact-body { padding: 12px 13px 13px; }
.jbs-ai__artifact-body > strong { display: block; color: var(--jbs-ai-green-dark); font-size: 13px; line-height: 1.35; }
.jbs-ai__artifact-body p { margin: 5px 0 0; color: var(--jbs-ai-muted); font-size: 11.5px; line-height: 1.45; }
.jbs-ai__artifact-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.jbs-ai__artifact-action,
.jbs-ai__artifact-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #c7dacd;
  border-radius: 9px;
  color: var(--jbs-ai-green-dark) !important;
  background: #fff;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none !important;
  cursor: pointer;
  transform: none !important;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.jbs-ai__artifact-action:hover,
.jbs-ai__artifact-action:focus,
.jbs-ai__artifact-action:active,
.jbs-ai__artifact-actions button:hover,
.jbs-ai__artifact-actions button:focus,
.jbs-ai__artifact-actions button:active {
  border-color: #8db89c;
  background: var(--jbs-ai-green-soft);
  transform: none !important;
}

.jbs-ai__pdf-viewer {
  width: calc(100% - 20px);
  max-height: 360px;
  margin: 0 10px 12px;
  padding: 0 12px 12px;
  overflow-y: auto;
  border: 1px solid var(--jbs-ai-line);
  border-radius: 10px;
  color: #1d3027;
  background: #fff;
  box-shadow: inset 0 0 0 4px #f4f7f5;
  animation: jbs-ai-artifact-arrive .4s cubic-bezier(.22, 1, .36, 1) both;
}

.jbs-ai__pdf-preview-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -12px 10px;
  padding: 10px 12px;
  color: #fff;
  border-bottom: 1px solid rgba(214,169,40,.65);
  background: linear-gradient(120deg, #073b26, #116b3c);
}

.jbs-ai__pdf-preview-head img { width: 40px; height: 40px; object-fit: contain; }
.jbs-ai__pdf-preview-head small,
.jbs-ai__pdf-preview-head strong { display: block; }
.jbs-ai__pdf-preview-head small { color: #efd67b; font-size: 8px; font-weight: 780; letter-spacing: .12em; }
.jbs-ai__pdf-preview-head strong { margin-top: 2px; color: #fff; font-size: 12px; line-height: 1.3; }
.jbs-ai__pdf-viewer section + section { margin-top: 10px; }
.jbs-ai__pdf-viewer h3 { margin: 0 0 5px; color: var(--jbs-ai-green-dark); font-size: 11px; }
.jbs-ai__pdf-viewer ul { margin: 0; padding-left: 17px; }
.jbs-ai__pdf-viewer li { color: #35483f; font-size: 10px; line-height: 1.45; }
.jbs-ai__pdf-viewer li + li { margin-top: 4px; }
.jbs-ai__pdf-preview-note { margin: 10px 0 0; padding: 8px; color: #6f654c; border-left: 2px solid var(--jbs-ai-gold); background: #fffaf0; font-size: 9.5px; }
.jbs-ai__pdf-viewer footer { margin: 11px -5px -5px; padding: 8px; color: #fff; border-radius: 7px; background: var(--jbs-ai-green-dark); font-size: 9px; text-align: center; }

.jbs-ai__reply-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.jbs-ai__reply-suggestions button {
  padding: 6px 9px;
  border: 1px solid #cadbd1;
  border-radius: 999px;
  color: var(--jbs-ai-green-dark);
  background: rgba(255,255,255,.75);
  font-size: 10.5px;
  cursor: pointer;
}

.jbs-ai__reply-suggestions button:hover { border-color: #96bea5; background: #fff; }

@keyframes jbs-ai-artifact-arrive {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes jbs-ai-artifact-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -120% 0; }
}

.jbs-ai__thinking {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
  padding: 4px 2px;
}

.jbs-ai__thinking-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.jbs-ai__thinking-mark::before,
.jbs-ai__thinking-mark::after,
.jbs-ai__thinking-mark i {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: 50%;
}

.jbs-ai__thinking-mark::before {
  padding: 2px;
  background: conic-gradient(from 25deg, #27332c, #f4f7f5, #718079, #dfe6e2, #176b3a, #27332c);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: jbs-ai-metal-spin 1.65s linear infinite;
}

.jbs-ai__thinking-mark::after {
  inset: 6px;
  background: radial-gradient(circle at 35% 28%, #fff, #e5ebe7 38%, #a9b4ae 70%, #f7faf8);
  box-shadow: inset 0 0 0 1px rgba(31, 55, 42, .18), 0 4px 12px rgba(25, 58, 39, .16);
}

.jbs-ai__thinking-mark b {
  position: relative;
  z-index: 1;
  color: var(--jbs-ai-green-dark);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .04em;
}

.jbs-ai__thinking-copy strong,
.jbs-ai__thinking-copy small { display: block; }

.jbs-ai__thinking-copy strong {
  background: linear-gradient(100deg, #1c2922 15%, #7f8c85 42%, #1c2922 68%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 13px;
  font-weight: 720;
  animation: jbs-ai-metal-sheen 1.8s ease-in-out infinite;
}

.jbs-ai__thinking-copy small {
  margin-top: 2px;
  color: var(--jbs-ai-muted);
  font-size: 10.5px;
}

.jbs-ai__thinking.is-resolving .jbs-ai__thinking-mark::before {
  border: 2px solid #1f7a47;
  background: transparent;
  -webkit-mask: none;
  mask: none;
  animation: jbs-ai-resolve-ring .32s ease-out forwards;
}

.jbs-ai__thinking.is-resolving .jbs-ai__thinking-mark::after {
  background: #f5faf7;
  box-shadow: inset 0 0 0 1px rgba(31, 122, 71, .18), 0 3px 10px rgba(25, 58, 39, .12);
}

.jbs-ai__thinking.is-resolving .jbs-ai__thinking-mark b { color: #176b3a; }
.jbs-ai__thinking.is-resolving .jbs-ai__thinking-copy strong {
  color: #176b3a;
  background: none;
  animation: none;
}

.jbs-ai__bubble--typing::after {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -.12em;
  border-radius: 2px;
  background: linear-gradient(#9da9a2, var(--jbs-ai-green-dark));
  content: "";
  animation: jbs-ai-caret .85s steps(1) infinite;
}

@keyframes jbs-ai-metal-spin { to { transform: rotate(360deg); } }
@keyframes jbs-ai-metal-sheen { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@keyframes jbs-ai-caret { 0%, 48% { opacity: 1; } 49%, 100% { opacity: .08; } }
@keyframes jbs-ai-resolve-ring {
  0% { opacity: .45; transform: scale(.82); }
  70% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.jbs-ai__error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  color: #7b2d2d;
  border-top: 1px solid #f1c9c9;
  background: #fff4f4;
  font-size: 12px;
}

.jbs-ai__error[hidden] { display: none; }

.jbs-ai__error button {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #dda9a9;
  border-radius: 8px;
  color: #702525;
  background: #fff;
  cursor: pointer;
}

.jbs-ai__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  padding: 12px 12px 9px;
  border-top: 1px solid var(--jbs-ai-line);
  background: #fff;
}

.jbs-ai__composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 12px;
  resize: none;
  overflow-y: auto;
  color: var(--jbs-ai-ink);
  border: 1px solid #cbd8d0;
  border-radius: 12px;
  background: #fbfcfb;
  font-size: 14px;
  line-height: 1.45;
}

.jbs-ai__composer textarea::placeholder { color: #7d8982; }

.jbs-ai__send {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0 !important;
  border-radius: 12px !important;
  color: #fff;
  background: var(--jbs-ai-green) !important;
  cursor: pointer;
}

.jbs-ai__send:hover { background: var(--jbs-ai-green-dark) !important; }
.jbs-ai__send:disabled {
  opacity: .68;
  cursor: wait;
  background: linear-gradient(145deg, #526159, #27352e) !important;
}
.jbs-ai__send-loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .34);
  border-top-color: #fff;
  border-right-color: #b9c6bf;
  border-radius: 50%;
}
.jbs-ai__send.is-busy .jbs-ai__send-icon { display: none; }
.jbs-ai__send.is-busy .jbs-ai__send-loader {
  display: block;
  animation: jbs-ai-send-spin 1.25s linear infinite;
}

@keyframes jbs-ai-send-spin { to { transform: rotate(360deg); } }

.jbs-ai__composer > p {
  grid-column: 1 / -1;
  margin: -1px 3px 0;
  color: #849087;
  font-size: 10.5px;
  line-height: 1.2;
}

@media (max-width: 640px) {
  .jbs-ai {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .jbs-ai__panel {
    --jbs-ai-panel-open-y: 28px;
    --jbs-ai-panel-open-scale: 1;
    --jbs-ai-panel-close-y: 22px;
    --jbs-ai-panel-close-scale: 1;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .jbs-ai__header { padding-top: max(12px, env(safe-area-inset-top)); }
  .jbs-ai__composer { padding-bottom: max(9px, env(safe-area-inset-bottom)); }
  .jbs-ai.is-open .jbs-ai__launcher {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(.92);
  }
  .jbs-ai__message-stack { max-width: 89%; }
}

@media (prefers-reduced-motion: reduce) {
  .jbs-ai *,
  .jbs-ai *::before,
  .jbs-ai *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
