*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;background:#f5f8fc;color:#12213d}a{text-decoration:none;color:#175fdb}button,input,textarea,select{font:inherit}button,.btn{border:0;border-radius:10px;padding:11px 16px;cursor:pointer}.primary{background:#1175ed;color:#fff}.secondary{background:#16b6a3;color:#fff}.ghost{background:#eef5ff;color:#1263ce;border-radius:9px;padding:8px 12px}.topbar{height:72px;background:#fff;border-bottom:1px solid #e5eaf2;display:flex;align-items:center;padding:0 28px;position:fixed;top:0;left:0;right:0;z-index:10}.brand{display:flex;gap:10px;align-items:center;min-width:285px}.brandmark{width:42px;height:42px;border-radius:12px;background:linear-gradient(135deg,#1175ed,#12caa1);color:#fff;display:grid;place-items:center;font-size:24px;font-weight:900;font-style:italic}.brand b{font-size:21px}.brand b span{color:#17a57d}.brand small{display:block;color:#738099;font-size:11px}.topnav{display:flex;gap:8px;flex:1}.topnav a{padding:10px 14px;color:#1e2e49;border-radius:10px}.topnav a.active,.topnav a:hover{background:#eaf3ff;color:#1265d8}.account{display:flex;gap:8px;align-items:center}.sidebar{position:fixed;top:72px;left:0;bottom:0;width:215px;background:#fff;border-right:1px solid #e5eaf2;padding:16px 12px;display:flex;flex-direction:column;gap:4px}.sidebar>a{padding:12px 14px;border-radius:10px;color:#243450;display:flex;gap:12px;align-items:center}.sidebar>a.sel,.sidebar>a:hover{background:#1477ed;color:#fff}.storage{margin-top:auto;border:1px solid #e2e8f1;border-radius:12px;padding:12px;font-size:12px}.meter{height:7px;background:#edf1f7;border-radius:10px;margin:10px 0;overflow:hidden}.meter i{display:block;height:100%;background:#1d78ee}.main{margin-left:215px;padding-top:72px}.page{padding:18px;max-width:1500px;margin:auto}.hero{background:linear-gradient(115deg,#0b2654,#083c8e 55%,#0c6be2);border-radius:15px;color:#fff;padding:28px;display:grid;grid-template-columns:1fr 1.1fr .8fr;gap:20px;align-items:center;min-height:196px}.hero h1{font-size:31px;line-height:1.15;margin:0}.hero h1 span{color:#25e69c}.hero p{line-height:1.7;color:#e3ecff}.hero ul{list-style:none;padding:0;margin:0;line-height:2.1}.hero-art{font-size:50px;text-align:center}.screen{margin:10px auto 0;max-width:360px;background:#10264d;border:1px solid #4d7ec6;border-radius:10px;padding:18px;font-size:15px}.quick{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin:12px 0}.quick>a{background:#fff;border:1px solid #e4eaf3;border-radius:12px;padding:15px;display:grid;gap:5px;color:#13233e}.quick b{font-size:24px;color:#1475e9}.quick span,.projectcard span{font-size:12px;color:#71809a}.grid2{display:grid;grid-template-columns:2fr 1fr;gap:12px}.card{background:#fff;border:1px solid #e2e8f1;border-radius:13px;padding:16px;margin-bottom:12px;box-shadow:0 3px 12px #193b6808}.cardhead,.page-title{display:flex;justify-content:space-between;align-items:center;gap:12px}.card h2{margin:0 0 5px;font-size:17px}.cardhead small,.page-title p{color:#738099}.chatbox textarea{width:100%;min-height:150px;border:1px solid #d9e1ec;border-radius:10px;padding:14px;resize:vertical}.modes{display:flex;gap:9px;margin:10px 0}.mode{background:#edf3fb;color:#3e587c}.mode.active{background:#0fb879;color:#fff}.chat-actions{display:flex;gap:10px}.chat-actions select{flex:1}.chat-actions select,input,textarea,select{border:1px solid #d7dfeb;border-radius:9px;padding:11px;background:#fff}.modelrow{display:grid;grid-template-columns:80px 1fr auto;align-items:center;gap:9px;padding:10px 0;border-bottom:1px solid #edf0f5}.modelrow em{font-size:11px;color:#0b9d6c;background:#e5f8f1;padding:4px 8px;border-radius:10px;font-style:normal}.badge{display:inline-block;padding:6px 10px;border-radius:8px;font-size:11px;font-weight:800}.free{background:#18b77b;color:#fff}.hemat{background:#177cf0;color:#fff}.sedang{background:#8255e9;color:#fff}.pro{background:#f49a17;color:#fff}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.stats div{background:#f7f9fc;border-radius:9px;padding:10px}.stats b,.stats span{display:block}.stats span{font-size:11px;color:#78859b}.projects{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.projectcard{border:1px solid #e1e7f0;border-radius:10px;padding:9px;color:#13233e;display:grid;gap:5px}.thumb{height:80px;background:linear-gradient(135deg,#dcecff,#eef8ff);border-radius:8px;display:grid;place-items:center;color:#2374db;font-weight:900}.projectcard.add{place-items:center;min-height:140px}.page-title{margin:4px 0 15px}.page-title h1{margin:0}.page-title p{margin:4px 0 0}.btn{display:inline-block}.file-list{display:grid;gap:7px;background:#f8fafc;border-radius:10px;padding:12px}.actions{display:flex;gap:8px;margin-top:12px}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:12px;border-bottom:1px solid #edf0f4;font-size:13px}th{color:#71809a;font-size:12px}.status{background:#edf4ff;color:#1b66ce;padding:5px 8px;border-radius:8px;font-size:11px}.notice{padding:12px;background:#fff8e7;border:1px solid #ffe0a4;border-radius:10px;margin:12px 0;color:#76561b}.checks{line-height:2.1}.target{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;padding:12px 0;border-bottom:1px solid #edf0f5}.gridform{display:grid;grid-template-columns:1fr 1fr 2fr auto;gap:8px}.publish-grid{display:flex;gap:10px;margin:15px 0}.previewbox{padding:0;overflow:hidden}.browserbar{background:#eaf0f7;padding:10px;color:#65738a}.browserbar span{background:#fff;border-radius:7px;padding:5px 12px;margin-left:10px}.previewbox iframe{width:100%;height:760px;border:0;background:#fff}.login-wrap{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#eef5ff,#f8fbff)}.login-card{width:min(420px,92vw);background:#fff;padding:30px;border-radius:18px;box-shadow:0 15px 50px #17385d22}.brand.big{min-width:0;margin-bottom:25px}.login-card h1{margin-bottom:4px}.login-card label{display:block;margin:14px 0;font-size:13px}.login-card input{width:100%;margin-top:6px}.full{width:100%;margin:8px 0}.alert{padding:10px;border-radius:8px}.err{background:#ffe9e9;color:#a11}.chatResult{margin-top:10px}.chatResult pre{white-space:pre-wrap;background:#f7f9fc;padding:12px;border-radius:10px}.chatResult .approve{width:100%;margin-top:8px}
@media(max-width:1100px){.hero{grid-template-columns:1fr}.quick{grid-template-columns:repeat(2,1fr)}.grid2{grid-template-columns:1fr}.projects{grid-template-columns:repeat(2,1fr)}.topnav{display:none}.sidebar{width:70px}.sidebar span{display:none}.main{margin-left:70px}.brand{min-width:0}.storage{display:none}}
@media(max-width:650px){.topbar{padding:0 10px}.account{font-size:12px}.page{padding:10px}.quick{grid-template-columns:1fr}.projects{grid-template-columns:1fr}.chat-actions,.publish-grid{flex-direction:column}.modes{overflow:auto}.gridform{grid-template-columns:1fr}.hero h1{font-size:25px}.stats{grid-template-columns:repeat(2,1fr)}table{display:block;overflow:auto}.sidebar{top:72px}.brand b{font-size:16px}}

