/* Layout additions; identity, cards and result styling live in oaj-search.css. */
.dof-modes, .dof-actions, .dof-pagination { display:flex; flex-wrap:wrap; gap:.75rem; align-items:center; }
.dof-modes { margin:1.25rem 0; padding-bottom:.75rem; border-bottom:1px solid var(--border-color, #dbe2ea); }
.dof-modes a { padding:.5rem .8rem; border-radius:.6rem; }
.dof-modes a[aria-current] { background:var(--chip-neutral-bg, #edf2f7); color:var(--text-color, #1f2a37); font-weight:700; }
.dof-form { display:flex; flex-wrap:wrap; gap:1rem; align-items:flex-end; }
.dof-field { display:flex; flex:1 1 12rem; flex-direction:column; gap:.35rem; min-width:0; }
.dof-field--wide { flex-basis:26rem; }
.dof-field label { margin:0; font-weight:600; }
.dof-field .mley-field { width:100%; min-width:0; }
.dof-field small { color:var(--text-muted, #667789); }
.dof-results { margin-top:1.75rem; }
.dof-results .mley-oaj-result-footer .mley-oaj-result-authority { display:flex; flex-wrap:wrap; align-items:baseline; gap:.25rem 1rem; }
.dof-results .mley-oaj-result-authority strong { font-weight:700; }
.dof-group { margin-top:1.5rem; }
.dof-pagination { justify-content:center; margin:1.5rem 0; }
.dof-source-footer { display:flex; flex-wrap:wrap; gap:.25rem .5rem; padding:.75rem 1.25rem; border-top:1px solid var(--border-color, #e5e9ee); color:#7a8490; font-size:.75rem; line-height:1.5; }
.dof-source-footer a, .dof-source-footer a:visited { color:inherit; font-size:inherit; font-weight:400; text-decoration:underline; text-underline-offset:.15em; }
:root[data-theme="dark"] .dof-source-footer { color:#a3acb8; }
.dof-document { margin:1.5rem 0; font-family:Arial, sans-serif; font-size:12px; line-height:normal; overflow-wrap:anywhere; overflow-x:auto; }
.dof-document img { max-width:100%; height:auto; }
.dof-document table { border-collapse:collapse; max-width:100%; margin:1rem 0; }
.dof-document td, .dof-document th { border:1px solid var(--border-color, #dbe2ea); padding:.5rem; vertical-align:top; }
.dof-document pre { white-space:pre-wrap; }
.dof-document h1, .dof-document h2, .dof-document h3, .dof-document h4, .dof-document h5, .dof-document h6 { font-family:inherit; font-size:inherit; line-height:inherit; font-weight:700; }
.dof-document [id] { scroll-margin-top:6rem; }
/* Inline badges follow the source font and do not enlarge the line box. */
.dof-document .dof-reference.badge {
  display:inline-block !important;
  position:relative;
  min-width:0;
  min-height:0;
  margin:0;
  padding:.04em .28em !important;
  font-size:.9em;
  line-height:1;
  white-space:nowrap;
  vertical-align:baseline;
  text-indent:0;
  text-align:center;
  box-shadow:none;
}
/* Extend the click area vertically without taking space from the text. */
.dof-document .dof-reference.badge::before {
  content:"";
  position:absolute;
  inset:-.18em 0;
}
.dof-document .dof-reference.badge:focus-visible {
  outline:2px solid var(--link-color, #0d52bf);
  outline-offset:2px;
}
@media (max-width:767.98px) {
  .dof-form { flex-direction:column; align-items:stretch; }
  .dof-field { flex-basis:auto; }
  .dof-actions .btn { width:100%; }
  .dof-modes { gap:.3rem; font-size:.85rem; }
}
.dof-reference-status { font-size: .85rem; color: var(--text-muted, #667789); min-height: 1.5em; margin: .5rem 0; }

.dof-reading-actions { display:flex; gap:.5rem; align-items:center; }
.dof-reading-actions [hidden] { display:none !important; }
.dof-share-button { white-space:nowrap; }
.dof-share-button .mley-icon { margin-right:.3em; }
.dof-find { margin:.75rem 0; font-size:.9rem; }
.dof-find summary { cursor:pointer; color:var(--link-color, #0d52bf); }
.dof-find-form { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; margin:.5rem 0; }
.dof-find-form input { flex:1 1 12rem; min-width:0; }
.dof-reading-status { font-size:.85rem; color:var(--text-muted, #667789); margin:.25rem 0; }
::highlight(mley-dof-search) { background:#ffe28a; color:#17212f; }
.mley-dof-reader.mley-article-window--compact .dof-share-button { padding:.3rem .5rem; min-width:32px; }
.mley-dof-reader.mley-article-window--compact .dof-share-button span { display:none; }
.mley-dof-reader.mley-article-window--compact .dof-share-button .mley-icon { margin:0; }

/* Shared share-menu feedback also works on the lightweight DOF page. */
.mley-share-dialog .mley-share-status{margin:0;padding:0 12px 10px;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.mley-share-dialog .mley-share-status:empty{display:none}
.mley-share-dialog .mley-share-status input{display:block;width:100%;box-sizing:border-box;background:transparent;color:inherit}

/* Advertising stays in the document flow, separated from reading controls. */
.dof-ad-break { list-style: none; padding: 0; margin: 0; }
body[data-page-kind="dof"] [data-ad-slot-wrapper] { margin: 2rem 0; clear: both; }
body[data-page-kind="dof"] .mley-ad-shell--unfilled { margin-block: 1rem; }
body[data-page-kind="dof"] .mley-ad-shell--unfilled .mley-ad-shell__frame { min-height: 0; }

/* Reuse the shared spinner without changing the status text or reading flow. */
body[data-page-kind] .dof-reference-status .dof-reference-spinner {
  width: .9em;
  height: .9em;
  border-width: .12em;
  margin-right: .45em;
  vertical-align: -.1em;
}
@media (prefers-reduced-motion: reduce) {
  body[data-page-kind] .dof-reference-status .dof-reference-spinner { animation: none; }
}
