@layer defaults, application, domains, features, components;
@layer defaults.focus-appearance, defaults.workspace-typography, defaults.checkbox-appearance, defaults.selection-controls, defaults.toolbar-appearance, defaults.field-appearance, defaults.action-button-geometry, defaults.footer-appearance, defaults.connected-selects;
@layer components.settings, components.density, components.examples, components.selects, components.footers, components.actions, components.fields, components.toolbars, components.selections, components.checkboxes, components.typography, components.accessibility;
/* Company detail presentation; controls and status colors use their shared owners. */
@layer domains {
.hhcrm-company-profile { display: grid; gap: 20px; min-width: 0; }
.hhcrm-company-profile .hhcrm-profile-header { padding: 20px; border: 1px solid var(--hh-ui-border); border-radius: var(--app-content-card-radius); background: var(--app-content-card-bg); }
.hhcrm-company-profile .hhcrm-back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 20px; line-height: 20px; }
.hhcrm-company-profile .hhcrm-back:hover { color: var(--hh-color-text-primary); }
.hhcrm-profile-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hhcrm-profile-company-icon { display: grid; place-items: center; flex: 0 0 52px; width: 52px; height: 52px; border: 1px solid var(--hh-ui-border); border-radius: 16px; background: var(--hh-ui-panel); color: var(--hh-color-text-secondary); }
.hhcrm-profile-company-copy { flex: 1; min-width: 0; }
.hhcrm-company-profile .hhcrm-profile-company-copy h1 { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -.5px; }
.hhcrm-profile-details { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; margin-top: 7px; color: var(--hh-color-text-secondary); font-size: 12px; line-height: 1.5; }
.hhcrm-profile-details > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.hhcrm-profile-details svg { flex-shrink: 0; }
.hhcrm-company-profile .hhcrm-profile-stage { align-self: start; flex: 0 0 auto; margin-top: 3px; }
.hhcrm-company-profile .hhcrm-account-controls { display: flex; gap: 16px; padding-top: 18px; margin: 20px 0 0; border-top: 1px solid var(--hh-ui-separator); }
.hhcrm-company-profile .hhcrm-account-controls > label { flex: 0 1 220px; }
.hhcrm-company-profile .hhcrm-account-tabs { display: flex; flex-wrap: nowrap; gap: 4px; margin: 0; padding: 0 0 12px; border-bottom: 1px solid var(--hh-ui-border); overflow-x: auto; }
.hhcrm-company-profile .hhcrm-account-tabs button { flex: 0 0 auto; margin: 0; padding-inline: 16px; white-space: nowrap; }
.hhcrm-company-profile .hhcrm-account-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.hhcrm-company-profile .hhcrm-account-main { display: grid; align-content: start; gap: 20px; }
.hhcrm-company-profile .hhcrm-account-rail { gap: 20px; }
.hhcrm-company-profile .hhadmin-card-heading { margin: 0; min-width: 0; }
.hhcrm-company-profile .hhcrm-card { padding: var(--hhadmin-card-padding-y, 20px) var(--hhadmin-card-padding-x, 20px); }
.hhcrm-company-profile .hhcrm-profile-composer { display: grid; gap: 18px; }
.hhcrm-company-profile .hhcrm-composer { padding: 0; border: 0; gap: 12px; }
.hhcrm-company-profile .hhcrm-composer textarea { min-height: 96px; padding: 12px; }
.hhcrm-company-profile .hhcrm-composer-actions { align-items: end; gap: 12px; }
.hhcrm-company-profile .hhcrm-composer-actions > label { flex: 0 1 200px; }
.hhcrm-company-profile .hhcrm-composer-actions > .btn { margin-inline-start: auto; }
.hhcrm-company-profile .hhcrm-composer > small { font-size: 11px; }
.hhcrm-company-profile .hhcrm-profile-history { min-width: 0; }
.hhcrm-company-profile .hhcrm-timeline { padding-top: 24px; }
.hhcrm-company-profile .hhcrm-timeline-item { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 24px; }
.hhcrm-company-profile .hhcrm-timeline-item:last-child { padding-bottom: 0; }
.hhcrm-company-profile .hhcrm-timeline-dot { position: relative; z-index: 1; background: var(--hh-ui-panel); color: var(--hh-color-text-secondary); border: 1px solid var(--hh-ui-border); }
.hhcrm-company-profile .hhcrm-timeline-item::before { top: 28px; bottom: 0; }
.hhcrm-profile-entry { min-width: 0; padding: 2px 0 20px; border-bottom: 1px solid var(--hh-ui-separator); }
.hhcrm-timeline-item:last-child .hhcrm-profile-entry { border-bottom: 0; padding-bottom: 0; }
.hhcrm-company-profile .hhcrm-timeline-meta { align-items: start; gap: 6px 16px; }
.hhcrm-company-profile .hhcrm-timeline-meta strong { font-size: 12px; font-weight: 600; }
.hhcrm-company-profile .hhcrm-timeline-meta time { color: var(--hh-color-text-secondary); font-size: 11px; line-height: 1.6; }
.hhcrm-company-profile .hhcrm-author { margin-top: 3px; font-size: 11px; }
.hhcrm-company-profile .hhcrm-timeline-item p { max-width: 78ch; margin: 12px 0 0; font-size: 13px; line-height: 1.75; color: var(--hh-color-text-secondary); }
.hhcrm-company-profile .hhcrm-profile-due { display: flex; align-items: center; gap: 5px; margin-top: 12px; }
.hhcrm-profile-history-limit { margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--hh-ui-separator); color: var(--hh-color-text-secondary); font-size: 11px; line-height: 1.5; }
.hhcrm-company-profile .hhcrm-profile-workspace > .hhadmin-pill { display: inline-flex; margin-top: 16px; }
.hhcrm-company-profile .hhcrm-profile-workspace > .hhcrm-empty { margin: 12px 0 0; font-size: 12px; line-height: 1.7; }
.hhcrm-company-profile .hhcrm-profile-workspace > .hhcrm-facts { margin: 12px 0; }
.hhcrm-company-profile .hhcrm-profile-workspace > .btn { display: flex; align-items: center; justify-content: center; gap: 6px; }
.hhcrm-company-profile .hhcrm-next-action { margin-top: 18px; padding-top: 16px; }
.hhcrm-profile-next-heading { display: flex; align-items: center; gap: 7px; }
.hhcrm-profile-next-heading > svg { color: var(--hh-color-text-primary); }
.hhcrm-company-profile .hhcrm-next-action p { margin: 8px 0 0; font-size: 12px; line-height: 1.7; }
.hhcrm-company-profile .hhcrm-next-action > small { display: block; margin-top: 6px; }
.hhcrm-company-profile .hhcrm-profile-contacts > .hhcrm-card-heading { flex-wrap: wrap; gap: 12px 8px; margin-bottom: 6px; }
.hhcrm-company-profile .hhcrm-profile-contacts .hhadmin-card-heading { flex: 1 1 180px; }
.hhcrm-company-profile .hhcrm-profile-contacts .hhcrm-card-heading > .btn { padding-inline: 10px; }
.hhcrm-company-profile .hhcrm-contact-row { grid-template-columns: 34px minmax(0, 1fr) 14px; padding: 18px 0; gap: 10px; }
.hhcrm-company-profile .hhcrm-contact-row:last-child { padding-bottom: 0; }
.hhcrm-company-profile .hhcrm-contact-row > svg { color: var(--hh-color-text-secondary); }
.hhcrm-company-profile .hhcrm-contact-row strong { display: block; line-height: 1.5; }
.hhcrm-company-profile .hhcrm-contact-row small { line-height: 1.55; }
.hhcrm-company-profile .hhcrm-contact-row:hover strong { color: var(--semantic-text-teal-strong); }
.hhcrm-company-profile .hhcrm-profile-contact-kind { font-size: 10px; }
.hhcrm-company-profile :is(button, a):focus-visible { outline: 2px solid var(--hh-paint-text-primary); outline-offset: 3px; }
.hhcrm-company-profile > :is(.hhadmin-error, .hhcrm-notice) { margin: 0; }

