
/* Cafeneti tools enhancement release 2026-11-15. Scoped to tool workspace. */
#tool-ui .cn-studio-panel{display:grid;gap:18px;min-width:0;direction:rtl}
#tool-ui .cn-studio-panel .field{min-width:0;margin:0}
#tool-ui .cn-studio-panel .field>label{display:block;color:#2a4564;font-weight:800;font-size:13px;margin:0 0 8px}
#tool-ui .cn-studio-panel input:not([type=checkbox]):not([type=range]):not([type=file]),#tool-ui .cn-studio-panel select,#tool-ui .cn-studio-panel textarea{width:100%;max-width:100%;box-sizing:border-box;border:1px solid #d4e2ee;background:#fff;color:#1c344d;border-radius:14px;padding:13px 15px;font:inherit;line-height:1.9;outline:0;transition:border-color .18s,box-shadow .18s}
#tool-ui .cn-studio-panel input:focus-visible,#tool-ui .cn-studio-panel select:focus-visible,#tool-ui .cn-studio-panel textarea:focus-visible{border-color:#3178cb;box-shadow:0 0 0 3px #4c9de128}
#tool-ui .cn-studio-panel textarea{min-height:155px;resize:vertical;white-space:pre-wrap;tab-size:4}
#tool-ui .cn-studio-panel textarea[readonly]{background:#f8fbfe;min-height:140px;direction:rtl}
#tool-ui .cn-studio-panel .form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
#tool-ui .cn-studio-panel .dropzone{min-height:160px;padding:23px 18px;border:2px dashed #96bce0;background:linear-gradient(135deg,#edf6ff,#fff);box-shadow:inset 0 0 0 1px #fff}
#tool-ui .cn-studio-upload-mark{display:grid;place-items:center;font-family:Arial,sans-serif;font-size:27px;font-weight:500;line-height:1;width:42px;height:42px;border-radius:13px;background:#d9eafe;color:#2366ad;margin:0 auto 8px}
#tool-ui .cn-studio-panel .cn-studio-file{font-size:12px;font-weight:700;word-break:break-word;color:#315d88;text-align:center;min-height:20px}
#tool-ui .cn-studio-panel .cn-studio-preview{border:1px solid #dce8f5;background:linear-gradient(145deg,#f8fbff,#f0f6fd);border-radius:18px;min-width:0;overflow:hidden;box-shadow:0 8px 25px #214e8308}
#tool-ui .cn-studio-preview-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 16px;border-bottom:1px solid #dce8f5;color:#234f78}
#tool-ui .cn-studio-preview-head strong{font-size:13px;font-weight:850}
#tool-ui .cn-studio-preview-head span{font-size:11px;color:#6586a7}
#tool-ui .cn-studio-preview-body{min-height:105px;max-height:620px;display:grid;place-items:center;overflow:auto;padding:15px;background:linear-gradient(45deg,#eaf0f6 25%,transparent 25%,transparent 75%,#eaf0f6 75%),linear-gradient(45deg,#eaf0f6 25%,transparent 25%,transparent 75%,#eaf0f6 75%);background-size:18px 18px;background-position:0 0,9px 9px;background-color:#fff}
#tool-ui .cn-studio-preview-body canvas{display:block;width:auto;height:auto;max-width:100%;max-height:585px;object-fit:contain;border-radius:5px;box-shadow:0 7px 27px #152c431c}
#tool-ui .cn-studio-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap;min-width:0}
#tool-ui .cn-studio-actions>input{flex:1 1 140px}
#tool-ui .cn-studio-actions>.btn{white-space:normal}
#tool-ui .cn-studio-meta{background:#f0f7ff;border:1px solid #deecfa;color:#416d96;border-radius:12px;padding:10px 14px;font-size:12px;line-height:1.9}
#tool-ui .cn-studio-controls{display:flex;flex-wrap:wrap;align-items:center;gap:12px;background:#f8fbff;padding:14px;border:1px solid #e2ecf6;border-radius:13px}
#tool-ui .cn-studio-controls label{font-size:12px;font-weight:700;color:#44678c;display:flex;align-items:center;gap:7px}
#tool-ui .cn-studio-controls input{accent-color:#1669bd}
#tool-ui .cn-studio-panel input[type=range]{width:100%;cursor:pointer;accent-color:#276fb8}
#tool-ui .cn-pdf-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;background:#eef5fc;border:1px solid #dceaf8;border-radius:14px;padding:13px}
#tool-ui .cn-pdf-toolbar strong{font-size:13px;color:#1d4d7a}
#tool-ui .cn-pdf-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:start}
#tool-ui .cn-pdf-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;max-height:645px;overflow:auto;scrollbar-width:thin;padding:9px;border:1px solid #e1ebf5;background:#f8fbff;border-radius:16px;align-content:start}
#tool-ui .cn-pdf-page{border:1px solid #dbe5f2;background:#fff;border-radius:13px;padding:8px 6px;min-width:0;transition:border-color .15s,box-shadow .15s}
#tool-ui .cn-pdf-page.is-selected{border-color:#1e75bf;background:#eef7ff;box-shadow:0 0 0 1px #86b9e9}
#tool-ui .cn-pdf-thumb{height:125px;background:#f2f6fb;display:grid;place-items:center;overflow:hidden;border-radius:8px;color:#8aa1b8;font-size:11px;cursor:pointer}
#tool-ui .cn-pdf-thumb canvas{max-width:100%;max-height:120px;object-fit:contain;box-shadow:0 2px 8px #183c5c16}
#tool-ui .cn-pdf-page label{display:flex;align-items:center;justify-content:center;gap:5px;font-size:12px;font-weight:800;margin-top:8px;color:#315c82;cursor:pointer}
#tool-ui .cn-pdf-page input[type=checkbox]{accent-color:#2076c7;width:15px;height:15px}
#tool-ui .cn-studio-panel .meter{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
#tool-ui .cn-studio-panel .meter>div{min-width:0;border-radius:13px}
#tool-ui .cn-studio-panel .meter strong{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#tool-ui .cn-studio-panel .action-row{margin-top:3px;display:flex;gap:10px;flex-wrap:wrap}
#tool-ui .cn-studio-panel .cn-studio-action{background:linear-gradient(115deg,#1368b4,#165d9d);border-radius:13px;font-weight:850;min-height:45px}
#tool-ui .cn-studio-panel button:disabled{opacity:.65;cursor:wait}
@media(max-width:780px){
 #tool-ui .cn-pdf-layout{grid-template-columns:minmax(0,1fr)}
 #tool-ui .cn-pdf-grid{grid-template-columns:repeat(3,minmax(0,1fr));max-height:400px}
 #tool-ui .cn-studio-panel .meter{grid-template-columns:1fr}
 #tool-ui .cn-studio-panel .cn-studio-preview-body{max-height:440px}
}
@media(max-width:460px){
 #tool-ui .cn-studio-panel .form-grid{grid-template-columns:1fr}
 #tool-ui .cn-studio-actions>.btn{flex:1}
 #tool-ui .cn-pdf-toolbar{align-items:stretch}
 #tool-ui .cn-pdf-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #tool-ui .cn-pdf-thumb{height:110px}
 #tool-ui .cn-studio-preview-head{padding:11px 12px}
 #tool-ui .cn-studio-panel .action-row>*{width:100%;text-align:center}
 #tool-ui .cn-studio-panel .dropzone{min-height:145px}
}


#tool-ui .cn-wm-presets{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
#tool-ui .cn-wm-tile{display:grid;gap:6px;min-width:0;padding:7px;border:1px solid #d8e6f3;border-radius:12px;background:#fff;color:#24557c;font:inherit;cursor:pointer}
#tool-ui .cn-wm-tile strong{font-size:11px;text-align:center}
#tool-ui .cn-wm-tile.is-active{border-color:#1878be;background:#eff8ff;box-shadow:0 0 0 2px #1878be29}
#tool-ui .cn-wm-art{position:relative;display:block;height:65px;overflow:hidden;border-radius:7px;background:linear-gradient(145deg,#ddeaf4,#fff)}
#tool-ui .cn-wm-art i{position:absolute;font-style:normal;font-size:8px;white-space:nowrap;opacity:.5;color:#22517d}
#tool-ui #cn-preview-body canvas{max-width:100%}
#tool-preview:empty{display:none}
@media(max-width:560px){#tool-ui .cn-wm-presets{grid-template-columns:repeat(3,minmax(0,1fr))}}
