/* Deal Home — one-screen hub for a transaction */

.deal-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: #1e3a5f;
}
.deal-flow__arrow,
.deal-flow__or {
  font-weight: 500;
  color: #6b7280;
}
.deal-pipeline-set-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-end;
}

.deal-sheet__pipeline .deal-pipe-set,
.deal-sheet td .deal-pipe-set {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  min-width: 0;
}
.deal-sheet__pipeline .deal-pipe-set__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.deal-sheet__pipeline .deal-pipe-set__select,
.deal-sheet td .deal-pipe-set__select,
.deal-pipe-set__select--compact {
  min-width: 6.25rem;
  max-width: 7.75rem;
  padding: 0.16rem 0.28rem;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.2;
  border-radius: 6px;
}

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

.deal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f4f5f7;
  color: #111827;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
}

.deal-shell {
  flex: 1;
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2.75rem;
}

.deal-page--list .deal-hero,
.deal-page--list .deal-actions,
.deal-page--list .deal-titlesheet,
.deal-page--list .deal-checklist,
.deal-page--list .deal-earnest,
.deal-hero__next,
.deal-grid,
.deal-empty,
.deal-pipeline,
.deal-mls,
.deal-emails,
.deal-commission,
.deal-doc-tasks {
  display: none !important;
}

html.deal-opening-file .deal-picker,
html.deal-opening-file .deal-browse,
.deal-page--simple .deal-picker,
.deal-page--simple .deal-browse,
.deal-page--simple .deal-checklist,
.deal-page--simple .deal-titlesheet__grid {
  display: none !important;
}
html.deal-opening-file .deal-boot {
  display: block !important;
}

.deal-page--simple .deal-titlesheet,
.deal-page--simple .deal-hero {
  display: block;
}
.deal-page--simple .deal-actions {
  display: flex;
}

.deal-page--simple .deal-crumbs,
.deal-page--simple .deal-binding-date-wrap,
.deal-page--simple .deal-hero__kicker,
.deal-page--simple .deal-hero__sub,
.deal-page--simple .deal-badges,
.deal-page--simple .deal-other-file,
.deal-page--simple .deal-pipe-history,
.deal-page--simple .deal-earnest {
  display: none !important;
}

.deal-page--simple .deal-shell {
  padding-top: 0.55rem;
}

.deal-page--simple .deal-hero {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0.1rem 0 0.2rem;
  margin: 0 0 0.25rem;
  border-radius: 0;
  gap: 0.25rem;
}

.deal-page--simple .deal-hero__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem 0.75rem;
  width: 100%;
}

.deal-page--simple .deal-hero__title {
  grid-column: 1;
  grid-row: 1;
  font-size: 1.12rem;
  line-height: 1.2;
}

.deal-page--simple .deal-pipeline-set-wrap {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
}

.deal-page--simple .deal-actions {
  margin: 0 0 0.45rem;
  gap: 0.35rem;
}

.deal-page--simple .deal-sheet-summary {
  margin: 0 0 0.45rem;
}

.deal-page--simple .deal-titlesheet__contracts {
  display: block !important;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.deal-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.deal-crumbs a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.deal-crumbs a:hover {
  text-decoration: underline;
}

/* Deal picker — always on Deal Home */
.deal-picker {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 0.95rem 1.15rem 1rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.deal-picker__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
}

.deal-picker__start {
  flex: 0 0 auto;
  white-space: nowrap;
}

.deal-name-first {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0 0.15rem;
}

.deal-name-first__row,
.deal-name-first__people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.5rem 0.75rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.deal-name-first__people legend {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a5f;
  padding: 0;
  margin: 0 0 0.2rem;
}

.deal-name-first__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.deal-name-first__field input,
.deal-name-first__field select {
  min-width: 12rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #111827;
  background: #fff;
}

.deal-address-guide {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid #f3d19e;
  border-radius: 8px;
  background: #fff8eb;
  color: #7c4a12;
  font-size: 0.86rem;
  line-height: 1.4;
}

.deal-addr-hint {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #fff8eb;
  color: #7c4a12;
  font-size: 0.72rem;
  font-weight: 600;
}

.deal-picker__label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 8rem;
}

.deal-picker__kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

.deal-picker__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.deal-picker__select {
  flex: 1 1 16rem;
  min-width: min(100%, 14rem);
  max-width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  appearance: auto;
}

.deal-picker__select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #fff;
}

.deal-picker__select:disabled {
  opacity: 0.7;
  cursor: wait;
}

html:not(.deal-board-work) #deal-start-contract,
html:not(.deal-board-work) #deal-start-rider,
html:not(.deal-board-work) #deal-open-add-buyers {
  display: none !important;
}
html:not(.deal-board-pending) #deal-pay-at-close {
  display: none !important;
}
html.deal-board-pending #deal-pay-at-close {
  display: inline-flex !important;
}
html:not(.deal-board-work) #deal-crumb-list,
html:not(.deal-board-work) .deal-crumbs__sep--current {
  display: none !important;
}
html.deal-board-closed #deal-start-contract,
html.deal-board-closed #deal-start-rider,
html.deal-board-closed #deal-open-add-buyers,
html.deal-board-closed #deal-pay-at-close,
html.deal-board-closed #deal-crumb-list,
html.deal-board-closed .deal-crumbs__sep--current,
html.deal-board-listings #deal-start-contract,
html.deal-board-listings #deal-start-rider,
html.deal-board-listings #deal-open-add-buyers,
html.deal-board-listings #deal-pay-at-close {
  display: none !important;
}

.deal-picker__hint {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #6b7280;
}

/* Browse list + filters — first-class CW + open deals */
.deal-browse {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 0.95rem 1.1rem 1.05rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.deal-browse__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
}

.deal-browse__head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.deal-browse__hint {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #6b7280;
}