.mobile-nav{display:none}
@media(max-width:650px){body{padding-bottom:68px}.mobile-nav{position:fixed;display:grid;grid-template-columns:repeat(5,1fr);left:0;right:0;bottom:0;height:68px;background:#0d1224;border-top:1px solid #26304a;z-index:50}.mobile-nav a{color:#aeb9d2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:18px}.mobile-nav span{font-size:11px}.mobile-nav a:hover,.mobile-nav a:focus{color:#fff}.chatbox textarea{min-height:125px}.hero{padding:20px}.hero ul{font-size:13px}.quick>a{padding:13px}.card{padding:13px}}

.provider-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px}
.provider-card .cardhead{align-items:flex-start}
.provider-badge{font-size:11px;padding:5px 8px;border-radius:999px;background:#e9fff6;color:#16764f;font-weight:700}
.provider-form{}
.table-wrap{overflow:auto}
.form-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.provider-card label{margin-top:8px}
.provider-card input,.provider-card select,.card input,.card select,.card textarea{max-width:100%}
hr{border:0;border-top:1px solid var(--line);margin:16px 0}
@media(max-width:900px){.provider-grid{grid-template-columns:1fr}}
.compact-grid{grid-template-columns:1fr 1fr}.compact-grid label{display:block}.script-import-card{border-left:4px solid #1b78ee}.analysis-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:10px 0}.analysis-section{background:#f7f9fc;border:1px solid #e1e7f0;border-radius:9px;padding:10px}.analysis-section ul{margin:8px 0 0 18px;padding:0}.analysis-section.danger{background:#fff0f0;border-color:#ffc6c6}.analysis-section.warn{background:#fff8e7;border-color:#ffe0a4}.script-import-card input[type=file]{width:100%;background:#fff} .script-import-card .actions button{position:relative;z-index:2;pointer-events:auto}.small{font-size:12px;color:#71809a}@media(max-width:650px){.compact-grid,.analysis-grid{grid-template-columns:1fr}.script-import-card .cardhead{align-items:flex-start}.script-import-card .actions{flex-direction:column}.script-import-card .actions button{width:100%}}

/* V3.3 Chat + File Manager */
.chat-app{display:grid;gap:12px}.chat-toolbar{display:grid;grid-template-columns:1fr .8fr 1.8fr auto;gap:12px;align-items:end}.chat-control label{display:block;font-size:12px;color:#70809a;font-weight:700}.chat-control select{width:100%;margin-top:6px}.chat-note{background:#eff8ff;border:1px solid #cfe4ff;color:#29527f;padding:12px 14px;border-radius:12px;font-size:13px}.chat-window{min-height:58vh;max-height:65vh;overflow:auto;padding:18px;display:flex;flex-direction:column;gap:12px;background:linear-gradient(180deg,#fafdff,#f7faff)}.chat-empty{min-height:48vh;display:grid;place-items:center;text-align:center;color:#73819a;padding:30px}.chat-empty-icon{width:56px;height:56px;border-radius:18px;background:linear-gradient(135deg,#1175ed,#12caa1);color:#fff;display:grid;place-items:center;font-size:28px;font-weight:800;margin:0 auto 12px}.chat-empty h2{margin:0;color:#173055}.chat-empty p{max-width:520px}.msg{max-width:min(84%,900px);padding:14px 16px;border-radius:16px;border:1px solid #e1e8f2;box-shadow:0 4px 15px rgba(23,54,94,.05);background:#fff;align-self:flex-start}.msg.user{align-self:flex-end;background:#0f6fe8;color:#fff;border-color:#0f6fe8}.msg-meta{font-size:11px;font-weight:800;opacity:.72;margin-bottom:7px}.msg-body{font-size:14px;line-height:1.7;white-space:normal}.chat-composer{position:sticky;bottom:0}.composer-tools{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}.composer-tools select{max-width:420px}.chat-composer textarea{width:100%;min-height:150px;resize:vertical;font-size:15px;line-height:1.6}.composer-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}.send-chat{min-width:130px}.file-manager-grid{display:grid;grid-template-columns:320px minmax(0,1fr);gap:12px}.fm-files,.fm-editor{min-width:0}.tree{display:grid;gap:4px;margin-top:12px;max-height:65vh;overflow:auto}.tree-item{display:flex;gap:8px;align-items:center;padding:9px 10px;border-radius:9px;color:#28405f}.tree-item:hover{background:#eef5ff}.tree-item.active{background:#0f74eb;color:#fff}.fm-editor textarea{width:100%;min-height:65vh;background:#0f1725;color:#e7edf7;font:13px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;border-radius:12px;border:1px solid #24324c;padding:14px;resize:vertical}.fm-toolbar{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.fm-toolbar label{min-width:280px;flex:1;font-size:12px;color:#70809a;font-weight:700}.fm-toolbar select{width:100%;margin-top:6px}.danger{background:#e94c5d;color:#fff}.empty-state{padding:30px;text-align:center;color:#73809a;display:grid;gap:6px}.empty-state b{color:#1c2e4b;font-size:16px}.model-banner{display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:#effbf5;border-color:#cfeee0}.model-banner b{color:#078a60}.model-banner code{background:#fff;padding:3px 6px;border-radius:6px}@media(max-width:900px){.chat-toolbar{grid-template-columns:1fr 1fr}.chat-model-control{grid-column:1/-1}.file-manager-grid{grid-template-columns:1fr}.fm-editor textarea{min-height:55vh}.msg{max-width:96%}}@media(max-width:650px){.chat-toolbar{grid-template-columns:1fr}.composer-actions{align-items:stretch;flex-direction:column}.send-chat{width:100%}.chat-window{min-height:52vh;max-height:58vh}.fm-toolbar{align-items:stretch}.fm-toolbar label{min-width:100%}}

/* V3.4 reliability UI: prioritize usable chat workspace over decoration. */
.chat-app{min-height:calc(100vh - 115px);display:grid;grid-template-rows:auto auto minmax(420px,1fr) auto;gap:12px}
.chat-toolbar-v2{grid-template-columns:minmax(180px,1fr) minmax(160px,.8fr) minmax(260px,1.6fr) auto;align-items:end}
.chat-toolbar-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.chat-window-v2{min-height:56vh;max-height:none;height:56vh;overflow:auto;padding:22px;background:#fbfdff;display:flex;flex-direction:column;gap:14px}
.chat-window-v2 .msg{max-width:min(92%,1100px);font-size:15px}
.chat-composer-v2{padding:18px;position:sticky;bottom:8px;z-index:5;background:rgba(255,255,255,.98)}
.chat-composer-v2 textarea{min-height:190px;height:190px;resize:vertical;font-size:16px;line-height:1.65;padding:16px}
.chat-project-control{display:flex;flex-direction:column;gap:6px;min-width:min(520px,100%);font-size:12px;color:#70809a;font-weight:700}
.chat-project-control select{width:100%}
.send-chat-v2{min-width:150px;min-height:46px;font-size:15px;font-weight:800}
.chat-error{margin-top:10px;white-space:pre-wrap;word-break:break-word}
@media(max-width:1000px){
  .chat-toolbar-v2{grid-template-columns:1fr 1fr}
  .chat-model-control{grid-column:1/-1}
  .chat-toolbar-actions{grid-column:1/-1}
  .chat-window-v2{height:52vh;min-height:420px}
}
@media(max-width:650px){
  .chat-app{min-height:calc(100vh - 90px)}
  .chat-toolbar-v2{grid-template-columns:1fr}
  .chat-model-control{grid-column:auto}
  .chat-toolbar-actions{grid-column:auto}
  .chat-window-v2{height:50vh;min-height:340px;padding:12px}
  .chat-composer-v2 textarea{min-height:150px;height:150px}
  .chat-project-control{min-width:100%}
}

/* V3.5 functional chat workspace */
.chat-app{min-height:calc(100vh - 120px);grid-template-rows:auto auto minmax(48vh,1fr) auto}
.chat-window-v2{min-height:52vh;height:52vh;max-height:none}
.chat-input-large{min-height:340px !important;height:340px !important;font-size:17px !important;line-height:1.7;padding:18px !important}
@media(max-width:900px){.chat-window-v2{height:48vh;min-height:380px}.chat-input-large{min-height:220px !important;height:220px !important}}
@media(max-width:650px){.chat-window-v2{height:44vh;min-height:320px}.chat-input-large{min-height:190px !important;height:190px !important}}


/* V3.6 Chat usability: white canvas, blue AI bubbles, green admin bubbles, very large composer */
.chat-window-v2{background:#fff !important;}
.msg.assistant{align-self:flex-start;background:#2563eb !important;color:#fff !important;border-color:#2563eb !important;box-shadow:0 6px 18px rgba(37,99,235,.16);}
.msg.user{align-self:flex-end;background:#16a34a !important;color:#fff !important;border-color:#16a34a !important;box-shadow:0 6px 18px rgba(22,163,74,.16);}
.msg.assistant .msg-meta,.msg.user .msg-meta{color:#fff !important;opacity:.92;}
.msg.assistant .msg-body,.msg.user .msg-body{color:#fff !important;}
.chat-input-large{min-height:420px !important;height:420px !important;max-height:60vh !important;font-size:18px !important;line-height:1.75 !important;padding:20px !important;background:#fff !important;}
.chat-composer-v2{background:#fff !important;}
@media(max-width:900px){.chat-input-large{min-height:300px !important;height:300px !important;max-height:50vh !important;}}
@media(max-width:650px){.chat-input-large{min-height:240px !important;height:240px !important;max-height:45vh !important;}}

/* Build completion actions */
.build-complete-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px;}
.build-complete-actions .btn{display:inline-flex;align-items:center;justify-content:center;}
.build-complete-note{margin-top:8px;color:#58708f;font-size:12px;}


/* ARIFBUILD V3.7 FINAL CHAT / PROJECT WORKSPACE */
.chat-app{min-height:calc(100vh - 108px);display:grid;gap:12px;grid-template-rows:auto auto minmax(380px,1fr) auto;}
.chat-window-v2{background:#fff !important;height:56vh;min-height:430px;max-height:68vh;overflow:auto;padding:24px;display:flex;flex-direction:column;gap:16px;border:1px solid #dfe6f0;}
.chat-window-v2 .msg{max-width:min(86%,980px);border:0 !important;border-radius:18px;padding:15px 18px;box-shadow:0 5px 20px rgba(15,23,42,.08);}
.chat-window-v2 .msg.assistant{align-self:flex-start;background:#2563eb !important;color:#fff !important;}
.chat-window-v2 .msg.user{align-self:flex-end;background:#16a34a !important;color:#fff !important;}
.chat-window-v2 .msg-meta,.chat-window-v2 .msg-body{color:#fff !important;}
.chat-window-v2 .msg-meta{font-size:11px;font-weight:800;margin-bottom:7px;opacity:.92;}
.chat-window-v2 .msg-body{font-size:15px;line-height:1.75;white-space:normal;overflow-wrap:anywhere;}
.chat-composer-v2{background:#fff !important;padding:20px;position:sticky;bottom:0;z-index:5;box-shadow:0 -6px 20px rgba(15,23,42,.05);}
.chat-input-large{width:100% !important;min-height:420px !important;height:420px !important;max-height:65vh !important;resize:vertical !important;padding:20px !important;background:#fff !important;font-size:18px !important;line-height:1.75 !important;border:2px solid #cfd8e6 !important;}
.chat-input-large:focus{border-color:#1677f2 !important;outline:3px solid rgba(22,119,242,.12);}
.chat-project-control{min-width:min(620px,100%);}
.chat-toolbar-actions{display:flex;gap:8px;flex-wrap:wrap;}
.page-title-actions{display:flex;gap:8px;align-items:center;}
.row-actions{white-space:normal;min-width:320px}.row-actions>*{margin-right:7px}.link-danger{background:none;border:0;color:#d92d20;padding:0;cursor:pointer;font-weight:700;}
.project-detail .file-list{max-height:420px;overflow:auto;}
.build-complete-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}.build-complete-actions .btn{min-width:180px;text-align:center}.build-complete-actions .primary{background:#1677f2}.build-complete-actions .secondary{background:#16a34a}
.build-preview-note{margin-top:10px;padding:10px 12px;background:#eff8ff;border:1px solid #cfe4ff;border-radius:10px;color:#24517e;}
@media(max-width:900px){.chat-window-v2{height:50vh;min-height:360px}.chat-input-large{min-height:280px !important;height:280px !important;max-height:55vh !important}.chat-window-v2 .msg{max-width:94%}.row-actions{min-width:0}}
@media(max-width:650px){.chat-app{min-height:calc(100vh - 85px)}.chat-window-v2{height:44vh;min-height:300px;padding:12px}.chat-input-large{min-height:220px !important;height:220px !important;max-height:50vh !important;font-size:16px !important;padding:16px !important}.chat-toolbar-v2{grid-template-columns:1fr}.chat-model-control,.chat-toolbar-actions{grid-column:auto}.page-title-actions{width:100%}.page-title-actions .ghost{width:100%;text-align:center}.row-actions{display:flex;flex-wrap:wrap;gap:8px}.row-actions>*{margin-right:0}}
.build-preview-embed{margin-top:14px;border:1px solid #dfe6f0;border-radius:12px;overflow:hidden;background:#fff}.build-preview-embed iframe{width:100%;height:520px;border:0;background:#fff}@media(max-width:650px){.build-preview-embed iframe{height:420px}}



/* V3.12.7 — Build action must remain visible while user is at the bottom of Chat AI. */
.composer-row-chat-actions{align-items:stretch;}
.composer-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px;min-width:280px;}
.build-chat-bottom{min-width:130px;min-height:48px;font-weight:800;}.build-chat-bottom,.send-chat{position:relative;z-index:20;pointer-events:auto;} .send-chat{background:#1175ed !important;color:#fff !important;border:1px solid #1175ed !important;} .send-chat:disabled{opacity:.65;cursor:wait;}
@media(max-width:650px){
  .composer-row-chat-actions{grid-template-columns:1fr;}
  .composer-buttons{grid-template-columns:1fr 1fr;min-width:0;}
}

/* V3.8 — Chat architecture: conversation and composer are separate components. */
.chat-page{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto auto;
  gap:12px;
  min-height:calc(100vh - 135px);
}
.chat-header{display:grid;gap:12px;padding:16px 18px;}
.chat-header-top{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;}
.chat-header-top h2{margin:0;color:#17345c;}
.chat-header-status{display:block;margin-top:4px;color:#71829b;font-size:12px;}
.chat-header-actions{display:flex;gap:8px;flex-wrap:wrap;}
.chat-toolbar{display:grid;grid-template-columns:1fr 1.4fr 1.3fr auto;gap:10px;align-items:end;}
.chat-toolbar label{font-weight:700;font-size:12px;color:#60728b;}
.chat-toolbar select{margin-top:6px;width:100%;}
.chat-provider-note,.chat-model-status{font-size:12px;color:#687b95;}
.chat-conversation{
  min-height:0;
  height:clamp(420px,58vh,760px);
  overflow-y:auto;
  overflow-x:hidden;
  background:#fff !important;
  padding:24px;
  display:flex;
  flex-direction:column;
  gap:14px;
  scroll-behavior:smooth;
}
.chat-conversation .msg{
  max-width:min(84%,920px);
  padding:14px 16px;
  border-radius:18px;
  box-shadow:0 5px 20px rgba(15,23,42,.08);
  overflow-wrap:anywhere;
}
.chat-conversation .msg.assistant{
  align-self:flex-start;
  background:#2563eb !important;
  color:#fff !important;
  border:1px solid #2563eb !important;
}
.chat-conversation .msg.user{
  align-self:flex-end;
  background:#16a34a !important;
  color:#fff !important;
  border:1px solid #16a34a !important;
}
.chat-conversation .msg-meta{font-size:11px;font-weight:800;opacity:.92;margin-bottom:7px;color:#fff !important;}
.chat-conversation .msg-body{font-size:15px;line-height:1.72;color:#fff !important;white-space:normal;overflow-wrap:anywhere;}
.chat-build-result{display:grid;gap:10px;}
.chat-build-result:empty{display:none;}
.chat-build-result pre{max-height:320px;overflow:auto;white-space:pre-wrap;word-break:break-word;}
.chat-build-result textarea{width:100%;min-height:120px;resize:vertical;}
.chat-composer{background:#fff !important;padding:14px 16px;}
.chat-composer form{margin:0;}
.composer-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end;}
.chat-composer textarea{
  width:100%;
  min-height:48px !important;
  height:48px !important;
  max-height:170px !important;
  resize:none !important;
  overflow-y:auto !important;
  border:1px solid #cbd6e5 !important;
  border-radius:14px !important;
  background:#fff !important;
  padding:12px 14px !important;
  font-size:15px !important;
  line-height:1.5 !important;
  box-sizing:border-box;
}
.chat-composer textarea:focus{border-color:#1677f2 !important;outline:3px solid rgba(22,119,242,.11);}
.send-chat{min-width:110px;min-height:48px;font-weight:800;}
.composer-hint{font-size:11px;color:#7a8aa1;margin-top:7px;}
.chat-error{margin:0;white-space:pre-wrap;word-break:break-word;}
.build-complete-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px;}
.build-complete-actions .btn{min-width:180px;text-align:center;}
.build-preview-embed{margin-top:14px;border:1px solid #dfe6f0;border-radius:12px;overflow:hidden;background:#fff;}
.build-preview-embed iframe{width:100%;height:520px;border:0;background:#fff;}
@media(max-width:900px){
  .chat-page{min-height:calc(100vh - 110px);}
  .chat-toolbar{grid-template-columns:1fr 1fr;}
  .chat-toolbar label:nth-child(3){grid-column:1/-1;}
  .chat-toolbar button{grid-column:1/-1;}
  .chat-conversation{height:52vh;min-height:360px;padding:16px;}
  .chat-conversation .msg{max-width:94%;}
}
@media(max-width:650px){
  .chat-toolbar{grid-template-columns:1fr;}
  .chat-toolbar label:nth-child(3),.chat-toolbar button{grid-column:auto;}
  .chat-conversation{height:50vh;min-height:300px;padding:12px;}
  .composer-row{grid-template-columns:1fr;}
  .send-chat{width:100%;}
  .chat-composer textarea{min-height:48px !important;height:48px !important;max-height:150px !important;}
  .chat-conversation .msg{max-width:96%;}
  .build-preview-embed iframe{height:420px;}
}

/* V3.8 Hosting-aware File Manager */
.fm-hosting-toolbar{align-items:end}.fm-hosting-toolbar label{min-width:220px;flex:1}.fm-hosting-toolbar .fm-source-label{min-width:160px;max-width:220px}.fm-pathbar{display:grid;gap:12px}.fm-connection{display:flex;align-items:center;gap:8px;font-weight:800;color:#355173}.fm-dot{width:10px;height:10px;border-radius:999px;background:#98a7bb;box-shadow:0 0 0 4px rgba(152,167,187,.12)}.fm-dot.ok{background:#12b76a;box-shadow:0 0 0 4px rgba(18,183,106,.12)}.fm-dot.bad{background:#e94c5d;box-shadow:0 0 0 4px rgba(233,76,93,.1)}.fm-path-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.fm-breadcrumb{display:flex;gap:5px;align-items:center;flex-wrap:wrap;min-width:0}.fm-crumb{border:0;background:transparent;color:#1267d6;font-weight:800;padding:6px 4px;cursor:pointer}.fm-crumb:hover{text-decoration:underline}.fm-search-row{display:grid;grid-template-columns:1fr 170px;gap:8px}.fm-table-wrap{overflow:auto}.fm-table{width:100%;border-collapse:separate;border-spacing:0;min-width:780px}.fm-table th,.fm-table td{padding:10px 9px;border-bottom:1px solid #e7edf5;text-align:left;vertical-align:middle}.fm-table th{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#70809a;background:#f8fafc;position:sticky;top:0;z-index:1}.fm-table td{font-size:13px;color:#304765}.fm-table tbody tr:hover{background:#fbfdff}.fm-name-btn{border:0;background:transparent;color:#145fc3;font-weight:800;cursor:pointer;padding:0;text-align:left}.fm-name-btn:hover{text-decoration:underline}.fm-actions{display:flex;gap:6px;flex-wrap:wrap}.fm-editor-shell{display:grid;grid-template-columns:54px minmax(0,1fr);min-height:65vh;border-radius:12px;overflow:hidden;background:#0f1725;border:1px solid #24324c}.fm-line-numbers{white-space:pre;text-align:right;padding:14px 9px;color:#677792;background:#0b1320;font:13px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow:hidden;user-select:none}.fm-code-layer{position:relative;min-width:0;overflow:hidden}.fm-code-layer pre,.fm-code-layer textarea{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:14px;font:13px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:pre;overflow:auto;tab-size:2;box-sizing:border-box}.fm-code-layer pre{z-index:1;color:#dbe8fa;pointer-events:none}.fm-code-layer textarea{z-index:2;border:0;border-radius:0;background:transparent;color:transparent;caret-color:#fff;resize:none;outline:none}.fm-code-layer textarea::selection{background:rgba(83,153,255,.28)}.tok-keyword{color:#83b9ff}.tok-string{color:#a8e6b2}.tok-comment{color:#6c7b92}.fm-editor-status{font-size:12px;color:#687b95;font-weight:700;margin-right:5px}.fm-editor-note{margin-top:8px;font-size:12px;color:#71819a}.modal[hidden]{display:none!important}.modal{position:fixed;inset:0;display:grid;place-items:center;background:rgba(15,23,42,.55);z-index:100}.modal-card{width:min(720px,92vw);max-height:86vh;overflow:auto;background:#fff;border-radius:16px;padding:18px;box-shadow:0 20px 60px rgba(15,23,42,.25)}
@media(max-width:900px){.fm-hosting-toolbar{align-items:stretch}.fm-search-row{grid-template-columns:1fr}.fm-editor-shell{min-height:55vh}.fm-table{min-width:700px}}
@media(max-width:650px){.fm-hosting-toolbar label,.fm-hosting-toolbar .fm-source-label{min-width:100%;max-width:none}.fm-editor-shell{grid-template-columns:42px minmax(0,1fr)}.fm-line-numbers{font-size:12px;padding:12px 7px}.fm-code-layer pre,.fm-code-layer textarea{padding:12px;font-size:12px}.fm-actions{flex-direction:column}.fm-actions button{width:100%}}
.chat-hosting-context{display:grid;grid-template-columns:1fr 1.4fr;gap:10px;align-items:end;margin-top:10px;padding:12px;border:1px solid #dfe8f5;border-radius:12px;background:#f8fbff}.chat-hosting-context label{font-size:12px;font-weight:800;color:#60728b}.chat-hosting-context select,.chat-hosting-context input{width:100%;margin-top:6px}.chat-context-hint{grid-column:1/-1;font-size:11px;color:#6d7e96}.fm-source-label select{width:100%}@media(max-width:900px){.chat-hosting-context{grid-template-columns:1fr}.chat-context-hint{grid-column:auto}}

.project-create-card{border:1px solid #cfe0f8;background:#fbfdff}.project-create-card[hidden]{display:none}.project-create-form{display:grid;gap:12px}.project-create-form label{display:grid;gap:6px;font-size:13px;font-weight:700;color:#2c4361}.project-create-form input,.project-create-form textarea,.project-create-form select{width:100%}.project-create-form textarea{min-height:150px;resize:vertical}.project-create-card pre{white-space:pre-wrap;background:#f7f9fc;padding:12px;border-radius:10px;max-height:360px;overflow:auto}.small{font-size:12px;color:#70809a;margin-top:4px}.required{color:#d92d20}.project-create-card .actions{flex-wrap:wrap}

.preview-runtime-actions{display:flex;gap:10px;align-items:center;padding:12px;border-bottom:1px solid #e5eaf2;background:#fbfdff}.preview-runtime-actions .status{display:inline-block}

/* Dedicated Upload & Repair workspace */
.script-page-title .eyebrow{font-size:11px;letter-spacing:.16em;font-weight:800;color:#64748b;margin-bottom:7px}
.script-workspace{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(300px,.8fr);gap:18px;align-items:start}
.script-import-main{min-width:0}
.workflow-strip{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;margin:18px 0}
.workflow-strip>div{border:1px solid #e2e8f0;background:#f8fafc;border-radius:12px;padding:11px 10px;display:flex;flex-direction:column;gap:4px}
.workflow-strip b{font-size:11px;color:#64748b}.workflow-strip span{font-weight:750;font-size:13px}
.script-side-stack{display:grid;gap:18px}.feature-list{margin:0;padding-left:20px;display:grid;gap:10px;color:#475467}.feature-list li::marker{color:#64748b}
.recent-list{display:grid;gap:2px}.recent-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 0;border-bottom:1px solid #eef2f6}.recent-item:last-child{border-bottom:0}.recent-item b{display:block;font-size:13px;word-break:break-word}.recent-item small{display:block;color:#667085;margin-top:3px}
@media(max-width:900px){.script-workspace{grid-template-columns:1fr}.workflow-strip{grid-template-columns:repeat(3,1fr)}}
@media(max-width:560px){.workflow-strip{grid-template-columns:repeat(2,1fr)}}

/* V3.13.5 — Chat AI real attachment composer/history */
.chat-composer{position:relative;}
.chat-composer.drag-active{outline:2px dashed #1677f2;outline-offset:-4px;background:#f7fbff !important;}
.chat-attachment-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:10px;}
.chat-attachment-actions{display:flex;gap:8px;flex-wrap:wrap;}
.chat-attach-btn{min-height:38px;font-weight:800;}
.chat-attachment-policy{font-size:11px;color:#73839a;}
.chat-attachment-preview{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 10px;padding:10px;border:1px solid #dfe7f2;border-radius:12px;background:#f8fbff;}
.chat-attachment-preview[hidden]{display:none;}
.chat-attachment-preview-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;min-width:230px;max-width:360px;padding:8px 10px;background:#fff;border:1px solid #dfe7f2;border-radius:10px;box-shadow:0 2px 10px rgba(15,23,42,.04);}
.chat-attachment-preview-thumb{width:46px;height:46px;object-fit:cover;border-radius:8px;border:1px solid #d8e1ee;}
.chat-attachment-preview-info,.chat-attachment-info{display:grid;gap:3px;min-width:0;}
.chat-attachment-preview-info b,.chat-attachment-info b{font-size:12px;color:#17345c;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.chat-attachment-preview-info small,.chat-attachment-info small{font-size:10px;color:#73839a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.chat-attachment-remove{border:0;background:#fee4e2;color:#c4322d;width:28px;height:28px;border-radius:8px;font-size:20px;line-height:1;cursor:pointer;}
.chat-attachment-remove:hover{filter:brightness(.97);}
.msg-attachments{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;}
.chat-attachment-card{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;min-width:210px;max-width:360px;padding:8px 10px;border:1px solid rgba(255,255,255,.26);border-radius:10px;background:rgba(255,255,255,.12);color:inherit;text-decoration:none;}
.chat-attachment-card:hover{background:rgba(255,255,255,.18);}
.chat-attachment-thumb{width:72px;height:72px;object-fit:cover;border-radius:8px;border:1px solid rgba(255,255,255,.35);}
.chat-attachment-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:9px;background:rgba(255,255,255,.16);font-size:22px;}
@media(max-width:650px){
  .chat-attachment-preview-card,.chat-attachment-card{min-width:100%;max-width:100%;}
  .chat-attachment-toolbar{align-items:stretch;}
  .chat-attachment-actions{width:100%;}
  .chat-attach-btn{flex:1;}
}

/* V3.16.0 — deterministic AI Build Gate + bounded chat composer */
.chat-input-wrap{position:relative;width:100%;}
.chat-input-wrap textarea{padding-bottom:28px !important;max-height:220px;}
.chat-char-count{position:absolute;right:12px;bottom:8px;color:#7a879a;font-size:11px;font-weight:700;pointer-events:none;}
.chat-char-count.limit-near{color:#b42318;}


/* V3.18.0 — Build Gate: tampilan murni dari state server. Hijau HANYA untuk .build-gate-armed (BUILD_ARMED). */
#chatBuild, .build-chat-bottom {
  background:#98a2b3 !important; color:#fff !important; border-color:#98a2b3 !important;
  opacity:1 !important; cursor:not-allowed !important; pointer-events:none !important;
}
#chatBuild.build-gate-running, .build-chat-bottom.build-gate-running {
  background:#b7791f !important; border-color:#b7791f !important;
}
#chatBuild.build-gate-armed:not(:disabled), .build-chat-bottom.build-gate-armed:not(:disabled) {
  background:#16a34a !important; color:#fff !important; border-color:#16a34a !important;
  opacity:1 !important; cursor:pointer !important; pointer-events:auto !important;
}
#chatBuild.build-gate-armed:not(:disabled):hover, .build-chat-bottom.build-gate-armed:not(:disabled):hover { filter:brightness(.96); }
.chat-gate-note { font-size:.85rem; margin:.25rem 0 .5rem; }
.chat-char-count.limit-over { color:#b42318; font-weight:600; }
#chatInput[aria-invalid="true"] { outline:2px solid #b42318; }
.build-progress { height:8px; background:#e4e7ec; border-radius:4px; margin:.5rem 0; overflow:hidden; }
.build-progress > span { display:block; height:100%; background:#16a34a; transition:width .3s; }
