.fp-desk {
  --fp-blue: #1677ff;
  --fp-border: #dce5ef;
  --fp-muted: #65758a;
  color: #20324d;
  font: inherit;
  min-width: 0
}

.fp-desk * {
  box-sizing: border-box
}

.fp-desk h2,
.fp-desk h3,
.fp-desk p {
  margin: 0
}

.fp-desk button,
.fp-desk input,
.fp-desk textarea,
.fp-desk select {
  font: inherit
}

.fp-desk button {
  border: 1px solid var(--fp-border);
  background: #fff;
  border-radius: 9px;
  padding: 9px 13px;
  color: #29496e;
  cursor: pointer;
  line-height: 1.4
}

.fp-desk button:hover {
  background: #eef5ff
}

.fp-desk button:disabled {
  opacity: .5;
  cursor: default
}

.fp-desk input,
.fp-desk select,
.fp-desk textarea {
  width: 100%;
  border: 1px solid var(--fp-border);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: #20324d
}

.fp-desk textarea {
  resize: vertical;
  min-height: 80px
}

.fp-desk label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600
}

.fp-desk small,
.fp-footnote {
  font-size: 12px;
  color: var(--fp-muted);
  line-height: 1.5
}

.fp-desk :focus-visible {
  outline: 3px solid #96c7ff;
  outline-offset: 2px
}

.fp-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 16px
}

.fp-toolbar label {
  min-width: 160px;
  flex: 1
}

.fp-toolbar .fp-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 100px;
  flex: 0 0 auto;
  padding-bottom: 10px
}

.fp-check input {
  width: auto
}

.fp-toolbar h2 {
  flex: 1
}

.fp-layout {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.7fr);
  gap: 18px;
  align-items: start;
  min-width: 0
}

.fp-chat {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  height: min(820px, calc(100dvh - 200px));
  min-height: 520px;
}

.fp-chat-heading {
  grid-column: 1;
  grid-row: 1;
}
.fp-composer {
  grid-column: 1;
  grid-row: 5;
}
.fp-chat.has-tools {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.fp-chat-body {
  grid-column: 1;
  grid-row: 3;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.fp-mobile-back {
  display: none;
}

.fp-list,
.fp-chat,
.fp-provider,
.fp-connection,
.fp-page-select {
  background: #fff;
  border: 1px solid var(--fp-border);
  border-radius: 14px;
  overflow: hidden
}

.fp-list {
  max-height: 740px;
  overflow: auto
}

.fp-list-title {
  padding: 17px;
  border-bottom: 1px solid var(--fp-border);
  display: flex;
  justify-content: space-between;
  gap: 10px
}

.fp-thread {
  display: flex !important;
  gap: 11px;
  align-items: start;
  border: 0 !important;
  border-radius: 0 !important;
  border-bottom: 1px solid #eef2f7 !important;
  width: 100%;
  text-align: left;
  padding: 15px !important
}

.fp-thread.selected {
  background: #eaf3ff
}

.fp-thread>span:nth-child(2) {
  display: grid;
  gap: 5px;
  min-width: 0;
  flex: 1
}

.fp-thread strong {
  font-size: 14px
}

.fp-thread small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.fp-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7f1ff;
  color: #2873ce;
  flex: none;
  position: relative;
  overflow: hidden
}

.fp-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit
}

.fp-unread {
  font-size: 11px;
  border-radius: 12px;
  padding: 3px 7px;
  background: var(--fp-blue);
  color: #fff
}

.fp-chat-heading {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--fp-border);
  flex-wrap: wrap
}

.fp-chat-heading>div {
  flex: 1
}

.fp-chat-heading h3 {
  font-size: 17px;
  margin-bottom: 4px
}

.fp-tag {
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11px;
  background: #eff4f8;
  white-space: nowrap
}

.fp-active,
.fp-sent {
  background: #e4f8ee;
  color: #237749
}

.fp-unknown,
.fp-pending,
.fp-queued {
  background: #fff2d3;
  color: #9a6b05
}

.fp-rejected,
.fp-revoked {
  background: #ffeded;
  color: #b94545
}

.fp-messages {
  position: relative;
  flex: 1 1 320px;
  padding: 20px;
  min-height: 180px;
  max-height: 480px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, #f8fbff, #fff)
}

.fp-chat-body > :not(.fp-messages) {
  flex: 0 0 auto;
}

