/* Shared reader chrome. Legal content and window geometry remain in adapters. */
.mley-reader-header.mley-reader-header { position:relative; display:flex; flex-wrap:nowrap; align-items:center; gap:4px; padding:6px 8px; min-height:56px; flex:none; box-sizing:border-box; border-bottom:1px solid var(--border-color); background:var(--bg-surface); color:var(--text-color); }
.mley-reader-header > :is(h1,h2,.modal-title) { flex:1 1 0; min-width:0; max-width:none; margin:0!important; font:var(--weight-semibold) var(--text-small)/var(--leading-compact) var(--font-ui); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.mley-reader-header__primary,.mley-reader-header__controls { display:flex; flex:none; align-items:center; gap:2px; margin:0!important; }
.mley-reader-header__primary:empty { display:none; }
.mley-article-window .modal-header.mley-reader-header { display:flex; }
.mley-reader-header .mley-reader-header__menu { flex:1 0 100%; order:1; box-sizing:border-box; max-width:100%; max-height:min(50vh,360px); overflow:auto; overscroll-behavior:contain; padding:10px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-surface); }
.mley-reader-header__identity { font:var(--weight-semibold) var(--text-small)/var(--leading-ui) var(--font-ui); margin:0 0 10px; white-space:normal; overflow-wrap:anywhere; color:var(--text-color); }
.mley-reader-header .mley-window-control-tooltip { white-space:normal; overflow-wrap:anywhere; }
.mley-reader-header .mley-window-law { min-width:44px; min-height:44px; }
.mley-reader-header :is(button,a):focus-visible { outline:2px solid var(--accent-color); outline-offset:-2px; }
.mley-reader-header :is(.mley-reader-header__primary,.mley-reader-header__controls) > :is(button,a), .mley-pdf-mobile-bar > button { min-width:44px; min-height:44px; flex-shrink:0; }
.mley-reader-header.mley-reader-header :is(.mley-reader-header__primary,.mley-reader-header__controls,.mley-reader-header__menu) :is(button,a[href]) { min-height:44px; }
:is(.mley-reader-header__primary,.mley-reader-header__controls,.mley-pdf-mobile-bar) > [data-reader-command] { display:inline-flex!important; align-items:center; justify-content:center; width:44px!important; height:44px!important; min-width:44px!important; padding:0!important; border:0!important; border-radius:8px; background:transparent!important; color:var(--text-color)!important; font-size:0!important; line-height:0!important; }
:is(.mley-reader-header__primary,.mley-reader-header__controls,.mley-pdf-mobile-bar) > [data-reader-command] > * { display:none!important; }
:is(.mley-reader-header__primary,.mley-reader-header__controls,.mley-pdf-mobile-bar) > [data-reader-command]::before { content:""; width:20px; height:20px; background:currentColor; mask:var(--reader-icon) center/contain no-repeat; }
:is(.mley-reader-header__primary,.mley-reader-header__controls,.mley-pdf-mobile-bar) > [data-reader-command]:not(:disabled):hover { background:var(--surface-accent)!important; color:var(--accent-color)!important; }
[data-reader-command]:disabled { opacity:.45; cursor:default; }
.mley-reader-header__menu > :is(button,a) { display:flex; align-items:center; width:100%; min-height:44px; padding:8px 10px; text-align:left; font-size:var(--text-small); }
#mley-pdf-panel[data-reader-shell] { display:flex; flex-direction:column; gap:0; }
#mley-pdf-panel[data-reader-shell] .mley-pdf-heading { flex:none; }
#mley-pdf-panel[data-reader-shell] .mley-pdf-toolbar { display:none; }
#mley-pdf-panel[data-reader-shell] #mley-pdf-frame { flex:1 1 0; width:100%; min-height:0; height:0; }
#mley-pdf-panel[data-reader-shell] .mley-pdf-heading h2 span { font:inherit; }
#mley-pdf-panel[data-reader-shell] .mley-pdf-more { transform:none; }
.mley-reader-header__menu [data-reader-command] { width:auto; font-size:var(--text-small); }
@media(max-width:1099px) {
  .mley-reader-header.mley-reader-header { padding:4px; min-height:53px; }
}
/* Each adapter moves the live share control when its own reader becomes compact. */
[data-reader-command="save"] { --reader-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%203h12v18l-6-4-6%204z%22/%3E%3C/svg%3E"); }
[data-reader-command="more"] { --reader-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%225%22%20cy%3D%2212%22%20r%3D%221%22/%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%221%22/%3E%3Ccircle%20cx%3D%2219%22%20cy%3D%2212%22%20r%3D%221%22/%3E%3C/svg%3E"); }
[data-reader-command="minimize"] { --reader-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%2018h14%22/%3E%3C/svg%3E"); }
[data-reader-command="expand"] { --reader-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%203H3v5m13-5h5v5M3%2016v5h5m13-5v5h-5%22/%3E%3C/svg%3E"); }
[data-reader-command="close"] { --reader-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%206%2012%2012M18%206%206%2018%22/%3E%3C/svg%3E"); }
[data-reader-command="search"] { --reader-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%226%22/%3E%3Cpath%20d%3D%22m15%2015%206%206%22/%3E%3C/svg%3E"); }
[data-reader-command="previous"] { --reader-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m14%205-7%207%207%207%22/%3E%3C/svg%3E"); }
[data-reader-command="next"] { --reader-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m10%205%207%207-7%207%22/%3E%3C/svg%3E"); }

.mley-reader-header [hidden][hidden], .mley-pdf-mobile-bar [hidden][hidden] { display:none!important; }
.mley-pdf-mobile-menu > [data-reader-command="save"] > svg { display:none; }
.mley-reader-header__menu #mley-pdf-download-open { width:100%; height:auto; min-height:44px; justify-content:flex-start; gap:10px; padding:8px 10px; }

[data-reader-command="expand"][aria-pressed="true"] { --reader-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%208h5V3m8%200v5h5M8%2021v-5H3m18%200h-5v5%22/%3E%3C/svg%3E"); }
.mley-reader-header__controls > [data-header-share] { border:0!important; border-radius:8px; background:transparent; color:var(--text-color); }
.mley-reader-header__controls > [data-header-share]:hover { background:var(--surface-accent); color:var(--accent-color); }
.mley-reader-header__menu .mley-share-label { display:inline!important; }
.mley-reader-header__menu [data-header-share] { width:100%; min-height:44px; justify-content:flex-start; gap:8px; }
.mley-reader-header__primary .mley-view-pdf-action button { min-height:44px; }


/* The tools open over the reading area so the header stays in one row. */
.mley-reader-header.mley-reader-header .mley-reader-header__menu {
  position:absolute; z-index:70; inset:calc(100% + 4px) 8px auto auto;
  width:min(340px, calc(100% - 16px)); box-shadow:0 8px 24px #0002;
}
.mley-article-window--compact .mley-reader-header .mley-window-law-help,
.mley-article-window--compact .mley-reader-header .modal-title > [aria-hidden="true"] { display:none; }
.mley-reader-header__controls > [data-header-share] {
  width:44px; height:44px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
}
.mley-reader-info-body :is(.dof-note-details,.sjf-reader-meta) { margin:0 0 12px; }
.modal.mley-article-window--inline .modal-header.mley-reader-header .modal-title { flex:1 1 0; }
.mley-reader-header__menu > [data-reader-command="expand"]::after { content:attr(aria-label); }
.mley-reader-header__menu > [data-reader-command="expand"] > span { display:none; }
.mley-dof-note-page #contain_id .mley-reader-header > .dof-note-title {
  font:var(--weight-semibold) var(--text-small)/var(--leading-compact) var(--font-ui);
}
dialog.mley-reader-info {
  position:fixed;
  inset:0;
  box-sizing:border-box;
  width:min(620px, calc(100vw - 24px));
  max-height:min(760px, calc(100dvh - 24px));
  margin:auto;
  padding:0;
  overflow:hidden;
  border:1px solid var(--border-color);
  border-radius:16px;
  background:var(--bg-surface);
  color:var(--text-color);
  box-shadow:0 20px 56px #0004;
  font-size:var(--text-small);
}
dialog.mley-reader-info[open] { display:flex; flex-direction:column; }
dialog.mley-reader-info::backdrop { background:rgb(15 23 42 / .56); }
.mley-reader-info-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:16px clamp(14px, 4vw, 24px);
  border-bottom:1px solid var(--border-color);
}
.mley-reader-info-heading h2 { margin:0; font-size:var(--text-heading); }
.mley-reader-info-heading p { margin:4px 0 0; }
dialog.mley-reader-info .mley-reader-info-heading button {
  display:grid; place-items:center; width:44px; height:44px; padding:0;
  border:0; border-radius:8px; background:transparent; color:var(--text-color);
  font-size:24px; line-height:1; cursor:pointer;
}
.mley-reader-info-heading button:hover { background:var(--surface-accent); }
.mley-reader-info :focus-visible { outline:2px solid var(--accent-color); outline-offset:2px; }
.mley-reader-info-trigger { cursor:pointer; }
.mley-reader-header__controls > .mley-reader-info-trigger {
  box-sizing:border-box; width:44px; height:44px; padding:0; border:0; border-radius:8px;
  background:transparent; color:var(--text-color); font-size:0; line-height:0;
}
.mley-reader-header__controls > .mley-reader-info-trigger::before {
  content:"i"; display:grid; place-items:center; margin:auto; width:18px; height:18px;
  box-sizing:border-box; border:1.5px solid currentColor; border-radius:50%;
  font:var(--weight-semibold) 13px/1 var(--font-ui);
}
.mley-reader-header__controls > .mley-reader-info-trigger:hover { background:var(--surface-accent); }
.mley-reader-info-body { padding:16px clamp(14px, 4vw, 24px) 20px; overflow:auto; overscroll-behavior:contain; }
.mley-reader-info-body #mley-pdf-detail-status {
  margin:0 0 8px;
  padding:10px 12px;
  border-radius:8px;
  background:var(--bg-surface-2);
  color:var(--text-color);
}
.mley-reader-info-body .mley-pdf-source-links { gap:4px 16px; padding-bottom:8px; }
.mley-reader-info-body .mley-pdf-source-links a:not([hidden]) { display:inline-flex; align-items:center; min-height:44px; }
.mley-reader-info-body :is(select, button) { min-height:44px; max-width:100%; }
.mley-reader-info .mley-reader-info-body dl { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:0 16px; }
.mley-reader-info-body dl > div { min-width:0; padding:10px 0; border-bottom:1px solid var(--border-color); }
.mley-reader-info-body dt { color:var(--text-muted); }
.mley-reader-info-body dd { margin:4px 0 0; overflow-wrap:anywhere; }
.mley-pdf-info-fingerprint { grid-column:1 / -1; }
.mley-pdf-info-fingerprint code { display:block; margin-top:4px; padding:7px 9px; border-radius:6px; background:var(--bg-surface-2); }
@media (max-width:440px) {
  .mley-reader-info .mley-reader-info-body dl { grid-template-columns:minmax(0, 1fr); }
}
.mley-reader-info-body h3 { margin:0 0 8px; font-size:var(--text-heading); }
.mley-reader-info-body :is(h2,h3,p,dd,a) { overflow-wrap:anywhere; }
