/* Record reading and editing share the existing forms and persistence owner. */
.record-view {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink, #20332e);
}
.record-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line, #dce4e0);
}
.record-section-header h2,
.record-section-header h3 { margin: 0; font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
.record-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; max-width: 100%; gap: 8px; }
.record-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 4px 0 0; }
.record-value { min-width: 0; padding: 15px 0; border-bottom: 1px solid #e2e9e580; }
.record-value-wide { grid-column: 1 / -1; }
.record-value dt { margin-bottom: 4px; font-size: 13px; color: var(--muted, #64756e); font-weight: 500; }
.record-value dd { margin: 0; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.record-value dd.record-value-empty { color: var(--muted, #64756e); }
.record-value-link { color: var(--accent-dark, #105a47); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; font-weight: 550; }
.record-value-link:hover { color: var(--accent, #147d64); }
.record-group-title { margin: 28px 0 0; padding-bottom: 10px; font-size: 17px; color: var(--ink, #20332e); border-bottom: 1px solid var(--line, #dce4e0); }
.record-attachments { margin-top: 28px; padding: 0; border: 0; border-radius: 0; }
.record-attachments .record-section-header { padding-bottom: 12px; }
.record-attachments h3 { font-size: 18px; }
.record-empty { color: var(--muted, #64756e); margin: 16px 0 0; }
.record-file-list { list-style: none; padding: 0; margin: 0; }
.record-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line, #dce4e0); }
.record-file:last-child { border-bottom: 0; }
.record-file-name { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.record-file .button { flex-shrink: 0; }
.record-edit-bar {
  position: sticky;
  top: var(--app-header-height, 0px);
  z-index: 20;
  margin: 0 0 8px;
  padding: 12px 0 0;
  background: #fff;
}
.record-edit-bar .record-section-header { padding-bottom: 12px; }
.record-view .button:focus-visible,
.record-edit-bar .button:focus-visible,
.record-value-link:focus-visible { outline: 3px solid #299478; outline-offset: 3px; }
.record-view [data-record-field] { scroll-margin-top: calc(var(--app-header-height, 0px) + 80px); }
@media (max-width: 600px) {
  .record-values { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .record-section-header { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .record-section-header h2 { font-size: 19px; }
  .record-actions { margin-left: auto; }
  .record-edit-bar .record-section-header { align-items: center; }
  .record-edit-bar .record-actions { flex-wrap: nowrap; }
  .record-value { padding: 12px 0; }
}
@media (max-height: 500px) {
  .record-edit-bar { top: 0; }
}
@media print {
  .record-actions, .record-edit-bar { display: none; }
}

/* One action bar per editor; original controls remain available to their handlers. */
.record-presented-editor > .section-heading[hidden],
.record-presented-editor > .action-row[hidden] { display: none !important; }
.record-more-actions { position: relative; align-self: center; }
.record-more-actions > summary { cursor: pointer; list-style: none; white-space: nowrap; }
.record-more-actions > summary::-webkit-details-marker { display: none; }
.record-more-actions > summary::after { content: "⌄"; margin-left: 8px; }
.record-more-actions[open] > summary { background: #edf5f0; border-color: var(--accent, #147d64); }
.record-more-actions-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  width: max-content;
  min-width: 190px;
  max-width: min(280px, calc(100vw - 48px));
  padding: 6px;
  border: 1px solid var(--line, #dce4e0);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px #153d321a;
}
.record-more-actions-list .button { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; border-color: transparent; }
.record-more-actions-list .record-destructive-action { color: #a52b22; }
.record-more-actions-list .record-destructive-action:hover { background: #fff3f1; border-color: #e8b4aa; }
.record-back-action { border-color: transparent; padding-inline: 0; background: transparent; color: var(--accent-dark, #105a47); text-decoration: underline; text-underline-offset: 3px; }
.record-related-records { margin-top: 22px; }
.record-related-records > .record-group-title { margin-top: 0; }
.record-additional-details { margin-top: 20px; border-top: 1px solid var(--line, #dce4e0); border-bottom: 1px solid var(--line, #dce4e0); }
.record-additional-details > summary { padding: 13px 0; cursor: pointer; color: var(--accent-dark, #105a47); font-size: 14px; font-weight: 600; }
.record-additional-details > .record-values { margin-top: 0; }
.record-more-actions > summary:focus-visible,
.record-additional-details > summary:focus-visible { outline: 3px solid #299478; outline-offset: 3px; }
@media (max-width: 600px) {
  .record-edit-bar .record-section-header { gap: 10px; }
  .record-edit-bar .record-section-header > h2 { flex: 1 1 100%; }
  .record-edit-bar .record-actions { justify-content: flex-end; width: 100%; }
  .record-edit-bar .record-more-actions { margin-right: auto; }
  .record-edit-bar .record-more-actions-list { left: 0; right: auto; }
  .record-related-records { margin-top: 18px; }
}
@media print {
  .record-more-actions { display: none; }
  .record-additional-details > .record-values { display: grid !important; }
}
