.company-record-page {
  /* Outer inset comes from .app__main (same as /companies list). */
  padding: 0;
  height: calc(100vh - var(--header-h) - var(--sp-8) - var(--sp-12));
  min-height: 0;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

.company-record-header {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.company-record-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.company-record-breadcrumb a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.company-record-grid {
  height: calc(100% - 50px);
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(230px, 25%) minmax(420px, 50%) minmax(
      230px,
      25%
    );
  gap: 10px;
}

.company-record-column {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2px 10px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.company-record-column::-webkit-scrollbar {
  width: 6px;
}

.company-record-column::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}

.company-record-column::-webkit-scrollbar-track {
  background: transparent;
}

.company-record-column > .card {
  margin-bottom: 10px;
}

.company-profile-card {
  padding: 16px;
}

/* R1: the back link row (record-ui.php:231-234) and the subtitle and domain row under the
   name (record.php:392-400). */
.company-profile-head {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.company-profile-sub {
  margin: 0 0 5px;
  color: var(--text-muted);
  font-size: 13px;
}

.company-profile-link {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.company-profile-link > a:first-child {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-profile-link__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
}

.company-profile-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.company-record-logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 17px;
  font-weight: 700;
}

.company-profile-copy {
  min-width: 0;
}

.company-profile-copy h1 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  margin: 1px 0 5px;
}

.company-profile-copy a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-size: 12px;
  text-decoration: none;
}

.company-quick-actions {
  display: grid;
  /* R1: Note, Email, Call, Task, Meeting, More (record-popups-hs.js:985-986). */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 16px 0;
}

.company-quick-action > span {
  display: none;
}
.company-quick-action svg,
.company-quick-action .icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}
.company-quick-action {
  min-width: 0;
  min-height: 40px !important;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  transition:
    background-color var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.company-quick-action:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.company-quick-action--more {
  cursor: pointer;
}

.company-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.company-about dl {
  margin: 0;
}

.company-about dl > div {
  padding: 7px 0;
  border-top: 1px solid var(--border);
}

.company-about dt {
  font-size: 10.5px;
  color: var(--text-subtle);
  margin-bottom: 2px;
}

.company-about dd {
  font-size: 12px;
  color: var(--text);
  margin: 0;
}

.company-side-card {
  padding: 15px;
}

.company-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.company-card-head h2 {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.company-card-head p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.45;
}

.company-side-list {
  display: flex;
  flex-direction: column;
}

.company-side-list > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.company-side-list span {
  font-size: 10.5px;
  color: var(--text-subtle);
}

.company-side-list strong {
  font-size: 11px;
  text-align: right;
  overflow-wrap: anywhere;
}

.company-record-main-card {
  padding: 0;
  overflow: hidden;
}

.company-primary-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 15px;
  overflow: auto;
  scrollbar-width: none;
}

.company-primary-tabs::-webkit-scrollbar {
  display: none;
}

.company-primary-tab {
  position: relative;
  height: 46px;
  padding: 0 13px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.company-primary-tab:first-child {
  padding-left: 2px;
}

.company-primary-tab:hover {
  color: var(--text);
}

.company-primary-tab.is-active {
  color: var(--text);
}

.company-primary-tab.is-active::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: -1px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
}

.company-primary-panel {
  padding: 15px;
}

.company-primary-panel[hidden],
.company-tab-panel[hidden] {
  display: none;
}

.company-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.company-overview-card {
  padding: 13px 12px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.company-overview-card:last-child {
  border-right: 0;
}

.company-overview-card span {
  display: block;
  color: var(--text-subtle);
  font-size: 10.5px;
  margin-bottom: 4px;
}

.company-overview-card strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.company-overview-card small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9.5px;
}

.company-overview-section {
  margin-top: 16px;
}

.company-mini-timeline {
  display: flex;
  flex-direction: column;
}

.company-mini-timeline article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.company-mini-timeline article > div {
  min-width: 0;
}

