/* Customers & Profiles */

.customers-scope-banner {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.04);
  border-left: 3px solid var(--ev-red);
  font-size: 0.92rem;
  color: var(--ev-charcoal);
}

.customers-access-denied {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.92rem;
  border-radius: 6px;
}

.customers-filter-field {
  min-width: 12rem;
}

.customers-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--ev-off-white, #fafafa);
  border: 1px solid var(--ev-border-subtle);
}

.customers-bulk-bar .field {
  margin: 0;
}

.customer-table .th-bulk {
  width: 2.5rem;
}

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

.main-customers-profiles {
  max-width: min(1600px, 100%);
}

.main-customers-profiles:has(.property-research-panel:not([hidden])) {
  max-width: 100%;
}

/* Property tab — flexible columns so fields use full form width */
.main-customers-profiles #panel-property .form-row.form-row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.main-customers-profiles #panel-property .field,
.main-customers-profiles #panel-property input,
.main-customers-profiles #panel-property select,
.main-customers-profiles #panel-property textarea {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Form left, customer research right; profile preview full width below */
.main-customers-profiles .profile-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .main-customers-profiles .profile-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      'form form'
      'preview preview';
    gap: 1.5rem 1.75rem;
  }

  .main-customers-profiles .profile-layout.has-customer-research {
    grid-template-areas:
      'form research'
      'preview preview';
  }

  .main-customers-profiles .profile-layout.has-property-research {
    grid-template-areas:
      'form form'
      'property property'
      'preview preview';
  }

  .main-customers-profiles .profile-layout.has-customer-research.has-property-research {
    grid-template-areas:
      'form research'
      'property property'
      'preview preview';
  }

  .main-customers-profiles .profile-form-section {
    grid-area: form;
    min-width: 0;
  }

  .main-customers-profiles .property-research-panel {
    grid-area: property;
    min-width: 0;
    width: 100%;
  }

  .main-customers-profiles .customer-research-section {
    grid-area: research;
    min-width: 0;
    width: 100%;
  }

  .main-customers-profiles .profile-view-section {
    grid-area: preview;
    min-width: 0;
    width: 100%;
  }
}

@media (min-width: 1280px) {
  .main-customers-profiles .profile-layout {
    grid-template-columns: minmax(0, 46%) minmax(0, 54%);
    gap: 1.5rem 2rem;
  }
}

/* Multi-column preview — use full-width row */
@media (min-width: 900px) {
  .main-customers-profiles .profile-view-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 2rem;
    align-items: start;
  }
}

@media (min-width: 1100px) {
  .main-customers-profiles .profile-view-content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  .main-customers-profiles .profile-view-content {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.main-customers-profiles .profile-view {
  padding: 1rem 1.25rem;
  min-height: 8rem;
}

.main-customers-profiles .profile-view-content {
  font-size: 0.9rem;
  line-height: 1.5;
}

.main-customers-profiles .profile-view-content .profile-block {
  margin-bottom: 0.85rem;
}

.main-customers-profiles .profile-view-content h4 {
  margin-top: 0.75rem;
}

.workspace-customer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
}

.workspace-portal-hint {
  flex: 1 1 100%;
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--ev-gray);
  line-height: 1.4;
}

.workspace-select-field {
  flex: 1 1 16rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.workspace-customer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  flex: 1 1 100%;
}

.workspace-customer-actions-primary,
.workspace-customer-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.workspace-customer-actions-secondary {
  margin-left: auto;
}

.workspace-customer-actions-divider {
  width: 1px;
  height: 28px;
  background: #e5e5e5;
  margin: 0 0.85rem;
  flex-shrink: 0;
}

.workspace-customer-actions .btn-outline,
.workspace-customer-actions .btn-link.btn-outline {
  background: #fff;
  border: 1px solid #d0d0d0;
  color: #1a1a1a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 4px;
  text-decoration: none;
}

.workspace-customer-actions-secondary .btn-outline,
.workspace-customer-actions-secondary .btn-link.btn-outline {
  font-size: 11px;
  padding: 5px 11px;
}

.workspace-customer-actions .btn-outline:hover:not(:disabled),
.workspace-customer-actions .btn-link.btn-outline:hover:not(:disabled) {
  background: #f5f5f5;
}

.workspace-customer-actions .btn-outline:disabled,
.workspace-customer-actions .btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.workspace-customer-actions .btn-outline:disabled:hover,
.workspace-customer-actions .btn-primary:disabled:hover {
  background: #fff;
}

