:root{
  color-scheme:dark;
  --ink:#061019;
  --panel:#0b1822;
  --panel-2:#10232e;
  --line:#29404b;
  --text:#f6f8f9;
  --muted:#9eacb5;
  --lime:#d7ff16;
  --pink:#ed007a;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--ink);color:var(--text);font-family:Arial,Helvetica,sans-serif;letter-spacing:0}
body{overflow:hidden}
button,input{font:inherit;letter-spacing:0}
button,a{touch-action:manipulation}
.viewer-header{
  height:84px;
  display:grid;
  grid-template-columns:minmax(170px,1fr) minmax(240px,auto) minmax(170px,1fr);
  align-items:center;
  gap:20px;
  padding:12px 28px;
  border-bottom:1px solid var(--line);
  background:#050d14;
}
.viewer-brand{display:inline-flex;width:max-content;align-items:center}
.viewer-brand img{display:block;width:148px;height:auto}
.viewer-title{text-align:center;min-width:0}
.viewer-title span{display:block;color:var(--lime);font-size:11px;font-weight:900;text-transform:uppercase}
.viewer-title h1{margin:3px 0 0;font-size:20px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.viewer-back{
  justify-self:end;
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:10px 16px;
  border:1px solid var(--line);
  border-radius:8px;
  color:var(--text);
  text-decoration:none;
  font-weight:800;
}
.viewer-back:hover{border-color:var(--lime);color:var(--lime)}
.viewer-main{height:calc(100vh - 84px);display:grid;grid-template-rows:auto minmax(0,1fr)}
.viewer-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  min-height:68px;
  padding:10px 28px;
  border-bottom:1px solid var(--line);
  background:var(--panel);
}
.viewer-toolbar__group{display:flex;align-items:center;gap:8px}
.icon-button,.fit-button,.viewer-mobile-nav button{
  min-width:44px;
  height:44px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel-2);
  color:var(--text);
  font-weight:900;
  cursor:pointer;
}
.icon-button{font-size:25px;line-height:1}
.icon-button:hover,.fit-button:hover,.viewer-mobile-nav button:hover{border-color:var(--lime);color:var(--lime)}
button:disabled{opacity:.35;cursor:not-allowed}
.page-field{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:14px;font-weight:800}
.page-field input{
  width:70px;
  height:44px;
  padding:8px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#07131c;
  color:var(--text);
  text-align:center;
  font-weight:900;
}
.page-field strong{color:var(--text)}
.viewer-zoom output{width:58px;text-align:center;color:var(--muted);font-size:14px;font-weight:900}
.fit-button{padding:0 14px}
.viewer-stage{
  position:relative;
  min-height:0;
  overflow:auto;
  padding:28px;
  background:
    linear-gradient(rgba(255,255,255,.022) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.022) 1px,transparent 1px),
    #07121a;
  background-size:40px 40px;
  scrollbar-color:#52636d #0a151e;
}
.viewer-stage__inner{position:relative;display:flex;justify-content:center;align-items:flex-start;min-width:100%;min-height:100%}
.viewer-stage__inner.is-fit{align-items:center}
.viewer-page{
  display:block;
  flex:0 0 auto;
  width:100%;
  max-width:none;
  height:auto;
  background:#fff;
  box-shadow:0 18px 60px rgba(0,0,0,.45);
}
.viewer-page.is-loading{opacity:0}
.viewer-loading{
  position:absolute;
  top:40%;
  left:50%;
  transform:translate(-50%,-50%);
  padding:12px 18px;
  border-radius:8px;
  background:var(--panel);
  color:var(--muted);
  font-weight:800;
}
.viewer-loading[hidden]{display:none}
.viewer-mobile-nav{display:none}
@media(max-width:760px){
  body{overflow:hidden}
  .viewer-header{height:68px;grid-template-columns:112px minmax(0,1fr) 48px;gap:10px;padding:10px 14px}
  .viewer-brand img{width:110px}
  .viewer-title{text-align:left}
  .viewer-title span{font-size:9px}
  .viewer-title h1{font-size:15px}
  .viewer-back{width:44px;min-height:44px;padding:0;justify-content:center;font-size:0}
  .viewer-back span{font-size:22px}
  .viewer-main{height:calc(100vh - 68px);grid-template-rows:auto minmax(0,1fr) 62px}
  .viewer-toolbar{min-height:58px;padding:7px 12px;justify-content:center}
  .viewer-toolbar .icon-button[data-action="first"],
  .viewer-toolbar .icon-button[data-action="previous"],
  .viewer-toolbar .icon-button[data-action="next"],
  .viewer-toolbar .icon-button[data-action="last"],
  .page-field>span:first-child{display:none}
  .viewer-toolbar__group{gap:6px}
  .page-field{gap:5px}
  .page-field input{width:58px;height:42px}
  .viewer-zoom .icon-button{height:42px;min-width:42px}
  .fit-button{height:42px;padding:0 10px;font-size:13px}
  .viewer-stage{padding:12px}
  .viewer-mobile-nav{
    display:grid;
    grid-template-columns:1fr auto 1fr;
    align-items:center;
    gap:8px;
    padding:8px 12px;
    border-top:1px solid var(--line);
    background:var(--panel);
  }
  .viewer-mobile-nav button{padding:0 12px;font-size:13px}
  .viewer-mobile-nav button:last-child{justify-self:end}
  .viewer-mobile-nav span{min-width:64px;text-align:center;color:var(--muted);font-size:12px;font-weight:900}
}
@media(max-width:390px){
  .viewer-header{grid-template-columns:96px minmax(0,1fr) 44px}
  .viewer-brand img{width:94px}
  .viewer-title h1{font-size:13px}
  .viewer-zoom output{width:48px;font-size:12px}
  .fit-button{padding:0 8px}
}