.fp-context-panel {
  display: none;
  grid-column: 2;
  grid-row: 1 / -1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
  border-left: 1px solid var(--fp-border);
}

.fp-chat.has-tools .fp-context-panel {
  display: flex;
}
.fp-context-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}
.fp-context-content [role='tabpanel'][hidden] {
  display: none !important;
}
.fp-context-tabs,
.fp-context-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  gap: 6px;
}
.fp-context-tabs > button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.fp-context-panel svg {
  width: 18px;
  height: 18px;
}
@media (max-width: 1279px) {
  .fp-chat.has-tools {
    grid-template-columns: minmax(0, 1fr);
  }
  .fp-chat.has-tools .fp-chat-body {
    display: none;
  }
  .fp-chat.has-tools .fp-context-panel {
    grid-column: 1;
    grid-row: 3;
    border: 0;
  }
}

.fp-tools-toggle svg,
.fp-composer svg,
.fp-mobile-back svg {
  width: 20px;
  height: 20px;
}

.fp-message {
  max-width: 85%;
  align-self: flex-start;
  border: 1px solid #e3e9f2;
  background: #fff;
  border-radius: 12px 12px 12px 3px;
  padding: 10px 13px
}

.fp-message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.6
}

.fp-message small {
  display: block;
  margin-top: 5px;
  font-size: 10px
}

.fp-message.outgoing {
  align-self: flex-end;
  background: #e6f1ff;
  border-color: #d1e4ff;
  border-radius: 12px 12px 3px 12px
}

.fp-composer {
  padding: 18px;
  border-top: 1px solid var(--fp-border);
  display: grid;
  gap: 9px
}

.fp-composer>div {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between
}

.fp-composer button[type=submit] {
  background: var(--fp-blue);
  color: #fff;
  border-color: var(--fp-blue);
  white-space: nowrap
}

.fp-composer label {
  font-size: 13px
}

.fp-demo {
  padding: 16px 18px;
  background: #fffaf0;
  display: flex;
  align-items: end;
  gap: 10px;
  border-top: 1px dashed #e9d9b5
}

.fp-demo label {
  flex: 1
}

.fp-demo button {
  white-space: nowrap
}

.fp-ai,
.fp-operation {
  margin: 12px 18px;
  padding: 13px;
  background: #f7f9fd;
  border: 1px solid var(--fp-border);
  border-radius: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center
}

.fp-ai p,
.fp-operation p {
  width: 100%;
  white-space: pre-wrap;
  font-size: 14px
}

.fp-operation small {
  width: 100%
}

.fp-empty {
  padding: 32px 20px;
  color: var(--fp-muted);
  line-height: 1.7;
  text-align: center
}

.fp-empty h3 {
  color: #29496e;
  margin-bottom: 9px
}

.fp-footnote {
  margin: 12px 0 !important
}

.fp-notice {
  padding: 12px 16px;
  border: 1px solid #c8ddff;
  background: #f0f6ff;
  border-radius: 10px;
  margin-bottom: 15px;
  line-height: 1.6
}

.fp-provider {
  padding: 22px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px
}

.fp-provider strong,
.fp-provider p {
  width: 100%;
  line-height: 1.7
}

.fp-provider p {
  color: var(--fp-muted)
}

