:root{font:100%/1.45 system-ui,-apple-system,"Segoe UI",sans-serif;color:#282535;background:#f8f7f4;--ink:#282535;--muted:#666475;--purple:#5743b6;--border:#dcd9e1;--surface:#ebeaf0;--accent-wash:#eeeafa;font-synthesis:none}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;min-height:100dvh}
[hidden]{display:none!important}
button,input,select{font:inherit;color:inherit}
button,a,select{touch-action:manipulation}
button{cursor:pointer}
button:disabled{opacity:.4;cursor:default}
:focus-visible{outline:3px solid #8066dd;outline-offset:3px}
.masthead{border-bottom:1px solid #e4e1e6;background:#fcfbf9}
.mast-inner{min-height:3.9rem;max-width:94rem;margin:auto;padding:0 clamp(1rem,4vw,3.25rem);display:flex;align-items:center;justify-content:space-between;gap:.55rem}
.identity,.connection,.download,.tool-group,.page-form{display:inline-flex;align-items:center}
.identity{gap:.55rem;white-space:nowrap}
.brand-logo{display:block;width:auto;height:2.625rem;max-width:10rem;object-fit:contain}
@media(max-width:500px){.brand-logo{height:2.25rem;max-width:8.125rem}}
.identity i,.separator{display:block;background:var(--border);width:1px;height:1.05rem;margin:0 .32rem}
.identity>span,.file-details p{color:var(--muted);font-size:.85rem}
@media(max-width:380px){.identity>i,.identity>span{display:none}}
.connection{gap:.4rem;color:#514b64;font-size:.78rem;font-weight:580}
.connection i{width:.49rem;height:.49rem;background:#ba832f;border-radius:50%}
.connection.online i{background:#42866a}
main{max-width:94rem;margin:auto;padding:0 clamp(.7rem,3.5vw,3.25rem)}
.center-state{min-height:72vh;min-height:72dvh;display:flex;justify-content:center;align-items:center;flex-direction:column;padding:2.5rem .4rem;text-align:center}
.center-state h1{font-size:clamp(1.75rem,4vw,2.35rem);font-weight:700;line-height:1.16;letter-spacing:-.052em;margin:1.25rem 0 .65rem}
.center-state p{color:var(--muted);margin:0;line-height:1.6}
.session-actions{display:flex;align-items:center;gap:clamp(.4rem,2vw,1.3rem)}
.quiet-button{min-height:2.75rem;padding:.35rem .55rem;color:var(--purple);font-size:.85rem;font-weight:630;border:0;border-radius:.4rem;background:transparent}
.quiet-button:hover{background:var(--accent-wash)}
.login-card{width:min(100%,24.5rem);padding:clamp(1.55rem,4vw,2.35rem);border:1px solid #dfdce4;border-radius:1.15rem;background:#fff;text-align:left;box-shadow:0 12px 36px #413b5609}
.tile{width:3.1rem;height:3.1rem;display:grid;place-items:center;background:var(--accent-wash);color:var(--purple);border-radius:.88rem}
.tile svg,.download svg{height:1.45rem;width:1.45rem;stroke:currentColor;stroke-width:1.65;fill:none;stroke-linecap:round;stroke-linejoin:round}
.login-card label{display:block;font-size:.88rem;font-weight:650;margin:1.15rem 0 .4rem}
.login-card input{width:100%;min-height:2.85rem;background:#fbfafc;border:1px solid #c9c4d2;border-radius:.5rem;padding:.64rem .8rem;font-size:1rem}
.password-field{position:relative}
.password-field input{padding-right:4.85rem}
.password-field button{position:absolute;right:.22rem;top:50%;transform:translateY(-50%);min-width:4rem;min-height:2.4rem}
.feedback{color:#9f293e;font-size:.88rem}
.feedback:not(:empty){margin:.55rem 0}
.primary,.secondary,.download{border-radius:.5rem;font-weight:630}
.primary{margin-top:1rem;width:100%;color:white;background:var(--purple);border:1px solid var(--purple);padding:.73rem 1rem}
.primary:hover{background:#48359f}
.secondary{background:#fff;border:1px solid var(--border);padding:.55rem .85rem;margin:1rem .2rem 0}
.empty-card{max-width:23rem}
.sheet-mark{width:5.5rem;height:5.5rem;margin:0 auto;position:relative;background:#eeeaf8;border-radius:1.6rem}
.sheet-mark i,.sheet-mark b{width:2.55rem;height:3.25rem;border:2px solid #9584c9;position:absolute;top:1rem;left:1.22rem;border-radius:.28rem;transform:rotate(-12deg);background:#f5f3fb}
.sheet-mark b{transform:rotate(7deg);left:1.65rem;top:1.1rem;background:white;border-color:#7260ac}
.sheet-mark b:after{content:"";position:absolute;width:1.12rem;height:2px;background:#a69bc1;top:.85rem;left:.45rem;box-shadow:0 .43rem #c2b9d7}
.workspace{width:100%;padding:.95rem 0 max(.8rem,env(safe-area-inset-bottom));height:calc(100vh - 4rem);height:calc(100dvh - 4rem);min-height:17rem;display:flex;flex-direction:column;gap:0}
.file-head{display:flex;align-items:center;gap:.75rem;padding:.1rem .15rem .85rem;min-width:0;flex-shrink:0}
.file-glyph{display:grid;place-items:center;color:var(--purple);background:var(--accent-wash);border:1px solid #ded8ef;border-radius:.53rem;min-width:2.85rem;height:2.85rem;font-size:.65rem;line-height:1;font-weight:750;letter-spacing:.035em}
.file-details{flex:1;min-width:0}
.file-details h1{font-size:clamp(1.02rem,2vw,1.42rem);line-height:1.25;letter-spacing:-.028em;margin:0;font-weight:680;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-details p{margin:.12rem 0 0;font-size:.78rem}
.download{min-height:2.7rem;gap:.4rem;padding:.42rem .8rem;background:white;border:1px solid var(--border);color:#423958;text-decoration:none;font-size:.85rem}
.download svg{width:1.05rem;height:1.05rem}
.download:hover,.secondary:hover,.icon-button:not(:disabled):hover{border-color:#9e91bd;background:#f5f2fc}
.surface{position:relative;min-height:0;flex:1;overflow:hidden;border:1px solid #d9d5df;border-radius:.78rem;background:var(--surface)}
.surface>div:not(.presentation){height:100%}
.presentation{height:100%;width:100%;display:flex;align-items:center;justify-content:center;padding:1rem;overflow:auto}
.surface figure,.surface pre{margin:0}
.image-stage{padding:0;background:#272632}
.image-stage img{object-fit:contain;max-width:100%;max-height:100%;width:100%;height:100%}
.video-stage{padding:0;background:#1b1b22}
.video-stage video{display:block;max-width:100%;width:100%;height:100%;object-fit:contain}
.surface .text-stage,.surface .html-stage{height:100%;overflow:auto;background:#fff}
.surface .text-stage{padding:clamp(1rem,4vw,2.8rem)}
.text-stage pre{white-space:pre-wrap;overflow-wrap:anywhere;font:1rem/1.65 ui-monospace,"SFMono-Regular",Consolas,monospace}
.text-stage .text-notice{margin:1.2rem 0 0;padding:.7rem .85rem;border:1px solid var(--border);border-radius:.4rem;font-size:.84rem;color:var(--muted)}
.html-stage iframe{width:100%;height:100%;border:0;display:block;background:#fff}
.fallback{max-width:30rem;text-align:center;color:var(--muted)}
.fallback strong{display:block;color:var(--ink);font-size:1.12rem;margin-bottom:.45rem}
.fallback p{margin:0}
.loading-wheel{width:1.6rem;height:1.6rem;border:2px solid #d8d2e7;border-top-color:var(--purple);border-radius:50%;animation:turn .9s linear infinite}
@keyframes turn{to{transform:rotate(360deg)}}
#waiting .loading-wheel{margin-bottom:.8rem}
.tool-strip{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:.2rem 1.1rem;flex-shrink:0;padding-top:.55rem}
.tool-strip:has(.tool-group[hidden]+.tool-group[hidden]){display:none}
.tool-group{gap:.16rem;min-height:2.8rem;max-width:100%;font-variant-numeric:tabular-nums}
.icon-button{border:1px solid transparent;background:transparent;border-radius:.45rem;min-width:2.65rem;min-height:2.65rem;font-size:1.55rem;line-height:1;color:#443d55;padding:.15rem .35rem}
.page-form{gap:.3rem;font-size:.85rem;color:#655e70;white-space:nowrap}
.page-form input{width:3.05rem;min-height:2.12rem;padding:.1rem .22rem;text-align:center;background:white;border:1px solid var(--border);border-radius:.36rem;appearance:textfield;-moz-appearance:textfield;font-size:1rem}
.page-form input::-webkit-inner-spin-button{appearance:none}
#zoom-value{font-size:.82rem;color:#50495d;min-width:2.25rem;text-align:center}
.tool-group select{width:auto;max-width:min(40vw,16rem);padding:.44rem .45rem;border:1px solid var(--border);border-radius:.4rem;background:white;font-size:1rem}
.file-message{font-size:.85rem;line-height:1.35;margin:.45rem .3rem 0;color:#7a3541}
.pdf-scroll{height:100%;width:100%;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;position:relative;-webkit-overflow-scrolling:touch}
.pdf-stack{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:.72rem;margin:0 auto;padding:.7rem 0;min-height:100%}
.pdf-sheet{position:relative;flex:none;background:white;box-shadow:0 1px 4px #302d4930;overflow:hidden}
.pdf-sheet canvas{display:block;width:100%;height:100%}
.pdf-sheet:empty:after{content:attr(data-number);position:absolute;top:.5rem;right:.7rem;color:#827a91;font-size:.78rem}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(min-width:740px){.workspace{padding-top:1.3rem}.file-head{padding-bottom:1.1rem}.surface{border-radius:1rem}.tool-strip{padding-top:.6rem}}
@media(max-width:500px){.mast-inner{min-height:3.25rem}.workspace{height:calc(100vh - 3.3rem);height:calc(100dvh - 3.3rem);padding-top:.7rem}.file-head{gap:.55rem}.file-glyph{height:2.4rem;min-width:2.4rem}.download{min-width:2.6rem;justify-content:center;padding:.4rem}.download span{display:none}.icon-button{min-width:2.4rem}.tool-strip{gap:0}.tool-group{min-height:2.57rem}.pdf-controls .separator{margin:0 .1rem}}
@media(prefers-reduced-motion:reduce){.loading-wheel{animation-duration:2.5s}}