.company-mini-timeline strong {
  font-size: 11.5px;
}

.company-mini-timeline p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 3px 0;
  line-height: 1.45;
}

.company-mini-timeline small {
  font-size: 9.5px;
  color: var(--text-subtle);
}

.company-event-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  flex: 0 0 28px;
}

.company-record-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.company-record-tabs::-webkit-scrollbar {
  display: none;
}

.company-record-tab {
  position: relative;
  height: 40px;
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.company-record-tab:first-child {
  padding-left: 0;
}

.company-record-tab.is-active {
  color: var(--text);
}

.company-record-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--brand);
}

.company-activity-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0 9px;
}

.company-activity-search,
.company-history-search {
  min-height: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-width: 0;
}

.company-activity-search {
  flex: 1;
}

.company-activity-search .icon,
.company-history-search .icon {
  color: var(--text-subtle);
  flex: 0 0 auto;
}

.company-activity-search input,
.company-history-search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  width: 100%;
  min-width: 0;
}

.company-activity-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-bottom: 10px;
}

.company-activity-filters__add {
  margin-left: auto;
}

.company-activity-filters .custom-select-wrapper {
  min-width: 120px;
}

.company-clear-filters,
.company-more-filter {
  font-size: 10.5px;
  color: var(--brand);
  font-weight: 600;
  padding: 7px 5px;
}

.company-tab-panels {
  min-height: 0;
}

.company-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.company-timeline > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.company-timeline-item {
  margin-top: 0;
}

.company-timeline-date {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 0;
}

.company-timeline-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
}

.company-timeline-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
}

.company-timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.company-timeline-meta strong,
.company-content-item strong {
  font-size: 11.5px;
}

.company-timeline-meta span {
  font-size: 9.5px;
  color: var(--text-subtle);
  white-space: nowrap;
}

.company-timeline-card p,
.company-content-item p {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 4px 0;
}

.company-timeline-card small,
.company-content-item small {
  display: block;
  color: var(--text-subtle);
  font-size: 9.5px;
}

.company-content-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.company-content-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.company-content-item:last-child {
  border-bottom: 0;
}

.company-intelligence-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.company-intelligence-grid .card {
  padding: 14px;
}

.company-intelligence-grid ul {
  margin: 0;
  padding-left: 17px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.7;
}

.company-intelligence-grid p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.55;
}

.company-associated-card {
  padding: 15px;
}

.company-add-link {
  font-size: 11px;
  color: var(--brand);
  font-weight: 600;
}

.company-contacts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.company-contacts a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.mini-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 9px;
  font-weight: 700;
  flex: 0 0 28px;
}

.company-contacts a span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.company-contacts strong {
  font-size: 11px;
}

.company-contacts small {
  font-size: 9.5px;
  color: var(--text-subtle);
}

