/* v707: backend-style shell for the frontend review center only.
   The lead-entry dialog keeps its existing v705/v706 rules and lifecycle. */
.v707-center-shell {
  min-width: 0;
}

.v707-center-shell > .v707-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
}

.v707-center-shell > .v707-mode-tabs button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #dde5f0;
  border-radius: 6px;
  color: #52627b;
  background: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}

.v707-center-shell > .v707-mode-tabs button.is-active {
  border-color: #a8bcff;
  color: #3159ff;
  background: #edf2ff;
}

.v707-center-shell > .v707-mode-tabs button:focus-visible {
  outline: 2px solid #557bff;
  outline-offset: 2px;
}

.v707-lead-workbench.v696-review-workbench {
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 12px;
  height: calc(100dvh - 232px);
  min-height: 620px;
  min-width: 0;
  align-items: stretch;
}

.v707-lead-workbench > .v696-review-queue,
.v707-lead-workbench > .v696-review-detail {
  min-width: 0;
  min-height: 0;
  border: 1px solid #e1e8f3;
  border-radius: 8px;
  background: #fff;
}

.v707-lead-workbench > .v696-review-queue {
  padding: 16px 12px 10px;
  overflow: hidden;
}

.v707-lead-workbench .v696-review-queue h3 {
  font-size: 21px;
  line-height: 1.45;
}

.v707-lead-workbench .v696-review-queue > header {
  flex-shrink: 0;
  margin-bottom: 12px;
}

.v707-lead-workbench .v706-center-tabs {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.v707-lead-workbench .v706-center-tabs > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}

.v707-lead-workbench .v706-center-tabs button,
.v707-lead-workbench .v707-queue-tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid #dde5f0;
  border-radius: 6px;
  background: #fff;
  color: #52627b;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}

.v707-lead-workbench .v706-center-tabs button.is-active,
.v707-lead-workbench .v707-queue-tabs button.is-active {
  border-color: #325dff;
  color: #fff;
  background: #325dff;
}

.v707-lead-workbench .v696-queue-search {
  display: block;
  flex: 0 0 auto;
  min-width: 0;
}

.v707-lead-workbench .v696-queue-search input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  font-size: 14px;
}

.v707-lead-workbench .v696-queue-filters {
  flex: 0 0 auto;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.v707-lead-workbench .v696-queue-filters button {
  flex: 1 0 calc(33.333% - 6px);
  padding-inline: 5px;
  white-space: nowrap;
}

.v707-lead-workbench .v696-queue-list {
  min-height: 64px;
  min-width: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.v707-lead-workbench .v696-queue-row {
  padding: 15px 10px;
  min-height: 96px;
  overflow-wrap: anywhere;
}

.v707-lead-workbench .v696-queue-row-heading {
  gap: 7px;
}

.v707-lead-workbench .v696-queue-row-heading strong {
  min-width: 0;
  font-size: 16px;
  line-height: 1.5;
}

.v707-lead-workbench .v696-queue-row :is(.v706-state, .v707-state) {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.45;
  color: #2860c7;
  background: #edf3ff;
  white-space: nowrap;
}

.v707-lead-workbench .v707-workflow-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #7584a0;
  font-size: 12px;
}

.v707-lead-workbench .v707-workflow-filter select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  font: inherit;
  color: #52627b;
}

.v707-lead-workbench .v707-queue-empty {
  padding: 24px 10px;
  color: #7584a0;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.v707-lead-workbench .v696-review-queue > footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  margin-top: auto;
}

.v707-lead-workbench .v696-review-queue > footer button {
  min-height: 32px;
  padding: 4px 7px;
  font-size: 12px;
}

.v707-lead-workbench #aiLeadReviewDetail {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  container: lead-review-detail / inline-size;
}

