/* Individual history: flat, compact surfaces. Scoped to this delivery. */
.animal-profile-modal {
  --border: #e2e8f0;
  --surface: #fff;
  --surface-alt: #fff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --shadow: none;
  --shadow-card: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: none;
}
.animal-profile-modal .modal-header,
.animal-profile-modal .modal-footer { background: #fff; border-color: var(--border); box-shadow: none; }
.animal-profile-modal .modal-header { gap: 12px; padding: 14px 20px; }
.animal-profile-modal .modal-footer { padding: 10px 20px; }
.animal-profile-modal .button { border-radius: 6px; box-shadow: none; min-height: 34px; }
.animal-profile-modal .button.secondary,
.animal-profile-modal [data-action="close-modal"] { color: var(--text-primary); border: 1px solid var(--border); background: #fff; }
.animal-profile-modal [data-action="close-modal"]::before { display: none; }
.animal-profile-modal .button.primary { background: #0f4f55; border-color: #0f4f55; color: #fff; }
.animal-profile-modal :is(button, summary):focus-visible { outline: 2px solid #0f4f55; outline-offset: 3px; }
.animal-profile-modal-header .eyebrow,
.animal-profile-title > span { color: #64748b; font-size: 12px; letter-spacing: 0; text-transform: none; }
.animal-profile-modal-header > .animal-profile-toolbar { display: flex; flex-wrap: wrap; margin-left: auto; gap: 8px; align-items: center; }
.animal-profile-export-menu { position: relative; }
.animal-profile-export-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
.animal-profile-export-menu > summary::-webkit-details-marker { display: none; }
.animal-profile-export-options { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; width: 190px; padding: 4px; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; }
.animal-profile-export-options .button { display: block; width: 100%; text-align: left; border: 0; }
.animal-profile-export-options .button:hover { background: #f8fafc; }
.animal-profile { gap: 16px; }
.animal-profile-modal .animal-profile-hero { padding: 0 0 16px; background: #fff; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; gap: 12px; }
.animal-profile-modal .animal-profile-icon { width: 40px; height: 40px; color: #475569; border: 0; background: #fff; box-shadow: none; }
.animal-profile-modal .animal-profile-title h2 { color: #0f172a; font-size: 26px; }
.animal-profile-identities span { padding: 0 12px 0 0; border: 0; border-radius: 0; background: #fff; color: #64748b; }
.animal-profile-modal .animal-profile-current-state { padding: 8px 12px; min-width: 0; align-self: center; background: #fff; border: 0; border-left: 1px solid var(--border); border-radius: 0; }
.animal-profile-current-state strong { color: #0f172a; font-size: 16px; }
.animal-profile-current-state :is(span, small) { color: #64748b; font-size: 12px; font-weight: 400; }
.animal-profile-modal .animal-profile-metric { padding: 12px; min-height: 90px; border: 1px solid var(--border); border-radius: 8px; box-shadow: none; background: #fff; }
.animal-profile-metric::before { display: none; }
.animal-profile-metric :is(span, small) { font-size: 12px; font-weight: 400; color: #64748b; }
.animal-profile-metric strong { font-size: 24px; color: #0f172a; font-weight: 700; overflow-wrap: anywhere; }
.animal-profile-metric.neutral strong { font-size: 16px; }
.animal-profile-modal .animal-profile-actions { padding: 10px 0; background: #fff; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.animal-profile-actions > div:first-child { min-width: 0; white-space: nowrap; font-size: 13px; }
.animal-profile-actions .table-actions { gap: 8px; }
.animal-profile-modal :is(.detail-panel, .module-insight, .chart-panel) { background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: none; }
.animal-profile .module-insight .metric-icon { background: #fff; border: 0; }
.animal-profile .module-insight-message { display: none; }
.animal-profile .module-insight .button { border: 0; background: #fff; color: var(--text-primary); text-decoration: underline; padding: 4px 0; font-size: 12px; }
.animal-profile .module-insight-context { font-size: 12px; }
.animal-profile-modal .animal-profile-history { padding: 14px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.animal-profile-history .panel-title p { font-size: 12px; color: #64748b; }
.animal-profile-import-notice { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
.animal-profile-notice-icon { width: 22px; height: 22px; color: #64748b; flex: 0 0 22px; }
.animal-profile-notice-icon svg { width: 22px; height: 22px; }
.animal-profile-import-notice strong { font-size: 13px; color: var(--text-primary); }
.animal-profile-import-notice p { margin: 3px 0 0; font-size: 12px; color: #64748b; }
.animal-profile-import-notice .animal-profile-record-link { margin-left: auto; flex-shrink: 0; }
.animal-profile-import-errors { margin-bottom: 16px; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; color: var(--text-primary); font-size: 13px; }
.animal-profile-import-errors summary { cursor: pointer; font-weight: 600; }
.animal-profile-import-errors p { color: #64748b; font-size: 12px; }
.animal-profile-import-errors ul { max-height: 240px; overflow-y: auto; padding-left: 20px; }
.animal-profile-import-errors li { padding: 8px 0; border-bottom: 1px solid #e2e8f0; overflow-wrap: anywhere; }
.animal-profile-import-errors li span { display: block; margin-top: 4px; }
.animal-profile-timeline { gap: 0; }
.animal-profile-timeline::before { content: ""; position: absolute; top: 18px; bottom: 18px; left: 6px; width: 1px; background: #cbd5e1; }
.animal-profile-event { gap: 14px; }
.animal-profile-modal .animal-profile-event .animal-profile-event-marker { width: 9px; height: 9px; margin: 18px 0 0 2px; border: 2px solid #fff; background: #64748b; box-shadow: 0 0 0 1px #94a3b8; }
.animal-profile-event-marker::after { display: none; }
.animal-profile-modal .animal-profile-event-content { padding: 10px 0 14px; background: #fff; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; min-width: 0; }
.animal-profile-event-heading h4 { font-size: 14px; color: #0f172a; }
.animal-profile-event-heading :is(small, time) { font-size: 12px; font-weight: 400; color: #64748b; }
.animal-profile-event-content p { overflow-wrap: anywhere; }
.animal-profile-event-content > details { margin-top: 8px; }
.animal-profile-event-content summary { cursor: pointer; font-size: 12px; color: #475569; }
.animal-profile-record-link { display: block; width: fit-content; margin: 8px 0 0 auto; padding: 2px 0; border: 0; background: transparent; color: var(--text-primary); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.animal-profile-record-link:hover { color: #0f172a; }
.animal-profile-data dl > div,
.animal-profile-event-details > div { background: #fff; padding: 6px 0; border-radius: 0; border-bottom: 1px solid var(--border); }
.animal-profile-data dt,
.animal-profile-event-details dt { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 400; color: #64748b; }
.animal-profile-event-details dd { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .animal-profile-modal .modal-header { flex-wrap: wrap; padding: 12px; }
  .animal-profile-modal-header > .animal-profile-toolbar { order: 3; width: 100%; margin: 0; }
  .animal-profile-modal-header > [data-action="close-modal"] { margin-left: auto; }
  .animal-profile-import-notice { flex-wrap: wrap; }
  .animal-profile-import-notice > div { flex: 1; min-width: 180px; }
  .animal-profile-modal .animal-profile-actions { align-items: flex-start; }
  .animal-profile-metric strong { font-size: 24px; }
}
