/* Local team communication prototype */
.communication-dialog {
  width: min(1100px, 94vw);
  max-width: 94vw;
}
.communication-tools {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 14px;
  margin: 20px 0;
}
.communication-tools .field {
  min-width: 180px;
}
.communication-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  gap: 24px;
}
.communication-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 65vh;
  overflow: auto;
}
.communication-thread {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 8px;
  white-space: normal;
  width: 100%;
}
.communication-thread[aria-current='true'] {
  border-color: currentColor;
}
.communication-thread small {
  font-weight: 400;
  opacity: 0.75;
}
.communication-detail {
  min-width: 0;
  padding: 0 8px;
}
.communication-messages {
  display: grid;
  gap: 14px;
  margin: 20px 0;
  max-height: 40vh;
  overflow: auto;
}
.communication-message {
  padding: 18px;
  border: 1px solid #8884;
  border-radius: 14px;
  overflow-wrap: anywhere;
}
.communication-message > small {
  display: block;
  margin-top: 5px;
}
.communication-message p {
  white-space: pre-wrap;
}
.communication-mention {
  font-weight: 600;
}
.communication-compose {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.communication-compose textarea {
  min-height: 100px;
}
@media (max-width: 700px) {
  .communication-layout {
    grid-template-columns: 1fr;
  }
  .communication-list {
    max-height: 190px;
  }
  .communication-detail {
    padding: 0;
  }
  .communication-tools .field {
    width: 100%;
  }
}
.communication-fab {
  position: fixed !important;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  width: 56px;
  height: 56px;
  border: 1px solid #ffffff33;
  border-radius: 50% !important;
  background: #252525 !important;
  color: white !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px !important;
  box-shadow: 0 6px 24px #0003;
  cursor: pointer;
}
.communication-fab svg,
.conversation-icon svg,
.communication-dialog svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.conversation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 8px !important;
}
.communication-dialog {
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid #8884;
  border-radius: 18px;
  background: var(--surface, #fff);
  color: var(--text, #222);
  max-height: 90dvh;
  overflow: auto;
}
.communication-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.communication-dialog .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.communication-dialog .form-grid {
  display: grid;
  gap: 16px;
}
.communication-dialog input,
.communication-dialog textarea,
.communication-dialog select {
  box-sizing: border-box;
  width: 100%;
  padding: 12px;
  border: 1px solid #8885;
  border-radius: 8px;
  font: inherit;
  background: transparent;
  color: inherit;
}
.communication-dialog .btn {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #8884;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.communication-dialog .communication-thread {
  display: flex;
  align-items: flex-start;
}
.communication-dialog .primary {
  background: #252525;
  color: #fff;
}
[data-theme='dark'] .communication-dialog {
  background: #242424;
  color: #eee;
}
.crm-lead-wrap > .crm-row-actions {
  position: absolute;
  right: 8px;
  top: 8px;
  gap: 4px;
}
.crm-lead-wrap > .lead-card {
  padding-right: 96px;
}
@media (max-width: 600px) {
  .communication-fab {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .communication-dialog {
    padding: 16px;
  }
}
/* Brand mark and centered icon-only controls. */
.studio-identity .brand .studio-logo {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  box-sizing: border-box;
  padding: 8px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 11px;
}
[data-theme='dark'] .studio-identity .brand .studio-logo {
  background: #f4f4f4;
  border-color: #f4f4f4;
}
.communication-fab,
.conversation-icon {
  box-sizing: border-box;
  gap: 0 !important;
  line-height: 1;
  flex-shrink: 0;
}
.conversation-icon {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 8px !important;
}
.communication-fab > svg,
.conversation-icon > svg,
.delete-icon > svg {
  display: block;
  margin: 0 !important;
  flex-shrink: 0;
}
.delete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1;
}
@media (max-width: 700px) {
  .studio-identity .brand .studio-logo {
    width: 38px;
    height: 38px;
    padding: 6px;
  }
}
.communication-fab > svg,
.conversation-icon > svg {
  transform: translate(1px, -1px);
}
.studio-identity .brand {
  min-width: 46px;
  min-height: 46px;
  overflow: visible;
}
.studio-identity .brand .studio-logo {
  visibility: visible;
  opacity: 1;
  flex: none;
  max-width: none;
}
/* The brand is filled artwork, unlike the outline UI icons. */
.studio-identity .brand svg.studio-logo,
.topbar .studio-identity .brand svg.studio-logo {
  width: 46px;
  height: 46px;
  padding: 8px;
  background: #fff !important;
  color: #111 !important;
  fill: #111 !important;
  stroke: none !important;
  border: 1px solid #ddd;
  border-radius: 11px;
  display: block;
}
.studio-identity .brand svg.studio-logo path {
  fill: #111 !important;
  stroke: none !important;
}
@media (max-width: 700px) {
  .studio-identity .brand svg.studio-logo,
  .topbar .studio-identity .brand svg.studio-logo {
    width: 38px;
    height: 38px;
    padding: 6px;
  }
}
.communication-fab .communication-count {
  position: absolute;
  right: -4px;
  top: -4px;
  min-width: 23px;
  height: 23px;
  padding: 3px 6px;
  border-radius: 20px;
  background: #c44949;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 17px;
  border: 2px solid #fff;
  box-sizing: content-box;
}
.communication-thread.has-unread {
  border-left: 3px solid #568caa;
  background: #568caa12;
}
.communication-thread.has-unread strong:before {
  content: '●';
  color: #568caa;
  margin-right: 8px;
  font-size: 10px;
}
.communication-detail details {
  margin: 12px 0;
}
.communication-detail details .field {
  margin: 12px 0;
}
