:root {
  --ai-ink: #132033;
  --ai-muted: #667085;
  --ai-line: #d9e2ec;
  --ai-soft: #f5f7fb;
  --ai-panel: #ffffff;
  --ai-blue: #1769c2;
  --ai-teal: #0f8f8a;
  --ai-red: #c93535;
  --ai-amber: #936d00;
  --ai-shadow: 0 12px 32px rgba(19, 32, 51, .12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body.pde-ai-body {
  background: var(--ai-soft);
  color: var(--ai-ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button,
textarea,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ai-shell {
  width: min(1180px, calc(100vw - 24px));
  min-height: 760px;
  margin: 12px auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  background: var(--ai-panel);
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  box-shadow: var(--ai-shadow);
}

.pde-ai-body--embed .ai-shell {
  width: 100%;
  min-height: 760px;
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  box-shadow: none;
}

.ai-sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: #f8fbfd;
  border-right: 1px solid var(--ai-line);
}

.ai-sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--ai-line);
}

.ai-sidebar h1,
.ai-chat__title h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.ai-kicker {
  margin: 0 0 5px;
  color: var(--ai-teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ai-icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ai-blue);
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.ai-icon-button:hover,
.ai-icon-button:focus {
  background: #eef6ff;
  border-color: #b8d4f1;
  outline: none;
}

.ai-icon-button--danger {
  color: var(--ai-red);
}

.ai-icon-button--danger:hover,
.ai-icon-button--danger:focus {
  background: #fff1f1;
  border-color: #efb7b7;
}

.ai-icon-button svg,
.ai-send svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-thread-list {
  min-height: 0;
  padding: 10px;
}

.ai-empty-list {
  margin: 10px 8px;
  color: var(--ai-muted);
  font-size: 14px;
}

.ai-thread {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 5px 3px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ai-ink);
  text-align: left;
  transition: background .16s ease, box-shadow .16s ease;
}

.ai-thread:hover,
.ai-thread:focus-within {
  background: #f1f7f7;
  box-shadow: inset 0 0 0 1px #d4e7e6;
  outline: none;
}

.ai-thread.is-active {
  background: transparent;
  box-shadow: none;
}

.ai-thread.is-active:hover,
.ai-thread.is-active:focus-within {
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px #c8dcf2;
}

.ai-thread__title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.ai-thread__title:focus {
  outline: none;
}

.ai-thread__delete {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ai-red);
  opacity: 0;
  pointer-events: none;
  transform: translateX(4px);
  transition: opacity .14s ease, transform .14s ease, background .14s ease;
}

.ai-thread:hover .ai-thread__delete,
.ai-thread:focus-within .ai-thread__delete {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.ai-thread__delete:hover,
.ai-thread__delete:focus {
  background: #fff1f1;
  outline: none;
}

.ai-thread__delete svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-chat {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 760px;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  background: #fff;
}

.ai-chat__header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ai-line);
}

.ai-chat__title {
  min-width: 0;
}

