.judith-widget-root {
  position: fixed;
  right: 18px;
  bottom: 86px;
  z-index: 90;
  font-family: var(--font, 'DM Sans', system-ui, sans-serif);
}

.judith-launcher {
  border: 0;
  min-height: 54px;
  padding: 14px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffdb2e, #bafc3b);
  color: #062419;
  font-weight: 1000;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .32);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.judith-launcher span:first-child {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #062419;
  color: #ffdb2e;
}

.judith-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(380px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 110px));
  display: none;
  overflow: hidden;
  border-radius: 28px;
  background: #fffef5;
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
}

.judith-widget-root.is-open .judith-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.judith-widget-root.is-open .judith-launcher { display: none; }

.judith-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  color: #fff;
  background: linear-gradient(135deg, #03150f, #0b3b25);
}

.judith-title { display: flex; align-items: center; gap: 11px; }
.judith-avatar {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffdb2e, #28df79);
  color: #062419;
  font-weight: 1000;
}
.judith-title strong { display: block; line-height: 1; }
.judith-title small { display: block; color: rgba(255,255,255,.68); font-weight: 800; margin-top: 3px; }
.judith-close {
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 20px;
}

.judith-messages {
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  background:
    radial-gradient(circle at 10% 0%, rgba(255,219,46,.18), transparent 28%),
    #fffef5;
}

.judith-message {
  max-width: 88%;
  padding: 12px 13px;
  border-radius: 18px;
  line-height: 1.42;
  font-size: 14px;
  white-space: pre-wrap;
}
.judith-message.bot {
  justify-self: start;
  color: #102418;
  background: #fff;
  border: 1px solid rgba(6,36,25,.1);
  box-shadow: 0 10px 28px rgba(9,43,27,.08);
}
.judith-message.user {
  justify-self: end;
  color: #fff;
  background: linear-gradient(135deg, #0f5b36, #062419);
}

.judith-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.judith-chip {
  border: 1px solid rgba(19,182,95,.2);
  background: #f1fbef;
  color: #0b3b25;
  border-radius: 999px;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.judith-handoff {
  display: inline-flex;
  margin-top: 9px;
  border-radius: 999px;
  padding: 11px 12px;
  background: linear-gradient(135deg, #ffdb2e, #bafc3b);
  color: #062419;
  font-weight: 1000;
  text-decoration: none;
}

.judith-form {
  padding: 12px;
  border-top: 1px solid rgba(6,36,25,.1);
  background: #fff;
}
.judith-input-row { display: flex; gap: 8px; align-items: flex-end; }
.judith-input {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 104px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(6,36,25,.16);
  font: inherit;
  outline: none;
}
.judith-input:focus { border-color: #13b65f; box-shadow: 0 0 0 3px rgba(19,182,95,.12); }
.judith-send {
  border: 0;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: #062419;
  color: #ffdb2e;
  font-weight: 1000;
  cursor: pointer;
}
.judith-meta {
  display: none;
  margin-top: 8px;
  color: #69786f;
  font-size: 11px;
  font-weight: 800;
}
.judith-meta.is-visible { display: block; }
.judith-error { color: #8a3a13; }

@media (max-width: 760px) {
  .judith-widget-root { right: max(12px, env(safe-area-inset-right)); left: auto; bottom: max(80px, env(safe-area-inset-bottom)); }
  .judith-launcher { width: auto; min-height: 50px; padding: 12px 16px; justify-content: center; }
  .judith-panel {
    right: 0;
    left: auto;
    width: min(390px, calc(100vw - 24px));
    bottom: 0;
    max-height: min(82dvh, calc(100dvh - 96px));
    border-radius: 26px;
  }
  .judith-header { padding: 14px; }
  .judith-messages { padding: 14px; }
  .judith-message { max-width: 94%; }
  .judith-form { padding: 10px; }
  .judith-input { min-height: 42px; max-height: 96px; padding: 11px; }
}
