/* Layout additions; identity, cards and result styling live in oaj-search.css. */
.dof-reader-loading { display:flex; align-items:center; gap:.75rem; min-height:5rem; }
.dof-reader-loading p { margin:0; }
.dof-reader-actions { display:flex; align-items:center; flex-wrap:wrap; gap:1rem; }
.dof-reader-actions > a { padding:.6rem 0; }
.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:var(--weight-bold); }
.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:var(--weight-semibold); }
.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:var(--weight-bold); }
.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:var(--text-caption); line-height:var(--leading-ui); }
.dof-source-footer a, .dof-source-footer a:visited { color:inherit; font-size:inherit; font-weight:var(--weight-regular); 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:var(--text-small); }
}
.dof-reference-status { font-size: var(--text-small); color: var(--text-muted, #667789); min-height: 1.5em; margin: .5rem 0; }
.mley-ner-entity { text-decoration: underline dotted; text-underline-offset: .18em; cursor: help; }

.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:var(--text-small); }
.dof-find summary { cursor:pointer; color:var(--accent-color); }
.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:var(--text-small); color:var(--text-muted, #667789); margin:.25rem 0; }
::highlight(mley-dof-search) { background:#ffe28a; color:#17212f; }
.mley-dof-reader.mley-article-window--compact .modal-header .dof-share-button { padding:.3rem .5rem; min-width:32px; }
.mley-dof-reader.mley-article-window--compact .modal-header .dof-share-button span { display:none; }
.mley-dof-reader.mley-article-window--compact .modal-header .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:var(--text-caption);line-height:var(--leading-ui);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; }
}

/* Standalone DOF uses the shared law/article reader frame and actions. */
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-note-return a { display:inline-flex; gap:.5rem; align-items:center; min-height:44px; margin-bottom:12px; color:var(--reader-link); font-size:var(--text-small); }
:is(.mley-dof-note-page, .mley-dof-reading-surface) #contain_id header.dof-note-heading h1 { font-size:clamp(1.25rem, 2vw, 1.65rem); line-height:1.35; letter-spacing:-.02em; margin-bottom:16px; }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-note-heading p { margin:0 0 .4rem; line-height:1.5; }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-note-date { color:var(--reader-ink); font-weight:var(--weight-semibold); }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-note-authority, :is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-note-meta { color:var(--reader-muted); font-size:var(--text-small); }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-reading-actions { flex-wrap:wrap; }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-find { margin:0 0 24px; padding-bottom:16px; border-bottom:1px solid var(--reader-border); }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-find-controls { display:flex; gap:8px; width:100%; min-width:0; }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-find-controls input { flex:1; width:100%; min-width:0; min-height:44px; padding:10px 12px; border:1px solid var(--reader-border); border-radius:11px; background:var(--reader-surface); color:var(--reader-ink); font:inherit; }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-find-options { width:100%; }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-find-options summary { display:flex; align-items:center; min-height:44px; width:fit-content; color:var(--reader-link); }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-find-options summary::after { content:'+'; margin-left:.5rem; }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-find-options[open] summary::after { content:'−'; }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-find-options select { min-height:44px; max-width:100%; color:var(--reader-ink); background:var(--reader-surface); }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-note-source { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.5rem 1rem; padding-top:16px; border-top:1px solid var(--reader-border); color:var(--reader-muted); font-size:var(--text-small); }
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-note-source a { display:inline-flex; align-items:center; gap:.4rem; min-height:44px; color:var(--reader-link); }
:is(.mley-dof-note-page, .mley-dof-reading-surface) input::placeholder { color:var(--reader-muted); opacity:1; }

/* The floating shell retains shared window controls; only reading content changes. */
.mley-dof-reading-surface .modal-body { background:var(--reader-background); padding:clamp(12px, 2vw, 24px); }
.mley-dof-reading-surface .modal-body .card { border:1px solid var(--reader-border); border-radius:22px; background:var(--reader-surface); color:var(--reader-ink); box-shadow:var(--reader-shadow); margin-bottom:20px; }
.mley-dof-reading-surface .dof-note-heading, .mley-dof-reading-surface .dof-note-reading > .card-body { padding:clamp(18px, 2vw, 28px); }
.mley-dof-reading-surface .dof-reader-title { font:var(--weight-semibold) clamp(1.2rem, 2vw, 1.6rem)/1.35 var(--reader-font); color:var(--reader-ink); margin:0 0 16px; overflow-wrap:anywhere; }
.mley-dof-reading-surface .mley-reader-heading__eyebrow { letter-spacing:.08em; }
.mley-dof-reading-surface .modal-body :is(button,a,input,summary,select):focus-visible { outline:3px solid var(--reader-focus); outline-offset:3px; }
.mley-dof-reading-surface .modal-body .dof-note-heading { display:block; min-width:0; }
.mley-dof-reading-surface .modal-body .dof-note-heading > * { max-width:100%; width:auto; }
.mley-dof-reading-surface .modal-body .dof-reader-title { white-space:normal; overflow:visible; text-overflow:clip; }

/* Responsive metadata shared by full page and floating reader. */
:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-note-details {
  display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:18px 20px;
  margin:24px 0 0; padding:0; text-align:left;
}
.dof-note-details > div { min-width:0; }
.dof-note-details .dof-meta-date { grid-area:1 / 1 / 2 / 3; }
.dof-note-details .dof-meta-edition { grid-area:1 / 3 / 2 / 5; }
.dof-note-details .dof-meta-code { grid-area:1 / 5 / 2 / 7; }
.dof-note-details .dof-meta-authority { grid-area:2 / 1 / 3 / 5; }
.dof-note-details .dof-meta-section { grid-area:2 / 5 / 3 / 6; }
.dof-note-details .dof-meta-page { grid-area:2 / 6 / 3 / 7; }
.dof-note-details dt { margin:0 0 4px; color:var(--reader-muted); font:var(--weight-regular) var(--text-caption)/1.4 var(--reader-font); }
.dof-note-details dd { margin:0; color:var(--reader-ink); font:var(--weight-semibold) var(--text-small)/1.5 var(--reader-font); overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.dof-note-details .dof-meta-authority dd { font-size:var(--text-caption); font-weight:var(--weight-medium); }
@container (max-width:600px) {
  :is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-note-details { gap:16px 12px; }
  .dof-note-details .dof-meta-date { grid-area:1 / 1 / 2 / 4; }
  .dof-note-details .dof-meta-edition { grid-area:1 / 4 / 2 / 7; }
  .dof-note-details .dof-meta-authority { grid-area:2 / 1 / 3 / 7; }
  .dof-note-details .dof-meta-code { grid-area:3 / 1 / 4 / 3; }
  .dof-note-details .dof-meta-section { grid-area:3 / 3 / 4 / 5; }
  .dof-note-details .dof-meta-page { grid-area:3 / 5 / 4 / 7; }
}

:is(.mley-dof-note-page, .mley-dof-reading-surface) .dof-reading-footer { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; margin:24px 0 16px; padding-top:16px; border-top:1px solid var(--reader-border); }
.mley-dof-reading-surface .modal-header :is([data-overlay-button="save-article"],[data-overlay-button="share-document"]) { display:none; }