.ai-chat__title h2 {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-chat__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-social {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ai-social__pill {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(19, 32, 51, .08);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.ai-social__pill:hover,
.ai-social__pill:focus {
  transform: translateY(-1px);
  border-color: #b8d4f1;
  box-shadow: 0 4px 12px rgba(19, 32, 51, .13);
  outline: none;
}

.ai-social__pill img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.ai-status {
  margin: 12px 18px 0;
  padding: 10px 12px;
  border: 1px solid #d8c37a;
  border-radius: 8px;
  background: #fff8db;
  color: var(--ai-amber);
  font-size: 14px;
  line-height: 1.4;
}

.ai-status.is-error {
  border-color: #efb7b7;
  background: #fff1f1;
  color: #9f2727;
}

.ai-messages {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 18px calc(var(--ai-composer-height, 78px) + 24px);
}

.ai-empty-chat {
  width: min(520px, 100%);
  margin: auto;
  display: grid;
  gap: 8px;
  text-align: center;
  color: var(--ai-muted);
}

.ai-empty-chat strong {
  color: var(--ai-ink);
  font-size: 22px;
}

.ai-empty-chat span {
  line-height: 1.5;
}

.ai-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.ai-message:focus {
  outline: none;
}

.ai-message--user {
  align-items: flex-end;
}

.ai-message--assistant {
  align-items: flex-start;
}

.ai-message--user .ai-message__avatar {
  order: 1;
}

.ai-message--user .ai-message__bubble {
  order: 2;
}

.ai-message__avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  overflow: hidden;
  border: 1px solid #d9e2ec;
  border-radius: 50%;
  background: #fff;
  color: var(--ai-blue);
  font-size: 13px;
  font-weight: 900;
  position: relative;
  z-index: 1;
}

.ai-message + .ai-message .ai-message__avatar {
  margin-top: -37px;
}

.ai-message__bubble {
  margin-top: -8px;
  padding-top: 18px;
}

.ai-message--user .ai-message__bubble {
  padding-right: 44px;
}

.ai-message--assistant .ai-message__bubble {
  padding-left: 44px;
}

.ai-message__bubble::before {
  content: none;
}

.ai-message--assistant {
  position: relative;
}

.ai-message--assistant .ai-message__avatar {
  position: absolute;
  top: 0;
  left: 0;
  margin-top: 0;
}

.ai-message--assistant .ai-message__bubble {
  margin-top: 0;
  padding-left: 14px;
}

.ai-message--assistant .ai-message__bubble::after {
  content: "";
  width: 42px;
  height: 28px;
  float: left;
}

.ai-message--user .ai-message__avatar {
  position: relative;
  top: auto;
  right: auto;
  margin-top: 0;
  margin-bottom: 0;
  transform: none;
}

.ai-message--user .ai-message__bubble {
  margin-top: 0;
  padding-right: 14px;
}

.ai-message + .ai-message .ai-message__avatar {
  margin-top: 0;
}

.ai-message--user {
  gap: 2px;
}

.ai-message--assistant {
  position: static;
  gap: 2px;
}

.ai-message--assistant .ai-message__avatar {
  position: relative;
  top: auto;
  left: auto;
  margin-top: 0;
  margin-bottom: 0;
  transform: none;
}

.ai-message--assistant .ai-message__bubble {
  margin-top: 0;
  padding-left: 14px;
}

.ai-message--assistant .ai-message__bubble::after {
  content: none;
}

.ai-shell {
  grid-template-columns: 1fr;
}

.ai-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: min(82vw, 320px);
  height: 100vh;
  transform: translateX(-105%);
  transition: transform 0.18s ease;
  border-right: 1px solid var(--ai-line);
  border-bottom: 0;
  box-shadow: 0 18px 40px rgba(19, 32, 51, 0.18);
}

.ai-shell.is-sidebar-open .ai-sidebar {
  transform: translateX(0);
}

.ai-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  display: block;
  border: 0;
  background: rgba(19, 32, 51, 0.28);
}

.ai-sidebar-backdrop[hidden] {
  display: none;
}

.ai-chat__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 64px;
  padding: 10px 12px;
  border-bottom: 0;
}

.ai-chat__title {
  display: none;
}

.ai-mobile-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  color: var(--ai-ink);
  background: #fff;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(19, 32, 51, 0.12);
  cursor: pointer;
}

.ai-mobile-icon-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-mobile-icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.ai-mobile-icon-button--threads {
  justify-self: start;
}

.ai-mobile-actions {
  display: inline-flex;
  gap: 6px;
  justify-self: end;
  padding: 4px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(19, 32, 51, 0.12);
}

.ai-mobile-actions .ai-mobile-icon-button {
  width: 42px;
  height: 42px;
  box-shadow: none;
}