.workspace-customer-actions .btn-primary:disabled:hover {
  background: #1a1a1a;
  opacity: 0.4;
}

.workspace-customer-actions .btn-research {
  border-color: #d0d0d0;
  color: #1a1a1a;
}

.workspace-customer-actions .btn-research:hover:not(:disabled) {
  background: #f5f5f5;
}

.btn-agent-only-tag {
  display: inline-block;
  background: #333;
  color: #999;
  font-size: 9px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  border: none;
}

.customer-person-intro {
  margin: 0 0 1rem;
}

.customer-person-block {
  border: 1px solid var(--ev-border-subtle);
  border-radius: 8px;
  padding: 0 1.15rem 1.15rem;
  margin: 0 0 1.35rem;
  background: #fafafa;
}

.customer-person-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0 -1.15rem 1rem;
  padding: 0 0.85rem;
  border-bottom: 1px solid var(--ev-border-subtle);
  background: #f3f3f3;
  border-radius: 8px 8px 0 0;
}

.customer-person-tab {
  position: relative;
  margin: 0;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ev-gray);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  line-height: 1.3;
}

.customer-person-tab:not(:first-child)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 1.1rem;
  background: var(--ev-border);
  transform: translateY(-50%);
}

.customer-person-tab:hover {
  color: var(--ev-charcoal);
}

.customer-person-tab.active {
  color: var(--ev-charcoal);
  font-weight: 600;
  border-bottom-color: var(--ev-red);
  background: #fafafa;
}

.customer-person-tab .legend-optional {
  font-weight: 400;
  color: var(--ev-gray);
  font-size: 0.85rem;
}

.customer-person-panel:not(.active) {
  display: none;
}

.customer-person-panel.active {
  display: block;
}

.customer-shared-heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.25rem 0 0.75rem;
  color: var(--ev-charcoal);
}

.profile-block .customer-person-sub {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--ev-border-subtle);
}

.btn-research {
  border-color: var(--ev-red);
  color: var(--ev-red);
}

.btn-research:hover:not(:disabled) {
  background: rgba(139, 41, 66, 0.08);
}

.btn-research:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-block-research {
  border-left: 3px solid var(--ev-red);
  padding-left: 0.85rem;
  margin-bottom: 1rem;
}

.profile-block-research .research-meta {
  font-size: 0.85rem;
  color: var(--ev-gray);
  margin: 0 0 0.5rem;
}

.profile-block-research .research-stale-notice {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #6b4e16;
  background: #fff9f0;
  border: 1px solid #e8dcc8;
  border-radius: 6px;
}

.profile-block-research .research-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1rem 0 0.35rem;
  color: var(--ev-black);
}

.profile-block-research .research-section-title:first-of-type {
  margin-top: 0.5rem;
}

.profile-block-research .research-bullet {
  margin: 0.2rem 0 0.2rem 0.5rem;
  font-size: 0.92rem;
}

.profile-block-research .research-disclaimer {
  font-size: 0.85rem;
  color: var(--ev-gray);
  margin-top: 0.75rem;
}

.research-sources {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.research-sources a {
  color: var(--ev-red);
}

.customer-form {
  margin-bottom: 0;
}

.customer-list,
.profile-saved-list {
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.main-customers-profiles .customer-list.card,
.main-customers-profiles .profile-saved-list.card {
  padding: 1.25rem 1.5rem;
}

/* Field spacing — control sizing from agent-layout.css */
#customerForm .profile-panel .field,
#customerForm.customer-form .profile-panel .form-row {
  margin-bottom: 1rem;
}

#customerForm .profile-panel .form-row .field {
  margin-bottom: 1rem;
}

#customerForm .profile-panel .form-row .field:last-child {
  margin-bottom: 1rem;
}

.customer-form h2,
.customer-list h2 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row .field:nth-child(3) {
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .form-row.form-row-3 {
    grid-template-columns: 1fr minmax(5rem, 6.5rem) minmax(6.5rem, 8.5rem);
  }

  .form-row.form-row-3 .field:nth-child(3) {
    grid-column: auto;
  }
}

.form-row .field {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
}

.customer-form .field + .field,
.customer-form .form-row + .form-row,
.customer-form .form-row + .field {
  margin-top: 1rem;
}

/* Side-by-side row: adjacent .fields are siblings, not stacked — no extra top margin */
.customer-form .form-row .field + .field {
  margin-top: 0;
}