.company-view-link {
  display: block;
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.company-deals {
  display: flex;
  flex-direction: column;
}

.company-deals a {
  padding: 9px 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
}

.company-deals a:first-child {
  border-top: 0;
  padding-top: 0;
}

.company-deals strong {
  display: block;
  font-size: 11px;
  color: var(--brand);
}

.company-deals span {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.company-muted {
  font-size: 10.5px;
  color: var(--text-subtle);
  line-height: 1.5;
}

.company-history-overlay {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity var(--fast) var(--ease);
}

.company-history-overlay.is-open {
  opacity: 1;
}

.company-history-drawer {
  position: fixed;
  z-index: 71;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(760px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--slow) var(--ease);
  display: flex;
  flex-direction: column;
}

.company-history-drawer.is-open {
  transform: none;
}

.company-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.company-history-head h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.company-history-head p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 5px 0 0;
}

.company-history-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.company-history-search {
  flex: 1;
}

.company-history-filters {
  display: flex;
  gap: 6px;
}

.company-history-filters .is-active {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.company-history-table-wrap {
  overflow: auto;
  flex: 1;
}

.company-history-table {
  min-width: 650px;
}

.company-history-table td,
.company-history-table th {
  white-space: nowrap;
}

.company-history-table td {
  font-size: 11px;
}

.company-history-table th {
  font-size: 10px;
}

.company-history-table .badge {
  font-size: 10px;
  padding: 3px 8px;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 100;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-size: 10px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition:
    opacity var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1199.98px) {
  .company-record-grid {
    grid-template-columns: 230px minmax(420px, 1fr);
  }

  .company-record-right {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-y: auto;
    gap: 10px;
  }
  .company-record-column > .card {
    margin-bottom: 0;
  }
  .company-record-center {
    grid-column: 2;
  }

  .company-record-left {
    grid-row: 1;
  }

  .company-record-right {
    grid-row: 2;
    max-height: 240px;
  }
}

@media (max-width: 991.98px) {
  .company-record-header {
    height: auto;
  }

  .company-record-grid {
    height: auto;
    grid-template-columns: 1fr;
  }

  .company-record-column {
    overflow: visible;
    max-height: none;
  }

  .company-record-left,
  .company-record-center,
  .company-record-right {
    grid-column: auto;
    grid-row: auto;
  }

  .company-record-right {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .company-record-right .card {
    flex: 1;
  }

  .company-overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .company-overview-card:nth-child(2) {
    border-right: 0;
  }

  .company-overview-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 575.98px) {
  .company-overview-grid {
    grid-template-columns: 1fr;
  }

  .company-overview-card {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .company-overview-card:last-child {
    border-bottom: 0;
  }

  .company-activity-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .company-activity-search {
    width: 100%;
  }

  .company-history-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .company-history-filters {
    overflow: auto;
  }

  .company-history-drawer {
    width: 100%;
  }
}

/* Intelligence sections */
.company-intelligence-sections {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 10px;
}

.company-intelligence-card {
  padding: 15px;
  min-width: 0;
}
.company-intelligence-grid-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin-top: 14px;
}

.company-intelligence-grid-list > div {
  padding: 9px 0;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.company-intelligence-grid-list span {
  display: block;
  font-size: 11px;
  color: var(--text-subtle);
  margin-bottom: 3px;
}
.company-intelligence-grid-list span.badge--warning {
  display: block;
  width: fit-content;
  font-size: 11px;
  background: var(--warning-bg);
  color: var(--warning);
  margin-bottom: 0;
}
.company-intelligence-grid-list strong {
  display: block;
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.company-tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.company-tech-list span {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 11.5px;
  color: var(--text);
}

.company-social-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.company-social-list a {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.company-social-list a .icon {
  color: var(--brand);
}

.company-social-list a span {
  font-size: 12px;
  font-weight: 600;
}

.company-social-list a small {
  font-size: 10.5px;
  color: var(--text-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .company-intelligence-sections {
    grid-template-columns: 1fr;
  }

  .company-intelligence-grid-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .company-intelligence-grid-list {
    grid-template-columns: 1fr;
  }

  .company-social-list a {
    grid-template-columns: 24px 1fr;
  }

  .company-social-list a small {
    grid-column: 2;
  }
}

/* Company detail tabs and popup scrolling */
.company-primary-panel {
  min-height: 0;
}

.company-tab-panels {
  min-height: 0;
}

.company-tab-panel {
  display: none;
  min-height: 0;
}

.company-tab-panel.is-active {
  display: block;
}

.company-content-list,
.company-timeline {
  min-width: 0;
}

.company-record-center {
  min-height: 0;
}

.company-record-center .company-primary-panel[data-primary-panel="activities"] {
  min-height: 0;
}

.company-record-center .company-tab-panels {
  max-height: calc(100vh - 285px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
}

.company-record-center .company-tab-panels::-webkit-scrollbar {
  width: 6px;
}

.company-record-center .company-tab-panels::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 20px;
}

.company-record-center .company-tab-panels::-webkit-scrollbar-track {
  background: transparent;
}

#companyActionModal {
  overflow-y: auto;
  padding: 24px 16px;
}

#companyActionModal .modal {
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#companyActionModal .modal__header,
#companyActionModal .modal__footer {
  flex: 0 0 auto;
}
#companyActionModal .modal__body {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  max-height: calc(100vh - 180px);
  scrollbar-width: thin;
}

#companyActionModal .modal__body::-webkit-scrollbar {
  width: 6px;
}

#companyActionModal .modal__body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 20px;
}

.company-history-drawer {
  overflow: hidden;
}

.company-history-table-wrap {
  overflow-y: auto;
  overflow-x: auto;
  min-height: 0;
}

@media (max-width: 991.98px) {
  .company-record-center .company-tab-panels {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  #companyActionModal {
    padding: 12px;
  }

  #companyActionModal .modal {
    max-height: calc(100vh - 24px);
  }

  #companyActionModal .modal__body {
    max-height: calc(100vh - 150px);
  }
}