.ai-message__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-message__bubble {
  position: relative;
  width: fit-content;
  max-width: min(82ch, 94%);
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.ai-message__bubble::before {
  content: "";
  position: absolute;
  top: -7px;
  width: 14px;
  height: 14px;
  background: inherit;
  transform: rotate(45deg);
}

.ai-message.is-focus-target .ai-message__bubble {
  outline: none;
}

.ai-message__bubble p {
  margin: 0 0 10px;
}

.ai-message__bubble p:last-child,
.ai-message__bubble ul:last-child,
.ai-message__bubble ol:last-child {
  margin-bottom: 0;
}

.ai-message__bubble ul,
.ai-message__bubble ol {
  margin: 0 0 10px 20px;
  padding: 0;
}

.ai-message__bubble li + li {
  margin-top: 4px;
}

.ai-message__bubble a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ai-message__bubble code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(15, 32, 51, .08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .92em;
}

.ai-message--user .ai-message__bubble {
  background: #1769c2;
  color: #fff;
  white-space: pre-wrap;
}

.ai-message__text {
  display: block;
}

.ai-attachment-card {
  width: min(260px, 100%);
  display: grid;
  gap: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, .14);
  color: inherit;
  text-decoration: none;
}

.ai-attachment-card[href] {
  cursor: pointer;
}

.ai-attachment-card:first-child {
  margin-top: 0;
}

.ai-attachment-card img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  background: rgba(255, 255, 255, .18);
}

.ai-attachment-card__name {
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 7px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.ai-message--user .ai-message__bubble::before {
  right: 13px;
}

.ai-message--assistant .ai-message__bubble {
  background: #f3f6f8;
  color: var(--ai-ink);
  border: 0;
  box-shadow: inset 0 0 0 1px #e0e7ee;
}

.ai-message--assistant .ai-message__bubble::before {
  left: 13px;
  box-shadow: inset 1px 1px 0 #e0e7ee;
}

.ai-message--loading .ai-message__avatar {
  animation: ai-avatar-pulse 1.4s ease-in-out infinite;
}

.ai-message--loading .ai-message__bubble {
  min-width: 0;
  padding: 5px 7px;
  border: 0;
  background: transparent;
}

.ai-message--loading.is-focus-target .ai-message__bubble {
  outline: none;
}

.ai-typing {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-typing span {
  width: 9px;
  height: 9px;
  display: block;
  border-radius: 999px;
  background: var(--ai-teal);
  opacity: .18;
  transform: translateY(0) scale(.58);
  animation: ai-typing-pulse .84s linear infinite !important;
  will-change: transform, opacity, background-color;
}

.ai-typing span:nth-child(2) {
  animation-delay: .14s;
}

.ai-typing span:nth-child(3) {
  animation-delay: .28s;
}

@keyframes ai-typing-pulse {
  0%,
  100% {
    transform: translateY(0) scale(.58);
    opacity: .18;
    background: #89d3d0;
  }

  30% {
    transform: translateY(-7px) scale(1.24);
    opacity: 1;
    background: var(--ai-teal);
  }

  60% {
    transform: translateY(0) scale(.72);
    opacity: .28;
    background: #89d3d0;
  }
}

@keyframes ai-avatar-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(15, 143, 138, .22);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(15, 143, 138, .08);
  }
}

.ai-composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  width: 100%;
  padding: 8px 18px calc(10px + env(safe-area-inset-bottom));
  border-top: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  will-change: transform;
}

.ai-jump-bottom {
  position: fixed;
  bottom: 76px;
  left: 50%;
  z-index: 9;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid #d9e2ec;
  border-radius: 50%;
  background: #fff;
  color: #132033;
  box-shadow: 0 2px 8px rgba(19, 32, 51, .18);
  transform: translateX(-50%);
  transition: opacity .16s ease, transform .16s ease, box-shadow .16s ease;
}

.ai-jump-bottom[hidden] {
  display: none;
}

.ai-jump-bottom:hover,
.ai-jump-bottom:focus {
  transform: translateX(-50%) translateY(-1px);
  box-shadow: 0 4px 12px rgba(19, 32, 51, .22);
  outline: none;
}

.ai-jump-bottom svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-composer textarea {
  width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 180px;
  resize: none;
  overflow-y: hidden;
  padding: 10px 2px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ai-ink);
  line-height: 1.4;
  outline: none;
}