.customer-form textarea {
  resize: vertical;
  min-height: 5rem;
}

.customer-form .field.field-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 500;
  cursor: pointer;
}

.customer-form .field.field-checkbox input[type='checkbox'] {
  width: auto;
  margin: 0.2rem 0 0;
  flex-shrink: 0;
  cursor: pointer;
}

.customer-form .field.field-checkbox span {
  line-height: 1.4;
}

.form-actions,
.profile-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding-top: 0.25rem;
}

.main-customers-profiles .profile-form-section h2 {
  margin-bottom: 0.65rem;
}

/* Customer list */
.customer-list-toolbar {
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  max-width: 360px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--ev-border);
  border-radius: 8px;
  font-size: 1rem;
}

.customer-table-wrap {
  overflow-x: auto;
  margin: 0 -0.5rem;
}

.agent-registry-table {
  min-width: 1100px;
}

.agent-registry-table th {
  white-space: nowrap;
}

.import-hint {
  margin-top: 0;
  margin-bottom: 1rem;
}

.import-form-row {
  align-items: flex-end;
}

.import-form-actions {
  margin-bottom: 0.15rem;
}

.import-success {
  color: var(--ev-success, #1a6b3c);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.agent-registry-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}

.agent-registry-toolbar .field-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 10rem;
}

.agent-registry-toolbar .field-filter-search {
  flex: 1 1 12rem;
  min-width: 12rem;
}

.agent-registry-toolbar .field-filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ev-gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.agent-registry-toolbar select,
#agentForm select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--ev-border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--ev-white, #fff);
  max-width: 100%;
  width: 100%;
}

.agent-registry-toolbar .search-input {
  width: 100%;
  max-width: none;
}

.agent-registry-toolbar .btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
}

.agent-filter-count {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.9rem;
  color: var(--ev-gray);
}

.agent-registry-table .btn-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}

/* Edit + Remove need more than the default 80px actions column */
.agent-registry-table th.th-actions,
.agent-registry-table td.th-actions {
  width: 1%;
  min-width: 11.75rem;
  white-space: nowrap;
  vertical-align: middle;
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--ev-white, #fff);
  box-shadow: -6px 0 10px -4px rgba(0, 0, 0, 0.1);
}

.agent-registry-table thead th.th-actions {
  z-index: 3;
}

.agent-registry-table tbody tr:hover td.th-actions {
  background: #fafafa;
}

.agent-registry-table tr.agent-row-editing td.th-actions {
  background: rgba(201, 162, 39, 0.08);
}

.agent-registry-table tr.agent-mark-avoid td.th-actions {
  background: #fff8f5;
}

#agentFormSection.agent-form-editing {
  outline: 2px solid var(--ev-gold, #c9a227);
  outline-offset: 2px;
}

.agent-registry-table tr.agent-row-editing {
  background: rgba(201, 162, 39, 0.08);
}

.customer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.customer-table th,
.customer-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--ev-border-subtle);
}