/* =========================================================
   Company details typography + visual refinement
   Uses the same type scale and interaction rhythm as details.php.
   ========================================================= */
.company-record-header {
  min-height: 48px;
}

.company-record-breadcrumb {
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.company-record-breadcrumb a {
  font-weight: 700;
}

.company-record-main-card,
.company-profile-card,
.company-side-card,
.company-associated-card,
.company-intelligence-card {
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.company-profile-card {
  padding: 20px;
}

.company-record-logo {
  width: 56px;
  height: 56px;
  flex-basis: 56px;
  font-size: 18px;
  border-radius: 16px;
}

.company-profile-copy h1 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.company-profile-copy a {
  font-size: 13px;
  font-weight: 600;
}

.company-quick-actions {
  gap: 7px;
  margin: 20px 0;
}

.company-quick-action {
  min-height: 60px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.company-quick-action .icon {
  width: 18px;
  height: 18px;
}

.company-section-label {
  font-size: 11.5px;
  letter-spacing: 0.07em;
  margin-bottom: 11px;
}

.company-about dl > div {
  padding: 9px 0;
}

.company-about dt {
  font-size: 12.5px;
  line-height: 1.35;
  margin-bottom: 3px;
}

.company-about dd {
  font-size: 14px;
  line-height: 1.45;
}

.company-side-card,
.company-associated-card {
  padding: 18px;
}

.company-card-head {
  margin-bottom: 13px;
}

.company-card-head h2 {
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.company-card-head {
}

.company-card-head p {
  font-size: 12.5px;
  line-height: 1.5;
}

.company-side-list > div {
  padding: 10px 0;
}

.company-side-list span {
  font-size: 12.5px;
}

.company-side-list strong {
  font-size: 13.5px;
  line-height: 1.4;
}

/* Main record tabs match details.php activity-tab scale. */
.company-primary-tabs {
  min-height: 60px;
  padding: 0 18px;
}

.company-primary-tab {
  height: 60px;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 600;
}

.company-primary-tab:first-child {
  padding-left: 2px;
}

.company-primary-tab.is-active::after {
  height: 3px;
}

.company-primary-panel {
  padding: 18px;
}

.company-overview-grid {
  border-radius: 14px;
}

.company-overview-card {
  padding: 16px 15px;
}

.company-overview-card span {
  font-size: 12.5px;
  margin-bottom: 5px;
}

.company-overview-card strong {
  font-size: 17px;
  line-height: 1.3;
}

.company-overview-card small {
  margin-top: 5px;
  font-size: 12px;
}

.company-overview-section {
  margin-top: 20px;
}

.company-mini-timeline article {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  padding: 13px 0;
}

.company-mini-timeline strong {
  font-size: 14px;
}

.company-mini-timeline p {
  font-size: 13.5px;
  line-height: 1.5;
  margin: 4px 0;
}

.company-mini-timeline small {
  font-size: 12px;
}

.company-event-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

/* Activity tabs/content follow details.php sizing. */

.company-record-tab {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
}

.company-record-tab:first-child {
  padding-left: 0;
}

.company-record-tab.is-active::after {
  height: 3px;
  border-radius: 3px 3px 0 0;
}

.company-activity-toolbar {
  gap: 16px;
  padding: 18px 0 10px;
}

.company-activity-search,
.company-history-search {
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 20px;
}

.company-activity-search input,
.company-history-search input {
  font-size: 14px;
}

.company-activity-filters {
  gap: 6px;
  padding-bottom: 14px;
}

.company-activity-filters .custom-select-wrapper {
  min-width: 145px;
}

.company-clear-filters,
.company-more-filter {
  font-size: 14px;
  font-weight: 600;
  padding: 7px 10px;
}

.company-timeline {
  gap: 10px;
}

.company-timeline-date {
  font-size: 12px;
  padding: 6px 0 8px;
}

.company-timeline-item {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
}

.company-timeline-card {
  padding: 18px 20px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.company-timeline-meta {
  gap: 16px;
}

.company-timeline-meta strong,
.company-content-item strong {
  font-size: 14px;
  line-height: 1.4;
}

.company-timeline-meta span {
  font-size: 12px;
}

.company-timeline-card p,
.company-content-item p {
  font-size: 14px;
  line-height: 1.5;
  margin: 7px 0;
}

.company-timeline-card small,
.company-content-item small {
  font-size: 12px;
}

.company-content-list {
  gap: 0;
}

.company-content-item {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  padding: 15px 0;
}

/* Intelligence gets the same readable type hierarchy as details.php. */
.company-intelligence-sections {
  gap: 14px;
}

.company-intelligence-card {
  padding: 18px;
}

.company-intelligence-card .company-card-head {
  margin-bottom: 0;
}

.company-intelligence-grid-list {
  gap: 0 22px;
}

.company-intelligence-grid-list > div {
  padding: 11px 0;
}

.company-intelligence-grid-list span {
  font-size: 12.5px;
  margin-bottom: 4px;
}

.company-intelligence-grid-list strong {
  font-size: 14px;
  line-height: 1.45;
}

.company-tech-list {
  gap: 8px;
}

.company-tech-list span {
  padding: 7px 10px;
  font-size: 13px;
}

.company-social-list a {
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  padding: 11px 0;
}

.company-social-list a span {
  font-size: 14px;
}

.company-social-list a small {
  font-size: 12px;
}

/* Right rail hierarchy. */
.company-contacts {
  gap: 10px;
}

.company-contacts strong {
  font-size: 13px;
}

.company-contacts small {
  font-size: 12px;
}

.company-add-link,
.company-view-link {
  font-size: 13px;
}

.company-deals a {
  padding: 11px 0;
}

.company-deals strong {
  font-size: 13px;
}

.company-deals span {
  font-size: 12px;
  margin-top: 3px;
}

.company-muted {
  font-size: 13px;
  line-height: 1.55;
}

/* Property history / popups use the same readable modal scale. */
.company-history-head {
  padding: 22px;
}

.company-history-head h2 {
  font-size: 18px;
  line-height: 1.3;
}

.company-history-head p {
  font-size: 13px;
  line-height: 1.5;
}

.company-history-toolbar {
  padding: 14px 22px;
}

.company-history-table td {
  font-size: 13px;
}

.company-history-table th {
  font-size: 12px;
}

#companyActionModal .modal__title {
  font-size: 18px;
}

#companyActionModal .field__label {
  font-size: 14px;
}

#companyActionModal .input,
#companyActionModal select,
#companyActionModal textarea {
  font-size: 14px;
}
@media (min-width: 1199.98px) {
  .company-details-body {
    overflow-y: hidden;
  }
}
@media (max-width: 1199.98px) {
  .company-record-grid {
    height: auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
  }
  .company-record-page {
    height: auto;
    min-height: calc(100vh - var(--header-h));
    overflow: visible;
    padding: 0;
  }
  .company-record-left.company-record-column {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 10px;
  }
}
@media (max-width: 991.98px) {
  .company-primary-panel {
    padding: 16px;
  }
  .company-primary-tab,
  .company-record-tab {
    height: 56px;
  }
}

@media (max-width: 767px) {
  .company-record-header .company-record-breadcrumb {
    margin-bottom: 10px;
  }
  .company-record-header {
    display: block;
  }
  .company-record-left.company-record-column {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .company-record-right {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    max-height: none;
  }
  .company-record-page {
    padding: 0 0 80px;
  }
}
@media (max-width: 575.98px) {
  .company-profile-card,
  .company-side-card,
  .company-associated-card,
  .company-intelligence-card {
    border-radius: 16px;
  }

  .company-primary-panel {
    padding: 14px;
  }

  .company-overview-card {
    padding: 14px;
  }

  .company-timeline-card {
    padding: 15px;
  }

  .company-record-tab,
  .company-primary-tab {
    font-size: 13.5px;
    padding-inline: 12px;
  }
}

/* Company intelligence card controls */
.company-card-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.company-card-collapse svg {
  transition: transform 0.18s ease;
}
.company-card-collapse[aria-expanded="false"] svg {
  transform: rotate(180deg);
}

/* Activity filters use the same dimensions/rhythm as the CRM custom selects. */
.company-activity-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.company-activity-select {
  min-width: 150px;
  flex: 0 0 auto;
}
.company-activity-select .custom-select,
.company-activity-select .custom-select__trigger {
  min-height: 38px;
  height: 38px;
  font-size: 13px;
}
.company-clear-filters,
.company-more-filter {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.company-clear-filters {
  margin-left: auto;
}
.company-more-filter {
  margin-left: 0;
}
@media (max-width: 991px) {
  .crm-table.company-history-table td:last-child {
    text-align: right !important;
  }
  .company-history-toolbar {
    border-bottom: none;
  }
  .company-history-table-wrap {
    padding: 0 22px 14px 22px;
  }
}
@media (max-width: 767px) {
  .company-clear-filters {
    margin-left: 0;
  }
  .company-activity-filters {
    flex-direction: column;
  }
  .company-activity-filters .custom-select-wrapper {
    max-width: 100%;
    width: 100%;
  }
}

/* Company edit/create drawers reuse the shared Deals-style drawer component. */
.company-create-overlay,
.company-edit-overlay {
  z-index: 9998;
}
.company-create-drawer,
.company-edit-drawer {
  z-index: 9999;
}

/* Keep the empty activity state full width instead of inheriting timeline column sizing. */
.company-timeline > .company-content-item {
  width: 100%;
  min-width: 0;
  grid-column: 1 / -1;
  flex: 1 1 100%;
  display: flex;
  align-items: flex-start;
  padding: 32px 24px;
  border: 1px dashed var(--border);
  background: var(--surface);
  border-radius: var(--radius);
}

.company-timeline > .company-content-item > div:last-child {
  max-width: none;
  width: 100%;
}

.company-timeline > .company-content-item strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}

.company-timeline > .company-content-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

/* ==========================================================================
   B11: Catch-up tab (28 Oct design, record-tabs.css :12-23, :28-47, :64-67, :87-94, :132-142,
   :178-186). Every rule under .company-catchup, which only CompanyCatchUp renders: Contacts'
   Intelligence tab and Deals keep .rp-sample (contacts-parity.css).
   ========================================================================== */
.company-catchup { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.company-catchup [hidden] { display: none; }
.company-catchup .rt-card { background: var(--surface, #fff); border: 1px solid var(--border, #e4e7ec); border-radius: var(--radius-lg, 12px); min-width: 0; }
.company-catchup .rt-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px 0; }
.company-catchup .rt-card__head h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--text, #101828); }
.company-catchup .rt-card__acts { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.company-catchup .rt-card__acts:empty { display: none; }
.company-catchup .rt-card__body { padding: 14px 22px 20px; font-size: 14px; line-height: 1.5; min-width: 0; color: var(--text, #101828); }
.company-catchup .rt-card p { margin: 0 0 10px; }
.company-catchup .rt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text, #101828); background: var(--surface, #fff); border: 1px solid var(--border-strong, #d0d5dd); border-radius: var(--radius-sm, 8px); cursor: pointer; text-decoration: none; white-space: nowrap; }
.company-catchup .rt-btn:hover { background: var(--surface-hover, #f2f4f7); }
.company-catchup .rt-btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.company-catchup .rt-btn[disabled] { opacity: .5; cursor: not-allowed; }
.company-catchup .rt-btn[disabled]:hover { background: var(--surface, #fff); }
.company-catchup .rt-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; font: inherit; font-size: 13px; color: var(--text-muted, #475467); background: var(--surface, #fff); border: 1px solid var(--border-strong, #d0d5dd); border-radius: var(--radius-sm, 8px); cursor: pointer; text-decoration: none; white-space: nowrap; }
.company-catchup .rt-pill--ai { color: #b42318; border-color: #f97066; background: #fff1f3; }
.company-catchup .rt-btn:focus-visible, .company-catchup .rt-pill:focus-visible, .company-catchup .rt-link:focus-visible, .company-catchup .rt-section button:focus-visible { outline: 2px solid var(--brand, #2456e6); outline-offset: 2px; }
.company-catchup .rt-link { color: var(--brand, #2456e6); font-weight: 600; text-decoration: none; }
.company-catchup .rt-link:hover { text-decoration: underline; }
.company-catchup .rt-muted { color: var(--text-muted, #475467); }
.company-catchup .rt-section { margin: 4px 0 -4px; font-size: 21px; font-weight: 600; line-height: 1.3; }
.company-catchup .rt-section button { display: inline-flex; align-items: center; gap: 8px; padding: 2px 4px; font: inherit; color: var(--text, #101828); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.company-catchup .rt-section svg { width: 18px; height: 18px; transition: transform .15s; }
.company-catchup .rt-section button[aria-expanded="false"] svg { transform: rotate(-90deg); }
.company-catchup .rt-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; text-align: center; color: var(--text-muted, #475467); }
.company-catchup .rt-check { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; font-size: 26px; color: var(--brand, #2456e6); background: #eef4ff; border-radius: 50%; }
.company-catchup .rt-iox { margin-top: 14px; padding: 12px 16px; border: 1px solid var(--border, #e4e7ec); border-radius: var(--radius-sm, 8px); }
.company-catchup .rt-iox h4 { margin: 14px 0 6px; font-size: 14px; }
.company-catchup .rt-iox h4:first-child { margin-top: 0; }
.company-catchup .rt-ilist { margin: 0; padding: 0; list-style: none; }
.company-catchup .rt-ilist li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border, #e4e7ec); font-size: 13.5px; }
.company-catchup .rt-ilist li:first-child { border-top: 0; }
.company-catchup .rt-ilist strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-catchup .rt-ilist span { color: var(--text-muted, #475467); white-space: nowrap; }
.company-catchup .rt-sent { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.company-catchup .rt-sent__dot { width: 10px; height: 10px; background: #12b76a; border-radius: 50%; }
/* No verdict (AI is out): a grey dot, "Not rated". */
.company-catchup .rt-sent__dot--none { background: var(--border-strong, #d0d5dd); }
.company-catchup .rt-agent { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 14px 18px; border: 1px solid var(--border-strong, #d0d5dd); border-radius: var(--radius-sm, 8px); }
.company-catchup .rt-agent p { margin: 0; flex: 1; }
.company-catchup .rt-ul { margin: 0 0 10px; padding-left: 20px; list-style: disc; }
[data-theme="dark"] .company-catchup .rt-check { background: var(--brand-soft); }
[data-theme="dark"] .company-catchup .rt-pill--ai { color: #fda29b; border-color: #f97066; background: rgba(249, 112, 102, 0.12); }
@media (max-width: 640px) {
  .company-catchup .rt-card__head { padding: 14px 14px 0; }
  .company-catchup .rt-card__body { padding: 12px 14px 16px; }
  .company-catchup .rt-agent { flex-direction: column; align-items: flex-start; }
}

/* R9: the company About tab's Company profile and Lead Score cards and its Signals heading,
   as the 28 Oct design (record-tabs.css), scoped: Catch-up has its own .rt-card. */
.rt-card.company-about-card { background: var(--surface, #fff); border: 1px solid var(--border, #e4e7ec); border-radius: var(--radius-lg, 12px); min-width: 0; }
.company-about-card .rt-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px 0; }
.company-about-card .rt-card__head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.company-about-card .rt-card__head h3:empty { display: none; }
.company-about-card .rt-card__acts { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.company-about-card .rt-card__body { padding: 14px 22px 20px; font-size: 14px; line-height: 1.5; min-width: 0; }
.rt-card.company-about-card p { margin: 0 0 10px; }
.company-about-card .rt-gear { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: var(--text-muted, #475467); background: var(--surface, #fff); border: 1px solid var(--border-strong, #d0d5dd); border-radius: var(--radius-sm, 8px); cursor: pointer; }
.company-about-card .rt-gear svg { width: 15px; height: 15px; }
.company-about-card .rt-gear:hover { color: var(--text, #101828); background: var(--surface-hover, #f2f4f7); }
.company-about-card .rt-gear:focus-visible { outline: 2px solid var(--brand, #2456e6); outline-offset: 2px; }
.company-about-card .rt-link { color: var(--brand, #2456e6); font-weight: 600; text-decoration: none; }
.company-about-card .rt-link:hover { text-decoration: underline; }
.company-about-card .rt-link svg { width: 13px; height: 13px; vertical-align: -2px; }
.company-about-card .rt-right { text-align: right; }
.rt-section.company-about-section { margin: 4px 0 -4px; font-size: 21px; font-weight: 600; }
.rt-section.company-about-section button { display: inline-flex; align-items: center; gap: 8px; padding: 2px 4px; font: inherit; color: var(--text, #101828); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.rt-section.company-about-section svg { width: 18px; height: 18px; transition: transform .15s; }
.rt-section.company-about-section button[aria-expanded="false"] svg { transform: rotate(-90deg); }
.company-about-card .rt-grid3 { display: grid; gap: 14px 16px; margin: 0; }
.company-about-card .rt-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.company-about-card .rt-grid3 dt { font-size: 13px; color: var(--text-muted, #475467); }
.company-about-card .rt-grid3 dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.rt-card.company-about-card { margin-bottom: 16px; }
@media (max-width: 640px) {
  .company-about-card .rt-card__head { padding: 14px 14px 0; }
  .company-about-card .rt-card__body { padding: 12px 14px 16px; }
  .company-about-card .rt-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* LD2: the company name as the 28 Oct design's record name (record-page.css:8, :172-175). */
.company-profile-copy h1 { font-size: 20px; }
@media (max-width: 480px) {
  .company-profile-copy h1 { font-size: 18px; }
}

/* GLB4 (go-live Medium 1): the back link and Actions keep apart as the design's card top row
   (record-actions.css:45-50), and the quick row uses the card's width as the design's .rp-quick
   (record-page.css:20-22: no side padding inside the padded card). */
.company-profile-head {
  justify-content: space-between;
  gap: 8px;
}
.company-profile-card .crm-contact-profile__quick-actions {
  padding-right: 0;
  padding-left: 0;
}

/* GLB4 (go-live Medium 6): the activity type tabs as the design's .act__tabs / .act__tab
   (activity-tabs.css:20-45): edge to edge in the center panel, gap 2, 0 10px; tabs 0 14px, 14px. */
.company-primary-panel .company-activity-tabs {
  gap: 2px;
  margin: 0 -15px;
  padding: 0 10px !important;
}
.company-primary-panel .company-activity-tabs .set-tab {
  padding: 12px 14px !important;
  font-size: 14px !important;
}