/* Two IDs deliberately outrank the old full-screen root, including its media rules. */
#aiLeadReviewDetail #leadSentenceReview.v707-center-review {
  position: static;
  inset: auto;
  z-index: auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: inherit;
  overflow: hidden;
  background: #fff;
  color: #15233e;
  font-size: 14px;
  line-height: 1.7;
  box-shadow: none;
  transform: none;
  isolation: auto;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review[hidden] {
  display: none;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review > .v705-review-header {
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 16px;
  min-height: 0;
  padding: 0 0 12px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-review-header :is(h1, h2) {
  margin: 0 0 5px;
  color: #15233e;
  font-size: 23px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-review-subtitle {
  margin-top: 0;
  color: #7584a0;
  font-size: 13px;
  line-height: 1.7;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-header-actions {
  flex: 0 1 auto;
  max-width: 100%;
  margin-left: auto;
  gap: 7px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-header-actions button,
#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v706-footer-actions button {
  min-height: 36px;
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 500;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-back {
  min-height: 28px;
  margin-bottom: 6px;
  font-size: 13px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review > .v706-review-tabs {
  flex: 0 0 auto;
  min-height: 40px;
  gap: 16px;
  margin: 0 0 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid #e3e9f3;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review > .v706-review-tabs > button {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #7c8ba2;
  background: transparent;
  font-size: 14px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review > .v706-review-tabs > button.is-active {
  border-bottom-color: #3159ff;
  color: #3159ff;
  background: transparent;
  font-weight: 650;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review > .v705-review-grid {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  align-items: stretch;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v707-material {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid #e3e9f3;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review :is(.v707-material-tools, .v707-material-tabs) {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 43px;
  margin: 0 12px;
  padding: 5px 0;
  border-bottom: 1px solid #e3e9f3;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review :is(.v707-material-tools, .v707-material-tabs) button {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #7584a0;
  background: transparent;
  font-size: 13px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review :is(.v707-material-tools, .v707-material-tabs) button:is(.is-active, [aria-selected="true"]) {
  border-bottom-color: #3159ff;
  color: #3159ff;
  font-weight: 650;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-color: #e3e9f3;
  border-radius: 7px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v707-material > .v705-pane {
  flex: 1 1 auto;
  border: 0;
  border-radius: 0;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-pane-head {
  flex: 0 0 auto;
  padding: 12px 12px 10px;
  gap: 8px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-pane-head h2 {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 650;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-pane-head p {
  font-size: 12px;
  line-height: 1.65;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-pane-head button {
  min-height: 32px;
  padding: 4px 7px;
  font-size: 12px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-pane-body {
  padding: 0 12px 12px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-accounts {
  gap: 6px;
  margin: 0 10px 10px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-accounts button {
  flex: 1 0 auto;
  min-width: 104px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-message-list {
  padding: 0 4px 12px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-message {
  padding: 12px 7px;
  margin-bottom: 4px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-message-body,
#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-comment-text,
#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-comment-quote {
  font-size: 14px;
  line-height: 1.8;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-message-head strong {
  font-size: 14px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-message-head :is(time, small),
#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-message-meta {
  font-size: 11px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-comments {
  padding: 0 12px 12px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-comment-card {
  margin-bottom: 10px;
  padding: 12px;
  border-color: #e1e8f3;
  border-radius: 7px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-comment-card.is-selected {
  border-color: #9fbaff;
  background: #fcfdff;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-comment-header > button {
  font-size: 15px;
  min-height: 44px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-comment-tools button {
  min-height: 32px;
  padding: 4px 6px;
  font-size: 12px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review :is(.v705-message-actions, .v705-quote-select) button,
#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-quote-select {
  min-height: 44px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-source-stage {
  margin: 0 10px 12px;
  padding: 7px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-source-footer {
  flex-wrap: wrap;
  margin: 10px 10px 12px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-proofnote {
  margin: 6px 12px 10px;
  font-size: 11px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review :is(.v705-comment-form, .v705-summary-block) textarea,
#aiLeadReviewDetail #leadSentenceReview.v707-center-review :is(.v706-question, .v706-grading, .v706-confirm) textarea {
  font-size: 14px;
  line-height: 1.75;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v706-training-footer {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 0;
  max-height: 240px;
  margin: 10px 0 0;
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid #e3e9f3;
  border-radius: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  font-size: 12px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v706-footer-actions {
  margin-top: 0;
  gap: 7px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v706-confirm {
  flex: 1 0 100%;
  min-width: 0;
  margin-top: 0;
  padding-top: 8px;
}

#aiLeadReviewDetail #leadSentenceReview.v707-center-review .v706-confirm > div {
  flex-wrap: wrap;
}

.v707-lead-workbench :is(button, input, textarea, select, summary):focus-visible {
  outline: 2px solid #557bff;
  outline-offset: 2px;
}

.v707-lead-workbench button:disabled {
  cursor: not-allowed;
}

@media (max-width: 1280px) {
  .v707-lead-workbench.v696-review-workbench {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

/* The right pane can be narrow even on a wide screen with the CRM navigation open. */
@container lead-review-detail (max-width: 740px) {
  #aiLeadReviewDetail #leadSentenceReview.v707-center-review {
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review > .v705-review-grid {
    display: flex;
    flex-direction: column;
    min-height: auto;
    overflow: visible;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review .v707-material {
    height: 480px;
    min-height: 320px;
    max-height: 65dvh;
    flex: 0 0 auto;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-review-grid > .v705-pane {
    flex: 0 0 auto;
    min-height: 280px;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review .v706-training-footer {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 900px) {
  .v707-lead-workbench.v696-review-workbench {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
  }

  .v707-lead-workbench > .v696-review-queue {
    min-height: 245px;
    max-height: 340px;
  }

  .v707-lead-workbench #aiLeadReviewDetail {
    height: auto;
    min-height: 560px;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review {
    display: block;
    height: auto;
    overflow: visible;
    padding: 14px;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review > .v705-review-grid {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review .v707-material {
    flex: 0 0 auto;
    height: 480px;
    min-height: 300px;
    max-height: 65dvh;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review .v707-material > .v705-pane {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-review-grid > .v705-pane {
    flex: 0 0 auto;
    min-height: 280px;
    overflow: visible;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review .v706-training-footer {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 600px) {
  .v707-lead-workbench > .v696-review-queue {
    padding-inline: 10px;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review {
    padding: 12px;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-review-header :is(h1, h2) {
    font-size: 21px;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-header-actions {
    flex: 1 0 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review :is(.v705-header-actions, .v706-footer-actions, .v706-confirm > div) button {
    min-height: 40px;
    padding: 7px 10px;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review > .v706-review-tabs {
    gap: 12px;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review > .v706-review-tabs > label {
    flex: 1 0 100%;
    margin-left: 0;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-accounts button {
    min-height: 40px;
  }

  #aiLeadReviewDetail #leadSentenceReview.v707-center-review .v705-comment-tools button {
    min-height: 40px;
  }
}
