:root{--bg:#f6f8fb;--card:#fff;--line:#e6eaf1;--text:#192235;--muted:#7c879a;--blue:#365edf;--bluebg:#edf2ff;--green:#218a66}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
aside{position:fixed;left:0;top:0;bottom:0;width:235px;background:#fff;border-right:1px solid var(--line);padding:22px 14px}.brand{display:flex;align-items:center;gap:10px;padding:0 8px 23px}.brand span,.authmark{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:linear-gradient(145deg,#4c72ed,#3158d6);color:#fff;font-weight:700}.brand b{font-size:15px}
nav a{display:flex;gap:12px;align-items:center;text-decoration:none;color:#58657a;padding:10px 12px;border-radius:9px;margin:2px 0}nav a i{font-style:normal}nav a:hover{background:var(--bluebg);color:var(--blue)}.sep{height:1px;background:var(--line);margin:12px}
main{margin-left:235px;padding:32px 38px;max-width:1450px}header{display:flex;justify-content:space-between;align-items:start;margin-bottom:24px}h1{margin:0 0 5px;font-size:27px}header p{margin:0;color:var(--muted)}.logout,.tablelink,.primarylink{color:var(--blue);text-decoration:none}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin-bottom:16px}.stat,.panel,.chat{background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 3px 14px rgba(30,50,90,.035)}.stat{padding:18px}.stat small{display:block;color:var(--muted);margin-bottom:9px}.stat strong{font-size:25px}.panel{padding:20px;margin-bottom:16px}.panel h2{margin:0 0 16px;font-size:17px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}.narrow{max-width:720px}
.botrow{display:flex;align-items:center;gap:12px}.botrow.big{margin-bottom:18px}.botrow>div:nth-child(2){flex:1}.botrow small,.event small,td small{display:block;color:var(--muted);margin-top:3px}.avatar{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:var(--bluebg);font-size:20px}.okdot{color:var(--green);background:#edfaf5;padding:6px 9px;border-radius:20px}.event{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}.event>span{color:var(--green)}
label{display:block;font-weight:600;margin:12px 0 5px}input,textarea{width:100%;border:1px solid #dce2ec;border-radius:9px;padding:11px 12px;font:inherit;outline:none;background:#fff}input:focus,textarea:focus{border-color:#91a8ee;box-shadow:0 0 0 3px var(--bluebg)}button{border:0;border-radius:9px;background:var(--blue);color:#fff;padding:10px 14px;font:inherit;cursor:pointer}.secondary{background:var(--bluebg);color:var(--blue)}.notice{padding:11px 13px;border-radius:9px;background:var(--bluebg);border:1px solid #d8e2ff;margin:12px 0}.notice.bad{background:#fff0f0;border-color:#ffdada}.notice.ok{background:#edfaf5;border-color:#d5f1e5}.emptyline,.emptycell{color:var(--muted)}
table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:12px 9px;border-bottom:1px solid var(--line);vertical-align:top}th{font-size:12px;color:var(--muted);font-weight:600}.pill{background:#eef2fa;border-radius:20px;padding:5px 8px;font-size:12px}.toolbar,.search,.editorbar{display:flex;gap:8px;margin-bottom:14px}.toolbar input,.search input{max-width:360px}
.canvas{min-height:600px;border:1px solid var(--line);border-radius:14px;background-image:radial-gradient(#dfe5ef 1px,transparent 1px);background-size:20px 20px;padding:35px;display:flex;flex-direction:column;align-items:center}.node{width:330px;background:#fff;border:1px solid #dfe4ed;border-radius:12px;padding:15px;box-shadow:0 5px 18px rgba(30,50,90,.06)}.node b,.node small{display:block}.node small{color:var(--muted);margin:8px 0 12px}.arrow{font-size:24px;color:#9ba6ba;padding:7px}
.chat{overflow:hidden}.messages{min-height:500px;max-height:65vh;overflow:auto;padding:22px;display:flex;flex-direction:column;gap:9px}.msg{max-width:72%;padding:10px 12px;border-radius:12px;background:#f0f3f8;align-self:flex-start}.msg.out{background:var(--bluebg);align-self:flex-end}.msg small{display:block;color:var(--muted);font-size:11px;margin-top:5px}.sendbox{display:flex;gap:9px;border-top:1px solid var(--line);padding:14px}.sendbox textarea{resize:none}.sendbox button{align-self:stretch}
.emptybig{text-align:center;padding:90px 20px;color:var(--muted)}.emptyicon{font-size:45px;color:#acb5c4}.auth{min-height:100vh;display:grid;place-items:center}.authbox{width:390px;background:#fff;border:1px solid var(--line);border-radius:17px;padding:30px;box-shadow:0 12px 45px rgba(40,60,100,.08)}.authmark{width:58px;height:58px;margin:auto;font-size:26px}.authbox h1{text-align:center;font-size:21px;margin:15px 0 22px}.authbox button{width:100%;margin-top:16px}
@media(max-width:800px){aside{width:65px;padding:15px 8px}.brand b,nav a i{display:none}.brand{padding-left:5px}.brand span{width:38px}main{margin-left:65px;padding:20px 14px}.cards{grid-template-columns:1fr 1fr}.grid2{grid-template-columns:1fr}.toolbar,.search{flex-direction:column}.toolbar input,.search input{max-width:none}.node{width:min(330px,100%)}.msg{max-width:88%}}

.wggrid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.statusrows>div{display:flex;justify-content:space-between;gap:20px;padding:12px 0;border-bottom:1px solid var(--line)}.statusrows span{color:var(--muted)}.statusrows b{text-align:right}.good{color:var(--green)}.badtext{color:#c44242}.wgsummary{margin-top:16px;padding:12px 13px;border-radius:10px;background:#f2f4f8;color:var(--muted)}.goodbox{background:#edfaf5;color:#207b5d}.badbox{background:#fff0f0;color:#b63d3d}.dangerform{margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}button.danger{background:#fff0f0;color:#b63d3d}.panel input[type=file]{margin-bottom:12px}
@media(max-width:900px){.wggrid{grid-template-columns:1fr}}

.wgdetail{margin-top:10px;padding:11px 12px;border:1px solid #f0d5d5;background:#fff8f8;border-radius:9px;color:#8e4141;font:12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:pre-wrap;word-break:break-word;max-height:220px;overflow:auto}.reconnectform{margin-top:12px}

.editorlayout{display:grid;grid-template-columns:minmax(500px,1fr) 300px;gap:16px}.editorhelp{align-self:start;position:sticky;top:20px}.editorhelp p{color:var(--muted);line-height:1.45}.editorhelp code{background:#f2f4f8;padding:2px 5px;border-radius:5px}.editorbar .grow,.modalactions .grow{flex:1}.nodetop{display:flex;align-items:center;gap:8px}.nodeicon{font-size:18px}.nodenum{margin-left:auto;color:var(--muted);font-size:12px}.canvasempty{margin:auto;color:var(--muted)}.modal{position:fixed;inset:0;background:rgba(24,34,53,.28);z-index:20;place-items:center;padding:20px}.modalbox{width:min(620px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:16px;padding:22px;box-shadow:0 20px 70px rgba(20,30,50,.18)}.modalhead,.modalactions{display:flex;align-items:center;gap:8px}.modalhead h2{margin:0;flex:1}.x{background:transparent;color:#667085;font-size:24px;padding:2px 8px}.modalactions{margin-top:18px}.buttonrow{display:grid;grid-template-columns:1fr 1fr 38px;gap:7px;margin:7px 0}.removebtn{background:#fff0f0;color:#b63d3d;padding:0}.smallbtn{margin-top:6px}.toast{position:fixed;right:24px;bottom:24px;background:#172033;color:#fff;padding:11px 15px;border-radius:10px;z-index:50;box-shadow:0 8px 30px rgba(0,0,0,.15)}select{border:1px solid #dce2ec;border-radius:8px;padding:8px 9px;background:#fff;font:inherit}.successpill{background:#edfaf5;color:#218a66}.chatheadbar{display:flex;justify-content:flex-end;margin-bottom:10px}
@media(max-width:1050px){.editorlayout{grid-template-columns:1fr}.editorhelp{display:none}}

.twocol{display:grid;grid-template-columns:1fr 1fr;gap:10px}.mutedline{color:var(--muted);line-height:1.55}.tiny{padding:6px 8px;font-size:12px}code{background:#f2f4f8;border-radius:6px;padding:4px 6px;font-size:12px;word-break:break-all}
@media(max-width:700px){.twocol{grid-template-columns:1fr}}

.templatehero{display:flex;justify-content:space-between;align-items:end;margin-bottom:14px}.templatehero h2{margin:0 0 5px;font-size:20px}.templatehero p{margin:0;color:var(--muted)}
.templategrid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:13px;margin-bottom:16px}.templatecard{background:#fff;border:1px solid var(--line);border-radius:14px;padding:17px;display:flex;flex-direction:column;gap:12px;box-shadow:0 3px 14px rgba(30,50,90,.035);transition:.15s ease}.templatecard:hover{transform:translateY(-2px);border-color:#cbd6f6;box-shadow:0 8px 24px rgba(30,50,90,.07)}.templateicon{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;background:var(--bluebg);font-size:21px}.templatebody{flex:1}.templatecard h3{margin:0 0 7px;font-size:15px}.templatecard p{margin:0;color:var(--muted);line-height:1.45;font-size:13px}.templatecard button{width:100%}.sectionhead{display:flex;align-items:end;justify-content:space-between;gap:20px}.sectionhead h2{margin-bottom:5px}.sectionhead p{margin:0;color:var(--muted)}.inlinecreate{display:flex;gap:8px;min-width:460px}.inlinecreate input{margin:0}.editornotice{margin-bottom:12px;padding:11px 13px;border:1px solid #dce4fa;background:#f7f9ff;border-radius:10px;color:#64708a}
@media(max-width:1250px){.templategrid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:850px){.templategrid{grid-template-columns:1fr 1fr}.sectionhead{align-items:stretch;flex-direction:column}.inlinecreate{min-width:0;width:100%}}
@media(max-width:560px){.templategrid{grid-template-columns:1fr}.inlinecreate{flex-direction:column}}

.rowactions{display:flex;align-items:center;justify-content:flex-end;gap:12px;white-space:nowrap}.rowactions form{margin:0}.linkdanger{background:transparent;color:#b64b4b;padding:0;border:0;font:inherit;cursor:pointer}.linkdanger:hover{text-decoration:underline}.inlinecreate input[type=file]{background:#fff;padding:8px}.pendingmsg{opacity:.72}.senderror{margin-top:6px;font-size:12px;color:#b64b4b;max-width:480px}
@media(max-width:760px){.rowactions{justify-content:flex-start;flex-wrap:wrap}.inlinecreate input[type=file]{width:100%}}

.editorbar{flex-wrap:wrap;align-items:center}

.branchrow{grid-template-columns:1fr 1fr 1.15fr auto}
.branchrow select{min-width:180px}
@media(max-width:760px){.branchrow{grid-template-columns:1fr}.branchrow select{min-width:0;width:100%}}

.saleform{display:flex;gap:6px;align-items:center;min-width:130px}.saleform input{width:95px;margin:0}table code{white-space:nowrap}

/* Visual node graph */
.editorlayout{display:block}
.canvas{display:block;position:relative;overflow:auto;min-height:650px;padding:0;background-color:#fbfcfe}
.flowgraph{position:relative;min-width:100%;min-height:100%}
.flowedges{position:absolute;inset:0;overflow:visible;pointer-events:none}
.flowline{fill:none;stroke:#aab5c6;stroke-width:1.7}
.flowline.button,.flowline.jump{stroke:#7289da}.flowline.yes{stroke:#55a17a}.flowline.no{stroke:#c17a7a}.flowline.return{stroke:#9a7cc1;stroke-dasharray:5 4}
.flowedges marker path{fill:#9ba8bb}
.flowlabel{font-size:11px;fill:#69758a;text-anchor:middle;paint-order:stroke;stroke:#fbfcfe;stroke-width:5px;stroke-linejoin:round}
.flownode{position:absolute;box-sizing:border-box;background:#fff;border:1px solid #dce3ed;border-radius:13px;padding:14px;box-shadow:0 5px 18px rgba(30,50,90,.06);z-index:2}
.flownode:hover{border-color:#9fb6dc;box-shadow:0 7px 24px rgba(30,50,90,.10)}
.flownode small{display:block;color:var(--muted);height:34px;overflow:hidden;margin:8px 0 9px;line-height:1.35}
.flownode button{padding:6px 10px;font-size:12px}
.flownode.menu,.flownode.buttons,.flownode.condition{border-color:#b8c9e7}
.flownode.subscription,.flownode.promo{border-color:#bad9c9}
.flownode.request,.flownode.handoff{border-color:#d7c6e7}
.branchbadge{font-size:10px;background:#eef3fb;color:#58719a;border-radius:999px;padding:3px 6px;margin-left:auto}
.branchbadge+.nodenum{margin-left:4px}
@media(max-width:800px){.canvas{min-height:600px}.flowgraph{transform-origin:top left}.flownode{font-size:13px}}

/* Graph workspace interactions */
.canvas{cursor:grab;overflow:hidden!important;height:calc(100vh - 230px);min-height:620px;position:relative;user-select:none;background-image:radial-gradient(#d7e0ed 1px,transparent 1px);background-size:20px 20px}
.canvas.panning{cursor:grabbing}
.flowgraph{position:absolute;left:0;top:0;transform-origin:0 0;will-change:transform}
.flownode{height:auto!important;min-height:150px;cursor:grab;user-select:none}
.flownode.dragging{cursor:grabbing;z-index:20;box-shadow:0 12px 32px rgba(30,50,90,.16)}
.nodeoutputs{border-top:1px solid #edf1f6;margin:7px -4px 9px;padding-top:6px}
.nodeout{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;padding:4px 5px;border-radius:6px;color:#66758b}
.nodeout span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:130px}
.nodeout b{font-weight:500;color:#4f6381;white-space:nowrap}
.nodeout.yes b{color:#428263}.nodeout.no b{color:#a15d5d}.nodeout.jump b,.nodeout.button b{color:#5675bd}
.mutedout{opacity:.65}
.graphcontrols{position:absolute;right:16px;top:16px;z-index:50;display:flex;align-items:center;gap:5px;background:rgba(255,255,255,.94);border:1px solid #dce3ed;border-radius:10px;padding:5px;box-shadow:0 5px 18px rgba(30,50,90,.08)}
.graphcontrols button{padding:6px 9px;margin:0;background:#fff;color:#42526b;border:1px solid #e1e6ee}
.graphcontrols span{font-size:12px;min-width:44px;text-align:center;color:#69758a}
.flowlabel{display:none}

/* Graph polish 0.3.0 */
.flownode{overflow:visible}
.inport,.outport{position:absolute;width:9px;height:9px;border-radius:50%;background:#fff;border:2px solid #8ea2c2;box-sizing:border-box;z-index:4}
.inport{left:-5px;top:24px}
.nodeout{position:relative;padding:5px 6px 5px 10px;min-height:27px}
.nodeout .outport{right:-15px;top:50%;transform:translateY(-50%)}
.nodeout.button .outport,.nodeout.jump .outport{border-color:#5e7ed0}
.nodeout.yes .outport{border-color:#55a17a}.nodeout.no .outport{border-color:#c17a7a}.nodeout.return .outport{border-color:#9a7cc1}
.nodeout .outlabel{max-width:135px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nodeout b{max-width:120px;overflow:hidden;text-overflow:ellipsis}
.flowline{transition:opacity .12s,stroke-width .12s;pointer-events:none}
.flowline.dim{opacity:.08}.flowline.hot{opacity:1;stroke-width:2.7}
.flownode:hover{z-index:8}
.graphcontrols{gap:4px}
.graphcontrols button{white-space:nowrap}

/* Selection and collision polish 0.3.1 */
.flownode.selected{
  border-color:#5f7fd6!important;
  box-shadow:0 0 0 3px rgba(95,127,214,.14),0 10px 28px rgba(30,50,90,.14)!important;
  z-index:25;
}
.flownode.selected .nodetop b{color:#365bb7}
.flowline.selectededge{opacity:1!important;stroke-width:3.1!important}
.flowline.dimselected{opacity:.07!important}

/* Smart layout 0.3.2 */
.flowline{stroke:#9aabc3}
.flownode{transition:border-color .12s,box-shadow .12s}
.graphcontrols button:last-child{font-weight:600}

/* Dynamic edge anchors 0.3.3 */
.inport,.outport{display:none!important}
.dynport{
  position:absolute;width:10px;height:10px;border-radius:50%;
  background:#fff;border:2px solid #8ea2c2;box-sizing:border-box;
  pointer-events:none;z-index:9
}
.dynport.button,.dynport.jump{border-color:#5e7ed0}
.dynport.yes{border-color:#55a17a}
.dynport.no{border-color:#c17a7a}
.dynport.return{border-color:#9a7cc1}
.dynport.indyn{border-color:#8ea2c2;background:#f8fbff}

/* Modal and editor controls polish 0.3.4 */

/* Graph toolbar must always stay under any open modal. */
.graphcontrols{
  z-index:30!important;
}

/* Modal stack must win over every editor layer. */
.modalback,
.modal-overlay,
.modal-backdrop{
  z-index:1000!important;
}
.modal,
.modalbox,
.modal-card,
.dialogbox{
  z-index:1010!important;
}

/* Prevent graph content / controls from visually bleeding through modal. */
body:has(.modalback:not([style*="display: none"])),
body:has(.modal-overlay:not([style*="display: none"])){
  overflow:hidden;
}

/* Button editor rows: give the delete action a proper click target. */
.branchrow{
  display:grid!important;
  grid-template-columns:minmax(150px,1fr) minmax(150px,1fr) minmax(200px,1.25fr) 42px!important;
  gap:8px!important;
  align-items:center!important;
}
.branchrow > button:last-child,
.branchrow .remove,
.branchrow .delete,
.branchrow .danger{
  width:38px!important;
  min-width:38px!important;
  height:38px!important;
  padding:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:18px!important;
  line-height:1!important;
  border-radius:9px!important;
  flex:0 0 38px!important;
}

/* If delete is rendered as a plain red X button without a class,
   the last button in a branch row still receives the larger target. */
.branchrow button:last-child{
  width:38px!important;
  min-width:38px!important;
  height:38px!important;
  padding:0!important;
}

/* Keep row inputs from squeezing the delete button. */
.branchrow input,
.branchrow select{
  min-width:0!important;
  width:100%!important;
}

@media(max-width:760px){
  .branchrow{
    grid-template-columns:1fr!important;
  }
  .branchrow button:last-child{
    justify-self:end!important;
  }
}

.editor-modalback{z-index:1000!important}
.editor-modal{z-index:1010!important}

/* Test reset 0.3.5 */
.resettestform{margin-top:18px;padding-top:14px;border-top:1px solid #e9edf3}
.resettestform .danger{background:#fff1f1;color:#b54141;border:1px solid #f0cccc}

/* Advertising source presets 0.3.6 */
.sourcepresets{margin-bottom:16px}
.presetgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:8px;margin-top:12px}
.presetcard{display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-align:left;background:#fff;color:#26344a;border:1px solid #dce4ef;padding:11px 12px;border-radius:10px}
.presetcard:hover,.presetcard.active{border-color:#7d9be0;background:#f5f8ff}
.presetcard small{color:#7a8799;font-size:11px}
.sourcelink{display:flex;align-items:center;gap:6px;min-width:280px}
.sourcelink code{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:330px}
.copymini{padding:5px 8px!important;font-size:11px!important;white-space:nowrap}

/* Global cleanup + mobile/PWA shell 0.3.7 */
.mobilemenu,.navshade{display:none}
aside nav a.active{background:#eef3ff;color:#315bd4}
.statlink{text-decoration:none;color:inherit;display:block}
.statlink:hover{border-color:#b8c8eb;transform:translateY(-1px)}
.statlink span{display:block;color:var(--muted);font-size:12px;margin-top:5px}
.scenario-name{font-size:18px!important;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.panelhead{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}
.panelhead h2{margin:0}.panelhead p{margin:3px 0 0;color:var(--muted);font-size:13px}
.panelhead>a{font-size:13px;text-decoration:none;color:#365edf}
.recentlist{display:flex;flex-direction:column}
.recentrequest{display:flex;align-items:center;gap:11px;padding:11px 0;border-top:1px solid #edf1f6;text-decoration:none;color:inherit}
.recentrequest:first-child{border-top:0}
.recentavatar{width:34px;height:34px;border-radius:10px;background:#eef3ff;color:#365edf;display:flex;align-items:center;justify-content:center;font-weight:700;flex:0 0 34px}
.recentbody{min-width:0;flex:1}.recentbody b,.recentbody small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.recentbody b span{font-weight:400;color:var(--muted)}.recentbody small{margin-top:3px;color:var(--muted)}
.recentmeta{text-align:right}.recentmeta small{display:block;color:var(--muted);margin-top:4px}
.statuspill{font-size:11px;padding:4px 7px;border-radius:999px;background:#eef2f7}.statuspill.new{background:#fff3d9;color:#8a6418}.statuspill.success{background:#e7f7ee;color:#2f7650}
.quickactions{display:grid;gap:8px;margin-top:16px}.quickactions a{padding:10px 12px;border:1px solid #e1e7ef;border-radius:9px;text-decoration:none;color:#365edf;background:#fff}.quickactions a:hover{background:#f7f9ff}

@media(max-width:900px){
  body{display:block}
  aside{position:fixed!important;left:-280px;top:0;bottom:0;width:250px!important;z-index:900;transition:left .2s ease;box-shadow:8px 0 30px rgba(20,35,60,.12)}
  body.navopen aside{left:0}
  .navshade{display:block;position:fixed;inset:0;background:rgba(26,35,52,.28);z-index:850;opacity:0;pointer-events:none;transition:opacity .2s}
  body.navopen .navshade{opacity:1;pointer-events:auto}
  .mobilemenu{display:flex;position:fixed;left:max(12px,env(safe-area-inset-left));top:max(12px,env(safe-area-inset-top));z-index:800;width:42px;height:42px;align-items:center;justify-content:center;border-radius:11px;background:#fff;color:#26344a;border:1px solid #dde4ee;box-shadow:0 4px 18px rgba(30,50,90,.10);padding:0;font-size:20px}
  main{margin-left:0!important;width:auto!important;padding:14px!important;padding-top:68px!important;padding-left:max(14px,env(safe-area-inset-left))!important;padding-right:max(14px,env(safe-area-inset-right))!important;padding-bottom:max(18px,env(safe-area-inset-bottom))!important}
  main>header{min-height:44px;margin-bottom:14px;align-items:flex-start}
  main>header h1{font-size:24px;margin:0}
  main>header p{font-size:13px;margin-top:3px}
  .logout{font-size:12px}
  .cards,.grid2,.dashboardgrid{grid-template-columns:1fr 1fr!important}
  .panel{min-width:0}
  table{min-width:720px}
  .panel:has(table){overflow-x:auto;-webkit-overflow-scrolling:touch}
}
@media(max-width:620px){
  .cards,.grid2,.dashboardgrid{grid-template-columns:1fr!important}
  .dashcards{grid-template-columns:1fr 1fr!important}
  .stat{padding:13px!important}.stat strong{font-size:25px}
  .scenario-name{font-size:15px!important}
  .recentrequest{gap:8px}.recentmeta{max-width:92px}
  .panel{padding:14px!important;border-radius:12px!important}
  input,select,textarea,button{font-size:16px}
}
@media(max-width:390px){
  .dashcards{grid-template-columns:1fr!important}
}

/* Scenario rename 0.3.8 */
.scenarionamebar{display:flex;align-items:end;gap:10px;margin-bottom:12px}
.scenarionamebar>label{display:none}
.scenarionamebar>div{display:flex;gap:8px;align-items:center;max-width:620px;width:100%}
.scenarionamebar input{margin:0;min-width:0;flex:1;font-size:18px;font-weight:600}
.scenarionamebar button{margin:0;white-space:nowrap}
@media(max-width:620px){
 .scenarionamebar>div{align-items:stretch}
 .scenarionamebar input{font-size:16px}
 .scenarionamebar button{padding-left:10px;padding-right:10px}
}

/* Multi-bot / admin cleanup 0.4.0 */
.botcards{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px}
.botcardhead{display:flex;align-items:center;gap:10px;margin-bottom:15px}.botcardhead>div:nth-child(2){flex:1}.botcardhead b,.botcardhead small{display:block}
.fieldhint{display:block;color:var(--muted);margin-top:-6px;margin-bottom:10px}
.checkline{display:flex;align-items:center;gap:8px;margin:10px 0}.checkline input{width:auto;margin:0}
.pagehint{padding:11px 13px;background:#f5f8ff;border:1px solid #e2e9f7;border-radius:10px;margin-bottom:14px;color:#536176;font-size:13px}
.recoverybox code{display:block;padding:13px;background:#f3f5f8;border-radius:9px;font-size:17px;word-break:break-all;margin-top:10px}
.authback{display:block;text-align:center;margin-top:14px;color:#526a9e;text-decoration:none}
@media(max-width:620px){.botcards{grid-template-columns:1fr}.botcreate{display:block}}

/* Product branding 0.4.1 */
.brand{display:flex;align-items:center;gap:10px}
.brand img{width:34px;height:34px;border-radius:10px;object-fit:cover;box-shadow:0 3px 10px rgba(54,94,223,.18)}
.brandauth{background:transparent!important;overflow:visible!important}
.brandauth img{width:58px;height:58px;border-radius:16px;display:block}
.productfooter{display:flex;gap:9px;align-items:center;justify-content:center;flex-wrap:wrap;color:#98a3b3;font-size:11px;padding:28px 8px 8px}
.productfooter span+span:before,.productfooter a:before{content:"·";margin-right:9px;color:#c3cad5}
.productfooter a{color:#7588aa;text-decoration:none}
@media(max-width:620px){.productfooter{padding-bottom:max(8px,env(safe-area-inset-bottom));font-size:10px}}

/* 0.4.2 scenario save + bot card + sidebar branding */
aside{display:flex;flex-direction:column}
aside nav{flex:1;min-height:0;overflow-y:auto}
.sidebarproduct{margin-top:auto;padding:14px 10px 4px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:3px;color:#98a3b3;font-size:10px;line-height:1.35}
.sidebarproduct b{color:#69778d;font-size:11px}
.sidebarproduct a{color:#7588aa;text-decoration:none;padding:0;margin:0;background:none!important}
.productfooter{display:none!important}

.botcards{display:grid;grid-template-columns:repeat(auto-fit,minmax(430px,1fr));gap:16px}
.botcard{position:relative}
.botidentity{display:flex;align-items:center;gap:12px;padding-bottom:15px;margin-bottom:15px;border-bottom:1px solid #edf1f6}
.botidentitytext{min-width:0;flex:1}
.botidentitytext small{display:block;color:var(--muted);margin-top:3px}
.botnameline{display:flex;align-items:center;gap:9px;min-width:0}
.botnameline b{font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.botsettings{display:grid;grid-template-columns:1fr 1fr;gap:14px 16px;align-items:end}
.botfield{min-width:0}
.botfield label{display:block;margin-bottom:6px}
.botfield input,.botfield select{width:100%;margin:0}
.botfieldwide{grid-column:1/-1}
.botcardactions{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:12px;padding-top:2px}
.botcardactions button{margin:0;min-width:120px}
.switchline{display:flex!important;align-items:center;gap:8px;margin:0!important;font-weight:500}
.switchline input{width:auto!important;margin:0!important}
.botdelete{margin-top:12px;padding-top:10px;border-top:1px solid #f0f2f6}
.botdelete button{margin:0;padding:0!important;background:none!important;border:0!important}
.scenarionamebar>div{max-width:720px}

@media(max-width:900px){
  .sidebarproduct{padding-bottom:max(8px,env(safe-area-inset-bottom))}
}
@media(max-width:620px){
  .botcards{grid-template-columns:1fr}
  .botsettings{grid-template-columns:1fr}
  .botfieldwide,.botcardactions{grid-column:1}
  .botcardactions{align-items:center}
  .botcardactions button{min-width:110px}
  .scenarionamebar>div{flex-direction:column;align-items:stretch}
  .scenarionamebar button{width:100%}
}

/* Sidebar product signature 0.4.3 */
.sidebarproduct{
  margin-top:auto!important;
  padding:10px 8px 2px!important;
  border-top:1px solid #edf1f6!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  color:#a0a9b7!important;
  font-size:9px!important;
  line-height:1!important;
  white-space:nowrap!important;
  font-weight:400!important;
}
.sidebarproduct span,
.sidebarproduct a{
  color:#a0a9b7!important;
  font-size:9px!important;
  font-weight:400!important;
  text-decoration:none!important;
  padding:0!important;
  margin:0!important;
  background:none!important;
}
.sidebarproduct a:hover{color:#7f8998!important}
.sidebarproduct-dot{opacity:.65}

/* Chat button preview 0.4.5 */
.chatbuttons{display:flex;flex-direction:column;gap:6px;margin-top:9px}
.chatbuttonrow{display:flex;gap:6px;flex-wrap:wrap}
.chatbutton{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-height:30px;
  padding:6px 10px;
  border:1px solid #dce5f2;
  border-radius:8px;
  background:#f7f9fd;
  color:#355070;
  font-size:12px;
  line-height:1.2;
}
.chatbutton small{font-size:10px;color:#8491a5;margin:0!important}
.msg.out .chatbutton{background:#edf3ff;border-color:#d6e2fb}
.replybuttons .chatbutton{background:#f5f7fa}
@media(max-width:620px){
  .chatbuttonrow{display:grid;grid-template-columns:1fr;width:100%}
  .chatbutton{width:100%}
}

/* Bot card & global modal 0.4.7 */
.botcards{display:grid;grid-template-columns:repeat(auto-fit,minmax(520px,1fr));gap:16px}
.botcard{padding:18px!important}
.botidentity{display:flex;align-items:center;gap:12px;padding-bottom:15px;margin-bottom:16px;border-bottom:1px solid #edf1f6}
.botidentity .avatar{flex:0 0 auto}
.botidentitytext{min-width:0;flex:1}
.botidentitytext b{display:block;font-size:16px}
.botidentitytext small{display:block;color:var(--muted);margin-top:3px}
.statusbadge{flex:0 0 auto;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:600}
.statusbadge.on{background:#e8f7ef;color:#2d7a50}
.statusbadge.off{background:#f1f3f6;color:#7b8593}

.botsettings{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px 16px}
.botfield{min-width:0}
.botfield label{display:block;margin-bottom:6px}
.botfield input,.botfield select{width:100%!important;max-width:none!important;box-sizing:border-box;margin:0!important}
.botfieldwide{grid-column:1/-1}
.fieldhint{display:block;margin:6px 0 0!important;color:var(--muted);font-size:11px}

.botactionbar{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:14px;padding-top:2px}
.botbuttons{display:flex;gap:8px;align-items:center}
.botbuttons button{margin:0!important;min-width:104px}
.dangerbtn{background:#fff!important;color:#c43d3d!important;border:1px solid #efcaca!important;border-radius:9px!important;padding:9px 14px!important;font-weight:600!important}
.dangerbtn:hover{background:#fff5f5!important;border-color:#e8adad!important}

.switchrow{display:flex!important;align-items:center;gap:9px;margin:0!important;cursor:pointer;font-weight:500}
.switch{position:relative;width:42px;height:24px;display:inline-block;flex:0 0 42px}
.switch input{position:absolute;opacity:0;pointer-events:none}
.switch i{position:absolute;inset:0;background:#cbd3df;border-radius:999px;transition:.18s}
.switch i:after{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(25,40,65,.2);transition:.18s}
.switch input:checked+i{background:#365edf}
.switch input:checked+i:after{transform:translateX(18px)}

.appmodal{position:fixed;inset:0;z-index:2000;display:none;align-items:center;justify-content:center;padding:18px}
.appmodal.open{display:flex}
.appmodalbackdrop{position:absolute;inset:0;background:rgba(22,30,43,.34);backdrop-filter:blur(2px)}
.appmodalbox{position:relative;width:min(420px,100%);background:#fff;border:1px solid #e4e9f0;border-radius:16px;box-shadow:0 20px 70px rgba(25,40,65,.22);padding:20px}
.appmodalbox h3{margin:0 36px 7px 0;font-size:18px}
.appmodalbox p{margin:0;color:#69768a;line-height:1.45;font-size:13px}
.appmodalclose{position:absolute;right:12px;top:10px;width:32px;height:32px;border:0;background:transparent!important;color:#8a94a3!important;font-size:22px;padding:0!important}
.appmodalactions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
.appmodalactions button{margin:0!important}
body.modalopen{overflow:hidden}

@media(max-width:620px){
  .botcards{grid-template-columns:1fr}
  .botsettings{grid-template-columns:1fr}
  .botfieldwide,.botactionbar{grid-column:1}
  .botactionbar{align-items:center}
  .botbuttons{margin-left:auto}
  .botbuttons button{min-width:auto}
  .appmodal{align-items:flex-end;padding:10px}
  .appmodalbox{border-radius:16px}
}

/* Telegram ownership diagnostics 0.4.9 */
.botdiagnostics{border:1px solid #e3e9f2;border-radius:12px;background:#fafbfd;padding:13px}
.botdiaghead{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.botdiaghead b,.botdiaghead small{display:block}.botdiaghead small{color:var(--muted);font-size:10px;margin-top:3px}
.diagstatus{padding:4px 8px;border-radius:999px;font-size:10px;font-weight:600;white-space:nowrap;background:#eef1f5;color:#6d7887}
.diagstatus.ok{background:#e8f7ef;color:#2d7a50}
.diagstatus.external_webhook,.diagstatus.polling_conflict{background:#fff0dc;color:#9b631b}
.diagstatus.error,.diagstatus.token_error{background:#fff0f0;color:#a94444}
.diagwarning{display:flex;flex-direction:column;gap:4px;margin-top:10px;padding:10px 11px;border-radius:9px;background:#fff7eb;color:#7f5a25;font-size:12px;word-break:break-word}
.diagok{margin-top:10px;color:#52705f;font-size:12px}
.diagfacts{display:flex;flex-direction:column;gap:4px;margin-top:9px;color:#788496;font-size:11px}
.diagerror{color:#a45b5b;word-break:break-word}
.diagoktext{color:#3f7657}
.diagactions{display:flex;gap:8px;margin-top:11px;flex-wrap:wrap}
.diagactions button{margin:0!important;font-size:12px!important;padding:7px 10px!important}
.takeoverbtn{border-color:#e9c98c!important;color:#8a611e!important;background:#fffaf0!important}
@media(max-width:620px){
 .botdiaghead{align-items:center}
 .diagactions{display:grid;grid-template-columns:1fr 1fr}
 .diagactions button{width:100%}
}

/* Modal hardening 0.5.0 */
.appmodal{
  position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;
  z-index:99999!important;display:none!important;align-items:center!important;justify-content:center!important;
  padding:20px!important;margin:0!important;box-sizing:border-box!important;overflow:hidden!important;
}
.appmodal.open{display:flex!important}
.appmodalbackdrop{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;background:rgba(20,28,40,.42)!important}
.appmodalbox{
  position:relative!important;z-index:1!important;display:block!important;
  width:min(440px,calc(100vw - 32px))!important;max-width:440px!important;height:auto!important;
  margin:0!important;padding:20px!important;box-sizing:border-box!important;overflow:visible!important;
  background:#fff!important;border:1px solid #e2e8f0!important;border-radius:16px!important;
  box-shadow:0 24px 80px rgba(15,25,40,.25)!important;color:#172033!important;
}
.appmodalbox h3{display:block!important;margin:0 36px 8px 0!important;padding:0!important;font-size:18px!important;line-height:1.3!important}
.appmodalbox p{display:block!important;margin:0!important;padding:0!important;max-width:none!important;font-size:13px!important;line-height:1.5!important;white-space:normal!important;overflow-wrap:anywhere!important}
.appmodalactions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;margin:18px 0 0!important;padding:0!important}
.appmodalactions button{display:inline-flex!important;width:auto!important;min-width:92px!important;height:38px!important;align-items:center!important;justify-content:center!important;margin:0!important}
.appmodalclose{display:flex!important;align-items:center!important;justify-content:center!important;position:absolute!important;right:10px!important;top:10px!important;width:32px!important;height:32px!important;margin:0!important}
@media(max-width:620px){
 .appmodal{align-items:flex-end!important;padding:10px!important}
 .appmodalbox{width:100%!important;max-width:none!important;border-radius:16px!important;padding:18px!important}
 .appmodalactions{display:grid!important;grid-template-columns:1fr 1fr!important}
 .appmodalactions button{width:100%!important}
}

/* Explicit Telegram diagnostics state 0.5.1 */
.diagresult{display:flex;flex-direction:column;gap:4px;margin-top:10px;padding:11px 12px;border-radius:10px;font-size:12px;line-height:1.4}
.diagresult b{font-size:12px}
.diagresult span{word-break:break-word}
.diagresult.ok{background:#edf8f2;color:#356b4d;border:1px solid #d7eee0}
.diagresult.external_webhook,.diagresult.polling_conflict{background:#fff7e8;color:#7c5a25;border:1px solid #f1dfba}
.diagresult.token_error,.diagresult.error{background:#fff1f1;color:#954747;border:1px solid #f0d3d3}
.diagresult.checking{background:#f4f7fb;color:#647287;border:1px solid #e2e8f0}
.diagspinner{display:inline-block;width:11px;height:11px;border:2px solid #c4cede;border-top-color:#365edf;border-radius:50%;vertical-align:-1px;animation:diagspin .8s linear infinite}
@keyframes diagspin{to{transform:rotate(360deg)}}

/* Notifications, request assignment, chat autoscroll 0.5.2 */
.messages{overflow-y:auto;scroll-behavior:smooth}
.managerassign{margin:0}.managerassign select{margin:0;min-width:140px}

aside nav a{position:relative}
.navbadge,.notifycount{display:none;align-items:center;justify-content:center;background:#e84e4e;color:#fff;border-radius:999px;font-size:9px;font-style:normal;font-weight:700;min-width:17px;height:17px;padding:0 4px;line-height:1}
.navbadge{margin-left:auto}
.navbadge.show,.notifycount.show{display:inline-flex}

.headeractions{display:flex;align-items:center;gap:9px}
.notifybutton{position:relative;width:38px;height:38px;display:flex;align-items:center;justify-content:center;padding:0!important;margin:0!important;border:1px solid #dfe5ee!important;border-radius:10px!important;background:#fff!important;color:#536176!important;font-size:20px!important}
.notifycount{position:absolute;right:-5px;top:-5px}
.notifypanel{display:none;position:fixed;right:22px;top:72px;z-index:1200;width:min(380px,calc(100vw - 28px));max-height:70vh;overflow:hidden;background:#fff;border:1px solid #e0e6ef;border-radius:14px;box-shadow:0 18px 60px rgba(25,40,65,.18)}
.notifypanel.open{display:block}
.notifyhead{display:flex;align-items:center;justify-content:space-between;padding:13px 14px;border-bottom:1px solid #edf1f6}
.notifyhead button{background:none!important;color:#6d7c92!important;border:0!important;padding:3px!important;margin:0!important;font-size:11px!important}
.notifylist{max-height:48vh;overflow-y:auto;padding:6px}
.notifyitem{display:flex!important;flex-direction:column!important;align-items:flex-start!important;width:100%!important;text-align:left!important;gap:3px!important;padding:10px!important;margin:0!important;border:0!important;border-radius:9px!important;background:#fff!important;color:#253247!important}
.notifyitem:hover{background:#f6f8fc!important}.notifyitem.unread{background:#f2f6ff!important}
.notifyitem b{font-size:12px}.notifyitem span{font-size:11px;color:#7b8798;line-height:1.35}
.notifypermission{display:block;width:calc(100% - 20px)!important;margin:8px 10px 10px!important;padding:8px!important;background:#f5f7fb!important;color:#556984!important;border:1px solid #e2e8f0!important;font-size:11px!important}

@media(max-width:620px){
 .notifypanel{right:10px;top:62px;width:calc(100vw - 20px);max-height:75vh}
 .managerassign select{min-width:125px}
}

.pagehelp{display:flex;gap:8px;align-items:flex-start;margin:0 0 14px;padding:10px 12px;border:1px solid #e2e8f1;border-radius:10px;background:#f8faff;color:#536176;font-size:12px;line-height:1.45}.pagehelp b{color:#263449;white-space:nowrap}.setupcheck{margin-bottom:16px}.setuplist{display:flex;flex-direction:column;gap:7px}.setupitem{display:flex;align-items:center;gap:11px;padding:10px 11px;border:1px solid #e6ebf2;border-radius:10px;text-decoration:none;color:inherit;background:#fff}.setupitem:hover{background:#f8faff}.setupicon{display:flex;align-items:center;justify-content:center;flex:0 0 26px;width:26px;height:26px;border-radius:50%;font-weight:700;background:#edf2ff;color:#365edf}.setupitem.warn .setupicon{background:#fff1df;color:#a56a1d}.setupitem.optional .setupicon{background:#f1f3f6;color:#718096}.setupbody{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}.setupbody b{font-size:13px}.setupbody small{font-size:11px;color:#758195;line-height:1.35}.setupaction{font-size:11px;color:#365edf;white-space:nowrap}.setupdone{display:flex;gap:8px;align-items:center;margin-bottom:16px;padding:11px 13px;border:1px solid #d9eee1;border-radius:10px;background:#eff9f3;color:#426c52;font-size:12px}.setupdone span{color:#668071}@media(max-width:620px){.pagehelp{flex-direction:column;gap:3px}.setupitem{align-items:flex-start}.setupaction{display:none}}

/* Admin roles + modal reliability 0.5.4 */
body.modalopen{overflow:hidden!important}.rolepill{display:inline-flex;margin:0 0 12px;padding:5px 9px;border-radius:999px;font-size:11px;background:#eef2f7;color:#627086}.rolepill.owner{background:#edf2ff;color:#365edf}.adminteam{margin-top:16px}.adminrows{display:flex;flex-direction:column;gap:7px}.adminrow{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 11px;border:1px solid #e5eaf1;border-radius:10px}.adminrow>div{display:flex;flex-direction:column;gap:2px}.adminrow small{color:#7b8798}.adminrow form{margin:0}.admincreate{margin-top:18px;padding-top:16px;border-top:1px solid #e8edf3}.admincreate h3{margin:0 0 10px;font-size:14px}
@media(max-width:620px){.adminrow{align-items:flex-start}.admincreate .grid2{grid-template-columns:1fr}}

/* Readable request cards/table 0.5.5 */
.requestdata{display:grid;gap:5px;min-width:190px}
.requestfield{display:grid;grid-template-columns:92px minmax(0,1fr);gap:8px;align-items:start;font-size:12px;line-height:1.3}
.requestfield span{color:#7a8799}
.requestfield b{font-weight:600;color:#263449;overflow-wrap:anywhere}
.requestactions{width:42px;text-align:right}
.requestdelete{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:32px!important;min-width:32px!important;height:32px!important;padding:0!important;margin:0!important;border:1px solid #efd6d6!important;border-radius:9px!important;background:#fff7f7!important;color:#c44b4b!important;font-size:18px!important;line-height:1!important}
.requestdelete:hover{background:#ffeded!important;border-color:#e8bcbc!important}
@media(max-width:760px){
 .requestfield{grid-template-columns:82px minmax(0,1fr)}
 .requestdata{min-width:170px}
}

/* Function audit 0.5.7 */
.manageractions{white-space:nowrap}.inlineaction{display:inline-block;margin:0 4px 0 0}.inlineaction button{margin:0!important}

/* Canonical global popup layer 0.5.8. Keep this block last. */
html body .appmodal{
 position:fixed!important;left:0!important;top:0!important;right:0!important;bottom:0!important;
 width:100%!important;height:100%!important;min-width:0!important;max-width:none!important;
 margin:0!important;padding:20px!important;box-sizing:border-box!important;
 display:none!important;align-items:center!important;justify-content:center!important;
 overflow:auto!important;z-index:2147483000!important;
 transform:none!important;translate:none!important;scale:none!important;filter:none!important;
 background:transparent!important;
}
html body .appmodal.open{display:flex!important}
html body .appmodalbackdrop{
 position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;
 margin:0!important;padding:0!important;z-index:0!important;
 background:rgba(18,27,41,.42)!important;backdrop-filter:blur(2px)!important;
}
html body .appmodalbox{
 position:relative!important;inset:auto!important;z-index:1!important;
 display:block!important;float:none!important;
 width:440px!important;max-width:calc(100vw - 32px)!important;min-width:0!important;
 height:auto!important;max-height:calc(100vh - 40px)!important;overflow:auto!important;
 margin:auto!important;padding:20px!important;box-sizing:border-box!important;
 transform:none!important;translate:none!important;scale:none!important;
 background:#fff!important;border:1px solid #e1e7ef!important;border-radius:16px!important;
 box-shadow:0 24px 80px rgba(15,25,40,.25)!important;color:#172033!important;text-align:left!important;
}
html body .appmodalbox h3{margin:0 38px 8px 0!important;padding:0!important;font-size:18px!important;line-height:1.3!important;color:#172033!important}
html body .appmodalbox p{margin:0!important;padding:0!important;font-size:13px!important;line-height:1.5!important;color:#69768a!important;white-space:normal!important;overflow-wrap:anywhere!important}
html body .appmodalactions{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;margin:18px 0 0!important;padding:0!important}
html body .appmodalactions button{position:static!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;width:auto!important;min-width:96px!important;height:38px!important;margin:0!important;padding:8px 14px!important}
html body .appmodalclose{position:absolute!important;right:10px!important;top:10px!important;display:flex!important;width:32px!important;min-width:32px!important;height:32px!important;padding:0!important;margin:0!important;align-items:center!important;justify-content:center!important}
html body.modalopen{overflow:hidden!important}
@media(max-width:620px){
 html body .appmodal{padding:10px!important;align-items:flex-end!important}
 html body .appmodalbox{width:100%!important;max-width:100%!important;max-height:85vh!important;margin:0!important;padding:18px!important;border-radius:16px!important}
 html body .appmodalactions{display:grid!important;grid-template-columns:1fr 1fr!important}
 html body .appmodalactions button{width:100%!important;min-width:0!important}
}

/* Sources help + unique code 0.5.9 */
.sourcecodeinput{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:center}
.sourcecodeinput input{margin:0!important}
.sourceunique{margin:0!important;height:42px!important;white-space:nowrap;font-size:11px!important;padding:0 12px!important}
.fieldhint{display:block;margin:5px 0 10px;color:#8390a2;font-size:10px;line-height:1.35}.fieldhint b{font-weight:600;color:#66758a}
.sourcehow{height:auto!important;min-height:0!important}
.howsteps{display:grid;gap:10px;margin-top:10px}
.howsteps div{display:flex;flex-direction:column;gap:2px;padding-left:11px;border-left:2px solid #dce5f5}
.howsteps b,.howmanager b{font-size:12px;color:#263449}.howsteps span,.howmanager span{font-size:11px;line-height:1.4;color:#748196}
.howmanager{display:flex;flex-direction:column;gap:3px;margin-top:12px;padding:10px 11px;border-radius:9px;background:#f6f8fc}
@media(max-width:620px){
 .sourcecodeinput{grid-template-columns:1fr}
 .sourceunique{width:100%!important}
}