/* Activity colors keep their labels and icons so the meaning is also readable. */
.hhcrm-company-profile :is(.hhcrm-timeline-item, .hhcrm-profile-last-contact) {
  --crm-activity-surface: var(--hh-ui-panel);
  --crm-activity-border: var(--hh-ui-border);
}
.hhcrm-company-profile [data-activity-type="note"] {
  --crm-activity-surface: color-mix(in srgb, var(--warning-400) 14%, var(--surface-raised));
  --crm-activity-border: color-mix(in srgb, var(--warning-400) 38%, var(--surface-raised));
}
.hhcrm-company-profile :is([data-activity-type="email"], [data-contact-type="email"]) {
  --crm-activity-surface: var(--info-surface);
  --crm-activity-border: var(--info-border);
}
.hhcrm-company-profile :is([data-activity-type="call"], [data-contact-type="call"]) {
  --crm-activity-surface: var(--teal-surface);
  --crm-activity-border: var(--teal-border);
}
.hhcrm-company-profile :is([data-activity-type="meeting"], [data-contact-type="meeting"], [data-activity-type="invitation"]) {
  --crm-activity-surface: var(--purple-surface);
  --crm-activity-border: color-mix(in srgb, var(--purple-700) 20%, var(--surface-raised));
}
.hhcrm-company-profile [data-activity-type="task"] {
  --crm-activity-surface: var(--warning-surface);
  --crm-activity-border: var(--warning-border);
}
.hhcrm-company-profile [data-activity-type="completed"] {
  --crm-activity-surface: var(--success-surface);
  --crm-activity-border: var(--success-border);
}
.hhcrm-company-profile .hhcrm-timeline-dot { background: var(--crm-activity-surface); border-color: var(--crm-activity-border); color: var(--hh-color-text-primary); }
.hhcrm-profile-entry-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; }
.hhcrm-profile-activity-kind { display: inline-flex; align-items: center; padding: 2px 7px; border: 1px solid var(--crm-activity-border); border-radius: 6px; background: var(--crm-activity-surface); color: var(--hh-color-text-primary); font-size: 10px; font-weight: 500; line-height: 1.4; }
.hhcrm-profile-tracking { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 20px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--hh-ui-separator); }
.hhcrm-company-profile .hhcrm-profile-tracking > .hhcrm-account-controls { margin: 0; padding: 0; border: 0; }
.hhcrm-profile-last-contact { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 12px 14px; border: 1px solid var(--hh-ui-border); border-radius: 12px; background: var(--hh-ui-panel); }
.hhcrm-profile-last-contact__icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid var(--crm-activity-border); border-radius: 10px; background: var(--crm-activity-surface); color: var(--hh-color-text-primary); }
.hhcrm-profile-last-contact > div { min-width: 0; }
.hhcrm-company-profile .hhcrm-profile-last-contact h2 { margin: 0 0 3px; color: var(--hh-color-text-primary); font-size: 11px; font-weight: 400; line-height: 1.5; }
.hhcrm-profile-last-contact :is(time, strong) { display: block; color: var(--hh-color-text-secondary); font-size: 12px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.hhcrm-company-profile .hhcrm-profile-last-contact small { display: block; margin-top: 2px; font-size: 10px; line-height: 1.5; }

@media (max-width: 900px) {
  .hhcrm-profile-tracking { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hhcrm-profile-last-contact { max-width: 360px; }
  .hhcrm-company-profile .hhcrm-account-grid { grid-template-columns: minmax(0, 1fr); }
  .hhcrm-company-profile .hhcrm-account-main { grid-row: auto; }
  .hhcrm-company-profile .hhcrm-account-rail { grid-row: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .hhcrm-company-profile .hhcrm-profile-header { padding: 16px; }
}

@media (max-width: 640px) {
  .hhcrm-company-profile { gap: 16px; }
  .hhcrm-profile-identity { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 12px; }
  .hhcrm-profile-company-icon { flex-basis: 44px; width: 44px; height: 44px; border-radius: 14px; }
  .hhcrm-company-profile .hhcrm-profile-company-copy h1 { font-size: 21px; }
  .hhcrm-company-profile .hhcrm-profile-stage { grid-column: 2; justify-self: start; margin: 0; }
  .hhcrm-company-profile .hhcrm-back { min-height: 32px; margin-bottom: 14px; }
  .hhcrm-company-profile .hhcrm-account-controls { gap: 12px; }
  .hhcrm-company-profile .hhcrm-account-controls > label { flex: 1 1 120px; }
  .hhcrm-profile-last-contact { max-width: none; }
  .hhcrm-company-profile .hhcrm-account-tabs button { padding-inline: 13px; }
  .hhcrm-company-profile .hhcrm-account-rail { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hhcrm-company-profile :is(.hhcrm-account-grid, .hhcrm-account-main) { gap: 16px; }
  .hhcrm-company-profile .hhcrm-composer-actions > label { flex: 1 1 100%; }
  .hhcrm-company-profile .hhcrm-composer-actions > .btn { width: 100%; margin-inline-start: 0; }
  .hhcrm-company-profile .hhcrm-timeline-item { gap: 9px; }
  .hhcrm-company-profile .hhcrm-timeline-meta { flex-direction: column; gap: 4px; }
  .hhcrm-company-profile .hhcrm-timeline-item p { font-size: 12px; line-height: 1.8; }
} }