.customer-table th {
  font-weight: 600;
  color: var(--ev-gray);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.th-actions {
  width: 1%;
  min-width: 9.5rem;
  white-space: nowrap;
}

.th-avoid {
  width: 4.5rem;
  white-space: nowrap;
}

.customer-table tr.agent-mark-avoid {
  background: #fff8f5;
}

.customer-table tr.agent-mark-avoid .customer-name {
  color: #8b4513;
}

.customer-table tbody tr:hover {
  background: #fafafa;
}

.customer-name {
  font-weight: 500;
}

.customer-contact {
  white-space: nowrap;
}

.customer-contact a {
  color: var(--ev-red);
  text-decoration: none;
}

.customer-contact a:hover {
  text-decoration: underline;
}

.customer-research-section {
  margin-top: 0;
}

.customer-research-section[hidden] {
  display: none !important;
}

.customer-research-body .profile-block-research {
  margin-bottom: 0;
}

.main-customers-profiles .profile-view-section .profile-view {
  width: 100%;
  box-sizing: border-box;
}

.customer-notes-preview {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  color: var(--ev-gray);
}

.btn-row {
  display: flex;
  gap: 0.35rem;
}

.btn-icon {
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid var(--ev-border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--ev-charcoal);
}

.btn-icon:hover {
  background: var(--ev-light);
  border-color: var(--ev-border-strong);
}

.btn-icon.btn-delete:hover {
  background: #fff5f5;
  border-color: #e0b0b0;
  color: #b22222;
}

.empty-state {
  color: var(--ev-gray);
  font-style: italic;
  padding: 1.5rem;
  margin: 0;
}

.customer-list.has-customers .empty-state {
  display: none;
}

.customer-list:not(.has-customers) .customer-table-wrap {
  display: none;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--ev-white);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.modal-content p {
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.modal-actions {
  margin-top: 1.25rem;
}

@media (max-width: 768px) {
  .form-row,
  .form-row.form-row-3,
  #customerForm .profile-panel .form-row,
  #customerForm .profile-panel .form-row.form-row-3,
  #customerForm .profile-panel .form-row.form-row-4 {
    grid-template-columns: 1fr;
  }

  .form-row .field:nth-child(3) {
    grid-column: 1;
  }

  .main-customers-profiles {
    padding-top: 0.5rem;
  }

  .main-customers-profiles .page-subtitle {
    display: none;
  }

  .main-customers-profiles .page-title {
    font-size: 28px;
    margin-top: 20px;
  }

  /* Pinned search below nav */
  #customerListSection .customer-list-toolbar,
  #profileListSection .customer-list-toolbar {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0 -1rem 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--cadence-bg, #F8F7F5);
    border-bottom: 1px solid var(--cadence-border, #E8E4DF);
  }

  #customerListSection .search-input,
  #profileListSection .search-input {
    min-height: 52px;
    font-size: 16px;
    border-radius: 8px;
    border: 1.5px solid var(--cadence-border, #E8E4DF);
    background: #FFFFFF;
  }

  #customerListSection > h2,
  #profileListSection > h2 {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cadence-text-secondary, #6B6460);
    margin-bottom: 8px;
  }

  .customer-table .customer-type-badge,
  .customer-table td:nth-child(3) {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(139, 26, 43, 0.08);
    color: #8B1A2B;
  }

  .customer-table tbody tr::after {
    content: '›';
  }

  .workspace-customer-bar {
    margin-bottom: 1rem;
  }

  .workspace-customer-bar .workspace-select-field {
    display: block;
    width: 100%;
    margin-bottom: 0.75rem;
  }

  .workspace-customer-bar .workspace-select-field select {
    display: block;
    width: 100%;
    min-height: 52px;
    font-size: 16px;
    opacity: 1;
    position: static;
    border-radius: 8px;
    border: 1.5px solid var(--cadence-border, #E8E4DF);
    background: #FFFFFF;
    color: var(--cadence-text, #1A1614);
  }

  /* Client detail — action pills */
  .workspace-customer-actions {
    width: 100%;
    gap: 0.65rem;
  }

  .workspace-customer-actions-divider {
    display: none;
  }

  .workspace-customer-actions-secondary {
    margin-left: 0;
    width: 100%;
  }

  .workspace-customer-actions .btn {
    flex: 1 1 auto;
  }

  .profile-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    margin: 0 -0.5rem 1rem;
    padding: 0 0.5rem;
    scrollbar-width: none;
  }

  .profile-tabs::-webkit-scrollbar {
    display: none;
  }

  .profile-tab {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 1rem;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1.5px solid var(--cadence-border, #E8E4DF);
    background: #fff;
    margin-right: 8px;
    transition: transform 80ms ease;
  }

  .profile-tab.active {
    background: #8B1A2B;
    border-color: #8B1A2B;
    color: #fff;
  }

  .profile-tab:active {
    transform: scale(0.97);
  }

  .customer-table th:nth-child(4),
  .customer-table td:nth-child(4) {
    display: none;
  }
}

/* Property research */
.property-research-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
}

.property-research-meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ev-gray);
}

.btn-research-property {
  position: relative;
  min-width: 10.5rem;
}

.btn-research-property.is-loading .btn-research-property-label {
  opacity: 0;
}

.btn-research-property.is-loading .btn-research-property-spinner {
  display: inline-block !important;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.btn-research-property-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: property-research-spin 0.7s linear infinite;
}

