.app-shell{height:100dvh;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;background:var(--bg);overflow:hidden}
.topbar{min-height:calc(54px + var(--safe-t));display:flex;align-items:center;padding:var(--safe-t) var(--safe-r) 5px var(--safe-l);background:var(--chrome);border-bottom:1px solid var(--line);position:relative;z-index:40}
.frame-side{display:flex;align-items:center;position:relative;z-index:2}.frame-left{justify-content:flex-start;gap:9px;min-width:0}.frame-right{justify-content:flex-end;margin-left:auto}.frame-btn{width:var(--control);height:var(--control);min-width:var(--control);border:1px solid transparent;border-radius:12px;background:transparent;display:grid;place-items:center;cursor:pointer}.frame-btn:hover,.frame-btn:focus-visible{background:var(--toolbar-hover);border-color:var(--line);outline:none}.frame-btn svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round}
.document-title{position:absolute;left:50%;transform:translateX(-50%);width:min(458px,52vw);max-width:calc(100% - 150px);height:38px;display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;z-index:1}.pdf-icon{width:30px;height:30px;flex:0 0 auto;filter:drop-shadow(0 3px 7px rgba(180,35,24,.16))}.title-text{height:100%;min-width:0;flex:1 1 auto;border:1px solid var(--line);border-radius:11px;background:var(--control-bg);display:flex;align-items:center;justify-content:center;padding:0 28px 0 12px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}.dirty-dot{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:7px;height:7px;border-radius:999px;background:var(--accent);opacity:0}.dirty-dot.visible{opacity:1}
.statusbar{min-height:34px;padding:0 var(--safe-r) var(--safe-b) var(--safe-l);background:var(--chrome);border-top:1px solid var(--line);display:flex;align-items:center;gap:14px;color:var(--muted);font-size:12px;white-space:nowrap;overflow-x:auto;scrollbar-width:none}.statusbar::-webkit-scrollbar{display:none}.statusbar span{flex:0 0 auto}.statusbar .status-spacer{flex:1 1 auto}
.backdrop{position:fixed;inset:0;z-index:100;background:var(--overlay);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}.drawer{position:fixed;z-index:110;top:calc(var(--safe-t) + 58px);left:var(--safe-l);width:min(330px,calc(100vw - var(--safe-l) - var(--safe-r)));max-height:calc(100dvh - var(--safe-t) - var(--safe-b) - 80px);overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:18px;box-shadow:0 22px 58px rgba(15,23,42,.28);padding:12px}.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:5px 5px 11px 7px;border-bottom:1px solid var(--line);margin-bottom:8px}.drawer-title{display:flex;align-items:center;gap:8px;font-weight:760}.drawer-icon{width:30px;height:30px}.close-btn{width:36px;height:36px;border:0;border-radius:10px;background:transparent;display:grid;place-items:center;cursor:pointer}.close-btn:hover{background:var(--toolbar-hover)}.close-btn svg,.menu-item svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.close-btn svg{width:18px;height:18px}.drawer-section-label{padding:9px 10px 5px;color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}.menu-list{display:grid;gap:3px}.menu-item{height:48px;border:0;border-radius:12px;background:transparent;display:grid;grid-template-columns:27px 1fr auto;align-items:center;gap:10px;padding:0 11px;text-align:left;cursor:pointer;font-weight:650}.menu-item:hover,.menu-item:focus-visible{background:var(--toolbar-hover);outline:none}.menu-item:disabled{opacity:.45;cursor:default;color:var(--muted)}.menu-item:disabled:hover{background:transparent}.menu-item svg{width:20px;height:20px}.menu-item .hint{font-size:11px;font-weight:500;color:var(--muted)}.appearance-switch{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;padding:4px}.appearance-choice{min-height:36px;border:1px solid var(--line);border-radius:10px;background:transparent}.appearance-choice.active{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.error-overlay{position:fixed;inset:0;z-index:160;background:var(--overlay);display:grid;place-items:center;padding:20px}.error-card{width:min(430px,100%);background:var(--panel);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:20px}.error-card h2{margin:0 0 8px}.error-card p{margin:7px 0}.error-card .muted{color:var(--muted)}.error-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.error-actions button{min-height:40px;border:1px solid var(--line);border-radius:10px;background:var(--paper);padding:0 14px}.error-actions .primary{background:var(--accent);border-color:var(--accent);color:white}
@media(max-width:640px){.topbar{min-height:calc(60px + var(--safe-t));padding-bottom:6px}.frame-left{gap:6px}.frame-btn{width:40px;height:40px;min-width:40px}.document-title{width:52vw;max-width:calc(100% - 126px);min-width:150px;height:40px;gap:7px}.pdf-icon{width:27px;height:27px}.title-text{font-size:15px;padding-left:9px;padding-right:23px}.dirty-dot{right:7px}.statusbar{gap:10px}}
@media(max-width:360px){.document-title{width:50vw;min-width:118px}.pdf-icon{display:none}.title-text{font-size:14px}}
@media(pointer:fine){.topbar{min-height:calc(46px + var(--safe-t));padding-bottom:4px}.frame-btn{width:36px;height:36px;min-width:36px;border-radius:9px}.frame-btn svg{width:19px;height:19px}.document-title{height:34px}.pdf-icon{width:27px;height:27px}.title-text{border-radius:9px;font-size:14px}.drawer{top:calc(var(--safe-t) + 52px)}}
