#gc-record-history,
#gc-record-history-tip {
  position: fixed;
  inset-inline-start: 10px;
  inset-block-end: 38px;
  z-index: 85;
  border-radius: 999px;
  border: 1px solid light-dark(#e4d7ca, #5a4b40);
  background: light-dark(#fff, #292420);
  color: light-dark(#674c39, #efe0d1);
  font: 500 11px/1.35 Inter, "Segoe UI", sans-serif;
  padding: 4px 8px;
  box-shadow: 0 1px 4px #0001;
}

#gc-record-history[hidden],
#gc-record-history-tip[hidden] { display: none; }

#gc-record-history[aria-pressed="true"] {
  border-color: #d87949;
  background: light-dark(#fff0e7, #523425);
}

#gc-record-history-tip { inset-block-end: 67px; }

body[data-record-history="admin-leads"] #partnership-crm-root :is([data-row-open], [data-open]):hover,
body[data-record-history="admin-master-classes"] [data-view="admin-master-classes"] :is([data-mc-event-row], [data-mc-history-registration], [data-mc-history-source]):hover {
  outline: 1px solid #d87949;
  outline-offset: -1px;
  cursor: help;
}

#gc-record-history-dialog {
  --paper: light-dark(#fffdfb, #292420);
  --line: light-dark(#e8ded4, #51463e);
  --muted: light-dark(#74675e, #c3b4a7);
  color-scheme: light dark;
  box-sizing: border-box;
  width: min(640px, calc(100vw - 20px));
  max-height: min(78vh, 720px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: light-dark(#292420, #f6ebdf);
  font: 400 12px/1.45 Inter, "Segoe UI", sans-serif;
  box-shadow: 0 12px 40px #0004;
}

#gc-record-history-dialog::backdrop { background: #211b1575; }
#gc-record-history-dialog > header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  position: sticky;
  top: 0;
  padding: 12px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
#gc-record-history-dialog h2 { font-size: 16px; margin: 0; }
#gc-record-history-dialog p { margin: 3px 0; overflow-wrap: anywhere; }
#gc-record-history-dialog header button {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: inherit;
  background: var(--paper);
  font: inherit;
}
#gc-record-history-dialog .gc-record-history-content { padding: 7px 14px 13px; }
#gc-record-history-dialog .gc-record-history-meta { color: var(--muted); font-size: 11px; }
#gc-record-history-dialog ol { list-style: none; margin: 0; padding: 0; }
#gc-record-history-dialog li { border-bottom: 1px solid var(--line); padding: 7px 0; }
#gc-record-history-dialog .gc-record-history-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .75fr) auto;
  align-items: baseline;
  gap: 5px 9px;
  overflow-wrap: anywhere;
}
#gc-record-history-dialog time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
#gc-record-history-dialog dl { display: grid; gap: 4px; margin: 6px 0 0; }
#gc-record-history-dialog dl div { display: grid; grid-template-columns: minmax(95px, .36fr) minmax(0, 1fr); gap: 6px; }
#gc-record-history-dialog dt { color: var(--muted); }
#gc-record-history-dialog dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
#gc-record-history-dialog del { color: var(--muted); }
#gc-record-history-dialog ins { color: light-dark(#24664b, #ade3c7); text-decoration: none; }

@media (max-width: 560px) {
  #gc-record-history-dialog .gc-record-history-event { grid-template-columns: minmax(0, 1fr); }
}