@keyframes property-research-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.property-research-panel {
  margin-top: 0;
  padding: 1.25rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.property-research-panel-head h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.property-research-panel-intro {
  margin: 0 0 1rem;
  color: var(--ev-gray);
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: none;
}

.property-research-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.property-research-card {
  border: 1px solid var(--ev-border-subtle);
  border-radius: 8px;
  background: var(--ev-light);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.property-research-card > summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.property-research-card > summary::-webkit-details-marker {
  display: none;
}

.property-research-card > summary::after {
  content: '+';
  font-size: 1.1rem;
  color: var(--ev-gray);
  font-weight: 400;
}

.property-research-card[open] > summary::after {
  content: '−';
}

.property-research-card-body {
  padding: 0 1rem 1rem;
  font-size: 0.94rem;
  line-height: 1.55;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

.property-research-card-body p {
  margin: 0 0 0.65rem;
}

.property-research-list {
  margin: 0;
  padding-left: 1.15rem;
  overflow-wrap: break-word;
}

.property-research-list li {
  margin-bottom: 0.45rem;
}

.property-research-list--positive li {
  color: #166534;
}

.property-research-list--concerns li {
  color: #92400e;
}

.property-research-card--motivation {
  border-color: rgba(139, 26, 47, 0.35);
  background: rgba(139, 26, 47, 0.06);
}

.property-research-card--motivation > summary {
  color: #8b1a2f;
}

.property-research-card--motivation .property-research-card-body {
  color: #5c1220;
}

.market-value-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.market-trend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 700;
}

.market-trend-badge.trend-up {
  background: rgba(22, 101, 52, 0.12);
  color: #166534;
}

.market-trend-badge.trend-stable {
  background: rgba(107, 114, 128, 0.15);
  color: var(--ev-gray);
}

.market-trend-badge.trend-down {
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
}

.walk-scores-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
}

.walk-score-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 5.5rem;
  text-align: center;
}

.walk-score-circle {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  border: 3px solid transparent;
}

.walk-score-circle.score-good {
  background: rgba(22, 101, 52, 0.12);
  border-color: #166534;
  color: #166534;
}

.walk-score-circle.score-mid {
  background: rgba(180, 83, 9, 0.12);
  border-color: #b45309;
  color: #b45309;
}

.walk-score-circle.score-low {
  background: rgba(185, 28, 28, 0.12);
  border-color: #b91c1c;
  color: #b91c1c;
}

.walk-score-circle.score-unknown {
  background: rgba(107, 114, 128, 0.12);
  border-color: var(--ev-gray);
  color: var(--ev-gray);
}

.walk-score-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.walk-score-desc {
  font-size: 0.78rem;
  color: var(--ev-gray);
  max-width: 8rem;
  line-height: 1.35;
}

/* Portal field visibility indicators */
.customer-field-legend {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ev-charcoal);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
  border-left: 3px solid var(--ev-gold, #c9a227);
}

.field-label-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.portal-visible-indicator {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  vertical-align: middle;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23166534' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8S1 12 1 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  cursor: help;
}

.field-agent-only-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6b4c0a;
  background: rgba(201, 162, 39, 0.15);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  vertical-align: middle;
}

.profile-panel h3 .field-agent-only-tag {
  font-size: 0.62rem;
  margin-left: 0.35rem;
}

.portal-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.portal-preview-modal[hidden] {
  display: none !important;
}

.portal-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.portal-preview-dialog {
  position: relative;
  z-index: 1;
  width: min(32rem, 100%);
  max-height: min(85vh, 640px);
  overflow: auto;
  margin: 0;
}

.portal-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.portal-preview-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.portal-preview-intro {
  font-size: 0.88rem;
  color: var(--ev-gray);
  margin: 0 0 1rem;
  line-height: 1.45;
}

.portal-preview-body dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.portal-preview-body dt {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ev-gray);
  margin: 0;
}

.portal-preview-body dd {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  color: var(--ev-charcoal);
}

.buyer-portal-admin { margin-top: 1rem; }
.buyer-admin-block { margin: 0.75rem 0; padding: 0.5rem 0; border-top: 1px solid var(--ev-border-subtle); }
.buyer-admin-block summary { cursor: pointer; font-weight: 500; padding: 0.35rem 0; }
.buyer-admin-form { margin: 0.75rem 0; }
.buyer-admin-list { list-style: none; margin: 0.75rem 0 0; padding: 0; font-size: 0.9rem; }
.buyer-admin-list li { padding: 0.4rem 0; border-top: 1px solid var(--ev-border-subtle); display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.buyer-admin-list .empty-hint { color: var(--ev-gray); font-style: italic; border: none; }
.field-hint { display: block; font-size: 0.8rem; color: var(--ev-gray); margin-top: 0.25rem; }
.buyer-intangible-textarea { min-height: 80px; }