.ai-composer::before {
  content: "";
  position: absolute;
  inset: 0 10px calc(2px + env(safe-area-inset-bottom));
  z-index: -1;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(19, 32, 51, .14);
}

.ai-composer > * {
  pointer-events: auto;
}

.ai-composer textarea:focus {
  box-shadow: none;
}

.ai-send {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--ai-teal);
  color: #fff;
  font-weight: 800;
}

.ai-send:hover,
.ai-send:focus {
  background: #0b7773;
  outline: none;
}

.ai-primary-link,
.ai-secondary-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.ai-primary-link {
  background: var(--ai-blue);
  color: #fff;
}

.ai-secondary-link {
  border: 1px solid var(--ai-line);
  background: #fff;
  color: var(--ai-ink);
}

@media (max-width: 820px) {
  .ai-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .ai-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--ai-line);
  }

  .ai-thread-list {
    display: grid;
    gap: 2px;
    padding: 10px 12px 12px;
  }

  .ai-thread {
    width: 100%;
    flex: 0 1 auto;
  }

  .ai-chat {
    min-height: 620px;
  }

  .ai-chat__header {
    align-items: flex-start;
  }

  .ai-chat__actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .ai-message__bubble {
    max-width: 100%;
  }

  .ai-composer {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ai-send {
    width: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-message--loading .ai-message__avatar {
    animation: none;
  }
}
/* Mobile chat header and thread drawer */
.ai-mobile-icon-button,
.ai-mobile-actions,
.ai-sidebar-backdrop {
  display: none;
}

@media (max-width: 820px) {
  .ai-shell {
    grid-template-columns: 1fr;
  }

  .ai-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: min(82vw, 320px);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    border-right: 1px solid var(--ai-line);
    border-bottom: 0;
    box-shadow: 0 18px 40px rgba(19, 32, 51, 0.18);
  }

  .ai-sidebar *,
  .ai-thread,
  .ai-thread__title {
    min-width: 0;
  }

  .ai-thread__title {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ai-shell.is-sidebar-open .ai-sidebar {
    transform: translateX(0);
  }

  .ai-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 29;
    display: block;
    border: 0;
    background: rgba(19, 32, 51, 0.28);
  }

  .ai-sidebar-backdrop[hidden] {
    display: none;
  }

  .ai-chat__header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    min-height: 64px;
    padding: 10px 12px;
    border-bottom: 0;
  }

  .ai-chat__title {
    display: none;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .ai-mobile-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    color: var(--ai-ink);
    background: #fff;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(19, 32, 51, 0.12);
    cursor: pointer;
  }

  .ai-mobile-icon-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.35;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .ai-mobile-icon-button:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .ai-mobile-icon-button--threads {
    justify-self: start;
  }

  .ai-mobile-actions {
    display: inline-flex;
    gap: 6px;
    justify-self: end;
    padding: 4px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(19, 32, 51, 0.12);
  }

  .ai-mobile-actions .ai-mobile-icon-button {
    width: 42px;
    height: 42px;
    box-shadow: none;
  }

  .ai-mobile-icon-button--danger {
    color: var(--ai-ink);
  }
}
/* Slightly slower loading dots */
.ai-typing-dot,
.ai-typing__dot,
.ai-loading-dot,
.ai-loading-dots span,
.ai-typing span {
  animation-duration: 1.25s !important;
}

/* Final chat layout overrides */
.ai-message__bubble::before,
.ai-message__bubble::after {
  content: none !important;
  display: none !important;
}

.ai-shell {
  grid-template-columns: 1fr !important;
}

.ai-sidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 30 !important;
  width: min(82vw, 320px) !important;
  height: 100vh !important;
  transform: translateX(-105%) !important;
  transition: transform 0.18s ease !important;
  border-right: 1px solid var(--ai-line) !important;
  border-bottom: 0 !important;
  box-shadow: 0 18px 40px rgba(19, 32, 51, 0.18) !important;
}

