.library-workspace{box-sizing:border-box;width:min(960px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:24px;border:1px solid #d7e2ee;border-radius:16px;color:#0a2342;background:#fff;font:15px/1.5 system-ui,sans-serif;overflow:auto}.library-workspace::backdrop{background:#061c35a6}.library-workspace *{box-sizing:border-box}.library-workspace header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.library-workspace h2{font-size:24px;margin:0 0 12px}.library-workspace h3{font-size:18px;margin:0 0 12px}.library-workspace h4{font-size:16px}.library-workspace form,.library-workspace section{border-top:1px solid #d7e2ee;padding-top:20px;margin-top:20px}.library-workspace label{display:flex;flex-direction:column;gap:5px;margin-bottom:12px;font-weight:600}.library-workspace input,.library-workspace select,.library-workspace textarea{font:inherit;color:inherit;min-width:0;width:100%;padding:9px 11px;border:1px solid #a8bace;border-radius:7px;background:white}.library-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.library-workspace button{font:inherit;min-height:42px;padding:8px 13px;border-radius:8px;border:1px solid #a8bace;background:#f5f9fd;color:#12375d;cursor:pointer}.library-workspace button:disabled{opacity:.55;cursor:wait}.library-workspace :focus-visible{outline:3px solid #2589ec;outline-offset:2px}.library-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.library-workspace .library-row{display:flex;justify-content:space-between;align-items:center;gap:16px;text-align:left;width:100%;margin:10px 0;padding:12px;background:white}.library-row>span:first-child{min-width:0;overflow-wrap:anywhere}.library-row small{display:block;color:#52657d;margin-top:3px}.library-state{flex-shrink:0;border-radius:999px;padding:3px 9px;background:#eaf2ff;color:#164d91;font-size:12px}.library-state[data-state=published],.library-state[data-state=accepted]{background:#e8f5ed;color:#176438}.library-state[data-state=changes_requested],.library-state[data-state=prepared]{background:#fff3d9;color:#79520a}.library-state[data-state=rejected]{background:#fce9ea;color:#982c33}.library-workspace dl{display:grid;grid-template-columns:170px 1fr;gap:6px 12px}.library-workspace dd{margin:0;overflow-wrap:anywhere}.library-workspace [role=status]{padding:10px 12px;background:#edf4fb;border-radius:8px;overflow-wrap:anywhere}.library-workspace [data-recovery]:empty{display:none}.library-workspace [data-recovery]{padding:12px;background:#fff8e8;border-radius:8px}.library-workspace p{margin:10px 0}@media(max-width:600px){.library-workspace{padding:16px;width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.library-grid{grid-template-columns:1fr}.library-workspace h2{font-size:21px}.library-workspace .library-row{align-items:flex-start;flex-direction:column;gap:8px}.library-workspace dl{grid-template-columns:1fr;gap:2px}.library-workspace dd{margin-bottom:8px}}
.library-workspace [hidden]{display:none!important}
.library-state[data-state=historical]{background:#eef1f5;color:#52657d}
.library-workspace [data-return-list]{margin-bottom:12px}
.library-workspace [data-service-reference-text]{overflow-wrap:anywhere}

/* Published lookup entrance only; separate reading and source workspaces remain. */
.published-document-search form { display:flex; flex-wrap:wrap; align-items:end; gap:12px; }
.published-document-search form label { flex:1 1 320px; min-width:0; margin:0; }
.published-document-search form [role=status] { flex-basis:100%; margin:0; }
@media(max-width:600px){.published-document-search form label{flex-basis:100%}.published-document-search form button{width:100%}}

/* Lookup presentation only: one visible result title; focus fallback remains accessible. */
.library-workspace .library-list-focus-heading { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.library-workspace [data-library-list-section]:has(> .library-list-focus-heading:focus) { outline:2px solid #2563eb; outline-offset:3px; }
.library-workspace [data-status][data-routine-status] { padding:0; background:transparent; margin:8px 0; color:#52657d; }
.library-workspace [data-detail]{overflow-wrap:anywhere}
.library-workspace[data-linked-asset] header>div{min-width:0;overflow-wrap:anywhere}
.library-workspace[data-linked-asset] h2{overflow-wrap:anywhere}
.library-workspace[data-linked-asset] button,.library-workspace[data-linked-asset] input{min-height:44px}

/* Separate the linked asset identity from the document heading on small screens. */
.library-workspace[data-linked-asset] .library-linked-asset-context { margin:0 0 12px; color:#52657d; font-size:14px; }
.library-workspace[data-linked-asset] .library-linked-asset-context :is(strong,span) { display:block; }
.library-workspace[data-linked-asset] [data-pages]:empty { display:none; }
@media(max-width:600px) { .library-workspace[data-linked-asset] h2 { margin-bottom:6px; font-size:21px; line-height:1.3; } }

/* Reading-only phone surface: one scroll owner and compact source-backed results. */
@media(max-width:640px), (max-width:900px) and (max-height:500px){
 html:has(dialog.library-workspace[data-reading][open]),body:has(dialog.library-workspace[data-reading][open]){overflow:hidden}
 .library-workspace[data-reading]{width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:16px 16px max(20px,env(safe-area-inset-bottom));overscroll-behavior:contain}
 .library-workspace[data-reading] header{gap:12px}
 .library-workspace[data-reading] header>div{min-width:0;overflow-wrap:anywhere}
 .library-workspace[data-reading] h2{font-size:21px;line-height:1.3}
 .library-workspace[data-reading] button,.library-workspace[data-reading] input{min-height:44px}
 .library-workspace[data-reading] .library-row{align-items:flex-start;flex-direction:column;gap:8px;margin:0;padding:12px 0;border:0;border-radius:0}
 .library-workspace[data-reading] .library-state{max-width:100%;white-space:normal;overflow-wrap:anywhere}
 .library-workspace[data-reading] .library-phone-result{border-top:1px solid #d7e2ee;padding:6px 0 12px}
 .library-workspace[data-reading] .library-phone-details{margin:8px 0;overflow-wrap:anywhere}
 .library-workspace[data-reading] .library-phone-details>summary{padding:10px 0;min-height:44px;color:#164d91;cursor:pointer;font-weight:600}
 .library-workspace[data-reading] .library-phone-details p{white-space:pre-wrap}
 .library-workspace[data-reading] .library-reading-actions{margin:12px 0}
 .library-workspace[data-reading] .library-reading-actions [data-open]{background:#164d91;color:#fff;border-color:#164d91}
 .library-workspace[data-reading] dl{grid-template-columns:1fr;gap:2px}
 .library-workspace[data-reading] dd{margin-bottom:8px}
}

@media (max-width:640px), (max-width:900px) and (max-height:500px) {
  .library-workspace [data-status][data-routine-status] {
    position:absolute; width:1px; height:1px; margin:-1px; padding:0;
    overflow:hidden; clip-path:inset(50%); white-space:nowrap;
  }
}

/* Reading views keep routine announcements accessible without a second visual status band. */
.library-workspace[data-reading] [data-status][data-routine-status] {
  position:absolute; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
.library-workspace[data-reading] [data-library-list-section],
.library-workspace[data-reading] [data-library-search-form] {
  border-top:0; margin-top:12px; padding-top:0;
}
/* My private library uses the shared page shell and its own document rows. */
.op-scope .owner-library-toolbar,
.op-scope .owner-library-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.op-scope .owner-library-toolbar {
  justify-content: space-between;
}

.op-scope .owner-library-toolbar [aria-pressed="true"] {
  background: var(--op-status-blue-bg);
  border-color: var(--op-status-blue-border);
  color: var(--op-status-blue-fg);
}

.op-scope .owner-library .op-button:disabled,
.op-scope .owner-library-leave .op-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.op-scope .owner-library-documents {
  min-width: 0;
  overflow-wrap: anywhere;
}

.op-scope .owner-library-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.op-scope .owner-library-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 8px 0;
  border-top: 1px solid var(--op-slate-200);
}

.op-scope .owner-library-row > :first-child {
  flex: 1 1 14rem;
  min-width: 0;
}

.op-scope .owner-library .op-field input {
  min-width: 0;
}

.op-scope .owner-library-leave {
  margin-bottom: 12px;
}

.op-scope .owner-library-leave .owner-library-actions,
.op-scope .owner-library .op-alert .owner-library-actions {
  margin-top: 8px;
}

.op-scope .owner-library-status-quiet {
  display: contents;
}

.op-scope .owner-library-status-quiet [role="status"]:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.owner-library-pdf.op-document-viewer--compact {
  width: min(60rem, calc(100vw - 32px));
}

.owner-library-pdf.op-document-viewer--compact > header {
  grid-template-columns: auto minmax(0, 1fr);
}

.owner-library-pdf.op-document-viewer--compact .op-pdf-page {
  scrollbar-gutter: stable;
}

.owner-library-pdf.op-document-viewer--compact .op-pdf-controls {
  flex-wrap: wrap;
}

.owner-library-pdf.op-document-viewer--compact .op-pdf-controls button[aria-expanded] {
  width: auto;
  max-width: 100%;
  padding-inline: 10px;
  font-size: 0.875rem;
  white-space: nowrap;
}

@media (max-width: 600px), (max-height: 500px) {
  .owner-library-pdf.op-document-viewer--compact {
    width: 100vw;
  }
}


.library-workspace[data-document-work] [data-routine-status] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.library-workspace[data-document-work] .library-work-view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.library-workspace[data-document-work] .library-work-view-bar h3 {
  margin: 0;
}
.library-workspace[data-document-work] [data-library-search-form] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) auto;
  align-items: end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 0;
  border: 0;
}
.library-workspace[data-document-work] [data-library-search-form] label {
  margin: 0;
}
.library-workspace[data-document-work] .library-work-group {
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  margin: 12px 0;
  padding: 0;
}
.library-workspace[data-document-work] .library-work-group h4 {
  margin: 0;
  padding: 8px 12px;
  background: #f2f6fa;
  border-radius: 8px 8px 0 0;
  overflow-wrap: anywhere;
}
.library-workspace[data-document-work] .library-work-group .library-row {
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-top: 1px solid #d7e2ee;
  border-radius: 0;
}
.library-workspace[data-document-work] .library-work-group .library-row:last-child {
  border-radius: 0 0 8px 8px;
}
.library-workspace[data-document-work] .library-work-group .library-row:focus-visible {
  position: relative;
  outline-offset: -2px;
}
.library-workspace[data-document-work] .library-work-row-action {
  color: #164d91;
  font-weight: 600;
}
.library-workspace[data-document-work] .library-correction-context {
  margin: 12px 0;
  padding: 12px;
  border-left: 3px solid #a8bace;
  background: #f2f6fa;
  overflow-wrap: anywhere;
}
.library-workspace[data-document-work] .library-full-note {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
@media (max-width: 600px) {
  .library-workspace[data-document-work] [data-library-search-form] {
    grid-template-columns: minmax(0, 1fr);
  }
  .library-workspace[data-document-work] .library-work-group .library-row {
    flex-direction: row;
    flex-wrap: wrap;
  }
}


/* Manufacturer Documents keeps the product and its document action together. */
.op-scope .product-library-list--compact .product-library-list-row {
  min-width: 0;
  padding: 10px 12px;
  gap: 8px 12px;
  overflow-wrap: anywhere;
}
.op-scope .product-library-list--compact .product-library-actions {
  gap: 6px;
}
.op-scope .product-library-actions .manufacturer-document-action {
  background: var(--op-blue-600);
  border-color: var(--op-blue-600);
  color: var(--op-white);
}
.op-scope .product-library-actions .manufacturer-document-action:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
.library-workspace .library-linked-product-context {
  margin: 4px 0 0;
  color: #52657d;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .op-scope .product-library-list--compact .product-library-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .op-scope .product-library-list--compact .product-library-list-row > :first-child,
  .op-scope .product-library-list--compact .product-library-actions {
    grid-column: 1 / -1;
  }
}
@media (max-width: 600px) {
  .op-scope .product-library-list--compact .product-library-actions .op-button {
    width: auto;
    min-height: 44px;
  }
}

