.oat-records-overlay[hidden],#oat-records-edit[hidden],.oat-records-footer .oat-records-add[hidden]{display:none!important}
.oat-records-overlay{position:fixed;inset:0;z-index:999999;background:rgba(26,9,13,.72);display:flex;align-items:center;justify-content:center;padding:18px}
.oat-records-modal{position:relative;width:min(1020px,100%);max-height:min(92vh,950px);overflow:auto;background:#f7ead1;color:#44202a;border:6px double #672337;border-radius:20px;box-shadow:0 24px 75px #19080abb;font-family:Georgia,'Times New Roman',serif}
.oat-records-heading{background:linear-gradient(135deg,#fff5e5,#ecd5aa);display:flex;align-items:center;gap:20px;padding:22px 42px 19px;border-bottom:1px solid #bf9c72}
.oat-records-avatar{height:78px;width:78px;flex:0 0 78px;border:3px double #a17b40;border-radius:50%;display:grid;place-items:center;background:#e8d1ab;font-size:35px}
.oat-records-heading h2{font-size:clamp(25px,3vw,38px);color:#551722;margin:0 0 5px;line-height:1.15}
.oat-records-heading p{font-size:15px;margin:0;color:#6d5750}
.oat-records-close{position:absolute;right:15px;top:10px;border:0;background:transparent;color:#531a28;font-size:36px;line-height:1;cursor:pointer;padding:6px 12px}
.oat-records-close:hover,.oat-records-close:focus-visible{background:#f2d6ba}
.oat-records-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;padding:0 20px;border-bottom:2px solid #793047;background:#f3e3cb}
.oat-records-tabs button{color:#5e2633;background:#f9ebd6;font-family:inherit;font-size:15px;cursor:pointer;border:1px solid #c9a78b;border-bottom:0;border-radius:10px 10px 0 0;margin-top:8px;padding:14px 6px}
.oat-records-tabs button[aria-selected='true']{background:#6d1d35;color:#fff8e9;border-color:#6d1d35;font-weight:bold}
.oat-records-main{padding:24px 28px;min-height:250px}
.oat-records-main h3{font-size:25px;color:#6d1d35;margin:0 0 15px}
.oat-records-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}
.oat-records-card{border:1px solid #bf9b78;border-radius:10px;background:#fff4e0;padding:8px;min-width:0}
.oat-records-thumb{display:flex;align-items:center;justify-content:center;aspect-ratio:1.75;background:linear-gradient(145deg,#e9d8bb,#d9bd95);border-radius:6px;overflow:hidden;position:relative}
.oat-records-thumb img{width:100%;height:100%;object-fit:cover}
.oat-records-thumb span{font-size:40px;color:#86536a}
.oat-records-card h4{font-size:16px;margin:9px 2px 3px;color:#5b1d30;line-height:1.25}
.oat-records-card p{font-size:13px;margin:3px 2px 8px;overflow-wrap:anywhere}
.oat-records-card button,.oat-records-card a,.oat-records-action,.oat-records-submit{border:1px solid #7b3347;background:#71233a;color:#fff7ee!important;border-radius:7px;padding:8px 11px;font:inherit;font-size:13px;text-decoration:none;display:inline-block;cursor:pointer}
.oat-records-card button:hover,.oat-records-card a:hover,.oat-records-action:hover{background:#521629}
.oat-records-empty{padding:45px 15px;text-align:center;color:#69555a;border:1px dashed #bd997d;border-radius:9px}
.oat-records-tags{display:flex;gap:7px;flex-wrap:wrap;margin:15px 0}
.oat-records-tag{display:inline-flex;background:#f4dfc2;border:1px solid #ad826b;border-radius:20px;padding:5px 11px;font-size:13px;color:#59283b}
.oat-records-source{border-bottom:1px solid #cfb79c;padding:12px 0}
.oat-records-source strong{color:#6d1d35}
.oat-records-footer{display:flex;justify-content:space-between;align-items:center;gap:15px;flex-wrap:wrap;padding:15px 28px;background:#efddc3;border-top:1px solid #c4a184}
.oat-records-footer a{color:#6d1d35;text-decoration:underline;font-weight:bold}
.oat-records-footer button{background:#6d1d35;color:white;border:0;padding:9px 15px;border-radius:6px;cursor:pointer}
.oat-records-form{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:15px;border:1px solid #c5a185;background:#fff5e5;border-radius:10px;margin:14px 0}
.oat-records-form label{display:flex;flex-direction:column;gap:4px;font-size:14px;font-weight:bold}
.oat-records-form input,.oat-records-form textarea,.oat-records-form select{border:1px solid #b7967b!important;padding:9px!important;color:#36252a!important;background:#fffdf7!important;border-radius:5px;max-width:100%;font:14px system-ui,sans-serif}
.oat-records-form .wide{grid-column:1/-1}
.oat-records-form .oat-records-submit{width:max-content}
.oat-records-picker{border:1px solid #c6a485;background:white;padding:8px;border-radius:7px;max-height:180px;overflow:auto}
.oat-records-picker button{display:block;width:100%;text-align:left;border:none;background:transparent;padding:7px;color:#532438;cursor:pointer}
.oat-records-picker button:hover{background:#f4e3cb}
.oat-records-selected{display:flex;gap:5px;flex-wrap:wrap}
.oat-records-selected button{color:#5c2635;background:#edd9bd;border:1px solid #9b7f69;border-radius:18px;padding:5px 9px;cursor:pointer}
.oat-records-viewer{position:fixed;inset:0;background:#130d11e8;z-index:1000001;display:grid;grid-template-rows:auto minmax(0,1fr);gap:5px;padding:15px;color:#fff}
.oat-records-viewer[hidden]{display:none}
.oat-records-viewer-head{display:flex;justify-content:space-between;gap:10px;align-items:center}
.oat-records-viewer-head button{background:#fff;color:#532438;border:0;border-radius:6px;font-size:21px;padding:5px 13px;cursor:pointer}
.oat-records-viewer-body{min-height:0;overflow:auto;display:flex;justify-content:center;align-items:flex-start}
.oat-records-viewer img{max-width:none;width:auto;height:auto;max-height:100%;object-fit:contain;transform-origin:top center}
.oat-records-viewer iframe{width:100%;height:100%;background:white;border:0}
@media(max-width:700px){.oat-records-overlay{padding:5px}.oat-records-modal{max-height:97vh;border-width:3px}.oat-records-heading{padding:17px 45px 15px 15px;gap:11px}.oat-records-avatar{width:55px;height:55px;flex-basis:55px}.oat-records-tabs{padding:0 6px}.oat-records-tabs button{font-size:11px;padding:11px 3px}.oat-records-main{padding:14px 12px}.oat-records-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.oat-records-footer{padding:12px}.oat-records-form{grid-template-columns:1fr}}
@media(max-width:400px){.oat-records-grid{grid-template-columns:1fr}}

/* Reuse previously uploaded WordPress media without a second upload. */
.oat-records-media-field{align-items:stretch}
.oat-records-media-options{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.oat-records-media-options button{width:max-content;max-width:100%}
.oat-records-media-selected{font-size:12px;font-weight:normal;color:#664c50;overflow-wrap:anywhere}

/* Split-view historical document transcription, with independent scrolling. */
.oat-records-viewer-controls{display:flex;gap:5px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.oat-records-viewer-head{min-width:0;flex-wrap:wrap}
.oat-records-viewer-head strong{overflow-wrap:anywhere}
.oat-records-viewer-head button[data-toggle-notes],.oat-records-viewer-head button[data-edit-notes]{font-size:14px;padding:9px 11px;background:#f5e5c9;color:#672337;font-family:Georgia,serif}
.oat-records-viewer-layout{min-height:0;min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.oat-records-viewer-layout.has-notes{grid-template-columns:minmax(0,1.45fr) minmax(300px,.8fr)}
.oat-records-viewer-body{min-width:0;min-height:0}
.oat-records-viewer-body img{max-width:100%;max-height:100%;object-fit:contain}
.oat-records-notes{min-width:0;min-height:0;overflow-y:auto;background:#f7ead1;color:#482334;border:4px double #9d7658;border-radius:10px;padding:18px;font-family:Georgia,'Times New Roman',serif}
.oat-records-notes[hidden]{display:none!important}
.oat-records-notes h3{color:#70253d;font-size:19px;margin:0 0 9px}
.oat-records-notes section{border-bottom:1px solid #d1b69a;margin:0 0 17px;padding-bottom:15px}
.oat-records-notes p{line-height:1.6;font-size:16px;white-space:normal;overflow-wrap:anywhere}
.oat-records-annotation-form{display:grid;gap:12px}
.oat-records-annotation-form label{display:grid;gap:5px;font-weight:bold}
.oat-records-annotation-form textarea{width:100%;box-sizing:border-box;border:1px solid #a77d66;border-radius:5px;padding:9px;font-size:15px;min-height:80px}
.oat-records-annotation-form button{border:0;background:#71233a;color:white;border-radius:6px;padding:9px 11px;cursor:pointer}
@media(max-width:800px){.oat-records-viewer-layout.has-notes{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(180px,1fr) minmax(180px,1fr)}.oat-records-viewer-controls{justify-content:flex-start}.oat-records-viewer{padding:8px}}

/* v1.4.2: Maintain accessible contrast against dark viewer backgrounds.
   Explicit hover/focus colors override theme-wide button hover styles. */
.oat-records-viewer .oat-records-viewer-head .oat-records-viewer-controls button,
.oat-records-viewer .oat-records-viewer-head .oat-records-viewer-controls button[data-toggle-notes],
.oat-records-viewer .oat-records-viewer-head .oat-records-viewer-controls button[data-edit-notes] {
  background: #f7e9d2 !important;
  color: #562035 !important;
  border: 1px solid #cfab7c !important;
  opacity: 1 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: #562035 !important;
}
.oat-records-viewer .oat-records-viewer-head .oat-records-viewer-controls button:hover,
.oat-records-viewer .oat-records-viewer-head .oat-records-viewer-controls button:focus-visible,
.oat-records-viewer .oat-records-viewer-head .oat-records-viewer-controls button[data-toggle-notes]:hover,
.oat-records-viewer .oat-records-viewer-head .oat-records-viewer-controls button[data-toggle-notes]:focus-visible,
.oat-records-viewer .oat-records-viewer-head .oat-records-viewer-controls button[data-edit-notes]:hover,
.oat-records-viewer .oat-records-viewer-head .oat-records-viewer-controls button[data-edit-notes]:focus-visible {
  background: #79263e !important;
  color: #fff8eb !important;
  border-color: #e3b971 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #fff8eb !important;
}
.oat-records-viewer button:focus-visible,
.oat-records-overlay button:focus-visible,
.oat-records-overlay a:focus-visible {
  outline: 3px solid #d8a853 !important;
  outline-offset: 3px !important;
}
.oat-records-viewer .oat-records-annotation-form button:hover,
.oat-records-viewer .oat-records-annotation-form button:focus-visible {
  background: #552038 !important;
  color: #fff8eb !important;
  -webkit-text-fill-color: #fff8eb !important;
}
.oat-records-modal .oat-records-tabs button:hover,
.oat-records-modal .oat-records-tabs button:focus-visible {
  background: #7a2a44 !important;
  color: #fff8eb !important;
  -webkit-text-fill-color: #fff8eb !important;
}
.oat-records-modal .oat-records-card button:hover,
.oat-records-modal .oat-records-card a:hover,
.oat-records-modal .oat-records-action:hover,
.oat-records-modal .oat-records-submit:hover,
.oat-records-modal .oat-records-footer button:hover,
.oat-records-modal .oat-records-card button:focus-visible,
.oat-records-modal .oat-records-card a:focus-visible,
.oat-records-modal .oat-records-action:focus-visible,
.oat-records-modal .oat-records-submit:focus-visible,
.oat-records-modal .oat-records-footer button:focus-visible {
  background: #542036 !important;
  color: #fff8eb !important;
  -webkit-text-fill-color: #fff8eb !important;
}

/* v1.4.3: Optional, per-person portrait; separate from tagged photos. */
.oat-records-avatar{overflow:hidden;color:#6b2630}
.oat-records-avatar.has-portrait{background:#f7ead4}
.oat-records-avatar img{width:100%;height:100%;display:block;object-fit:cover;object-position:center}
.oat-records-heading-details{min-width:0}
.oat-records-heading .oat-records-portrait-control{display:inline-flex;align-items:center;gap:7px;margin-top:9px;color:#5e2631;font:600 13px/1.4 inherit;cursor:pointer}
.oat-records-heading .oat-records-portrait-control[hidden]{display:none!important}
.oat-records-portrait-control input{accent-color:#701c35;width:16px;height:16px;margin:0}
#oat-records-portrait-status{display:block;font-size:12px;color:#6b2630;margin-top:3px}

/* v1.5.0: reuse gallery cards/citations within Relationship Explorer full profiles */
.oat-gallery-profile-records,.oat-gallery-profile-sources{margin:1.25rem 0 0;padding-top:1rem;border-top:1px solid rgba(100,38,46,.26)}
.oat-gallery-profile-records .oat-records-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,290px));gap:1rem}
.oat-gallery-profile-records .oat-records-card{max-width:300px}
.oat-gallery-profile-sources .oat-records-source{margin:.75rem 0}

/* Chronological, numbered citations: same layout in popup and full profile. */
.oat-records-source-list {list-style:decimal outside; padding-left:2rem; margin:1rem 0;}
.oat-records-source-list > li {display:list-item; padding-left:.35rem; margin-bottom:.9rem;}
.oat-records-source-list > li::marker {color:#691b35;font-weight:700;}
.oat-records-source-list > li p {margin:.35rem 0 .65rem;}
.oat-gallery-profile-sources .oat-records-source-list {max-width:100%;}

/* v1.5.4: A single public Sources section. Keep the legacy source data intact. */
#oat-sources.oat-gallery-sources-unified > .oat-gallery-profile-sources {
  border-top:0; padding-top:0; margin-top:0;
}
#oat-sources.oat-gallery-sources-unified > .oat-gallery-profile-sources > h3 {
  margin-top:0;
}

/* v1.5.5: Show the shared digitized documents as the sole public Records
   section when they exist. The Relationship Explorer data/editor is retained. */
#oat-records.oat-gallery-records-unified > .oat-gallery-profile-records {
  border-top:0; padding-top:0; margin-top:0;
}
#oat-records.oat-gallery-records-unified > .oat-gallery-profile-records > h3 {
  margin-top:0;
}

/* v1.5.6: The legacy Relationship Explorer Records view can be recreated
   after gallery sync. Keep its data, but always show only the gallery section
   while the unified Records view is active. */
#oat-records.oat-gallery-records-unified > :not(.oat-gallery-profile-records) {
  display: none !important;
}
#oat-records.oat-gallery-records-unified > .oat-gallery-profile-records {
  display: block !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
#oat-records.oat-gallery-records-unified > .oat-gallery-profile-records > h3 {
  margin: 0 0 12px !important;
}

/* v1.5.7: Records tab heading and divider-free presentation. */
#oat-records.oat-gallery-records-unified,
#oat-records.oat-gallery-records-unified > .oat-gallery-profile-records {
  border: none !important;
  border-top: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}
#oat-records.oat-gallery-records-unified::before,
#oat-records.oat-gallery-records-unified::after,
#oat-records.oat-gallery-records-unified > .oat-gallery-profile-records::before,
#oat-records.oat-gallery-records-unified > .oat-gallery-profile-records::after {
  content: none !important;
  display: none !important;
  border: 0 !important;
}
#oat-records.oat-gallery-records-unified > .oat-gallery-profile-records > h3 {
  border: none !important;
  margin: 0 0 12px !important;
  padding: 0 !important;
}

/* v1.6.0: On the full-profile Sources tab, show citations without
   ornamental dividers above the heading or after each citation. */
#oat-sources.oat-gallery-sources-unified,
#oat-sources.oat-gallery-sources-unified > .oat-gallery-profile-sources,
#oat-sources.oat-gallery-sources-unified > .oat-gallery-profile-sources > h3,
#oat-sources.oat-gallery-sources-unified .oat-records-source-list,
#oat-sources.oat-gallery-sources-unified .oat-records-source-list > li {
  border-top: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  background-image: none !important;
}
#oat-sources.oat-gallery-sources-unified > .oat-gallery-profile-sources {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
#oat-sources.oat-gallery-sources-unified::before,
#oat-sources.oat-gallery-sources-unified::after,
#oat-sources.oat-gallery-sources-unified > .oat-gallery-profile-sources::before,
#oat-sources.oat-gallery-sources-unified > .oat-gallery-profile-sources::after,
#oat-sources.oat-gallery-sources-unified .oat-records-source-list > li::after {
  content: none !important;
  display: none !important;
}

/* v1.6.3: Fit full scanned page before zooming; zoomed image can scroll to every edge. */
.oat-records-viewer-body{display:block;overflow:auto;overscroll-behavior:contain}
.oat-records-image-stage{display:flex;align-items:center;justify-content:center;max-width:none;max-height:none;box-sizing:border-box}
.oat-records-viewer-body .oat-records-image-stage img{display:block;flex:none;max-width:none!important;max-height:none!important;object-fit:fill;transform:none!important}


/* v1.6.4: Visible collection attribution on displayed scans and thumbnails.
   Does not modify the original historical file or imply ownership of its content. */
.oat-records-watermarked-document{position:relative;flex:none;overflow:hidden;isolation:isolate}
.oat-records-watermarked-document .oat-records-watermark{position:absolute;bottom:7px;right:7px;max-width:calc(100% - 14px);background:rgba(247,234,207,.88);border:1px solid rgba(97,31,47,.55);color:#622336;font:600 12px/1.25 Georgia,serif;letter-spacing:.02em;padding:4px 7px;border-radius:3px;box-sizing:border-box;pointer-events:none;text-align:right;overflow-wrap:anywhere}
.oat-records-thumb{position:relative;isolation:isolate}
.oat-records-thumb:has(img)::after{content:'OurAncestralTree.com';position:absolute;right:4px;bottom:4px;max-width:calc(100% - 8px);padding:2px 4px;border-radius:2px;background:rgba(247,234,207,.88);color:#622336;font:600 10px/1.2 Georgia,serif;pointer-events:none;overflow-wrap:anywhere}
.oat-records-viewer img,.oat-records-thumb img,.oat-records-avatar img{-webkit-user-drag:none;user-select:none;-webkit-user-select:none}
