/* NodexaBot AI Template Builder – Clean Dark redesign v5.32.2.
   This is a scoped skin for the owner-only page; no global theme changes. */
#dashboardAiTemplate.ai-template-page{--ait-fg:#f2f4ff;--ait-muted:#97a8c5;--ait-line:#283650;max-width:1180px;width:100%;min-width:0;margin:0 auto;padding-bottom:32px;color:var(--ait-fg);font-family:Inter,system-ui,sans-serif}
#dashboardAiTemplate *,#dashboardAiTemplate *::before,#dashboardAiTemplate *::after{box-sizing:border-box}
#dashboardAiTemplate button,#dashboardAiTemplate textarea{font:inherit}
#dashboardAiTemplate button{cursor:pointer;touch-action:manipulation}
#dashboardAiTemplate button:disabled{opacity:.6;cursor:wait}
#dashboardAiTemplate :is(button,textarea,summary):focus-visible{outline:2px solid #b0a3ff;outline-offset:3px}
#dashboardAiTemplate .ait-hero{position:relative;isolation:isolate;display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:241px;padding:28px 32px;border:1px solid #45407a;border-radius:20px;background:radial-gradient(ellipse at 95% 0%,rgba(123,49,228,.52),transparent 49%),radial-gradient(ellipse at 68% 120%,rgba(45,75,169,.33),transparent 45%),linear-gradient(120deg,#111b2b,#17172d 66%,#211b46);box-shadow:0 22px 68px #050a1850;overflow:hidden}
#dashboardAiTemplate .ait-hero::before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(100deg,#111c2a 4%,transparent 80%);opacity:.36;z-index:-1}
#dashboardAiTemplate .ait-hero-copy{position:relative;z-index:1;flex:1;min-width:0;max-width:780px}
#dashboardAiTemplate .ait-eyebrow{display:inline-flex;align-items:center;gap:7px;padding:7px 11px;border-radius:30px;background:#5d38ac36;border:1px solid #744cc161;color:#ceafff;font-size:10px;font-weight:800;letter-spacing:.095em}
#dashboardAiTemplate .ait-lock{font-size:12px;color:#ad76ff}
#dashboardAiTemplate .ait-hero h1{font:800 clamp(24px,3vw,39px)/1.13 Manrope,Inter,sans-serif;letter-spacing:-.045em;margin:17px 0 10px;color:#f6f7ff}
#dashboardAiTemplate .ait-hero p{font-size:13px;line-height:1.7;color:#b5c2de;max-width:600px;margin:0}
#dashboardAiTemplate .ait-feature-row{display:flex;flex-wrap:wrap;gap:21px;margin-top:24px}
#dashboardAiTemplate .ait-feature-row>span{display:grid;grid-template-columns:37px minmax(0,1fr);grid-template-rows:auto auto;column-gap:9px;min-width:0;align-items:center}
#dashboardAiTemplate .ait-feature-row i{grid-row:1/3;width:37px;height:37px;border-radius:12px;display:grid;place-items:center;background:#30265d;border:1px solid #6251a057;font-size:19px;font-style:normal;color:#b29aff}
#dashboardAiTemplate .ait-feature-row b{font-size:11px;font-weight:780;white-space:nowrap}
#dashboardAiTemplate .ait-feature-row small{font-size:10px;color:#a1afd0;margin-top:2px;white-space:nowrap}
#dashboardAiTemplate .ait-hero-illustration{position:relative;flex:0 0 160px;height:165px;margin:0 12px;filter:drop-shadow(0 18px 22px #26107d6b)}
#dashboardAiTemplate .ait-hero-tile{position:absolute;display:grid;place-items:center;border-radius:23px;font-size:77px;font-weight:700}
#dashboardAiTemplate .ait-tile-back{width:120px;height:130px;top:21px;left:10px;transform:rotate(-18deg);background:linear-gradient(130deg,#28234c,#161d39);border:1px solid #756db060;color:#776cbb}
#dashboardAiTemplate .ait-tile-front{width:127px;height:127px;top:10px;right:0;transform:rotate(13deg);background:linear-gradient(140deg,#70b0ff 0%,#5a6af6 31%,#7c36e6 78%,#422a98 100%);border:2px solid #b69bff;box-shadow:inset 0 0 23px #ce87ff5a,0 18px 22px #19135e80;color:#eedaff;text-shadow:0 4px 15px #2c136f}
#dashboardAiTemplate .ait-star{position:absolute;color:#8e9fff;font-size:21px}
#dashboardAiTemplate .ait-star-one{top:10px;left:-11px}
#dashboardAiTemplate .ait-star-two{bottom:1px;right:-12px}
#dashboardAiTemplate .ai-template-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:15px;margin-top:16px;min-width:0}
#dashboardAiTemplate .ai-template-panel{min-width:0;padding:23px;border-radius:17px;border:1px solid var(--ait-line);background:linear-gradient(125deg,#141e2d,#101822);overflow:visible;box-shadow:0 12px 28px #04091422}
#dashboardAiTemplate .ait-card-heading{display:flex;align-items:center;gap:13px;min-width:0;margin-bottom:20px}
#dashboardAiTemplate .ait-heading-icon{flex:0 0 42px;width:42px;height:42px;border-radius:12px;background:linear-gradient(140deg,#46318c,#28214b);border:1px solid #6b4bc05c;color:#d9c4ff;display:grid;place-items:center;font-size:24px;box-shadow:0 9px 21px #3a239e2c}
#dashboardAiTemplate .ait-card-heading>div{flex:1;min-width:0}
#dashboardAiTemplate .ait-card-heading h2{font:800 clamp(15px,1.55vw,19px)/1.3 Manrope,Inter,sans-serif;letter-spacing:-.025em;color:#f4f6fe;margin:0}
#dashboardAiTemplate .ait-card-heading p{font-size:12px;line-height:1.55;margin:5px 0 0;color:var(--ait-muted)}
#dashboardAiTemplate .ait-tertiary{flex:none;border:1px solid #4c5799;border-radius:9px;background:#242849;color:#d7ddff;min-height:41px;padding:9px 14px;font-size:12px;font-weight:700;white-space:nowrap}
#dashboardAiTemplate .ait-tertiary:hover{background:#323766}
#dashboardAiTemplate .ait-input-label{display:flex;justify-content:space-between;gap:10px;color:#dce5fa;font-size:12px;font-weight:750;margin:0 0 10px}
#dashboardAiTemplate .ait-input-label span{font-size:11px;font-weight:500;color:#8092b4}
#dashboardAiTemplate .ait-prompt-wrap{position:relative}
#dashboardAiTemplate #aiTemplatePrompt{display:block;max-width:none;width:100%;min-height:205px;resize:vertical;padding:18px 18px 38px;background:linear-gradient(155deg,#0e192b,#101e30);border:1px solid #3d506c;border-radius:13px;font:500 14px/1.7 Inter,system-ui,sans-serif;color:#eff5ff;outline:0;box-shadow:inset 0 0 18px #0710207a;transition:border-color .15s ease,box-shadow .15s ease}
#dashboardAiTemplate #aiTemplatePrompt::placeholder{color:#8294af;opacity:1}
#dashboardAiTemplate #aiTemplatePrompt:focus{border-color:#8d88ed;box-shadow:0 0 0 3px #706cf026}
#dashboardAiTemplate .ait-counter{position:absolute;bottom:12px;right:14px;color:#8292af;font-size:11px;font-variant-numeric:tabular-nums;pointer-events:none}
#dashboardAiTemplate .ait-category-chips{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 16px}
#dashboardAiTemplate .ait-category-chips button{background:#161f31;border:1px solid #37445f;border-radius:999px;color:#c8d4ee;padding:9px 13px;min-height:36px;font-size:12px;font-weight:700;transition:.15s ease}
#dashboardAiTemplate .ait-category-chips button:hover{background:#222c46;border-color:#7771cf;color:white;transform:translateY(-1px)}
#dashboardAiTemplate .ai-template-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:13px}
#dashboardAiTemplate .ait-primary-actions{margin-top:0}
#dashboardAiTemplate .ait-generate-btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:53px;padding:13px 18px;border:1px solid #9979ff;background:linear-gradient(105deg,#8b37ec 0%,#595ff9 57%,#279feb 100%);border-radius:11px;color:#fff;font-size:14px;font-weight:800;box-shadow:0 9px 27px #4e3bdd3f;transition:filter .15s ease,transform .15s ease}
#dashboardAiTemplate .ait-generate-btn:hover:not(:disabled){filter:brightness(1.12);transform:translateY(-1px)}
#dashboardAiTemplate .ait-generate-btn span:last-child{margin-left:3px}
#dashboardAiTemplate .ait-provider-note{font-size:11px;color:#93a5c2;line-height:1.6;margin:13px 0 0}
#dashboardAiTemplate .ait-provider-note span{color:#b4a1fa}
#dashboardAiTemplate .ai-template-status{margin-top:14px;padding:12px 14px;font-size:12px;line-height:1.55;border-radius:10px;color:#8beac2;background:#14362b;border:1px solid #337757;white-space:pre-wrap}
#dashboardAiTemplate .ai-template-status:empty{display:none}
#dashboardAiTemplate .ai-template-status.error{color:#ffc0cb;background:#422633;border-color:#8c4757}
#dashboardAiTemplate .ait-examples-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
#dashboardAiTemplate .ait-example{display:grid;grid-template-columns:42px minmax(0,1fr) 18px;align-items:center;gap:10px;min-height:78px;background:linear-gradient(120deg,#18243a,#131e30);border:1px solid #344563;border-radius:12px;color:#edf2fe;padding:13px;text-align:left;transition:background .15s ease,border-color .15s ease,transform .15s ease}
#dashboardAiTemplate .ait-example:hover{background:#212d48;border-color:#7774ca;transform:translateY(-1px)}
#dashboardAiTemplate .ait-example-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:11px;background:#263058;color:#ad9bff;font-size:22px}
#dashboardAiTemplate .ait-example>span:nth-child(2){display:grid;gap:4px;min-width:0}
#dashboardAiTemplate .ait-example b{font-size:12px;font-weight:800;color:#eef4ff}
#dashboardAiTemplate .ait-example small{color:#a1afc7;font-size:11px;line-height:1.45}
#dashboardAiTemplate .ait-example>span:last-child{font-size:17px;color:#c5d6f9}
#dashboardAiTemplate .ait-preview-pill{font-size:10px;font-weight:800;letter-spacing:.06em;color:#a1a9c3;background:#252b3b;border:1px solid #39445a;border-radius:30px;padding:7px 10px;white-space:nowrap}
#dashboardAiTemplate .ait-preview-pill-ready{color:#73eab4;background:#14352b;border-color:#2f6b56}
#dashboardAiTemplate .ait-placeholder-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
#dashboardAiTemplate .ait-placeholder-column{display:flex;flex-direction:column;gap:11px;min-width:0;border:1px dashed #3a4d6c;border-radius:12px;background:#101b2b;padding:15px}
#dashboardAiTemplate .ait-placeholder-column b{font-size:12px;font-weight:800;color:#bed0f3;margin-bottom:4px}
#dashboardAiTemplate .ait-placeholder-column span{font-size:12px;color:#91a4c0}
#dashboardAiTemplate .ait-placeholder-column em{font-size:10px;color:#7e8ea6;font-style:normal;margin-top:4px}
#dashboardAiTemplate .ait-preview-instruction{margin:15px 1px 0;font-size:11px;color:#a9b6d3;line-height:1.6}
#dashboardAiTemplate .ai-template-summary{padding:12px 14px;margin-bottom:15px;color:#bcd1ef;font-size:12px;border-radius:10px;background:#17243a;border:1px solid #334364}
#dashboardAiTemplate .ai-template-tree{max-height:520px;overflow-y:auto;background:#0c1626;border:1px solid #2c3c57;border-radius:13px;padding:16px;display:grid;grid-template-columns:repeat(auto-fit,minmax(205px,1fr));align-items:start;gap:10px;margin:0 0 18px}
#dashboardAiTemplate .ai-template-roles{display:flex;align-items:flex-start;align-content:flex-start;gap:7px;flex-wrap:wrap;margin:0;min-width:0;padding:13px;border:1px solid #374264;border-radius:11px;background:#172033}
#dashboardAiTemplate .ai-template-roles>strong{flex-basis:100%;font-size:13px;margin-bottom:5px;color:#f0e8ff}
#dashboardAiTemplate .ai-template-role{border:1px solid #4e4b85;border-radius:8px;padding:6px 9px;background:#2b2d4f;color:#e6ddff;font-size:11px;max-width:100%;overflow-wrap:anywhere}
#dashboardAiTemplate .ai-template-category{min-width:0;margin:0;padding:13px;border:1px solid #314463;border-radius:11px;background:#152138}
#dashboardAiTemplate .ai-template-category>strong{display:block;margin-bottom:9px;font-size:12px;color:#c5d8ff;overflow-wrap:anywhere}
#dashboardAiTemplate .ai-template-channel{font-size:11px;color:#e8f1ff;border-radius:7px;padding:8px;display:flex;justify-content:space-between;gap:8px;overflow-wrap:anywhere}
#dashboardAiTemplate .ai-template-channel span{flex-shrink:0;font-size:10px;color:#a7bad5}
#dashboardAiTemplate .ai-template-channel:nth-child(2n){background:#1b2b46}
#dashboardAiTemplate .ait-json-editor{margin-top:12px;background:#101b2d;border:1px solid #354560;border-radius:12px;overflow:hidden}
#dashboardAiTemplate .ait-json-editor>summary{list-style:none;cursor:pointer;font-size:13px;font-weight:760;display:flex;justify-content:space-between;gap:14px;padding:15px 17px;color:#d5def7}
#dashboardAiTemplate .ait-json-editor>summary::-webkit-details-marker{display:none}
#dashboardAiTemplate .ait-json-editor[open]>summary{border-bottom:1px solid #354560}
#dashboardAiTemplate .ait-json-editor>label{display:block;margin:15px 17px 8px;font-size:12px;font-weight:700;color:#b9c7e4}
#dashboardAiTemplate #aiTemplateJson{display:block;resize:vertical;width:calc(100% - 34px);margin:0 17px 17px;min-height:220px;max-width:100%;padding:14px;background:#0a1424;border:1px solid #3e4f6e;border-radius:10px;color:#d6e4ff;font:500 12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace}
#dashboardAiTemplate #aiTemplateJson:focus{border-color:#8880db;outline:none}
#dashboardAiTemplate .ait-preview-actions{margin-top:15px}
#dashboardAiTemplate .ait-preview-actions button{min-height:44px;padding:11px 17px;border-radius:9px;font-size:12px;font-weight:800}
#dashboardAiTemplate .ait-preview-actions .button-primary{background:linear-gradient(95deg,#5f54dd,#4f84ff);border-color:#747aff;color:#fff}
#dashboardAiTemplate .ait-safe-note{color:#a3b2ca;font-size:11px;line-height:1.6;margin:13px 0 0}
#dashboardAiTemplate [hidden]{display:none!important}
#dashboardAiTemplate .ait-tips{border:1px solid #344862;border-radius:13px;background:#15233a;overflow:hidden}
#dashboardAiTemplate .ait-tips>summary{list-style:none;cursor:pointer;display:flex;gap:12px;align-items:center;padding:14px 17px}
#dashboardAiTemplate .ait-tips>summary::-webkit-details-marker{display:none}
#dashboardAiTemplate .ait-tips>summary>span:nth-child(2){display:grid;gap:5px;flex:1;min-width:0}
#dashboardAiTemplate .ait-tips b{font-size:12px;font-weight:800}
#dashboardAiTemplate .ait-tips small{font-size:11px;color:#a2b2cc;line-height:1.4}
#dashboardAiTemplate .ait-tips p{border-top:1px solid #344862;margin:0;padding:15px 17px;font-size:11px;line-height:1.7;color:#b5c3dc}
@media(max-width:1050px){#dashboardAiTemplate .ait-hero{padding:23px 24px}#dashboardAiTemplate .ait-hero-illustration{flex-basis:115px;transform:scale(.78);margin:-12px}#dashboardAiTemplate .ait-feature-row{gap:12px}}
@media(max-width:780px){#dashboardAiTemplate .ait-hero{min-height:0}#dashboardAiTemplate .ait-hero-illustration{display:none}#dashboardAiTemplate .ait-feature-row{gap:13px}#dashboardAiTemplate .ait-feature-row>span{grid-template-columns:30px minmax(0,1fr)}#dashboardAiTemplate .ait-feature-row i{width:30px;height:30px;font-size:16px}#dashboardAiTemplate .ait-feature-row small{font-size:9px}#dashboardAiTemplate .ai-template-panel{padding:18px}#dashboardAiTemplate .ait-placeholder-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:540px){#dashboardAiTemplate .ait-hero{padding:20px;border-radius:14px}#dashboardAiTemplate .ait-hero h1{font-size:27px}#dashboardAiTemplate .ait-hero p{font-size:12px}#dashboardAiTemplate .ait-feature-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}#dashboardAiTemplate .ait-feature-row>span:last-child{grid-column:1/-1}#dashboardAiTemplate .ait-card-heading{align-items:flex-start;gap:10px;flex-wrap:wrap}#dashboardAiTemplate .ait-heading-icon{width:36px;height:36px;flex-basis:36px;font-size:21px}#dashboardAiTemplate .ait-card-heading>div{flex:1 1 calc(100% - 50px)}#dashboardAiTemplate .ait-tertiary{margin-left:46px}#dashboardAiTemplate .ait-examples-grid{grid-template-columns:1fr}#dashboardAiTemplate .ait-placeholder-grid{grid-template-columns:1fr}#dashboardAiTemplate .ait-input-label{flex-wrap:wrap}#dashboardAiTemplate #aiTemplatePrompt{min-height:195px;font-size:13px}#dashboardAiTemplate .ai-template-tree{grid-template-columns:1fr}#dashboardAiTemplate .ait-preview-pill{font-size:9px}#dashboardAiTemplate .ait-preview-actions .button{width:100%}}
@media(prefers-reduced-motion:reduce){#dashboardAiTemplate *{transition:none!important;scroll-behavior:auto!important}}
