html.resource-viewer-open,
html.resource-viewer-open body{
  height:100%;
  overflow:hidden!important;
  overscroll-behavior:none;
}
.resource-viewer-overlay{
  position:fixed;
  inset:0;
  z-index:4000;
  box-sizing:border-box;
  display:grid;
  width:100vw;
  height:100vh;
  height:100dvh;
  padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  background:#25332ccf;
  backdrop-filter:blur(10px);
}
.resource-viewer-shell{
  display:grid;
  min-width:0;
  min-height:0;
  grid-template-rows:auto minmax(0,1fr);
  width:min(1180px,100%);
  height:100%;
  margin:auto;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--paper);
  box-shadow:0 28px 80px #111d1766;
}
.resource-viewer-toolbar{
  display:grid;
  min-width:0;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  min-height:54px;
  padding:8px 10px;
  border-bottom:1px solid var(--line);
  background:var(--paper);
}
.resource-viewer-back{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:38px;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--paper);
  color:var(--ink);
  font:inherit;
  font-size:11px;
  font-weight:750;
}
.resource-viewer-title{min-width:0}
.resource-viewer-title strong,
.resource-viewer-title small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.resource-viewer-title strong{font-size:12px}
.resource-viewer-title small{margin-top:1px;color:var(--muted);font-size:9px}
.resource-viewer-external{white-space:nowrap;text-decoration:none}
.resource-viewer-document{
  display:block;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  border:0;
  background:#f1f2ee;
}
@media(max-width:650px){
  .resource-viewer-overlay{
    padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    background:var(--paper);
    backdrop-filter:none;
  }
  .resource-viewer-shell{width:100%;border:0;border-radius:0;box-shadow:none}
  .resource-viewer-toolbar{
    gap:8px;
    min-height:56px;
    padding:7px max(8px,env(safe-area-inset-right)) 7px max(8px,env(safe-area-inset-left));
  }
  .resource-viewer-back{min-width:44px;min-height:44px;padding:8px}
  .resource-viewer-back span:last-child{max-width:90px}
  .resource-viewer-external{display:inline-flex;min-height:40px;align-items:center;padding-inline:9px;font-size:10px}
}