.ai-shell.is-sidebar-open .ai-sidebar {
  transform: translateX(0) !important;
}

.ai-sidebar-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 29 !important;
  display: block !important;
  border: 0 !important;
  background: rgba(19, 32, 51, 0.28) !important;
}

.ai-sidebar-backdrop[hidden] {
  display: none !important;
}

.ai-chat__header {
  position: relative !important;
  z-index: 10 !important;
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  align-items: center !important;
  min-height: 64px !important;
  padding: 10px 12px !important;
  border-bottom: 0 !important;
}

.ai-chat__title {
  display: none !important;
}

.ai-mobile-icon-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 46px !important;
  height: 46px !important;
  padding: 0 !important;
  color: var(--ai-ink) !important;
  background: #fff !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 24px rgba(19, 32, 51, 0.12) !important;
  cursor: pointer !important;
}

.ai-mobile-icon-button svg {
  width: 24px !important;
  height: 24px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.35 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.ai-mobile-icon-button:disabled {
  opacity: 0.35 !important;
  cursor: default !important;
}

.ai-mobile-icon-button--threads {
  justify-self: start !important;
}

.ai-mobile-actions {
  display: inline-flex !important;
  gap: 6px !important;
  justify-self: end !important;
  padding: 4px !important;
  background: #fff !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 24px rgba(19, 32, 51, 0.12) !important;
}

.ai-mobile-actions .ai-mobile-icon-button {
  width: 42px !important;
  height: 42px !important;
  box-shadow: none !important;
}

/* Clean edges and match the community composer */
body.pde-ai-body {
  background: #fff !important;
}

.ai-shell,
.pde-ai-body--embed .ai-shell,
.ai-chat {
  border: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
}

.ai-shell {
  margin-top: 0 !important;
}

.ai-chat__header {
  border-top: 0 !important;
  border-bottom: 0 !important;
}

.ai-sidebar {
  border-right: 0 !important;
  box-shadow: none !important;
}

.ai-composer {
  left: 12px !important;
  right: 12px !important;
  width: auto !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 10px !important;
  padding: 6px 12px 6px 10px !important;
  margin-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  border: 1px solid #d1d5db !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04) !important;
  transition: border-color .25s ease, box-shadow .25s ease !important;
}

.ai-composer::before {
  content: none !important;
  display: none !important;
}

.ai-composer:hover,
.ai-composer:focus-within {
  border-color: #289dcc !important;
  box-shadow: 0 0 0 1px rgba(40, 157, 204, .2), 0 10px 24px rgba(40, 157, 204, .16) !important;
}

.ai-composer-avatar {
  display: none !important;
}

.ai-attach {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: end !important;
  margin: 0 0 1px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #f3f4f6 !important;
  color: #374151 !important;
}

.ai-attach:hover,
.ai-attach:focus {
  background: #e8f4f9 !important;
  color: #1769c2 !important;
  outline: none !important;
}

.ai-attach:disabled {
  opacity: .35 !important;
  cursor: not-allowed !important;
}

.ai-attach svg {
  width: 19px !important;
  height: 19px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.ai-composer-field {
  min-width: 0 !important;
  display: grid !important;
  align-items: end !important;
}

.ai-attachment-name {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  padding: 5px 0 0 !important;
  color: #4b5563 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.ai-composer textarea {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 120px !important;
  padding: 7px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  color: #111827 !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
}

.ai-send {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  align-self: end !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #289DCC !important;
  color: #fff !important;
  font-size: 18px !important;
  line-height: 1 !important;
  transform: translateX(-10px) !important;
  transition: transform .12s ease, box-shadow .15s ease, opacity .15s ease !important;
}

.ai-send svg {
  display: none !important;
}

.ai-send:hover,
.ai-send:focus {
  background: #289DCC !important;
  outline: none !important;
}

.ai-send:active {
  transform: translateX(-10px) scale(.92) !important;
}

.ai-send:disabled {
  opacity: .35 !important;
  cursor: not-allowed !important;
}