.deal-incoming {
  align-self: center;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 999px;
  color: #9a3412;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.28rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
}
.deal-incoming:hover { background: #ffedd5; }
.deal-incoming.is-zero {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.deal-browse__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.deal-browse__filter {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.deal-browse__filter:hover {
  background: #fff;
  border-color: #94a3b8;
}

.deal-browse__filter.is-active {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #fff;
}

.deal-tc-today {
  margin-top: 1rem;
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}
.deal-tc-today__head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.deal-tc-today__head h3 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a3412;
}
.deal-tc-list { list-style: none; margin: 0; padding: 0; }
.deal-tc-list li { margin: 0.25rem 0 0; font-size: 0.82rem; }
.deal-tc-list a { color: #9a3412; font-weight: 700; text-decoration: none; }
.deal-tc-list .is-due a { color: #1d4ed8; }
.deal-tc-list .is-zero { color: #64748b; }

.deal-browse__list {
  display: block;
  overflow-x: auto;
}

.deal-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.deal-sheet th,
.deal-sheet td {
  padding: 0.62rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.deal-sheet th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
}

.deal-sheet tbody tr {
  cursor: pointer;
}

.deal-sheet tbody tr:hover {
  background: #eff6ff;
}

.deal-sheet tbody tr.deal-sheet__moved {
  background: #dbeafe;
  outline: 2px solid #1e3a5f;
}

.deal-sheet a {
  color: #1e3a5f;
  font-weight: 700;
  text-decoration: none;
}

.deal-sheet a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.deal-sheet__amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}

.deal-sheet tfoot tr.deal-sheet__totals td {
  border-top: 2px solid #1e3a5f;
  background: #f8fafc;
  font-weight: 700;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.deal-sheet__totals-label {
  color: #1e3a5f;
}

.deal-sheet__totals-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.deal-sheet th,
.deal-sheet td {
  white-space: nowrap;
}

.deal-sheet td:first-child {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-sheet td:first-child a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.deal-sheet__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  white-space: nowrap;
}

.deal-sheet__actions .deal-btn {
  padding: 0.22rem 0.45rem;
  font-size: 0.72rem;
  flex: 0 0 auto;
}

.deal-sheet--skeleton tbody tr {
  cursor: default;
}

.deal-sheet--skeleton tbody tr:hover {
  background: transparent;
}

.deal-sheet__skel td {
  color: #94a3b8;
  font-weight: 500;
  background: linear-gradient(90deg, #f8fafc 0%, #eef2f7 50%, #f8fafc 100%);
  background-size: 200% 100%;
  animation: deal-sheet-skel 1.1s ease-in-out infinite;
}

@keyframes deal-sheet-skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.deal-browse__empty {
  margin: 0;
  padding: 0.85rem 0.2rem;
  color: #6b7280;
  font-size: 0.88rem;
}

.deal-browse__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

.deal-browse__main {
  min-width: 0;
  flex: 1 1 14rem;
}

.deal-browse__address {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  line-height: 1.3;
}

.deal-browse__address:hover {
  color: #2563eb;
  text-decoration: underline;
}

.deal-browse__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin: 0.28rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
}

.deal-browse__status {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
  text-transform: capitalize;
  background: #e2e8f0;
  color: #334155;
}

.deal-browse__status--pending {
  background: #fef3c7;
  color: #92400e;
}

.deal-browse__status--active,
.deal-browse__status--open {
  background: #dbeafe;
  color: #1e40af;
}

.deal-browse__status--listing {
  background: #dcfce7;
  color: #166534;
}

.deal-browse__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.deal-browse__btn {
  padding: 0.38rem 0.7rem;
  font-size: 0.8rem;
}

/* Title sheet — key deal facts */
.deal-titlesheet {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem 1.1rem 1.15rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.deal-titlesheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.deal-titlesheet__head-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.deal-titlesheet__head h2 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.deal-titlesheet__head #deal-doc-upload {
  flex: 0 0 auto;
  margin-top: 0.05rem;
}

.deal-titlesheet__sub {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.35;
}

.deal-titlesheet__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (max-width: 900px) {
  .deal-titlesheet__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .deal-titlesheet__grid {
    grid-template-columns: 1fr;
  }
}

.deal-titlesheet__tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  min-width: 0;
}

.deal-titlesheet__tile--emphasize {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.deal-titlesheet__tile.is-empty .deal-titlesheet__value {
  color: #94a3b8;
  font-weight: 600;
}

.deal-titlesheet__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.deal-titlesheet__value {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}

.deal-titlesheet__contracts {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e5e7eb;
}

.deal-titlesheet__contracts h3 {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.deal-titlesheet__check-hint {
  margin: -0.15rem 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
}

.deal-contract-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.deal-contract-list li {
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
}

.deal-contract-list__head,
.deal-contract-list__row {
  display: block;
  width: 100%;
}

.deal-contract-list__head {
  padding: 0;
}

.esign-include-form-head {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.2;
}

.esign-include-head-cluster,
.deal-contract-list__actions {
  display: contents;
}

.esign-include-head,
.deal-contract-list__esign-head,
.deal-contract-list__review-head,
.deal-contract-list__approve-head,
.deal-contract-list__pdf-head {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1d4ed8;
  text-align: center;
  line-height: 1.2;
}

.deal-contract-list__review-head {
  grid-column: 3;
  color: #64748b;
}

.deal-contract-list__approve-head {
  grid-column: 4;
  color: #64748b;
}

.deal-contract-list__pdf-head {
  grid-column: 5;
  color: #64748b;
}

.deal-contract-list__delete-head {
  grid-column: 6;
  color: #64748b;
}

.esign-include-head {
  grid-column: 2;
  width: auto;
  min-width: 0;
  max-width: 2.4rem;
  justify-self: start;
  text-align: left;
}

.deal-contract-list__esign,
.deal-contract-list__esign-spacer {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 1.35rem;
  min-width: 1.35rem;
  max-width: 1.35rem;
  height: 1.55rem;
  margin: 0;
  padding: 0;
  justify-self: start;
  cursor: pointer;
}

.deal-contract-list__esign-spacer {
  cursor: default;
}

.deal-contract-list__esign input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #1d4ed8;
  cursor: pointer;
}

.deal-contract-list__code {
  display: inline-flex;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-right: 0.25rem;
}

.deal-contract-list__empty {
  background: transparent !important;
  border: none !important;
  color: #6b7280 !important;
  font-weight: 500 !important;
  padding-left: 0 !important;
}

.deal-contract-list__head,
.deal-contract-list__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.4rem 4.75rem 5.5rem 3.1rem 4.4rem;
  align-items: center;
  column-gap: 0.4rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  box-sizing: border-box;
}

.deal-contract-list__head {
  padding-top: 0;
  padding-bottom: 0.2rem;
}

.esign-include-form-head {
  grid-column: 1;
  padding: 0;
}

.deal-contract-list__link {
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  text-decoration: none;
  font-weight: 600;
}

.deal-contract-list__name {
  grid-column: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.deal-contract-list__link:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.deal-contract-list__action,
.deal-contract-list__action-spacer {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #2563eb;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  text-decoration: none;
  justify-self: stretch;
  text-align: center;
}

.deal-contract-list__action-spacer {
  background: transparent;
  padding: 0;
}

.deal-contract-list__link.is-folder .deal-contract-list__action {
  color: #475569;
  background: rgba(71, 85, 105, 0.12);
}

.deal-contract-list__all .deal-contract-list__link {
  background: #fff;
  border-style: dashed;
}

.deal-contract-list__link.is-review {
  cursor: default;
}

.deal-contract-list__link.is-review:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #1e293b;
}

.deal-contract-list__action--btn {
  appearance: none;
  font: inherit;
  grid-column: 3;
  cursor: pointer;
  border: 1px solid transparent;
}

.deal-contract-list__action--btn:hover,
.deal-contract-list__action--btn:focus-visible {
  background: #2563eb;
  color: #fff;
  outline: none;
}

.deal-contract-list__action.deal-contract-list__action--approve {
  grid-column: 4;
  color: #047857;
  background: rgba(4, 120, 87, 0.14);
}

.deal-contract-list__action--approve:hover,
.deal-contract-list__action--approve:focus-visible {
  background: #047857;
  color: #fff;
}

.deal-contract-list__action--approve.is-approved,
.deal-contract-list__action--approve.is-approved:hover {
  color: #065f46;
  background: #d1fae5;
  cursor: default;
}

.deal-contract-list__approve-spacer {
  grid-column: 4;
  display: block;
}

.deal-contract-list__action--delete {
  grid-column: 6;
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.1);
}

.deal-contract-list__action--delete:hover,
.deal-contract-list__action--delete:focus-visible {
  background: #b91c1c;
  color: #fff;
}

.deal-contract-list__pdf,
.deal-contract-list__pdf-spacer {
  grid-column: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #475569;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-decoration: none;
  justify-self: stretch;
  text-align: center;
}

.deal-contract-list__pdf-spacer {
  padding: 0;
  background: transparent;
}

.deal-contract-list__pdf {
  background: rgba(71, 85, 105, 0.12);
  text-decoration: none;
}

.deal-contract-list__pdf:hover {
  background: #e2e8f0;
  color: #1e293b;
}

button.deal-contract-list__pdf {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.deal-pdf-dialog {
  width: min(1240px, calc(100vw - 1rem));
  height: min(94vh, 1200px);
  max-width: 100%;
  max-height: calc(100vh - 0.75rem);
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  overflow: hidden;
}

.deal-pdf-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.deal-pdf-dialog__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #e5e7eb;
}

.deal-pdf-dialog__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.deal-pdf-dialog__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.deal-pdf-dialog__status {
  margin: 0;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  color: #334155;
  background: #fff7ed;
}

.deal-pdf-dialog__frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #e5e7eb;
}

.deal-review-dialog {
  position: relative;
  width: min(1240px, calc(100vw - 1rem));
  max-width: 100%;
  height: min(94vh, 1200px);
  max-height: calc(100vh - 0.75rem);
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #f8fafc;
  color: #111827;
}

.deal-review-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.deal-review-dialog__chrome {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.deal-review-signers {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem 0.45rem;
  padding: 0.22rem 0.65rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.deal-review-signers__chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  min-width: 0;
  flex: 1 1 auto;
  padding-bottom: 0.05rem;
}

.deal-review-signer-chip {
  display: flex;
  flex-direction: column;
  gap: 0.02rem;
  min-width: 10.5rem;
  max-width: 16rem;
  flex: 0 0 auto;
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 600;
  color: #111827;
  background: #fff;
  border: 1px solid var(--signer-color, #f59e0b);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 0.18rem 0.5rem 0.22rem 0.5rem;
  line-height: 1.25;
}

.deal-review-signer-chip__role {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6b7280;
}

.deal-review-signer-chip__name,
.deal-review-signer-chip__email,
.deal-review-signer-chip__phone {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-review-signer-chip__name {
  font-size: 0.74rem;
  font-weight: 700;
  color: #111827;
}

.deal-review-signer-chip__email,
.deal-review-signer-chip__phone {
  font-size: 0.66rem;
  font-weight: 500;
  color: #4b5563;
}

.deal-review-add-signer {
  appearance: none;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1f2937;
  background: #fff;
  border: 1px dashed #9ca3af;
  border-radius: 8px;
  padding: 0.18rem 0.55rem;
  cursor: pointer;
  align-self: center;
}

.deal-review-add-signer-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  width: 100%;
}

.deal-review-add-signer-form[hidden] {
  display: none;
}

.deal-review-add-signer-form input,
.deal-review-add-signer-form select {
  font: inherit;
  font-size: 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.28rem 0.5rem;
  min-width: 8rem;
}

.deal-review-tools {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.12rem;
  min-width: 0;
  flex: 1 1 auto;
  align-self: center;
  overflow-x: auto;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.deal-review-dialog__chrome > .deal-review-tools {
  flex: 0 0 auto;
}

.deal-review-tool {
  appearance: none;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.22rem;
  min-width: 0;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  color: #4b5563;
  background: transparent;
  border: 0;
  border-radius: 7px;
  padding: 0.22rem 0.4rem;
  cursor: pointer;
  white-space: nowrap;
}

.deal-review-tool svg {
  display: block;
  width: 16px;
  height: 16px;
}

.deal-review-tool__glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  font-family: Georgia, serif;
}

.deal-review-tool__glyph--strike {
  text-decoration: line-through;
}

.deal-review-tool:hover,
.deal-review-tool.is-active {
  color: #111827;
  background: #fff;
}

.deal-review-tool--fill-now .deal-review-dot {
  margin-top: 0;
}

.deal-review-inspector {
  position: absolute;
  z-index: 8;
  width: 16.5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  padding: 0.65rem 0.75rem 0.8rem;
}

.deal-review-inspector__head {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 0.65rem;
}

.deal-review-inspector__kind {
  margin-right: auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6b7280;
}

.deal-review-inspector__icon {
  appearance: none;
  width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  color: #6b7280;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.deal-review-inspector__icon:hover {
  background: #f3f4f6;
  color: #111827;
}

.deal-review-inspector__actions {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.deal-review-fill-now,
.deal-review-clear {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 1;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: #111827;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}

.deal-review-clear[hidden] {
  display: none;
}

.deal-review-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: #22c55e;
  flex: 0 0 auto;
}

.deal-review-dot--fill {
  background: #2563eb;
}

.deal-review-inspector__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin-top: 0.55rem;
}

.deal-review-font {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.15rem 0.4rem;
  background: #f9fafb;
}

.deal-review-font input,
.deal-review-inspector__assign select {
  font: inherit;
  font-size: 0.85rem;
  border: 0;
  background: transparent;
  width: 3.2rem;
}

.deal-review-inspector__assign {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
}

.deal-review-inspector__assign select {
  flex: 1;
  width: auto;
}

.deal-review-color input[type="color"] {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.deal-review-style,
.deal-review-align {
  appearance: none;
  min-width: 1.85rem;
  height: 1.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  border: 0;
  border-radius: 6px;
  background: #eef2ff;
  color: #1e3a8a;
  cursor: pointer;
}

.deal-review-style.is-active,
.deal-review-align.is-active {
  background: #1e3a8a;
  color: #fff;
}

.deal-review-inspector__required {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.deal-review-inspector__date-format {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #475569;
}

.deal-review-inspector__date-format select {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  background: #fff;
}

.deal-review-page__overlay,
.deal-review-field,
.deal-review-field-shell,
.deal-review-esign-tab {
  cursor: grab;
}

.deal-review-field-shell {
  position: absolute;
  box-sizing: border-box;
  overflow: visible;
}

.deal-review-field-shell .deal-review-field {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.deal-review-resize {
  display: none;
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 18px;
  height: 18px;
  background: #1e3a8a;
  border: 2px solid #fff;
  border-radius: 3px;
  cursor: nwse-resize;
  box-shadow: 0 0 0 1px rgba(30, 58, 138, 0.45);
  z-index: 20;
  pointer-events: auto;
}

.deal-review-field-shell.is-selected .deal-review-resize,
.deal-review-esign-tab.is-selected .deal-review-resize {
  display: block;
}

.deal-review-esign-tab {
  position: absolute;
}

.deal-review-field-shell.is-selected,
.deal-review-field.is-selected,
.deal-review-esign-tab.is-selected {
  outline: 2px solid #1d4ed8;
  outline-offset: 1px;
  z-index: 5;
}

.deal-review-field-shell.is-selected .deal-review-field {
  overflow: hidden;
}

.deal-review-field-shell.is-selected .deal-review-field:focus {
  outline: 1px solid #93c5fd;
}

.deal-review-dialog__head {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem 0.5rem;
  padding: 0.28rem 0.65rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.deal-review-dialog__kicker {
  display: none;
}

.deal-review-dialog__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 0 auto;
}

.deal-review-dialog__sub {
  display: none;
}

.deal-review-zoom {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-right: 0.35rem;
  padding: 0.15rem 0.25rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
}

.deal-review-zoom button {
  appearance: none;
  width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  color: #1e3a8a;
  background: #f8fafc;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.deal-review-zoom button:hover:not(:disabled) {
  background: #e0e7ff;
}

.deal-review-zoom button:disabled {
  opacity: 0.4;
  cursor: default;
}

.deal-review-zoom span {
  min-width: 3.1rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
}

.deal-review-dialog__stage {
  --review-zoom: 1;
}

.deal-review-dialog__stage .deal-review-page {
  zoom: var(--review-zoom, 1);
}

.deal-review-dialog__head-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
}

.deal-review-dialog__head-actions .deal-btn {
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .deal-review-dialog__head {
    flex-wrap: wrap;
  }
  .deal-review-tools {
    order: 3;
    flex: 1 1 100%;
  }
}

.deal-btn--approve {
  background: #047857;
  color: #fff;
  border: 1px solid #047857;
}

.deal-btn--approve:hover,
.deal-btn--approve:focus-visible {
  background: #065f46;
  border-color: #065f46;
}

.deal-btn--approve.is-approved {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.deal-review-dialog__status {
  margin: 0;
  padding: 0.28rem 0.75rem;
  font-size: 0.75rem;
  background: #eff6ff;
  color: #1e3a8a;
  border-bottom: 1px solid #dbeafe;
}

.deal-review-dialog__status[data-tone="ok"] {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.deal-review-dialog__status[data-tone="error"] {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.deal-review-dialog__status[data-tone="warn"] {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.deal-review-dialog__stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.35rem 0.75rem 0.75rem;
}

.deal-review-dialog__chrome > .deal-review-dialog__stage {
  flex: 1;
}

.deal-review-dialog__loading,
.deal-review-dialog__empty {
  margin: 1.5rem 0;
  color: #4b5563;
}

.deal-review-page {
  margin: 0 0 1.1rem;
}

.deal-review-page__label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.deal-review-page__frame {
  position: relative;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.08);
}

.deal-review-page__frame canvas {
  display: block;
}

.deal-review-page__overlay {
  position: absolute;
  inset: 0;
  cursor: text;
}

.deal-review-field {
  position: absolute;
  margin: 0;
  border: none;
  outline: 1px solid rgba(37, 99, 235, 0.4);
  outline-offset: -1px;
  background: transparent;
  color: #2563eb;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: inherit;
  line-height: 1;
  padding: 0 2px;
  box-sizing: border-box;
  resize: none;
}

.deal-review-field:focus {
  outline: 2px solid #2563eb;
  background: rgba(255, 255, 255, 0.92);
}

.deal-review-field--check {
  appearance: auto;
  accent-color: #2563eb;
  background: transparent;
}

.deal-review-field--tall {
  font-size: 10px;
}

.deal-review-field--writein {
  border-style: dashed;
}

.deal-review-esign-tab {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-start;
  margin: 0;
  padding: 0 4px;
  border: 1px solid #d6dcc8;
  background: #eef2d8;
  color: #6b7280;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0;
  line-height: 1.15;
  pointer-events: auto;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 6px;
}

.deal-review-esign-tab svg {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
}

.deal-review-esign-tab.is-selected {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.deal-boot {
  padding: 1.25rem 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  color: #4b5563;
  margin-bottom: 0.85rem;
}

.deal-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  margin-bottom: 0.85rem;
}

.deal-hero__kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

.deal-hero__title {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #0f172a;
}

.deal-hero__sub {
  margin: 0.35rem 0 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.deal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.deal-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.deal-badge--status {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.deal-badge--pending {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.deal-badge--active {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.deal-badge--listing {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.deal-badge--expired {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.deal-badge--closed {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

.deal-badge--source-bia {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.deal-badge--source-bm {
  background: #faf5ff;
  color: #6b21a8;
  border-color: #e9d5ff;
}

.deal-badge--side {
  background: #f8fafc;
  color: #334155;
  border-color: #e2e8f0;
}

.deal-hero__next {
  min-width: min(240px, 100%);
  background: #0b0d10;
  color: #e8eaed;
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.deal-next__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa3b2;
  margin-bottom: 0.35rem;
}

.deal-next__text {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
}

.deal-next__why {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #9aa3b2;
  font-weight: 500;
}

.deal-next__cta {
  display: inline-flex;
  margin-top: 0.75rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: #2563eb;
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #3b82f6;
}

.deal-next__cta:hover {
  background: #1d4ed8;
}

.deal-pipeline-set-wrap {
  margin: 0.55rem 0 0;
}

.deal-binding-date-wrap {
  margin: 0.45rem 0 0;
}

.deal-bind-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
  max-width: 36rem;
}

.deal-bind-pick__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.deal-bind-pick__date {
  min-width: 10rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 600;
}

.deal-bind-pick__save {
  padding: 0.38rem 0.75rem;
}

.deal-bind-pick__hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #475569;
}

.deal-pipe-set {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.deal-pipe-set__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.deal-pipe-set__select {
  min-width: 8.5rem;
  padding: 0.28rem 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 600;
}

.deal-pipe-set--hero .deal-pipe-set__select {
  min-width: 10rem;
  padding: 0.4rem 0.55rem;
}

.deal-pipe-history {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}
.deal-pipe-history__title {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.deal-pipe-history li {
  margin: 0;
}

.deal-sheet__pipeline {
  white-space: nowrap;
}

.deal-pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
  padding: 0.65rem 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.deal-pipe-step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.deal-pipe-step.is-done {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.deal-pipe-step.is-current {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.deal-pipe-step__n {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.06);
}

.deal-pipe-step.is-done .deal-pipe-step__n {
  background: rgba(4, 120, 87, 0.15);
}

.deal-pipe-step.is-current .deal-pipe-step__n {
  background: rgba(37, 99, 235, 0.18);
}

.deal-btn--primary-next {
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

/* Commission snapshot on Deal Home */
.deal-earnest {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.deal-earnest__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.deal-earnest__head h2 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}
.deal-earnest__sub {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: #6b7280;
  max-width: 36rem;
}
.deal-earnest__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
@media (max-width: 720px) {
  .deal-earnest__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.deal-earnest__tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
}
.deal-earnest__tile span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.deal-earnest__tile strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.95rem;
}
.deal-earnest__flags {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}
.deal-earnest__flags li {
  font-size: 0.82rem;
  margin: 0.28rem 0 0;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}
.deal-earnest__flags .is-ok { background: #ecfdf5; color: #047857; }
.deal-earnest__flags .is-bad { background: #fef2f2; color: #b91c1c; }
.deal-earnest__flags .is-warn { background: #fff7ed; color: #c2410c; }
.deal-earnest__flags .is-info { background: #eff6ff; color: #1d4ed8; }
.deal-earnest__files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}
.deal-earnest__files a {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1d4ed8;
  text-decoration: none;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}
.deal-earnest__files a:hover { background: #dbeafe; }
.deal-earnest__files span {
  font-size: 0.78rem;
  color: #64748b;
}

.deal-commission {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.deal-commission__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.deal-commission__head h2 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.deal-commission__status {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.deal-commission__status.is-estimated {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.deal-commission__status.is-ready {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.deal-commission__status.is-paid,
.deal-commission__status.is-closed {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.deal-commission__status.is-held {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.deal-commission__status.is-after-close {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.deal-commission__sub {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: none;
  letter-spacing: 0;
}

.deal-commission__sides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.7rem;
}

@media (max-width: 720px) {
  .deal-commission__sides {
    grid-template-columns: 1fr;
  }
}

.deal-commission__side {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  min-width: 0;
}

.deal-commission__side.is-ours {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.deal-commission__side h3 {
  margin: 0 0 0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.deal-commission__side .deal-commission__who {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1d4ed8;
}

.deal-commission__side.is-ours .deal-commission__who { color: #1d4ed8; }
.deal-commission__side:not(.is-ours) .deal-commission__who { color: #9a3412; }

.deal-commission__side b {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  word-break: break-word;
}

.deal-commission__side span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #64748b;
}

.deal-commission__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.deal-commission__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (max-width: 720px) {
  .deal-commission__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.deal-commission__tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  min-width: 0;
}

.deal-commission__tile--highlight {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.deal-commission__tile b {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.2;
  word-break: break-word;
}

.deal-commission__tile span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.deal-commission__note {
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #6b7280;
}

.deal-commission__pay {
  margin-top: 0.75rem;
}

.deal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* Email history — Team Inbox linked to selected deal */
.deal-emails {
  margin: 0 0 1.1rem;
  padding: 1rem 1.05rem;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  scroll-margin-top: 5rem;
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.deal-emails.is-deep-linked {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.deal-emails__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.65rem;
}

.deal-emails__head h2 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  color: #111827;
}

.deal-emails__sub {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: #6b7280;
  max-width: 40rem;
}

.deal-emails__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.deal-emails__count {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: #6b7280;
}

.deal-emails__empty {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.45;
}

.deal-emails__empty a {
  color: #2563eb;
}

.deal-emails__list {
  border-top: 1px solid #e5e7eb;
  max-height: 26rem;
  overflow: auto;
}

.deal-emails__item {
  border-bottom: 1px solid #e5e7eb;
}

.deal-emails__item:last-child {
  border-bottom: none;
}

.deal-emails__row {
  display: flex;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.1rem;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.deal-emails__row:hover {
  background: #f9fafb;
}

.deal-emails__item.is-open .deal-emails__row {
  background: rgba(37, 99, 235, 0.06);
}

.deal-emails__item.is-unread .deal-emails__subject {
  font-weight: 700;
  color: #1e3a5f;
}

.deal-emails__dot {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.45rem;
  border-radius: 999px;
  background: transparent;
}

.deal-emails__item.is-unread .deal-emails__dot {
  background: #2563eb;
}

.deal-emails__meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.deal-emails__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  font-size: 0.88rem;
}

.deal-emails__top strong {
  color: #1e3a5f;
}

.deal-emails__badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  color: #6b7280;
  font-size: 0.78rem;
}

.deal-emails__folder {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(30, 58, 95, 0.08);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #1e3a5f;
}

.deal-emails__subject {
  font-size: 0.92rem;
  color: #111827;
}

.deal-emails__snippet {
  font-size: 0.84rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-emails__why {
  font-size: 0.75rem;
  color: #64748b;
  font-style: italic;
}

.deal-emails__detail {
  padding: 0 0.1rem 0.75rem 1.15rem;
}

.deal-emails__detail-inner {
  padding: 0.7rem 0.8rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

.deal-emails__headers {
  display: grid;
  gap: 0.2rem;
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  color: #6b7280;
}

.deal-emails__headers strong {
  color: #111827;
  margin-right: 0.35rem;
}

.deal-emails__body-text {
  margin: 0;
  max-height: 14rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #111827;
}

.deal-emails__note {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.deal-emails__note a {
  color: #2563eb;
}

.deal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}

.deal-btn--primary {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}

.deal-btn--primary:hover {
  background: #1d4ed8;
}

.deal-btn--secondary {
  background: #fff;
  color: #111827;
  border-color: #d1d5db;
}

.deal-btn--secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.deal-btn--ghost {
  background: transparent;
  color: #374151;
  border-color: #e5e7eb;
}

.deal-btn--ghost:hover {
  background: #fff;
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (max-width: 720px) {
  .deal-grid {
    grid-template-columns: 1fr;
  }
}

.deal-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.deal-card h2 {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.deal-card--flow {
  grid-column: 1 / -1;
}

.deal-dl {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.deal-dl > div {
  display: grid;
  grid-template-columns: minmax(7rem, 34%) 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.92rem;
}

.deal-dl dt {
  margin: 0;
  color: #6b7280;
  font-weight: 500;
}

.deal-dl dd {
  margin: 0;
  color: #111827;
  font-weight: 600;
  word-break: break-word;
}

.deal-flow {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
  color: #374151;
  line-height: 1.5;
  font-size: 0.95rem;
}

.deal-flow li + li {
  margin-top: 0.4rem;
}

.deal-flow__note {
  margin: 0;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.45;
}

.deal-empty {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.deal-empty h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.deal-empty p {
  margin: 0 auto 1.25rem;
  max-width: 36rem;
  color: #6b7280;
  line-height: 1.5;
}

.deal-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

.deal-error {
  color: #b91c1c;
}


/* Day-zero deal checklist */
.deal-checklist {
  margin: 0 0 1.1rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.deal-checklist__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.deal-checklist__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.deal-checklist__progress {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
}
.deal-checklist__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.deal-checklist__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.deal-checklist__item a {
  color: #1e3a8a;
  text-decoration: none;
  font-weight: 500;
}
.deal-checklist__item a:hover { text-decoration: underline; }
.deal-checklist__item.is-done a { color: #166534; }
.deal-checklist__mark {
  width: 1.1rem;
  text-align: center;
  font-weight: 700;
  color: #9ca3af;
}
.deal-checklist__item.is-done .deal-checklist__mark { color: #16a34a; }

/* Package document upload task list (PSA → post-close folders) */
.deal-doc-tasks {
  margin: 0 0 1.1rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.deal-doc-tasks__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
}
.deal-doc-tasks__head h2 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 700;
}
.deal-doc-tasks__sub {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #6b7280;
  max-width: 38rem;
}
.deal-doc-tasks__progress {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e3a5f;
  white-space: nowrap;
}
.deal-doc-tasks__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 28rem;
  overflow: auto;
  border-top: 1px solid #e5e7eb;
  padding-top: 0.55rem;
}
.deal-doc-tasks__row {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr) auto;
  gap: 0.45rem 0.55rem;
  align-items: center;
  padding: 0.45rem 0.35rem;
  border-radius: 8px;
  border: 1px solid transparent;
}
.deal-doc-tasks__row:hover {
  background: #f8fafc;
}
.deal-doc-tasks__row.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.deal-doc-tasks__row.is-custom {
  border-color: #dbeafe;
  background: #f8fbff;
}
.deal-doc-tasks__mark {
  font-weight: 700;
  color: #9ca3af;
  text-align: center;
}
.deal-doc-tasks__row.is-done .deal-doc-tasks__mark {
  color: #16a34a;
}
.deal-doc-tasks__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.deal-doc-tasks__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #111827;
}
.deal-doc-tasks__hint {
  font-size: 0.75rem;
  color: #6b7280;
}
.deal-doc-tasks__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
}
.deal-doc-tasks__btn {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.deal-doc-tasks__btn:hover {
  background: #f3f4f6;
}
.deal-doc-tasks__btn--primary {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
}
.deal-doc-tasks__btn--primary:hover {
  background: #1d4ed8;
}
.deal-doc-tasks__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.deal-doc-tasks__add {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #e5e7eb;
}
.deal-doc-tasks__add-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
}
.deal-doc-tasks__add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.deal-doc-tasks__input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
}
.deal-doc-tasks__status {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: #6b7280;
  min-height: 1.1em;
}
.deal-doc-tasks__status.is-error {
  color: #b91c1c;
}
.deal-doc-tasks__status.is-ok {
  color: #15803d;
}
.deal-doc-tasks__empty {
  margin: 0.35rem 0;
  font-size: 0.88rem;
  color: #6b7280;
}

/* MLS fetch (IDX — not Brokermint) */
.deal-mls {
  margin: 0 0 1.1rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.deal-mls__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.deal-mls__head h2 {
  margin: 0 0 0.15rem;
  font-size: 1rem;
  font-weight: 700;
}
.deal-mls__sub {
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
}
.deal-mls__badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.deal-mls__badge.is-expired {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.deal-mls__badge.is-pending {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}
.deal-mls__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}
.deal-mls__field {
  flex: 1 1 12rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #6b7280;
}
.deal-mls__input {
  padding: 0.5rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  color: #111827;
}
.deal-mls__status {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: #6b7280;
  min-height: 1.15em;
}
.deal-mls__status.is-error { color: #b91c1c; }
.deal-mls__status.is-ok { color: #15803d; }
.deal-mls__card {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.75rem;
}
.deal-mls__card img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  background: #e5e7eb;
}
.deal-mls__card-body {
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}
.deal-mls__card-body strong {
  display: block;
  margin-bottom: 0.2rem;
  color: #111827;
}
.deal-mls__card-meta {
  color: #4b5563;
  font-size: 0.82rem;
}

/* Send for signature stays on /deal/ — never Contract Writer. */
.deal-esign-dialog {
  border: 0;
  padding: 0;
  border-radius: 16px;
  max-width: min(640px, calc(100vw - 2rem));
  width: 100%;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.22);
}
/* Send for signature only — names and emails must show in full. */
#deal-esign-dialog.deal-esign-dialog--send {
  max-width: min(72rem, calc(100vw - 2rem));
  width: min(72rem, calc(100vw - 2rem));
  min-height: min(40rem, calc(100vh - 2rem));
}
#deal-esign-dialog.deal-esign-dialog--send .deal-esign-dialog__panel {
  min-height: min(40rem, calc(100vh - 2rem));
}
#deal-esign-dialog.deal-esign-dialog--send .deal-esign-dialog__body {
  flex: 1 1 auto;
}
#deal-esign-dialog.deal-esign-dialog--send .deal-esign-signer-row {
  grid-template-columns: 2.75rem 9.75rem minmax(16rem, 1.6fr) minmax(14rem, 1.2fr) auto;
}
#deal-esign-dialog.deal-esign-dialog--send .deal-esign-input[data-signer-name],
#deal-esign-dialog.deal-esign-dialog--send .deal-esign-input[data-signer-email] {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}
.deal-esign-dialog::backdrop {
  background: rgba(17, 24, 39, 0.45);
}
.deal-esign-dialog__panel {
  display: flex;
  flex-direction: column;
}
.deal-esign-dialog__head,
.deal-esign-dialog__body,
.deal-esign-dialog__foot {
  padding: 1rem 1.15rem;
}
.deal-esign-dialog__head {
  border-bottom: 1px solid #e5e7eb;
}
.deal-esign-dialog__head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: #1e3a5f;
}
.deal-esign-dialog__sub {
  margin: 0;
  font-size: 0.86rem;
  color: #6b7280;
  line-height: 1.45;
}
.deal-esign-dialog__package {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: #1e3a5f;
  line-height: 1.45;
}
.deal-esign-from-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: #6b7280;
}
.deal-esign-docs {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}
.deal-esign-signers {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.deal-esign-signer-row {
  display: grid;
  grid-template-columns: 2.6rem minmax(6.5rem, 8rem) 1fr 1.3fr auto auto;
  gap: 0.45rem;
  align-items: center;
}
.deal-esign-signer-order {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e3a5f;
  text-align: center;
}
.deal-esign-signer-move {
  display: flex;
  gap: 0.2rem;
}
.deal-esign-move {
  min-width: 2.6rem;
  padding: 0.28rem 0.4rem;
  font-size: 0.75rem;
}
.deal-esign-order-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #4b5563;
}
.deal-esign-input,
.deal-esign-field textarea,
.deal-esign-field select,
.deal-esign-field input[type="file"] {
  width: 100%;
  min-width: 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font: inherit;
}
.deal-esign-field input[type="file"] {
  padding: 0.35rem 0.4rem;
  background: #fff;
}
.deal-esign-field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #374151;
}
.deal-esign-field textarea {
  font-weight: 400;
}
.deal-esign-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: #92400e;
}
#deal-esign-review-gate .deal-esign-dialog__foot {
  flex-wrap: wrap;
  gap: 0.45rem;
}
#deal-esign-review-continue {
  min-width: 16rem;
}
.deal-esign-send-mode {
  margin: 0.65rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}
.deal-esign-send-mode legend {
  font-size: 0.78rem;
  font-weight: 700;
}
.deal-esign-send-mode label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-top: 0.45rem;
  font-size: 0.86rem;
  font-weight: 400;
}
.deal-esign-dialog__error {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 8px;
  font-size: 0.88rem;
}
.deal-esign-dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  border-top: 1px solid #e5e7eb;
}
.deal-esign-toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  max-width: min(36rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: #1e3a5f;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
}
.deal-sheet__actions .deal-btn {
  margin: 0 0.15rem 0.15rem 0;
}
.deal-sheet__pair-head td {
  padding: 0.35rem 0.45rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1e3a5f;
  background: #eef4fb;
  border-bottom: 0;
}
.deal-sheet__pair td:first-child {
  border-left: 4px solid #1e3a5f;
}
.deal-sheet__pair--buyer td:first-child {
  border-left-color: #2563eb;
}
.deal-sheet__pair-label {
  margin-top: 0.12rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a5f;
}
.deal-sheet__pair--buyer .deal-sheet__pair-label {
  color: #1d4ed8;
}
.deal-sheet__link select {
  max-width: 9.5rem;
  margin-top: 0.2rem;
  font-size: 0.7rem;
}
.deal-other-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0.55rem 0 0;
}
.deal-other-file[hidden] {
  display: none;
}
.deal-other-file__hint {
  font-size: 0.82rem;
  font-weight: 650;
  color: #1e3a5f;
}
.deal-other-file__pick {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a5f;
}
.deal-other-file__pick select {
  min-width: 14rem;
  min-height: 2rem;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.deal-sheet-summary {
  margin: 0.45rem 0 0.7rem;
  padding: 0.45rem 0.65rem 0.55rem;
  background: #fff;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
}
.deal-sheet-summary__form--compact {
  margin: 0;
}
.deal-sheet-summary__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.35rem;
}
.deal-sheet-summary__head h2 {
  margin: 0;
  font-size: 0.92rem;
  color: #1e3a5f;
}
.deal-sheet-summary__head .deal-btn {
  min-height: 1.7rem;
  padding: 0.18rem 0.7rem;
  font-size: 0.78rem;
}
.deal-sheet-summary__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.28rem 0.45rem;
  margin: 0 0 0.28rem;
}
.deal-sheet-summary__row--party {
  grid-template-columns: 6.6rem repeat(3, minmax(0, 1fr));
  align-items: end;
}
.deal-sheet-summary__row--vendor {
  grid-template-columns: 6.6rem repeat(4, minmax(0, 1fr));
}
.deal-sheet-summary__row--vendor:has(input[type="hidden"][name="closingAttorneyName"]) {
  grid-template-columns: 6.6rem repeat(3, minmax(0, 1fr));
}
.deal-sheet-summary__row--party .deal-sheet-summary__field:nth-child(n + 2) {
  min-width: 0;
}
.deal-sheet-summary__k {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1e3a5f;
  padding-bottom: 0.28rem;
}
.deal-sheet-summary__field {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  position: relative;
}
.deal-sheet-summary__field span {
  font-size: 0.64rem;
  font-weight: 650;
  color: #4b5563;
}
.deal-sheet-summary__field input {
  width: 100%;
  min-height: 1.7rem;
  padding: 0.16rem 0.38rem;
  border: 1px solid #c5d0dc;
  border-radius: 5px;
  font: inherit;
  font-size: 0.82rem;
}
.deal-sheet-summary__fileline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: end;
  gap: 0.3rem 0.45rem;
  margin: 0;
  min-height: 1.7rem;
}
.deal-sheet-summary__fileline:empty,
.deal-sheet-summary__fileline[hidden] {
  display: none;
}
.deal-sheet-summary__fileline a,
.deal-sheet-summary__fileline span {
  font-size: 0.75rem;
  font-weight: 650;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
}
.deal-sheet-summary__fileline a {
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}
.deal-sheet-summary__fileline .is-bad {
  color: #b91c1c;
  background: #fef2f2;
}
.deal-sheet-summary__fileline .is-warn {
  color: #c2410c;
  background: #fff7ed;
}
.deal-sheet-summary__status {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  color: #1e3a5f;
}
.deal-sheet-summary__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.15rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid #c5d0dc;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  max-height: 12rem;
  overflow: auto;
}
.deal-sheet-summary__menu button {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 0.32rem 0.5rem;
  font: inherit;
  font-size: 0.8rem;
  color: #1e3a5f;
  cursor: pointer;
}
.deal-sheet-summary__menu button:hover,
.deal-sheet-summary__menu button:focus {
  background: #eef4fb;
}
.deal-sheet-summary__menu small {
  display: block;
  color: #6b7280;
  font-size: 0.7rem;
}
@media (max-width: 900px) {
  .deal-sheet-summary__row,
  .deal-sheet-summary__row--party {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .deal-sheet-summary__k {
    grid-column: 1 / -1;
    padding-bottom: 0;
  }
}
@media (max-width: 560px) {
  .deal-sheet-summary__row,
  .deal-sheet-summary__row--party {
    grid-template-columns: 1fr;
  }
}
