
@font-face{font-family:Plex;src:url('/fonts/plex-400.woff2') format('woff2');font-weight:400}
@font-face{font-family:Plex;src:url('/fonts/plex-600.woff2') format('woff2');font-weight:600}
@font-face{font-family:Plex;src:url('/fonts/plex-700.woff2') format('woff2');font-weight:700}
:root{--navy:#0D1333;--ink:#1B2040;--muted:#6E7393;--line:#E3E5EF;--mist:#F6F7FB;--cyan:#13A9E0;--violet:#8B6CF0;--gold:#C9A227;--bg:#e7e9f1}
*{box-sizing:border-box}
html,body{margin:0;height:100%;font-family:Plex,system-ui,-apple-system,sans-serif;color:var(--ink);background:var(--bg)}
button{font-family:inherit;cursor:pointer}
[hidden]{display:none!important}
svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.login{position:fixed;inset:0;display:grid;place-items:center;background:radial-gradient(circle at 20% 10%,#2b2f7a,#0D1333 60%);padding:20px}
.login-card{background:#fff;border-radius:18px;padding:30px 26px;width:min(380px,100%);text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.35)}
.login-logo{height:54px;margin-bottom:8px}
.login-card h1{font-size:20px;margin:6px 0}
.login-card p{color:var(--muted);margin:0 0 16px;font-size:14px}
.login-card input{width:100%;font:inherit;font-size:17px;padding:12px 14px;border:1.5px solid var(--line);border-radius:12px;text-align:center}
.login-card input:focus{outline:none;border-color:var(--cyan)}
.login-card button{margin-top:12px;width:100%;font-size:17px;font-weight:700;padding:12px;border:0;border-radius:12px;background:linear-gradient(90deg,#4338A8,#13A9E0);color:#fff}
.login-err{color:#c0263f;min-height:22px;margin-top:8px;font-size:14px}
.app{display:flex;flex-direction:column;height:100%;height:100dvh}
.top{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--navy);color:#fff;padding:8px 14px;min-height:54px}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand img{width:30px;height:30px;background:#fff;border-radius:8px;padding:3px}
.brand div{display:flex;flex-direction:column;line-height:1.25;min-width:0}
.brand b{font-size:15px;white-space:nowrap}
.save{font-size:12px;color:#9fe0f7}
.save.dirty{color:#ffd27a}.save.err{color:#ff9aa9}
.top-tools{display:flex;align-items:center;gap:6px}
.tb{display:inline-grid;place-items:center;min-width:36px;height:36px;border:0;border-radius:9px;background:transparent;color:inherit;font-size:15px;font-weight:700;padding:0 6px}
.top .tb:hover{background:rgba(255,255,255,.12)}
.tb:disabled{opacity:.35;cursor:default}
.sep{width:1px;height:24px;background:rgba(255,255,255,.2);margin:0 2px}
.zoom{display:flex;align-items:center}
.zv{background:transparent;border:0;color:#fff;font:600 13px Plex,sans-serif;min-width:52px}
.btn{border:0;border-radius:10px;padding:9px 14px;font-size:14px;font-weight:700;background:linear-gradient(90deg,#4338A8,#13A9E0);color:#fff;white-space:nowrap}
.btn.ghost{background:rgba(255,255,255,.1)}
.btn:disabled{opacity:.6}
.menu{position:fixed;top:56px;left:10px;z-index:50;background:#fff;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.25);overflow:hidden;min-width:200px}
.menu button{display:block;width:100%;text-align:right;padding:13px 16px;border:0;background:#fff;font-size:15px;border-bottom:1px solid var(--line)}

.kbd{display:inline-flex;align-items:center;gap:6px;background:rgba(255,255,255,.1);color:#cfd6f5;border:1px solid rgba(255,255,255,.14);border-radius:10px;padding:6px 10px;font-size:13px}
.kbd:hover{background:rgba(255,255,255,.18);color:#fff}
.kbd kbd{font:600 11px system-ui;background:rgba(255,255,255,.14);border-radius:5px;padding:1px 6px;direction:ltr}
.tb.lang{font-size:12.5px;border:1px solid rgba(255,255,255,.22);min-width:38px}
.btn svg{width:14px;height:14px;fill:currentColor;stroke:none;margin-inline-end:5px;vertical-align:-2px}
.btn{transition:transform .12s ease,filter .15s}.btn:hover{filter:brightness(1.1)}.btn:active{transform:scale(.96)}
.tb{transition:background .15s,transform .1s}.tb:active{transform:scale(.92)}

.work{flex:1;display:flex;min-height:0;position:relative}
/* side panel: elements + pages */
.side{width:232px;flex:none;display:flex;flex-direction:column;background:#f4f5fa;border-inline-end:1px solid var(--line);min-height:0}
.side-tabs{display:flex;gap:4px;padding:8px 8px 0}
.side-tabs button{flex:1;border:0;background:transparent;border-radius:10px 10px 0 0;padding:9px 4px;font-size:14px;font-weight:700;color:var(--muted);position:relative}
.side-tabs button.on{background:#fff;color:var(--navy);box-shadow:0 -1px 0 var(--line)}
.side-tabs button.on::after{content:"";position:absolute;inset-inline:22%;top:0;height:3px;border-radius:0 0 3px 3px;background:linear-gradient(90deg,#8B6CF0,#13A9E0);animation:grow .25s ease}
@keyframes grow{from{transform:scaleX(.2);opacity:0}}
.side-body{flex:1;min-height:0;background:#fff;position:relative;overflow:hidden}
.panel{position:absolute;inset:0;overflow-y:auto;padding:12px;opacity:0;visibility:hidden;transform:translateX(12px);transition:opacity .2s,transform .22s cubic-bezier(.2,.8,.2,1),visibility 0s .22s}
[dir=ltr] .panel{transform:translateX(-12px)}
.panel.on{opacity:1;visibility:visible;transform:none;transition:opacity .2s,transform .22s cubic-bezier(.2,.8,.2,1)}
.panel-hint{font-size:12.5px;color:var(--muted);margin:0 0 10px;line-height:1.6}
.el-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.el{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:76px;border:1px solid var(--line);border-radius:12px;background:var(--mist);font-size:12.5px;font-weight:600;color:var(--ink);cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;transition:transform .14s,box-shadow .18s,border-color .18s;padding:4px}
.el:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(13,19,51,.12);border-color:#b9e6f7}
.el:active{cursor:grabbing;transform:scale(.97)}
.el .pv{display:grid;place-items:center;height:30px;color:var(--navy)}
.el .pv svg{width:26px;height:26px}
.el-sub{font-size:12.5px;font-weight:700;color:var(--muted);margin:16px 2px 8px}
.ic-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.ic-grid .el{height:46px;border-radius:10px}
.ic-grid .el svg{width:22px;height:22px;color:#0b7fae}
.ghost-drag{position:fixed;z-index:200;pointer-events:none;transform:translate(-50%,-50%) scale(1.04) rotate(-2deg);box-shadow:0 14px 34px rgba(13,19,51,.28);opacity:.94;background:#fff;border:2px solid var(--cyan);border-radius:12px;padding:8px 12px;font:700 13px Plex,sans-serif;color:var(--navy);transition:transform .12s}
.ghost-drag.over{transform:translate(-50%,-50%) scale(1.1) rotate(0)}
/* thumbnails */
.thumbs{display:flex;flex-direction:column;align-items:center;gap:16px;padding:4px 0 6px;position:relative}
.th{position:relative;display:block;width:132px;border:2px solid transparent;border-radius:7px;background:#fff;box-shadow:0 1px 6px rgba(13,19,51,.14);cursor:pointer;padding:0;transition:border-color .15s,box-shadow .2s,transform .2s;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.th:hover{box-shadow:0 6px 18px rgba(13,19,51,.2)}
.th.on{border-color:var(--cyan)}
.th.lift{z-index:5;transform:scale(1.06) rotate(-1deg);box-shadow:0 18px 40px rgba(13,19,51,.35);transition:box-shadow .2s,transform .12s;cursor:grabbing}
.th .box{display:block;width:128px;height:181px!important;overflow:hidden!important;position:relative;border-radius:5px;pointer-events:none}
.th .n{position:absolute;bottom:-1px;left:50%;transform:translate(-50%,50%);background:var(--navy);color:#fff;font-size:11px;font-weight:700;border-radius:999px;padding:0 8px}
.th .acts{position:absolute;top:4px;inset-inline-start:4px;display:flex;flex-direction:column;gap:4px;opacity:0;transition:opacity .15s}
.th:hover .acts,.th.on .acts{opacity:1}
.th .acts span{display:grid;place-items:center;width:26px;height:26px;border-radius:8px;background:rgba(13,19,51,.82);color:#fff;font-size:13px}
.th .acts span:hover{background:var(--cyan)}
.th .acts span.del:hover{background:#E0395A}
.th .grip{position:absolute;top:4px;inset-inline-end:4px;width:26px;height:26px;border-radius:8px;background:rgba(255,255,255,.92);display:grid;place-items:center;color:var(--muted);touch-action:none;cursor:grab;box-shadow:0 1px 4px rgba(0,0,0,.15)}
.th .grip svg{width:15px;height:15px}
.th.bad{border-color:#E0395A}
.th.bad::after{content:"!";position:absolute;bottom:6px;right:6px;background:#E0395A;color:#fff;font-size:11px;font-weight:800;border-radius:50%;width:18px;height:18px;display:grid;place-items:center}
.drop-line{position:absolute;height:3px;border-radius:3px;background:var(--cyan);box-shadow:0 0 0 3px rgba(19,169,224,.2);pointer-events:none;transition:top .12s,left .12s}
.add-page{display:block;margin:10px auto 0;width:132px;border:1.5px dashed #b8bdd6;background:transparent;border-radius:10px;padding:10px;color:var(--muted);font-weight:700;font-size:13px;transition:border-color .15s,color .15s}
.add-page:hover{border-color:var(--cyan);color:#0b7fae}
/* canvas */
.canvas{flex:1;position:relative;min-width:0;background:var(--bg);overflow:hidden}
.canvas iframe{position:absolute;inset:0;width:100%;height:100%;border:0;background:var(--bg)}
.canvas.drop-ok::after{content:"";position:absolute;inset:0;border:3px dashed rgba(19,169,224,.55);border-radius:6px;pointer-events:none;animation:fadein .15s}
@keyframes fadein{from{opacity:0}}
.ovf-warn{position:absolute;top:10px;left:50%;transform:translateX(-50%);background:#E0395A;color:#fff;font-size:13px;font-weight:600;padding:6px 14px;border-radius:999px;box-shadow:0 4px 14px rgba(0,0,0,.2);z-index:5;cursor:pointer;animation:drop .25s ease}
@keyframes drop{from{transform:translate(-50%,-12px);opacity:0}}
/* floating context toolbar */
.ctx{position:absolute;z-index:30;display:flex;align-items:center;gap:2px;background:#fff;border-radius:14px;padding:4px;box-shadow:0 10px 30px rgba(13,19,51,.22),0 0 0 1px rgba(13,19,51,.06);white-space:nowrap;transition:opacity .14s,transform .16s cubic-bezier(.2,.8,.2,1);transform-origin:50% 100%}
.ctx.hide{opacity:0;transform:translateY(6px) scale(.97);pointer-events:none}
.ctx .tb{color:var(--ink);min-width:32px;height:32px;font-size:14px;border-radius:9px}
.ctx .tb:hover{background:var(--mist)}
.ctx .tb.on{background:#e3f5fc;color:#0b7fae}
.ctx .tb.danger{color:#c0263f}
.ctx .tb.ai{color:#6b46d9;font-size:12.5px;padding:0 9px;gap:4px;display:inline-flex}
.ctx .tb.ai:hover{background:#f1ecff}
.ctx svg{width:17px;height:17px}
.ctx .nm{font-size:11.5px;font-weight:700;color:#fff;background:var(--cyan);border-radius:8px;padding:3px 8px;margin-inline-end:2px;cursor:pointer;display:inline-flex;align-items:center;gap:3px}
.ctx .nm:hover{background:#0b8fc2}
.ctx .fs{min-width:40px;text-align:center;font-size:12.5px;font-weight:700}
.ctx .sw1{width:20px;height:20px;border-radius:6px;border:1px solid rgba(0,0,0,.18);display:inline-block}
.ctx .sw1.fill{border-radius:50%}
.ctx .sep{background:var(--line);height:20px;margin:0 3px}
.ctx .dir{font:700 11px system-ui;letter-spacing:.3px}
.pop{position:fixed;z-index:90;background:#fff;border-radius:14px;box-shadow:0 14px 40px rgba(13,19,51,.25);padding:10px;width:228px;animation:popin .16s cubic-bezier(.2,.8,.2,1)}
@keyframes popin{from{opacity:0;transform:translateY(6px) scale(.96)}}
.pop .sws{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.pop .sws button{width:24px;height:24px;border-radius:50%;border:1px solid rgba(0,0,0,.15);padding:0;transition:transform .1s}
.pop .sws button:hover{transform:scale(1.15)}
.pop label{display:flex;align-items:center;justify-content:space-between;margin-top:10px;font-size:12.5px;color:var(--muted);gap:8px}
.pop input[type=color]{width:44px;height:28px;border:0;padding:0;background:none}
.pop .none{margin-top:8px;width:100%;border:1px solid var(--line);background:var(--mist);border-radius:9px;padding:6px;font-size:12.5px}
/* chat */
.chat{width:330px;flex:none;display:flex;flex-direction:column;background:#fff;border-inline-start:1px solid var(--line)}
.chat-head{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line)}
.chat-head b{font-size:15px}
.helper{font-size:12px;color:#0F9488}.helper.off{color:#c0263f}
.chat-list{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:10px}
.msg{max-width:92%;padding:9px 12px;border-radius:14px;font-size:14px;line-height:1.7;white-space:pre-wrap;word-break:break-word;animation:msgin .22s cubic-bezier(.2,.8,.2,1)}
@keyframes msgin{from{opacity:0;transform:translateY(8px)}}
.msg.me{align-self:flex-start;background:linear-gradient(90deg,#4338A8,#3a5fd0);color:#fff;border-end-start-radius:4px}
.msg.ai{align-self:flex-end;background:var(--mist);border:1px solid var(--line);border-end-end-radius:4px}
.msg.sys{align-self:center;background:transparent;color:var(--muted);font-size:12.5px;text-align:center}
.msg .acts{display:flex;gap:8px;margin-top:8px}
.msg .acts button{border:0;border-radius:9px;padding:6px 14px;font-weight:700;font-size:13px}
.msg .acts .ok{background:#0F9488;color:#fff}
.msg .acts .no{background:#fff;border:1px solid var(--line);color:var(--ink)}
.msg .st{display:block;font-size:12px;color:var(--muted);margin-top:4px}
.typing{display:inline-flex;gap:4px}.typing i{width:6px;height:6px;border-radius:50%;background:var(--muted);animation:tp 1s infinite}.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes tp{0%,80%{opacity:.25}40%{opacity:1}}
.chat-target{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 12px 8px;padding:6px 10px;border-radius:10px;background:#e9f7fd;border:1px solid #bfe8f8;color:#0b6f99;font-size:12.5px;font-weight:600;animation:msgin .2s}
.chat-target button{border:0;background:transparent;color:inherit;font-size:13px}
.chat-sugg{display:flex;flex-wrap:wrap;gap:6px;padding:0 12px 8px}
.chip{border:1px solid var(--line);background:var(--mist);color:var(--ink);border-radius:999px;padding:6px 12px;font-size:13px;font-weight:600;white-space:nowrap;transition:border-color .15s,transform .1s}
.chip:hover{border-color:var(--cyan)}.chip:active{transform:scale(.96)}
.chat-form{display:flex;gap:8px;padding:10px 12px 12px;border-top:1px solid var(--line)}
.chat-form textarea{flex:1;resize:none;font:inherit;font-size:15px;border:1.5px solid var(--line);border-radius:12px;padding:8px 10px;max-height:120px;transition:border-color .15s}
.chat-form textarea:focus{outline:none;border-color:var(--cyan)}
.chat-form button{width:44px;border:0;border-radius:12px;background:linear-gradient(90deg,#4338A8,#13A9E0);color:#fff;display:grid;place-items:center}
[dir=rtl] .chat-form button svg{transform:scaleX(-1)}
/* modals */
.modal{position:fixed;inset:0;background:rgba(13,19,51,.45);display:grid;place-items:center;z-index:60;padding:14px;animation:fadein .15s}
.modal-card{background:#fff;border-radius:16px;width:min(520px,100%);max-height:80vh;display:flex;flex-direction:column;padding:16px;animation:popin .2s cubic-bezier(.2,.8,.2,1)}
.modal-head{display:flex;justify-content:space-between;align-items:center}
.muted{color:var(--muted);font-size:13px}
.v-list{overflow-y:auto;display:flex;flex-direction:column;gap:6px}
.v-row{display:flex;justify-content:space-between;align-items:center;gap:8px;border:1px solid var(--line);border-radius:10px;padding:8px 10px}
.v-row b{font-size:14px}.v-row span{font-size:12px;color:var(--muted);display:block}
.v-row button{border-radius:9px;padding:7px 12px;background:var(--mist);font-weight:700;border:1px solid var(--line)}
.pal{place-items:start center;padding-top:12vh}
.pal-card{background:#fff;border-radius:16px;width:min(560px,100%);box-shadow:0 30px 80px rgba(0,0,0,.35);overflow:hidden;animation:popin .18s cubic-bezier(.2,.8,.2,1)}
.pal-in{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line)}
.pal-in svg{color:var(--muted)}
.pal-in input{flex:1;border:0;font:inherit;font-size:17px;outline:none;background:transparent}
.pal-list{max-height:52vh;overflow-y:auto;padding:6px}
.pal-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-radius:10px;font-size:14.5px;cursor:pointer}
.pal-item.on{background:#e9f7fd;color:#0b6f99}
.pal-item small{color:var(--muted);font-size:12px;direction:ltr}
.pal-item.ai b{color:#6b46d9}
.pal-foot{font-size:12px;color:var(--muted);padding:8px 16px;border-top:1px solid var(--line);background:var(--mist)}
.toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:var(--navy);color:#fff;padding:10px 18px;border-radius:12px;font-size:14px;z-index:80;box-shadow:0 8px 24px rgba(0,0,0,.3);max-width:90vw;text-align:center;animation:toastin .26s cubic-bezier(.2,.8,.2,1)}
@keyframes toastin{from{opacity:0;transform:translate(-50%,14px) scale(.96)}}
.pv-bar{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:10px;background:#0D1333;color:#fff;padding:8px 10px 8px 14px;border-radius:14px;box-shadow:0 10px 30px rgba(0,0,0,.3);z-index:70;font-size:14px;white-space:nowrap;animation:toastin .26s}
.pv-bar button{border:0;border-radius:10px;padding:8px 16px;font-weight:700;font-size:14px}
.pv-bar .ok{background:#0F9488;color:#fff}.pv-bar .no{background:#fff;color:#0D1333}
/* presentation */
.show{position:fixed;inset:0;z-index:300;background:radial-gradient(circle at 50% 30%,#1a2150,#070a1c 75%);display:block;overflow:hidden;animation:fadein .3s;user-select:none;-webkit-user-select:none}
.show-stage{position:absolute;inset:0;perspective:1600px}
.show-pg{position:absolute;left:50%;top:50%;width:794px;height:1123px;transform-origin:center center;box-shadow:0 30px 90px rgba(0,0,0,.55);border-radius:2px;background:#fff;overflow:hidden}
.show-bar{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:8px;background:rgba(13,19,51,.72);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:#fff;border-radius:14px;padding:6px 10px;font-size:14px;transition:opacity .4s;white-space:nowrap}
.show.idle .show-bar{opacity:0}
.show-bar button,.show-bar select{border:0;background:rgba(255,255,255,.12);color:#fff;border-radius:9px;height:34px;min-width:34px;font:600 14px Plex,sans-serif;padding:0 10px}
.show-bar select{-webkit-appearance:none;appearance:none;background-color:rgba(255,255,255,.14)!important;padding:0 12px}
.show-bar select option{color:#000;background:#fff}
.show-bar button:hover{background:rgba(255,255,255,.22)}
.show-bar .x{background:#E0395A}
.sh-anim{display:flex;align-items:center;gap:5px;font-size:13px}
#shCount{min-width:54px;text-align:center;font-weight:700;direction:ltr}
.m-only{display:none!important}
@media (max-width:900px){
  .d-only{display:none!important}
  .m-only{display:flex!important}
  .top{padding:6px 8px;min-height:50px;gap:4px}
  .brand img{width:26px;height:26px}
  .brand b{font-size:13px}
  .save{font-size:11px}
  .top-tools{gap:2px}
  .btn{padding:8px 9px;font-size:12.5px}
  #showBtn span{display:none}#showBtn svg{margin:0}
  .tb{min-width:32px}
  .side,.chat{display:none}
  .work.t-els .side,.work.t-pages .side{display:flex;position:absolute;inset:0;width:auto;z-index:20;border:0}
  .work.t-els .side-tabs,.work.t-pages .side-tabs{display:none}
  .work.t-chat .chat{display:flex;position:absolute;inset:0;width:auto;z-index:20;border:0}
  .el-grid{grid-template-columns:repeat(3,1fr)}
  .ic-grid{grid-template-columns:repeat(6,1fr)}
  .thumbs{display:grid;grid-template-columns:repeat(2,1fr);justify-items:center;gap:22px 10px}
  .th .acts{opacity:1}
  .tabs{display:flex;border-top:1px solid var(--line);background:#fff;padding-bottom:env(safe-area-inset-bottom)}
  .tabs button{flex:1;border:0;background:#fff;padding:12px 2px;font-size:13.5px;font-weight:600;color:var(--muted);transition:color .15s}
  .tabs button.on{color:#0b7fae;box-shadow:inset 0 3px 0 var(--cyan)}
  .chat-form textarea{font-size:16px}
  .ctx{position:absolute;left:6px!important;right:6px!important;top:auto!important;bottom:8px!important;overflow-x:auto;scrollbar-width:none;border-radius:14px;transform-origin:50% 100%}
  .ctx::-webkit-scrollbar{display:none}
  .ctx .tb{min-width:38px;height:38px}
  .pv-bar{bottom:calc(64px + env(safe-area-inset-bottom))}
  .ovf-warn{font-size:12px;padding:5px 12px;max-width:92%;white-space:normal;text-align:center}
  .pal{padding-top:8vh}
  .show-bar{bottom:calc(10px + env(safe-area-inset-bottom));gap:5px;padding:5px 6px}
  .sh-anim span{display:none}
}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

.toast-act{margin-inline-start:12px;border:0;border-radius:8px;background:rgba(255,255,255,.18);color:#fff;font:700 13px Plex,sans-serif;padding:4px 10px}
.toast-act:hover{background:rgba(255,255,255,.3)}
.work.peek .side{opacity:0;pointer-events:none;transform:translateY(30px);transition:opacity .2s,transform .25s}

.ctx{max-width:calc(100% - 16px);flex-wrap:wrap;justify-content:center;row-gap:2px}
.brand div{overflow:hidden}.save{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:900px){.ctx{flex-wrap:nowrap;justify-content:flex-start}.save{max-width:96px}}

/* ---------- v3: zoom menu, right-click menu, shortcuts panel, thin scrollbars ---------- */
.zv{cursor:pointer;border-radius:8px}.zv:hover{background:rgba(255,255,255,.12)}
.zv::after{content:"▾";font-size:9px;margin-inline-start:4px;opacity:.7}
.zmenu,.cmenu{position:fixed;z-index:95;background:#fff;border-radius:12px;box-shadow:0 14px 40px rgba(13,19,51,.28),0 0 0 1px rgba(13,19,51,.06);padding:6px;min-width:176px;animation:popin .14s cubic-bezier(.2,.8,.2,1);color:#1B2040}
.zmenu button,.cmenu button{display:flex;align-items:center;gap:10px;width:100%;border:0;background:transparent;padding:8px 10px;border-radius:8px;font:600 13.5px Plex,system-ui,sans-serif;color:inherit;text-align:start;cursor:pointer}
.zmenu button:hover,.cmenu button:hover,.cmenu button:focus-visible{background:#EEF3FF;outline:none}
.zmenu button.on{color:#0b7fae;background:#E8F7FD}
.cmenu button[disabled]{opacity:.38;cursor:default;background:transparent}
.cmenu svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none;opacity:.8}
.cmenu span{flex:1}
.cmenu kbd,.keys-list kbd{font:600 11px ui-monospace,Menlo,Consolas,monospace;color:#5B6285;background:#F2F4FA;border:1px solid #E1E5F0;border-bottom-width:2px;border-radius:6px;padding:1px 6px;direction:ltr;unicode-bidi:isolate;white-space:nowrap}
.zmenu .sep,.cmenu .sep{height:1px;background:#EDF0F6;margin:5px 4px}
.zpill{position:absolute;top:10px;inset-inline-end:10px;z-index:25;border:0;border-radius:99px;padding:7px 12px;background:rgba(13,19,51,.82);color:#fff;font:700 12.5px Plex,system-ui,sans-serif;box-shadow:0 6px 16px rgba(13,19,51,.25);backdrop-filter:blur(6px)}
.zpill.pulse{animation:zpulse .5s ease}
@keyframes zpulse{0%{transform:scale(1)}40%{transform:scale(1.12)}100%{transform:scale(1)}}
.keys-card{width:min(640px,100%)}
.keys-list{overflow:auto;display:grid;grid-template-columns:1fr;gap:2px;padding:4px 2px 6px}
.keys-list .krow{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 8px;border-radius:8px;font-size:13.5px}
.keys-list .krow:nth-child(odd){background:#F7F8FC}
.keys-list .kk{display:flex;flex-wrap:wrap;gap:4px;justify-content:flex-end}
.ghost-drag.hide{opacity:0}
*{scrollbar-width:thin;scrollbar-color:rgba(13,19,51,.25) transparent}
::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:rgba(13,19,51,.2);border-radius:8px;border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-thumb:hover{background:rgba(13,19,51,.38);background-clip:padding-box;border:2px solid transparent}::-webkit-scrollbar-button{display:none;width:0;height:0}::-webkit-scrollbar-corner{background:transparent}
@media (min-width:901px){.keys-list{grid-template-columns:1fr 1fr;column-gap:10px}}

.tmhint{font-size:12px;opacity:.75;margin-inline-start:6px}

/* v3: insert group, signature pad, chat attach/voice */
.ins-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:4px 0 10px}
.ins{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 4px;border:1px solid var(--line,#E3E5EF);border-radius:10px;background:#fff;font:inherit;font-size:12px;color:inherit;cursor:pointer}
.ins:hover{border-color:#13A9E0;background:#F3FAFE}.ins svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.sig-card{width:min(560px,94vw)}.qr-card{width:min(420px,94vw);display:flex;flex-direction:column;gap:8px}
.qr-card input{font:inherit;padding:9px 10px;border:1px solid #D5D8E5;border-radius:8px}
.sig-wrap{position:relative;height:220px;border:1.5px dashed #C9CCDA;border-radius:12px;background:repeating-linear-gradient(0deg,transparent 0 179px,#E3E5EF 179px 180px),#fff;touch-action:none}
.sig-wrap canvas{position:absolute;inset:0;width:100%;height:100%;cursor:crosshair;touch-action:none}
.sig-empty{position:absolute;inset:0;display:grid;place-items:center;color:#9AA0B8;pointer-events:none;font-size:14px}
.sig-bar{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin-top:10px;flex-wrap:wrap}
#sigPens{display:flex;gap:6px;margin-inline-end:auto}#sigPens button{width:22px;height:22px;border-radius:50%;border:2px solid #fff;background:var(--c);box-shadow:0 0 0 1px #C9CCDA;cursor:pointer}#sigPens button.on{box-shadow:0 0 0 2px #13A9E0}
.cbtn{flex:0 0 auto;width:36px;height:36px;border:0;border-radius:10px;background:transparent;color:#5A6080;cursor:pointer;display:grid;place-items:center;align-self:flex-end}
.cbtn:hover{background:#EEF0F7}.cbtn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.cbtn.rec{color:#fff;background:#E0395A;animation:recp 1.2s infinite}@keyframes recp{50%{box-shadow:0 0 0 6px rgba(224,57,90,.18)}}
.chat-att{display:flex;align-items:center;gap:8px;padding:6px 10px;margin:0 10px 6px;border:1px solid #E3E5EF;border-radius:10px;background:#F8F9FC;font-size:12px}
.chat-att img{width:44px;height:44px;object-fit:cover;border-radius:6px}.chat-att span{flex:1}
.msg img.att{display:block;max-width:160px;max-height:140px;border-radius:8px;margin-bottom:6px}
.chat.dropping{outline:2px dashed #13A9E0;outline-offset:-6px}

.chat{min-width:0;max-width:100%}.chat-sugg .chip{white-space:normal;max-width:100%;text-align:start;line-height:1.45}
@media (min-width:901px){.chat{width:330px;max-width:330px;min-width:330px}}

.findp{position:fixed;top:64px;inset-inline-end:350px;z-index:60;background:#fff;border:1px solid #E3E5EF;border-radius:12px;box-shadow:0 12px 32px rgba(13,19,51,.16);padding:10px 12px}
.findp form{display:flex;align-items:center;gap:8px;flex-wrap:wrap;max-width:min(640px,92vw)}.findp b{font-size:13px;width:100%}
.findp input{font:inherit;font-size:14px;padding:7px 9px;border:1px solid #D5D8E5;border-radius:8px;width:170px}
@media (max-width:900px){.findp{inset-inline:8px;top:56px}.findp input{flex:1 1 40%;width:auto}}

/* ===== v4 · batch 1: calm chat panel ===== */
[dir=rtl] .chat-form button svg{transform:none}
[dir=rtl] #chatSend svg,[dir=rtl] .flipx{transform:scaleX(-1)}
.chat-list{padding:16px;gap:12px;scroll-padding-bottom:16px}
.msg{max-width:88%;padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.75;box-shadow:none}
.msg.me{background:#1B2466;color:#fff;border-end-start-radius:6px}
.msg.ai{background:#F5F6FA;border:0;color:#1B2040;border-end-end-radius:6px}
.msg.sys{max-width:100%;padding:12px 14px;border-radius:12px;background:#F5F6FA;color:#5B6178;font-size:13px;line-height:1.8;text-align:start}
.msg .st{display:flex;align-items:center;gap:6px;margin-top:8px;padding-top:8px;border-top:1px solid rgba(27,36,102,.08);font-size:12px;font-weight:600;color:#7A8099;line-height:1}
.msg .st svg{width:14px;height:14px;flex:none;stroke-width:2.2}
.msg .st-applied{color:#0E8F6E}
.msg .st-reverted{color:#7A8099}
.msg .acts{gap:8px;margin-top:10px}
.msg .acts button{height:32px;padding:0 16px;border-radius:10px;font-size:13px;font-weight:600}
.msg .acts .ok{background:#1B2466}
.chat-sugg{flex:none;display:flex;flex-wrap:nowrap;gap:8px;padding:8px 16px 4px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.chat-sugg::-webkit-scrollbar{display:none}
.chat-sugg:empty{display:none}
.chat-sugg .chip,.chat-sugg .chip{flex:none;white-space:nowrap;max-width:none;height:30px;line-height:28px;padding:0 12px;border:1px solid #E3E6EF;border-radius:999px;background:#fff;color:#1B2466;font-size:13px;font-weight:500;text-align:center;box-shadow:none;transition:background .15s,border-color .15s}
.chat-sugg .chip:hover{background:#F0F8FD;border-color:#BFE6F6}
.chat-form{flex:none;display:flex;align-items:flex-end;gap:2px;margin:8px 16px 16px;padding:4px;border:1px solid #DDE1EA;border-top:1px solid #DDE1EA;border-radius:24px;background:#fff;transition:border-color .15s,box-shadow .15s}
.chat-form:focus-within{border-color:#13A9E0;box-shadow:0 0 0 3px rgba(19,169,224,.12)}
.chat-form textarea{flex:1;min-width:0;height:40px;max-height:88px;padding:8px 6px;border:0;border-radius:0;background:transparent;font-size:15px;line-height:24px;overflow-y:hidden;scrollbar-width:none;resize:none;color:#1B2040}
.chat-form textarea::-webkit-scrollbar{display:none}
.chat-form textarea:focus{outline:none;border:0}
.chat-form textarea::placeholder{color:#9AA0B4;opacity:1}
.chat-form .cbtn{width:36px;height:36px;margin:2px 0;border-radius:50%;background:transparent;color:#7A8099;align-self:flex-end}
.chat-form .cbtn:hover{background:#F1F3F7;color:#1B2466}
.chat-form .cbtn svg{width:20px;height:20px;stroke-width:1.8}
.chat-form .cbtn.rec{background:#E0395A;color:#fff}
#chatSend{flex:none;width:36px;height:36px;margin:2px 0;border:0;border-radius:50%;background:#1B2466;color:#fff;display:grid;place-items:center;align-self:flex-end;transition:background .15s,transform .1s}
#chatSend:hover{background:#252F80}#chatSend:active{transform:scale(.94)}
#chatSend svg{width:18px;height:18px;stroke-width:2.2}
.chat-att{margin:4px 16px 0;padding:6px 8px;border-radius:12px;border-color:#E3E6EF;background:#F7F8FB}
.chat-target{margin:4px 16px 0;padding:6px 10px;border-radius:10px;font-size:12.5px}
@media (max-width:900px){.chat-form textarea{font-size:16px}.chat-form{margin:8px 12px 12px}}
.work.t-chat .zpill,.work.t-els .zpill,.work.t-pages .zpill{display:none!important}

/* ===== v4 · batch 2: one calm shell — navy #1B2466 + cyan #13A9E0, neutral grey, 8px grid, 12px radius ===== */
:root{--navy:#1B2466;--ink:#1B2040;--muted:#6B7189;--line:#E6E8EF;--mist:#F6F7FA;--cyan:#13A9E0;--bg:#EEF0F4;--r:12px}
html,body{font-family:Plex,system-ui,sans-serif;font-size:14px;background:var(--bg)}
button,input,textarea,select{font-family:Plex,system-ui,sans-serif}
/* login */
.login{background:#1B2466}
.login-card{border-radius:16px;padding:32px 24px;box-shadow:0 24px 64px rgba(10,14,40,.35)}
.login-card input{border-radius:12px;border:1px solid #DDE1EA;font-size:16px;height:48px;padding:0 16px}
.login-card button{background:#1B2466;border-radius:12px;height:48px;padding:0;font-size:15px;font-weight:600}
.login-card button:hover{background:#252F80}
/* top bar */
.top{position:relative;background:#fff;color:var(--ink);min-height:56px;height:56px;padding:0 16px;gap:16px;border-bottom:1px solid var(--line);box-shadow:none}
.brand{gap:8px;flex:0 1 auto}
.brand img{width:32px;height:32px;padding:0;border-radius:8px;background:transparent}
.brand b{font-size:15px;font-weight:600;color:var(--navy)}
.save{font-size:12px;color:#8A90A6;display:inline-flex;align-items:center;gap:6px}
.save::before{content:"";width:6px;height:6px;border-radius:50%;background:#2BB673}
.save.dirty{color:#A07A12}.save.dirty::before{background:#E0A526}
.save.err{color:#C0263F}.save.err::before{background:#E0395A}
.top-mid{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;align-items:center;gap:8px}
.grp{display:flex;align-items:center;gap:0;padding:2px;border-radius:12px;background:#F3F4F7}
.top .tb{min-width:36px;height:36px;padding:0 8px;border-radius:10px;color:#4A5068;font-size:14px;font-weight:600;gap:6px;display:inline-flex;align-items:center;justify-content:center}
.top .tb:hover{background:#ECEEF3;color:var(--navy)}
.top .grp .tb{min-width:32px;height:32px;border-radius:9px}
.top .grp .tb:hover{background:#fff;box-shadow:0 1px 2px rgba(16,24,40,.08)}
.top .tb svg{width:18px;height:18px;stroke-width:1.9}
.zv{color:var(--ink);font:600 13px Plex,sans-serif;min-width:52px;height:32px;border-radius:9px}
.zv:hover{background:#fff}
.top-tools{gap:8px;flex:none}
.top .tb.lang{min-width:40px;height:32px;border:1px solid var(--line);border-radius:10px;font-size:12px;font-weight:600;color:#4A5068}
.top .tb.more{padding:0 12px 0 10px}
.top .tb.more svg{width:18px;height:18px}
.btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 16px;border-radius:10px;background:#1B2466;color:#fff;font-size:14px;font-weight:600;border:0;filter:none}
.btn:hover{background:#252F80;filter:none}
.btn svg{width:16px;height:16px;margin:0;fill:none;stroke:currentColor;stroke-width:2}
#showBtn svg{fill:currentColor;stroke:none}
.btn.ghost{background:#fff;color:var(--navy);border:1px solid var(--line)}
.btn.ghost:hover{background:#F6F7FA}
/* المزيد menu */
.menu{top:60px;left:16px;right:auto;min-width:240px;padding:8px;border-radius:12px;background:#fff;border:1px solid var(--line);box-shadow:0 12px 32px rgba(16,24,40,.14);animation:popin .14s cubic-bezier(.2,.8,.2,1)}
[dir=ltr] .menu{left:auto;right:16px}
.menu button{display:flex;align-items:center;gap:12px;width:100%;height:40px;padding:0 12px;border:0;border-radius:8px;background:transparent;color:var(--ink);font-size:14px;font-weight:500;text-align:start}
.menu button:hover{background:#F3F4F7}
.menu button svg{width:18px;height:18px;flex:none;color:#6B7189;stroke-width:1.8}
.menu button span{flex:1}
.menu kbd{font:500 11px system-ui;color:#8A90A6;background:#F3F4F7;border-radius:6px;padding:2px 6px;direction:ltr}
.msep{height:1px;background:var(--line);margin:8px 4px}
/* work area */
.work{background:var(--bg)}
.side{width:340px;min-width:340px;background:#fff;border-inline-end:1px solid var(--line);order:0}
.canvas{order:1;background:var(--bg)}
.canvas iframe{background:var(--bg)}
.prail{order:2;width:160px;flex:none;display:flex;flex-direction:column;background:#fff;border-inline-start:1px solid var(--line);min-height:0}
.prail-h{flex:none;height:48px;display:flex;align-items:center;padding:0 16px;font-size:13px;font-weight:600;color:#6B7189;border-bottom:1px solid var(--line)}
.prail-body{flex:1;min-height:0;overflow-y:auto;padding:16px 0;scrollbar-width:thin;scrollbar-color:#D5D9E3 transparent}
.side-tabs{flex:none;display:flex;gap:0;margin:8px 16px;padding:4px;border-radius:12px;background:#F3F4F7}
.side-tabs button{flex:1;height:32px;padding:0 8px;border:0;border-radius:9px;background:transparent;color:#6B7189;font-size:14px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.side-tabs button.on{background:#fff;color:var(--navy);box-shadow:0 1px 3px rgba(16,24,40,.1)}
.side-tabs button.on::after{display:none}
.side-tabs button:hover:not(.on){color:var(--navy)}
#helperState{display:inline-block;width:7px;height:7px;border-radius:50%;background:#2BB673;font-size:0;color:transparent;overflow:hidden;flex:none}
#helperState.off{background:#B9BECC}
#helperState:empty{background:#D5D9E3}
.side-body{background:#fff}
.panel{padding:8px 16px 16px;transform:none!important}
[dir=ltr] .panel{transform:none!important}
.panel-hint{font-size:13px;color:#8A90A6;margin:0 0 16px}
.el-sub{font-size:12px;font-weight:600;color:#8A90A6;margin:24px 0 8px;letter-spacing:0}
.el-grid{grid-template-columns:repeat(3,1fr);gap:8px}
.el{height:80px;border:1px solid #ECEEF3;border-radius:12px;background:#FAFBFC;font-size:12.5px;font-weight:500;color:#3A4062;gap:8px}
.el:hover{transform:none;border-color:#BFE6F6;background:#fff;box-shadow:0 2px 8px rgba(16,24,40,.06)}
.el .pv{color:var(--navy);height:28px}
.el .pv svg{width:24px;height:24px;stroke-width:1.7}
.ic-grid{grid-template-columns:repeat(6,1fr);gap:8px}
.ic-grid .el{height:44px;border-radius:10px}
.ic-grid .el svg{width:20px;height:20px;color:var(--navy)}
.aip{padding:0;overflow:hidden;display:flex;flex-direction:column}
.aip .chat{flex:1;width:auto!important;min-width:0!important;max-width:none!important;border:0;min-height:0;display:flex}
/* page thumbnails */
.thumbs{gap:24px;padding:0 0 8px}
.th{width:120px;border:2px solid transparent;border-radius:8px;box-shadow:0 1px 3px rgba(16,24,40,.12)}
.th:hover{box-shadow:0 4px 12px rgba(16,24,40,.14)}
.th.on{border-color:var(--cyan);box-shadow:0 0 0 3px rgba(19,169,224,.15)}
.th .box{width:116px;height:164px!important;border-radius:6px}
.th .n{background:#fff;color:#4A5068;border:1px solid var(--line);font-size:11px;font-weight:600;padding:0 8px;line-height:18px}
.th.on .n{background:var(--navy);color:#fff;border-color:var(--navy)}
.th .acts span{width:24px;height:24px;border-radius:8px;background:rgba(27,36,102,.86)}
.add-page{width:120px;height:40px;padding:0;margin:16px auto 0;border:1px dashed #C9CEDB;border-radius:10px;color:#6B7189;font-size:13px;font-weight:600}
.add-page:hover{border-color:var(--cyan);color:var(--navy)}
/* context toolbar + pops */
.ctx{border-radius:12px;padding:4px;box-shadow:0 8px 24px rgba(16,24,40,.14),0 0 0 1px rgba(16,24,40,.06)}
.ctx .tb{color:#3A4062;border-radius:8px}
.ctx .tb:hover{background:#F3F4F7}
.ctx .tb.ai{color:var(--navy);font-weight:600}
.ctx .tb.ai:hover{background:#EAF6FC}
.ctx .nm{background:var(--navy)}
.ctx .nm:hover{background:#252F80}
.pop,.modal-card,.pal-card{border-radius:12px;box-shadow:0 16px 40px rgba(16,24,40,.18)}
.modal{background:rgba(16,22,52,.4)}
.modal-card{padding:16px 24px 24px}
.v-row{border-radius:12px;padding:8px 16px}
.v-row button{border-radius:10px;background:#fff;color:var(--navy)}
.pal-item.ai b{color:var(--navy)}
.toast{background:#1B2466;border-radius:12px;font-size:14px;padding:8px 16px}
.pv-bar{background:#1B2466;border-radius:12px}
.pv-bar .ok,.msg .acts .ok{background:#13A9E0;color:#fff}
.ovf-warn{background:#fff;color:#B42318;border:1px solid #FAD1CC;box-shadow:0 4px 12px rgba(16,24,40,.1);font-weight:600}
@media (max-width:900px){
  .top{height:56px;padding:0 8px;gap:8px}
  .top-mid{position:static;transform:none}
  .brand{flex:1;min-width:0}
  .brand b{font-size:14px;overflow:hidden;text-overflow:ellipsis}
  .save{font-size:11px}
  .top-tools{gap:4px}
  .btn{height:36px;padding:0 12px;font-size:13px}
  #showBtn{width:36px;padding:0;justify-content:center}
  #showBtn span{display:none}
  .top .tb.more{padding:0;min-width:36px}
  .menu{top:60px;left:8px;right:8px;min-width:0}
  [dir=ltr] .menu{left:8px;right:8px}
  .side,.prail{display:none}
  .work.t-els .side,.work.t-ins .side,.work.t-chat .side{display:flex;position:absolute;inset:0;width:auto;min-width:0;z-index:20;border:0}
  .work.t-els .side-tabs,.work.t-ins .side-tabs,.work.t-chat .side-tabs{display:none}
  .work.t-pages .prail{display:flex;position:absolute;inset:0;width:auto;z-index:20;border:0}
  .work.t-pages .prail-h{display:none}
  .el-grid{grid-template-columns:repeat(3,1fr)}
  .ic-grid{grid-template-columns:repeat(6,1fr)}
  .tabs{height:auto}
  .tabs button{font-size:13px;font-weight:600;padding:12px 2px;color:#6B7189}
  .tabs button.on{color:var(--navy);box-shadow:inset 0 2px 0 var(--navy)}
}
@media (max-width:900px){.brand img{display:none}.brand b{font-size:13.5px}.toast{bottom:auto;top:calc(64px + env(safe-area-inset-top))}
.zpill{background:rgba(255,255,255,.92)!important;color:#1B2466!important;border:1px solid #E6E8EF!important;box-shadow:0 2px 8px rgba(16,24,40,.08)!important;font-weight:600!important}}

/* ===== v4 · batch 3: pre-export check ===== */
.ck-card{width:min(560px,100%);padding:16px 24px 24px;gap:0}
.ck-card .modal-head{height:40px}
.ck-card .modal-head b{font-size:16px;font-weight:600;color:var(--navy)}
.ck-card .modal-head .tb{width:36px;height:36px;border:0;border-radius:10px;background:transparent;color:#6B7189;display:grid;place-items:center}
.ck-card .modal-head .tb:hover{background:#F3F4F7}
.ck-sum{margin:8px 0 16px;font-size:14px;color:#4A5068}
.ck.clean .ck-sum{color:#0E8F6E;font-weight:600}
.ck-list{display:flex;flex-direction:column;gap:8px;overflow-y:auto;max-height:52vh}
.ck-row{display:flex;align-items:center;gap:12px;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:#fff}
.ck-dot{width:8px;height:8px;border-radius:50%;flex:none;background:#E0A526}
.ck-dot.ck-ovf,.ck-dot.ck-num,.ck-dot.ck-pn{background:#E0395A}
.ck-t{flex:1;font-size:14px;line-height:1.7;color:var(--ink)}
.ck-fix{flex:none;height:32px;padding:0 16px;border:1px solid #BFE6F6;border-radius:10px;background:#F0F8FD;color:var(--navy);font-size:13px;font-weight:600}
.ck-fix:hover{background:#E1F2FB}
.ck-foot{display:flex;gap:8px;justify-content:flex-start;margin-top:24px}
.ck-foot .btn{height:40px}
@media (max-width:900px){.ck-card{padding:16px}.ck-row{padding:12px}.ck-foot .btn{flex:1;justify-content:center}}
.modal.ck{z-index:90}

/* ---------- v5 · calm phone chrome, page budget, readable editing ---------- */
#shPrev svg,#shNext svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;display:block}
.pg-budget{font-size:12px;font-weight:600;color:#6B7189;text-align:center;padding:10px 8px 6px;letter-spacing:.2px}
.pg-budget.over{color:#C0263F}
.add-page.off{opacity:.45}
.ctx .tb.done{background:var(--navy);color:#fff;font-weight:700;font-size:14px;padding:0 16px;min-width:64px;border-radius:10px}
.ctx .tb.done:hover{background:#252F80}
.ctx.calm{justify-content:center;gap:4px}
.ctx.calm .tb{min-width:42px;height:42px}
.th .acts,.th .grip{transition:opacity .15s}
@media (hover:hover){.th .acts{opacity:0}.th:hover .acts,.th.on .acts{opacity:1}}
@media (pointer:coarse){
  .th:not(.on) .acts,.th:not(.on) .grip{display:none}
  #moreMenu kbd,#palBtnM,#keysBtnM,#moreMenu .msep:has(+#palBtnM){display:none}
  #moreMenu #zoomInM.m-only,#moreMenu #zoomOutM.m-only,#moreMenu #zoomFitWM.m-only{display:none!important}
}
/* v5 · a notice never swallows a tap on the page under it (the first-visit hint sat on page 3's first lines for 5 s) */
.toast{pointer-events:none}
.toast .toast-act{pointer-events:auto}

/* ---------- v6 · text sheet, number field, calm versions, 4 tabs, keyboard ---------- */
.tsheet{position:fixed;left:0;right:0;bottom:var(--kb,0px);z-index:70;background:#fff;border-radius:18px 18px 0 0;box-shadow:0 -10px 34px rgba(16,24,40,.18);padding:12px 16px calc(14px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:10px;animation:tsin .2s cubic-bezier(.2,.8,.2,1)}
@keyframes tsin{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}
.kb-open .tsheet{padding-bottom:12px}
.ts-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.ts-head b{font-size:14px;color:#5A6488;font-weight:600}
.ts-done{background:var(--navy,#1B2466);color:#fff;border:0;border-radius:12px;font-weight:700;font-size:15px;min-width:76px;min-height:44px;padding:0 18px}
.ts-ed{font-size:17px;line-height:1.75;color:#0D1333;border:1px solid #DCE2EF;border-radius:12px;padding:10px 14px;max-height:min(34vh,260px);overflow-y:auto;overflow-x:hidden;overflow-wrap:anywhere;white-space:normal;outline:none;text-align:start}
.ts-ed:focus{border-color:#13A9E0;box-shadow:0 0 0 3px rgba(19,169,224,.15)}
.ts-ed *{font-size:inherit!important;line-height:inherit!important;margin:0!important;padding:0!important;position:static!important;display:inline!important;translate:none!important;width:auto!important;height:auto!important}
.ts-num{font:700 24px/1.2 inherit;font-family:inherit;text-align:center;color:#0D1333;border:1px solid #DCE2EF;border-radius:12px;height:56px;padding:0 14px;width:100%;box-sizing:border-box;outline:none}
.ts-num:focus{border-color:#13A9E0;box-shadow:0 0 0 3px rgba(19,169,224,.15)}
.tsheet.num .ts-ed,.tsheet:not(.num) .ts-num{display:none}
.ts-hint{margin:0;font-size:12.5px;color:#6B7189}
body.ts-on .ctx{display:none!important}
@media (max-width:900px){body.ts-on .tabs{visibility:hidden}.kb-open .tabs{visibility:hidden}.kb-open .ctx{position:fixed!important;bottom:calc(var(--kb,0px) + 8px)!important}}
.v-row{padding:0!important;border:1px solid var(--line,#E4E7EF)}
.v-open{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;background:none;border:0;padding:12px 14px;text-align:start;min-height:52px;cursor:pointer;color:inherit;font:inherit;border-radius:12px}
.v-open:hover{background:#F6F8FB}
.v-open b{font-size:14px;font-weight:600;color:#0D1333;display:block}
.v-open span{font-size:12px;color:#6B7189;display:block;margin-top:2px}
.v-cur{font-style:normal;font-size:11px;font-weight:700;color:#0b7fae;background:#E6F6FD;border-radius:6px;padding:1px 6px;margin-inline-start:4px}
.v-chev{flex:none}.v-chev svg{width:18px;height:18px;fill:none;stroke:#9AA1B9;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.v-prev{display:flex;flex-direction:column;gap:10px;min-height:0}
.v-prev[hidden]{display:none}
.vp-head b{display:block;font-size:15px;color:#0D1333}
.vp-head span{display:block;font-size:12.5px;color:#6B7189;margin-top:2px}
.vp-head .vp-diff{color:#0b7fae;font-weight:600}
.vp-frame{width:100%;height:min(44vh,380px);border:1px solid #E4E7EF;border-radius:12px;background:#E9ECF3}
.vp-note{margin:0;font-size:12.5px;color:#6B7189}
.vp-foot{display:flex;gap:10px}.vp-foot .btn{flex:1;justify-content:center;min-height:44px}
.vp-foot .btn[disabled]{opacity:.45}
@media (max-width:900px){
  .work.t-add .side{display:flex;position:absolute;inset:0;width:auto;min-width:0;z-index:20;border:0}
  .work.t-add .side-tabs{display:none}
  .work.t-add .side-body{overflow-y:auto}
  .work.t-add .panel{position:static;opacity:1;visibility:visible;transform:none;overflow:visible}
  .work.t-add .panel[data-panel=ai]{display:none}
  .work.t-add .panel[data-panel=ins]{order:-1;padding-bottom:0}
  .work.t-add .side-body{display:flex;flex-direction:column}
  .work.t-add .zpill{display:none!important}
  #versions .modal-card{max-height:88vh}
}
.vp-frame{opacity:0;transition:opacity .25s}.vp-frame.ready{opacity:1}

/* ---------- v7 · notes, contents jump, chart view, calm zoom pill, version snippets ---------- */
.zpill{top:16px!important;inset-inline-end:16px!important;padding:6px 11px!important;font-size:12px!important;transition:opacity .25s ease}
.zpill.calm{opacity:0!important;pointer-events:none!important}
.nt-btn{position:relative;gap:6px}
.nt-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}
.nt-btn .nb{position:absolute;top:1px;inset-inline-end:-2px;min-width:17px;height:17px;border-radius:9px;background:#F2B33D;color:#0D1333;font:700 11px/17px Plex,system-ui,sans-serif;text-align:center;padding:0 4px}
.nt-btn .nb[hidden]{display:none}
@media (max-width:1100px){.nt-btn .nt-lbl{display:none}}
.ntp{position:fixed;z-index:58;top:68px;inset-inline-end:14px;width:min(360px,calc(100vw - 28px));max-height:calc(100vh - 150px);display:flex;flex-direction:column;gap:10px;background:#fff;border:1px solid var(--line,#E4E7EF);border-radius:16px;box-shadow:0 18px 40px rgba(16,24,40,.16);padding:14px 16px 16px;overflow:hidden;animation:popin .18s cubic-bezier(.2,.8,.2,1)}
.ntp[hidden]{display:none}
.ntp-head{display:flex;align-items:center;justify-content:space-between}
.ntp-head b{font-size:16px;color:#0D1333}
.ntp-head svg,.cv-tools svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.ntp-sub{margin:-4px 0 0;font-size:12.5px;color:#6B7189;line-height:1.5}
.nt-add{justify-content:center;min-height:44px;width:100%}
.nt-add svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
.nt-add[hidden],.nt-comp[hidden]{display:none}
.nt-comp{display:flex;flex-direction:column;gap:8px;border:1px solid #DCE6F5;background:#F7FAFE;border-radius:12px;padding:10px}
.nt-comp textarea,.nt-comp input{width:100%;box-sizing:border-box;border:1px solid #D6DBE7;border-radius:10px;padding:10px 12px;font:15px/1.6 Plex,system-ui,sans-serif;color:#0D1333;background:#fff;resize:vertical}
.nt-comp input{font-size:14px;padding:8px 12px}
.nt-comp textarea:focus,.nt-comp input:focus{outline:2px solid #13A9E0;outline-offset:0;border-color:transparent}
.nt-cbar{display:flex;gap:8px}.nt-cbar .btn{flex:1;justify-content:center;min-height:44px}.nt-cbar .btn[disabled]{opacity:.45}
.nt-list{overflow:auto;display:flex;flex-direction:column;gap:8px;min-height:0;padding-bottom:2px}
.nt-empty{margin:6px 0;font-size:14px;color:#6B7189;text-align:center}
.nt-item{border:1px solid var(--line,#E4E7EF);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:5px;transition:box-shadow .3s}
.nt-item.hl{box-shadow:0 0 0 3px rgba(242,179,61,.35)}
.nt-h{display:flex;align-items:center;gap:8px;font-size:12px;color:#6B7189}
.nt-no{font-style:normal;display:inline-grid;place-items:center;width:22px;height:22px;border-radius:11px 11px 11px 3px;background:#F2B33D;color:#0D1333;font-weight:700;font-size:12px}
.nt-pg{font-weight:700;color:#3A4062}
.nt-when{margin-inline-start:auto}
.nt-q{font-size:12.5px;color:#6B7189;border-inline-start:3px solid #E4E7EF;padding-inline-start:8px;line-height:1.55;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.nt-q.gone{color:#9A6A00}
.nt-b{font-size:15px;line-height:1.6;color:#0D1333;white-space:pre-wrap;overflow-wrap:anywhere}
.nt-act{display:flex;gap:8px;margin-top:2px}
.nt-act button{flex:1;min-height:40px;border-radius:10px;border:1px solid var(--line,#E4E7EF);background:#fff;color:#1B2466;font:600 13.5px Plex,system-ui,sans-serif;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.nt-act .nt-res{background:#EAF7EF;border-color:#CBEBD6;color:#146C3A}
.nt-act svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.nt-done{border-top:1px solid var(--line,#E4E7EF);padding-top:6px}
.nt-done summary{cursor:pointer;font-size:13px;color:#6B7189;padding:6px 0;list-style-position:inside}
.nt-done .nt-item{opacity:.75;margin-top:6px}
.pin-bar{position:absolute;z-index:26;top:14px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:12px;background:#1B2466;color:#fff;border-radius:12px;padding:8px 8px 8px 16px;font-size:14px;box-shadow:0 8px 22px rgba(16,24,40,.22);max-width:calc(100% - 28px)}
[dir=rtl] .pin-bar{padding:8px 16px 8px 8px}
.pin-bar[hidden]{display:none}
.pin-bar button{border:0;border-radius:9px;background:rgba(255,255,255,.14);color:#fff;font:600 13.5px Plex,system-ui,sans-serif;min-height:36px;padding:0 14px}
.cv-card{width:min(1100px,100%)!important;max-height:92vh!important;height:92vh;padding:12px 14px 14px!important}
.cv-card .modal-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.cv-tools{display:flex;gap:6px}.cv-tools .tb{min-width:40px;height:40px;border:1px solid var(--line,#E4E7EF);border-radius:10px}
.cv-tools .tb[disabled]{opacity:.35}
.cv-stage{flex:1;min-height:0;overflow:auto;background:#fff;border-radius:12px;border:1px solid #EEF0F5;padding:10px;-webkit-overflow-scrolling:touch}
.cv-stage .cv-art{display:block;height:auto;margin:0 auto;max-width:none}
.cv[hidden]{display:none}
.vp-wrap{position:relative}
.vp-load{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;background:#F4F6FA;border-radius:12px;border:1px solid #E4E7EF;color:#6B7189;font-size:13.5px}
.vp-load[hidden]{display:none}
.vp-sk{width:min(62%,320px);background:#fff;border-radius:8px;padding:16px;display:flex;flex-direction:column;gap:9px;box-shadow:0 2px 8px rgba(16,24,40,.06)}
.vp-sk i{display:block;height:9px;border-radius:5px;background:linear-gradient(90deg,#EEF1F6 0%,#E1E6EF 50%,#EEF1F6 100%);background-size:200% 100%;animation:vpsh 1.2s linear infinite}
.vp-sk i.s{width:62%}
@keyframes vpsh{0%{background-position:100% 0}100%{background-position:-100% 0}}
@media (prefers-reduced-motion:reduce){.vp-sk i{animation:none}}
.v-snip{display:block;font-style:normal;font-size:12.5px;color:#0b7fae;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.ctx .v7b svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
@media (max-width:700px){
  .ntp{top:auto;bottom:0;inset-inline:0;width:auto;max-height:72vh;border-radius:18px 18px 0 0;padding-bottom:calc(16px + env(safe-area-inset-bottom))}
  .pin-bar{font-size:13px;top:10px}
}
.cv-stage{position:relative;isolation:isolate}.cv-stage>.cv-art{pointer-events:none}
.cv{grid-template-columns:minmax(0,1fr)}.cv-card{min-width:0;max-width:100%!important;box-sizing:border-box}.cv-stage{min-width:0;max-width:100%}
@media (max-width:440px){#pdfBtn span{display:none}#pdfBtn{width:40px;padding:0;justify-content:center}#pdfBtn svg{margin:0}}