.fp-connection {
  padding: 18px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

.fp-connection h3 {
  margin-bottom: 8px;
  font-size: 16px
}

.fp-connection small {
  display: block;
  margin-top: 7px
}

.fp-page-select {
  padding: 20px;
  display: flex;
  gap: 15px;
  align-items: end
}

.fp-page-select label {
  flex: 1
}

@media(max-width:850px) {
  .fp-layout {
    grid-template-columns: minmax(185px, .75fr) minmax(0, 1.4fr);
    gap: 10px
  }

  .fp-toolbar label {
    min-width: 125px
  }

  .fp-thread {
    padding: 12px !important
  }

  .fp-avatar {
    display: none
  }

  .fp-demo {
    flex-wrap: wrap
  }

  .fp-chat-heading {
    padding: 14px
  }

  .fp-chat-heading .fp-tag {
    white-space: normal
  }
}

@media(max-width:600px) {
  .fp-layout {
    grid-template-columns: 1fr
  }

  .fp-list {
    max-height: 65dvh
  }

  .fp-layout:not(.fp-show-chat) .fp-chat,
  .fp-show-chat .fp-list {
    display: none;
  }

  .fp-chat {
    height: calc(100dvh - 140px);
    min-height: 480px;
  }

  .fp-mobile-back {
    display: inline-block;
  }

  .fp-chat-heading {
    gap: 8px;
  }

  .fp-chat-heading>button {
    width: auto;
    padding: 7px 9px;
  }

  .fp-chat-heading>div {
    flex: 1 1 55%;
    min-width: 0;
  }

  .fp-chat-heading h3 {
    overflow-wrap: anywhere;
  }

  .fp-composer {
    padding: 12px;
    gap: 6px;
  }

  .fp-composer textarea {
    min-height: 64px;
    max-height: 140px;
    font-size: 16px;
  }

  .fp-message {
    max-width: 94%
  }

  .fp-messages {
    padding: 14px;
    max-height: 430px
  }

  .fp-toolbar>button {
    flex: 1
  }

  .fp-composer>div {
    align-items: start;
    flex-direction: column
  }

  .fp-composer button[type=submit] {
    width: 100%
  }

  .fp-demo label {
    min-width: 100%;
    flex: 1
  }

  .fp-demo button {
    width: 100%
  }

  .fp-connection,
  .fp-page-select {
    flex-direction: column;
    align-items: stretch
  }
}

/* Controls shared with Growth's native desk; Client adds its own workspace presentation. */
.fp-list-controls {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--fp-border);
  background: #fff;
}
.fp-list-controls .fp-list-title {
  align-items: center;
  padding: 0;
  border: 0;
}
.fp-list-title > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fp-thread-count {
  padding: 2px 6px;
  border-radius: 5px;
  background: #f0f4f9;
  color: #64748b;
  font-size: 11px;
}
.fp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.fp-inbox-actions {
  position: relative;
  margin: 0;
}
.fp-inbox-actions > summary {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  list-style: none;
  cursor: pointer;
}
.fp-inbox-actions > summary::-webkit-details-marker {
  display: none;
}
.fp-inbox-actions svg {
  width: 20px;
  height: 20px;
}
.fp-inbox-actions > div {
  position: absolute;
  right: 0;
  top: 34px;
  z-index: 5;
  display: grid;
  min-width: 180px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--fp-border);
  border-radius: 9px;
}
.fp-search {
  position: relative;
  margin: 0;
}
.fp-search > svg {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #8390a3;
  pointer-events: none;
}
.fp-search input {
  margin: 0;
  padding-left: 36px;
}
.fp-channel {
  margin: 0;
}
.fp-channel select {
  margin: 0;
}
.fp-quick-filters {
  display: flex;
  gap: 5px;
  align-items: center;
}
.fp-filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  margin: 0;
  cursor: pointer;
  font-size: 12px;
  border-radius: 6px;
}
.fp-filter-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.fp-quick-filters > button[aria-pressed='true'],
.fp-filter-chip:has(input:checked) {
  color: #1764e8;
  background: #edf4ff;
}
.fp-thread-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.fp-thread-head time {
  flex: 0 0 auto;
  font-size: 10px;
  color: #8a95a5;
}
.fp-thread-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.5;
}
.fp-thread-channel {
  font-size: 10px;
  color: #8a95a5;
}
.fp-needs-reply {
  margin-left: 6px;
  color: #b67514;
  font-size: 10px;
}
.fp-chat-empty {
  padding: 32px;
  text-align: center;
}
.fp-chat-empty > svg {
  width: 44px;
  height: 44px;
  color: #75a3e9;
}

.fp-human-control {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--fp-border);
  background: #f7faff;
}
.fp-human-control span {
  min-width: 0;
}
.fp-human-control strong, .fp-human-control small {
  display: block;
  font-size: 12px;
}
.fp-human-control small {
  margin-top: 3px;
  color: #566b84;
}
.fp-human-control button {
  flex-shrink: 0;
  min-height: 44px;
}

.fp-schedule-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.fp-schedule-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fp-schedule-tools svg {
  width: 20px;
  height: 20px;
}
.fp-schedule-fields {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #f1f7ff;
  border-radius: 10px;
  margin: 8px 0;
}
.fp-schedule-fields .fp-schedule-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400;
}
.fp-schedule-fields input[type=checkbox] {
  width: auto;
  margin-top: 4px;
}
.fp-schedule-time {
  padding: 7px 0;
  color: #1264d9;
}
