/* REC-005: searchable, one-third tighter history across Account, Lead, and Opportunity records. */
[data-ps-logged-history-root="1.0.0"] {
  min-width: 0;
  overflow-x: hidden;
  padding: 0.6875rem !important;
}

[data-ps-logged-history-root="1.0.0"] > .mt-4,
[data-ps-logged-history-root="1.0.0"] .ps-logged-history-panel {
  margin-top: 0.6875rem !important;
}

[data-ps-logged-history-root="1.0.0"] > .mt-2 {
  margin-top: 0.375rem !important;
}

[data-ps-logged-history-root="1.0.0"] > .flex,
[data-ps-logged-history-root="1.0.0"] .ps-logged-history-header {
  gap: 0.5rem !important;
}

[data-ps-logged-history-root="1.0.0"] h3 {
  font-size: 1rem !important;
  line-height: 1.375rem !important;
  margin-top: 0.25rem !important;
}

.ps-logged-history-metric-grid {
  gap: 0.375rem !important;
}

.ps-logged-history-metric {
  min-height: 3.25rem !important;
  min-width: 0;
  padding: 0.5rem 0.625rem !important;
}

.ps-logged-history-metric p {
  max-width: 100%;
  overflow: visible !important;
  overflow-wrap: anywhere;
  text-overflow: clip !important;
  white-space: normal !important;
}

.ps-logged-history-metric > p:first-child {
  font-size: 0.6875rem !important;
  line-height: 0.875rem !important;
}

.ps-logged-history-metric > div > p:first-child {
  font-size: 0.8125rem !important;
  line-height: 1rem !important;
  margin-top: 0.25rem !important;
}

.ps-logged-history-metric > div > p + p,
.ps-logged-history-metric > div:last-child p {
  line-height: 0.875rem !important;
  margin-top: 0.25rem !important;
}

[data-ps-logged-history-panel="1.0.0"] {
  min-width: 0;
  padding: 0.5rem !important;
}

.ps-logged-history-header > div,
.ps-logged-history-header > div > div {
  min-width: 0;
}

.ps-logged-history-header button {
  min-height: 44px;
  max-width: 100%;
  padding: 0.375rem 0.625rem !important;
  text-align: left;
  white-space: normal;
}

.ps-logged-history-controls {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto minmax(7rem, auto);
  align-items: end;
  gap: 0.5rem;
  margin-top: 0.5rem;
  min-width: 0;
}

.ps-logged-history-label {
  display: grid;
  min-width: 0;
  gap: 0.25rem;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
}

.ps-logged-history-search {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  padding: 0.625rem 0.75rem;
}

.ps-logged-history-search::placeholder {
  color: #64748b;
  opacity: 1;
}

.ps-logged-history-search:focus-visible,
.ps-logged-history-clear:focus-visible {
  outline: 3px solid rgba(5, 150, 105, 0.28);
  outline-offset: 2px;
}

.ps-logged-history-clear {
  min-height: 44px;
  border: 1px solid #a7f3d0;
  border-radius: 0.375rem;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1rem;
  padding: 0.625rem 0.75rem;
}

.ps-logged-history-clear:hover:not(:disabled) {
  background: #d1fae5;
}

.ps-logged-history-clear:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ps-logged-history-status {
  align-self: center;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
  overflow-wrap: anywhere;
}

.ps-logged-history-timeline {
  gap: 0.375rem !important;
  margin-top: 0.5rem !important;
  min-width: 0;
}

.ps-logged-history-row {
  min-width: 0;
  gap: 0.5rem !important;
  padding: 0.25rem 0;
}

[data-ps-logged-history-panel="1.0.0"] .ps-logged-history-row[hidden],
[data-ps-logged-history-panel="1.0.0"] [data-ps-logged-history-empty][hidden] {
  display: none !important;
}

.ps-logged-history-row p,
.ps-logged-history-row span {
  max-width: 100%;
  overflow: visible !important;
  overflow-wrap: anywhere;
  text-overflow: clip !important;
  white-space: normal !important;
}

.ps-logged-history-row p.text-sm {
  font-size: 0.8125rem !important;
  line-height: 1.125rem !important;
}

.ps-logged-history-row p.text-xs,
.ps-logged-history-row span.text-xs {
  font-size: 0.71875rem !important;
  line-height: 1rem !important;
}

.ps-logged-history-mark {
  border-radius: 0.1875rem;
  background: #fef3c7;
  color: inherit;
  padding: 0 0.0625rem;
}

.ps-logged-history-empty {
  border-radius: 0.375rem;
  background: #f8fafc;
  color: #475569;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  overflow-wrap: anywhere;
  padding: 0.625rem;
}

[data-ps-logged-history-panel="1.0.0"] > p:last-child {
  margin-top: 0.5rem !important;
}

@media (max-width: 700px) {
  .ps-logged-history-controls {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ps-logged-history-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .ps-logged-history-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .ps-logged-history-clear {
    justify-self: stretch;
  }

  .ps-logged-history-status {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-ps-logged-history-root="1.0.0"] *,
  [data-ps-logged-history-root="1.0.0"] *::before,
  [data-ps-logged-history-root="1.0.0"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .ps-logged-history-search,
  .ps-logged-history-clear {
    border: 1px solid ButtonText;
  }

  .ps-logged-history-search:focus-visible,
  .ps-logged-history-clear:focus-visible {
    outline: 2px solid Highlight;
  }

  .ps-logged-history-mark {
    background: Highlight;
    color: HighlightText;
  }
}
