:root{color-scheme:dark;font-family:Inter,system-ui,sans-serif;color:#dbe8f5;background:#0b1018;--accent:#52e2bd}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button{background:#182a36;color:#e7f4fa;border:1px solid #314859;border-radius:8px;padding:10px 14px;cursor:pointer}button:hover{border-color:var(--accent)}button:disabled{opacity:.5;cursor:wait}button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible{outline:2px solid var(--accent);outline-offset:3px}[hidden]{display:none!important}#login{min-height:100dvh;display:grid;place-items:center;padding:calc(24px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));background:radial-gradient(at 85% 10%,#173b43,transparent 60%)}#login-form{width:min(430px,100%);padding:32px;border:1px solid #2a4350;border-radius:20px;background:#101c27}.eyebrow{font-size:11px;letter-spacing:.18em;color:var(--accent)}h1{font-size:54px;margin:10px 0}h1 span,header strong span{color:var(--accent)}label{display:block;margin:22px 0 12px;font-size:14px}input,textarea{display:block;width:100%;margin-top:8px;background:#09141e;border:1px solid #324955;color:#fff;border-radius:8px;padding:12px}#login-button{width:100%;margin-top:16px;background:var(--accent);color:#08251f;font-weight:750}#login-error,#file-status{min-height:22px;color:#f8b486}#workspace{height:100dvh;display:flex;flex-direction:column;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}header{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:12px 18px;border-bottom:1px solid #263846}header strong{letter-spacing:.06em;font-size:14px}header nav{margin-left:auto;display:flex;gap:8px}#status{font-size:12px;color:#9cb4c6}#terminal{flex:1;min-height:100px;overflow:hidden;padding:10px 6px 0 12px;background:#0b1018}.keys{display:flex;gap:5px;padding:6px 12px;overflow-x:auto}.keys button{padding:6px 12px;font:12px monospace;flex-shrink:0}#compose{display:flex;gap:10px;padding:0 12px 6px}#compose textarea{resize:none;margin:0;min-height:52px}footer{font-size:11px;color:#93a9bb;padding:4px 12px calc(8px + env(safe-area-inset-bottom))}dialog{background:#10202d;color:#e3eef5;border:1px solid #426173;border-radius:16px;padding:24px;width:min(600px,94vw);max-height:85dvh}dialog::backdrop{background:#0009}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px}code{display:block;overflow-wrap:anywhere;font-size:13px;color:var(--accent)}#file-list{padding-left:20px}#file-list li{margin:12px 0}a{color:var(--accent);overflow-wrap:anywhere}@media(max-width:650px){header{gap:8px;padding:8px}header nav{width:100%;margin:0}header nav button{flex:1;font-size:12px;padding:8px}#terminal{padding-left:4px}footer{font-size:10px}.keys{padding:5px}#compose{padding:0 5px 5px}#compose textarea{font-size:16px}#login-form{padding:24px}h1{font-size:46px}}
/* Composer override */
#compose{position:relative;display:block;padding:8px 12px 6px;background:#0b1018}
#compose-shell{border:1px solid #304957;border-radius:14px;background:#101c27;box-shadow:0 10px 28px #0004;overflow:hidden}
#compose-row{display:flex;align-items:flex-end;gap:8px;padding:8px 8px 0}
#compose-row textarea{flex:1;min-width:0;min-height:58px;max-height:42dvh;overflow-y:auto;resize:none;padding:10px 11px;border:0;background:transparent;border-radius:8px;line-height:1.45;outline:none}
#compose-row textarea:focus{box-shadow:0 0 0 1px #355465 inset}
#compose-actions{display:flex;align-items:center;gap:6px;padding-bottom:8px}
#compose-actions button{padding:8px 10px;font-size:12px;white-space:nowrap}
#voice-input{background:#162733;color:#bff6e7;border-color:#52e2bd}
#voice-input[aria-pressed="true"]{background:#a8323d;border-color:#ff7b83;color:#fff}
#compose-model{color:#b9cbd8;background:#162733}
#files-compose-button{color:#9ed6c7;background:#162733}
#compose-submit{background:var(--accent);border-color:var(--accent);color:#08251f;font-weight:750}
#compose-meta{display:flex;justify-content:space-between;gap:10px;padding:5px 12px 8px;color:#8ba1b1;font:11px monospace}
#model-turn-note{padding:0 12px 8px;color:#d5a84e;font-size:10px;line-height:1.4;overflow-wrap:anywhere}
#attachment-summary{color:#8edbc9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#attachment-summary.is-error{color:#f4a5a5}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important}
#upload-preview{margin-top:12px}
.file-manager-grid{display:flex;flex-direction:column;gap:12px;margin-top:14px}
@media (max-width:640px){
  header{padding:10px 12px}header nav{width:100%;margin-left:0}header nav button{flex:1;padding:8px 6px;font-size:11px}
  #compose{padding:6px 8px 4px}#compose-row{display:block;padding:7px}#compose-row textarea{min-height:62px}
  #compose-actions{justify-content:flex-end;padding:6px 0 0}#compose-meta{padding-inline:9px;font-size:10px}
  #compose-meta span:first-child{white-space:nowrap}
  /* Slightly larger tap targets for composer actions on phones while keeping same visual density */
  #compose-actions button{min-height:34px;padding:7px 8px;font-size:11px}
}

/* Day mode is intentionally scoped to the workspace so the login remains stable. */
html[data-theme="light"] body{background:#eef3f7;color:#142033}
html[data-theme="light"] #workspace{background:#eef3f7}
html[data-theme="light"] #workspace>header{background:linear-gradient(180deg,#fff,#e8eef3);border-bottom-color:#c5d2dc}
html[data-theme="light"] header strong,html[data-theme="light"] .header-identity strong{color:#142033}
html[data-theme="light"] #status,html[data-theme="light"] #action-truth{background:#f7fafc;color:#3e596c;border-color:#b8c9d4}
html[data-theme="light"] #user-mode{background:linear-gradient(180deg,#f7fafc,#e8eff4);color:#142033}
html[data-theme="light"] .user-mode-intro p,html[data-theme="light"] .session-empty,html[data-theme="light"] .readable-heading span{color:#526b7b}
html[data-theme="light"] .readable-session,html[data-theme="light"] .session-entry{background:#fff;border-color:#c4d3dd}
html[data-theme="light"] .session-entry p,html[data-theme="light"] .session-entry-label{color:#193042}
html[data-theme="light"] #compose,html[data-theme="light"] #workspace>footer{background:#e8eff4;color:#526b7b}
html[data-theme="light"] #compose-shell{background:#fff;border-color:#bdccd6}
html[data-theme="light"] #compose-row textarea{color:#142033}
html[data-theme="light"] #cli-surface{background:#dce6ec}
html[data-theme="light"] #theme-toggle{background:#fff;color:#142033;border-color:#9fb5c3}
#theme-toggle{min-height:32px;padding:6px 10px;border-radius:999px;font-size:11px;font-weight:700;background:#162a36;color:#bff6e7;border-color:#3b6978}
#theme-toggle:hover{border-color:var(--accent)}

/* Theme switch: two labeled sun/moon buttons with explicit contrast for each
   state instead of a single text label that only reads "Gelap"/"Terang". */
.theme-switch{display:inline-flex;align-items:center;gap:3px;padding:3px;border-radius:999px;background:#0d1f29;border:1px solid #29414e}
.theme-switch button{
  display:inline-flex;align-items:center;gap:5px;min-height:28px;
  padding:5px 10px;border-radius:999px;border:1px solid transparent;
  background:transparent;color:#9cb4c6;font-size:11px;font-weight:700;line-height:1;
}
.theme-switch button:hover{color:#e7f4fa;border-color:#3b6978}
.theme-switch button svg{width:15px;height:15px;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.theme-switch button[aria-pressed="true"]{background:#16303d;color:#bff6e7;border-color:#3b6978;box-shadow:0 0 0 1px #52e2bd45 inset}
html[data-theme="light"] .theme-switch{background:#dbe5ea;border-color:#aebfc9}
html[data-theme="light"] .theme-switch button{color:#4a6575}
html[data-theme="light"] .theme-switch button:hover{color:#142033;border-color:#9fb5c3}
html[data-theme="light"] .theme-switch button[aria-pressed="true"]{background:#fff;color:#142033;border-color:#9fb5c3;box-shadow:0 1px 3px #0002}

/* Conversation/Teknikal toggle: the +/- sign reads as a detail-level control. */
#terminal-details-toggle{display:inline-flex;align-items:center;gap:6px;font-weight:700}
#terminal-details-toggle .tdt-sign{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;background:#16303d;color:#bff6e7;font-size:13px;font-weight:800;line-height:1}
#terminal-details-toggle[aria-expanded="true"] .tdt-sign{background:#52e2bd;color:#04221b}
html[data-theme="light"] #terminal-details-toggle .tdt-sign{background:#cfe0e8;color:#1c3a49}
html[data-theme="light"] #terminal-details-toggle[aria-expanded="true"] .tdt-sign{background:#52e2bd;color:#04221b}
@media (max-width:640px){
  .theme-switch button{padding:6px 8px}
  .theme-switch button span{display:none}
}
.file-upload-panel,.file-list-panel{padding:16px;border:1px solid #284555;border-radius:12px;background:#0b1722}
.file-upload-panel p{margin:0 0 14px;color:#9cb4c6;font-size:13px;line-height:1.45}
.file-dropzone{display:grid;gap:7px;margin:0;padding:24px 16px;border:1px dashed #477183;border-radius:10px;text-align:center;cursor:pointer;background:#0e202c}
.file-dropzone:hover{border-color:var(--accent);background:#122a36}
.file-dropzone strong{color:#e7f4fa}.file-dropzone span{color:#8da7b8;font-size:11px}.file-dropzone input{display:none}
.file-list-head{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#e7f4fa}
.file-list-head button{padding:6px 9px;font-size:11px}.file-list-panel code{margin-bottom:10px;word-break:break-all}
.file-list-panel ul{margin:8px 0 0;padding:0;display:grid;gap:8px;max-height:42dvh;overflow:auto}.file-list-panel li{font-size:13px;word-break:break-all}.file-list-panel li a{color:#8edbc9}
.file-preview{max-width:100%;max-height:180px;display:block;margin:14px auto 0;border:1px solid #355465;border-radius:8px}
.file-preview-note{margin-top:10px!important;font-size:11px!important;color:#8da7b8!important}
@media (max-width:640px){.file-manager-grid{grid-template-columns:1fr}}

/* Add Website: a quiet Apple-like surface against the terminal. */
.add-website-button{background:#fff;color:#141414;border-color:#d9dde3;box-shadow:0 2px 8px #0002}
.add-website-button:hover{border-color:#4778d5;color:#174ca8;background:#f8fbff}
 .website-dialog{width:min(760px,calc(100vw - 28px));max-height:calc(100dvh - 28px);padding:0;border:0;border-radius:26px;background:#f5f6f8;color:#17181b;box-shadow:0 28px 90px #0007;overflow:auto}
.website-dialog::backdrop{background:#12161dcc;backdrop-filter:blur(7px)}
.website-dialog-shell{padding:30px;background:linear-gradient(145deg,#fff 0%,#f1f3f6 100%);border:1px solid #fff;box-shadow:inset 0 1px #fff}
.website-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:26px}
.website-kicker{margin:0 0 8px;color:#3469c7;font-size:10px;font-weight:800;letter-spacing:.2em}
.website-reference-note{margin:10px 0 0;color:#7b818a;font-size:11px;line-height:1.45}.website-reference-note span{color:#d92c3d;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.website-hero h2{margin:0;color:#111;font-size:clamp(30px,6vw,48px);letter-spacing:-.06em;line-height:1}.website-hero h2 span{color:#d92c3d}.website-hero p:not(.website-kicker){margin:12px 0 0;color:#6e747d;font-size:14px}
.neuralops-orbit{position:relative;width:142px;height:110px;flex:none;filter:drop-shadow(0 10px 12px #4778d52c);transform:perspective(500px) rotateX(14deg)}
.neuralops-orbit:before{content:"";position:absolute;inset:12px 22px;border:1px solid #7b9de066;border-radius:50%;transform:rotate(-24deg) skewX(-15deg)}
.neuralops-orbit:after{content:"";position:absolute;inset:25px 7px;border:1px solid #d92c3d55;border-radius:50%;transform:rotate(32deg) skewX(12deg)}
.neuralops-orbit i,.neuralops-orbit b{position:absolute;display:block;border-radius:50%;font-style:normal}.neuralops-orbit i{width:9px;height:9px;background:#d92c3d;box-shadow:0 0 0 5px #d92c3d18;animation:nodePulse 2.8s ease-in-out infinite}.neuralops-orbit i:nth-child(1){left:21px;top:54px}.neuralops-orbit i:nth-child(2){right:23px;top:22px;background:#3469c7;animation-delay:.7s}.neuralops-orbit i:nth-child(3){right:34px;bottom:14px;background:#111;animation-delay:1.4s}.neuralops-orbit b{height:1px;width:55px;left:42px;top:55px;background:#3469c788;transform:rotate(-28deg);transform-origin:left}.neuralops-orbit b:nth-of-type(2){transform:rotate(27deg);background:#d92c3d77}.neuralops-orbit b:nth-of-type(3){left:73px;top:31px;width:39px;transform:rotate(112deg);background:#1115}
@keyframes nodePulse{50%{transform:scale(1.6);opacity:.6}}
.website-dialog label{margin:0 0 16px;color:#3b3d42;font-size:12px;font-weight:750}.website-dialog input{margin-top:7px;background:#fff;border:1px solid #d8dce3;color:#111;border-radius:12px;padding:13px 14px;box-shadow:inset 0 1px 2px #00000009}.website-dialog input:focus{border-color:#4778d5;box-shadow:0 0 0 3px #4778d522}.website-field-hint{display:block;margin:6px 0 0;color:#8a9098;font-size:10px;font-weight:500}.website-url-preview{margin:2px 0 22px;color:#838891;font:12px ui-monospace,SFMono-Regular,monospace}.website-url-preview strong{color:#3469c7;font-weight:600}
.website-dialog textarea{display:block;width:100%;margin-top:7px;resize:vertical;min-height:82px;background:#fff;border:1px solid #d8dce3;color:#111;border-radius:12px;padding:13px 14px;line-height:1.45;box-shadow:inset 0 1px 2px #00000009}.website-dialog textarea:focus{border-color:#4778d5;box-shadow:0 0 0 3px #4778d522;outline:0}
.website-file-drop{display:grid;gap:6px;padding:24px 18px!important;border:1px dashed #b6bdc8;border-radius:16px;text-align:center;cursor:pointer;background:#fafbfc!important;color:#111!important}.website-file-drop:hover{border-color:#4778d5;background:#f4f8ff!important}.website-file-drop strong{font-size:14px}.website-file-drop span{color:#858b94;font-size:11px;font-weight:500}.website-file-drop input{display:none}
.website-file-list{display:grid;gap:6px;margin:12px 0;padding:0;list-style:none}.website-file-list li{padding:8px 11px;border-radius:9px;background:#e9edf2;color:#4a4e55;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.website-dialog #website-status{min-height:22px;margin:8px 0;color:#3469c7;font-size:12px}.website-dialog #website-status a{color:#d92c3d;font-weight:750}.website-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:12px}.website-actions button{border-radius:11px;padding:11px 15px;font-size:12px;font-weight:750}.website-cancel{background:#e9edf2;color:#4c5159;border-color:#e0e4e9}.website-publish{background:#111;color:#fff;border-color:#111;box-shadow:0 8px 18px #1113}.website-publish:hover{background:#3469c7;border-color:#3469c7}
@media (max-width:640px){.website-dialog-shell{padding:22px 18px}.website-hero{align-items:flex-start}.neuralops-orbit{width:92px;transform:scale(.72);transform-origin:top right;margin-right:-16px}.website-actions{position:sticky;bottom:0;padding-top:8px;background:#f3f5f7}.website-dialog{border-radius:20px}}

/* User mode keeps the normal workspace readable while raw CLI stays optional. */
#user-mode{flex:1;min-height:0;overflow:auto;padding:clamp(28px,6vh,72px) clamp(16px,5vw,72px) 24px;background:radial-gradient(circle at 78% 10%,#173b4329,transparent 38%),#0b1018}
.user-mode-intro{max-width:760px;margin:0 auto 26px}.user-mode-kicker{color:var(--accent);font:800 10px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.18em}.user-mode-intro h1{margin:10px 0 8px;font-size:clamp(30px,5vw,52px);letter-spacing:-.05em;line-height:1.05}.user-mode-intro p{margin:0;color:#9cb4c6;font-size:15px}
.conversation{display:grid;gap:12px;max-width:760px;margin:0 auto}.conversation-card{padding:15px 17px;border:1px solid #29414e;border-radius:16px;background:#101c27;box-shadow:0 12px 30px #0002}.conversation-card--user{margin-left:auto;background:#16332f;border-color:#286558;max-width:86%}.conversation-card--agent{margin-right:auto;max-width:86%}.conversation-label{display:block;margin-bottom:6px;color:var(--accent);font:800 10px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.12em;text-transform:uppercase}.conversation-card--user .conversation-label{color:#b9d6ff}.conversation-card p{margin:0;color:#dbe8f5;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5}.user-activity{display:flex;align-items:center;gap:8px;max-width:760px;margin:18px auto 0;color:#8fa8b8;font-size:12px}.user-activity-dot{width:7px;height:7px;border-radius:50%;background:var(--accent);box-shadow:0 0 12px var(--accent)}.user-activity.is-working .user-activity-dot{animation:workspacePulse 1.1s ease-in-out infinite}@keyframes workspacePulse{50%{opacity:.35;transform:scale(.7)}}
.quick-actions{display:flex;flex-wrap:wrap;gap:8px;max-width:760px;margin:0 auto 18px}.quick-actions button{padding:9px 12px;border-radius:999px;background:#10242d;color:#a9d9cd;border-color:#285366;font-size:12px}.quick-actions button:hover{background:#173640;color:#e7f4fa;border-color:var(--accent)}
.request-preview{margin:0;padding:13px 15px;border:1px solid #285366;border-radius:14px;background:#10242d}.request-preview span{display:block;margin-bottom:5px;color:#a9d9cd;font:800 10px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.12em;text-transform:uppercase}.request-preview p{margin:0;color:#e0edf5;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
/* Three balanced status cards on desktop; collapse the layout as space narrows. */
.request-cards{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr) minmax(0,1.4fr);gap:12px;align-items:stretch;margin:0 auto 14px}
.request-cards>article[hidden]+.request-viz{margin-left:auto}
@media(max-width:900px) and (min-width:641px){.request-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.request-viz{grid-column:1/-1}}
@media(max-width:720px){.request-preview,.request-technical{padding:10px}.request-preview>span,.request-technical-title{display:block}.request-preview p,.request-technical .request-viz-live{font-size:11px;line-height:1.3}}
@media(max-width:640px){.request-cards{grid-template-columns:minmax(0,1fr);gap:10px}.request-cards>article,.request-cards>aside,.request-viz{grid-column:1}}
/* Teknis: Paksa Live + Teknikal cards sentiasa terpapar (semua keadaan, mobile/desktop, idle/technical, web-cli+web-cli2).
   Jangan biar hidden atau moved. [hidden] override hanya untuk elemen lain. */
#request-cards,
#request-viz,
#request-technical,
#request-viz-gauges,
#request-viz-live,
.request-cards > .request-viz,
.request-cards > .request-technical {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
#request-cards[hidden],
#request-viz[hidden],
#request-technical[hidden],
#request-viz-gauges[hidden],
#request-viz-live[hidden] { display: flex !important; }
.request-technical{margin:0;padding:13px 15px;border:1px solid #29414e;border-radius:14px;background:#0d1923;min-width:0}
.request-technical-title{display:block;margin-bottom:8px;color:#a9d9cd;font:800 10px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.12em;text-transform:uppercase}
.request-viz{margin:0;padding:13px 15px;border:1px solid #29414e;border-radius:14px;background:#0d1923;display:flex;flex-direction:column;gap:10px;min-width:0;grid-column:auto}
.request-viz-title{color:#a9d9cd;font:800 10px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.12em;text-transform:uppercase}
.request-viz-flow{display:flex;align-items:center;gap:6px}
.rv-node{display:flex;flex-direction:column;align-items:center;gap:5px;flex:0 0 auto}
.rv-node i{width:14px;height:14px;border-radius:50%;border:2px solid #3d5a6b;background:#0b1018;transition:border-color .3s,background .3s,box-shadow .3s}
.rv-node small{color:#8fa8b8;font-size:9.5px;letter-spacing:.04em}
.rv-link{position:relative;flex:1 1 auto;height:2px;border-radius:2px;background:#2b4352;overflow:hidden;min-width:14px}
.rv-link:after{content:"";position:absolute;inset:0;transform:scaleX(0);transform-origin:left;background:linear-gradient(90deg,var(--accent),#7ae0c7);transition:transform .4s ease}
.request-viz[data-stage="1"] .rv-node--user i,.request-viz[data-stage="2"] .rv-node--user i,.request-viz[data-stage="3"] .rv-node--user i{border-color:var(--accent);background:var(--accent);box-shadow:0 0 10px #52e2bd66}
.request-viz[data-stage="1"] .rv-link--1:after{transform:scaleX(1)}
.request-viz[data-stage="2"] .rv-link--1:after,.request-viz[data-stage="2"] .rv-link--2:after{transform:scaleX(1)}
.request-viz[data-stage="3"] .rv-link--1:after,.request-viz[data-stage="3"] .rv-link--2:after{transform:scaleX(1)}
.request-viz[data-stage="2"] .rv-node--ai i,.request-viz[data-stage="3"] .rv-node--ai i{border-color:var(--accent);background:var(--accent);box-shadow:0 0 10px #52e2bd66}
.request-viz[data-stage="2"] .rv-node--ai i{animation:rvPulse 1.2s ease-in-out infinite}
.request-viz[data-stage="3"] .rv-node--done i{border-color:#7ae0c7;background:#7ae0c7;box-shadow:0 0 10px #7ae0c766}
.request-viz[data-stage="3"] .rv-node--done small{color:#a9d9cd}
@keyframes rvPulse{50%{opacity:.4;transform:scale(.78)}}
.request-viz-meter{height:4px;border-radius:999px;background:#1c2c38;overflow:hidden}
.request-viz-meter span{display:block;height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,var(--accent),#7ae0c7);transition:width .45s ease}
.request-viz-caption{margin:0;color:#9cb4c6;font-size:11.5px;line-height:1.45;overflow-wrap:anywhere}
.request-viz-stats{display:flex;flex-wrap:wrap;gap:4px 16px;margin:auto 0 0;padding:0}
.request-viz-stats div{display:flex;flex-direction:column;gap:1px;min-width:0}
.request-viz-stats dt{color:#6f8a9c;font:800 9px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.1em;text-transform:uppercase}
.request-viz-stats dd{margin:0;color:#dbe8f5;font-size:11.5px;overflow-wrap:anywhere}
.request-viz[data-state="working"]{border-color:#3b6d63}
.request-viz[data-state="working"] .request-viz-meter span{background:linear-gradient(90deg,#52e2bd,#7ae0c7,#52e2bd);background-size:200% 100%;animation:rvMeter 1.6s linear infinite}
.request-viz[data-state="error"]{border-color:#7a3b46}
.request-viz[data-state="error"] .rv-node i{border-color:#8d4a57}
.request-viz[data-state="error"] .request-viz-caption{color:#f0b3bd}
@keyframes rvMeter{to{background-position:-200% 0}}
@media(prefers-reduced-motion:reduce){.rv-link:after,.request-viz-meter span,.request-viz[data-state="working"] .request-viz-meter span,.request-viz[data-stage="2"] .rv-node--ai i{transition:none!important;animation:none!important}}
html[data-theme="light"] .request-viz{background:#fff;border-color:#c4d3dd}
html[data-theme="light"] .rv-node i{background:#eef3f7;border-color:#b8c9d4}
html[data-theme="light"] .rv-node small,html[data-theme="light"] .request-viz-caption{color:#526b7b}
html[data-theme="light"] .request-viz-stats dd{color:#193042}
html[data-theme="light"] .request-viz-meter{background:#e2eaf0}
/* Server resource gauges: CPU/disk needle gauges + load indicator */
.request-viz-gauges{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:12px;align-items:center;margin-top:2px;padding-top:10px;border-top:1px solid #23353f}
@media(max-width:420px){.request-viz-gauges{grid-template-columns:1fr;justify-items:start}}
.rv-gauge{margin:0;display:flex;flex-direction:column;align-items:center;gap:1px;flex:0 0 auto}
.rv-gauge svg{width:104px;height:64px;display:block;overflow:visible}
.rv-gauge-track{fill:none;stroke:#23353f;stroke-width:8;stroke-linecap:round}
.rv-gauge-fill{fill:none;stroke:url(#rvGaugeGrad);stroke-width:8;stroke-linecap:round;stroke-dasharray:157;stroke-dashoffset:157;transition:stroke-dashoffset .6s cubic-bezier(.16,1,.3,1)}
.rv-gauge-ticks line{stroke:#40596a;stroke-width:1.6;stroke-linecap:round}
.rv-gauge-needle{stroke:#dbe8f5;stroke-width:2.6;stroke-linecap:round;transform-box:view-box;transform-origin:60px 62px;transform:rotate(-90deg);transition:transform .6s cubic-bezier(.16,1,.3,1)}
.rv-gauge-hub{fill:#dbe8f5}
.rv-gauge figcaption{display:flex;align-items:baseline;gap:4px;margin-top:-14px}
.rv-gauge figcaption b{color:#dbe8f5;font-size:15px;font-weight:750;font-variant-numeric:tabular-nums}
.rv-gauge figcaption small{color:#6f8a9c;font:800 9px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.1em;text-transform:uppercase}
.rv-gauge[data-level="warn"] .rv-gauge-hub{fill:#f5c451}
.rv-gauge[data-level="high"] .rv-gauge-hub{fill:#ef5965}
.rv-load{display:flex;flex-direction:column;gap:5px;min-width:0}
.rv-load-head{color:#8fa8b8;font-size:10.5px}
.rv-load-head b{color:#dbe8f5;font-variant-numeric:tabular-nums}
.rv-load-bars{display:flex;gap:3px;align-items:flex-end;height:16px}
.rv-load-bars i{flex:1 1 auto;min-width:5px;max-width:22px;border-radius:2px;background:#23353f;transition:background .3s}
.rv-load-bars i.on{background:var(--accent)}
.rv-load-bars[data-level="warn"] i.on{background:#f5c451}
.rv-load-bars[data-level="high"] i.on{background:#ef5965}
.rv-load-scale{color:#6f8a9c;font-size:10px}
.rv-load-scale b{color:#9cb4c6;font-variant-numeric:tabular-nums}
.request-viz[data-sys="offline"] .rv-gauge-fill,.request-viz[data-sys="offline"] .rv-gauge-needle{opacity:.35}
html[data-theme="light"] .request-viz-gauges{border-top-color:#e2eaf0}
html[data-theme="light"] .rv-gauge-track{stroke:#e2eaf0}
html[data-theme="light"] .rv-gauge-ticks line{stroke:#c2d0da}
html[data-theme="light"] .rv-gauge-needle{stroke:#142033}
html[data-theme="light"] .rv-gauge-hub{fill:#142033}
html[data-theme="light"] .rv-gauge figcaption b,html[data-theme="light"] .rv-load-head b{color:#142033}
html[data-theme="light"] .rv-load-bars i{background:#e2eaf0}
html[data-theme="light"] .rv-load-head,html[data-theme="light"] .rv-load-scale{color:#5b6b80}
html[data-theme="light"] .rv-load-scale b{color:#3e596c}
@media(prefers-reduced-motion:reduce){.rv-gauge-fill,.rv-gauge-needle{transition:none!important}}
#cli-surface{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.terminal-details{flex:none;margin:0;border-bottom:1px solid #29414e;background:#08131c}.terminal-details-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;font-size:12px;color:#9cb4c6}.terminal-details-head button{min-height:40px}
.readable-session{width:100%;margin:auto;border:1px solid #29414e;background:#101c27;border-radius:16px;padding:16px}.readable-heading{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;color:#a9d9cd;font-size:12px}.readable-heading span{color:#8fa8b8}.session-history{display:grid;gap:12px;margin-top:18px}.session-entry{padding:13px 15px;border:1px solid #29414e;border-radius:13px;background:#0d1923;border-left:3px solid #2a6e64}.session-entry--user{border-color:#2e7663;border-left-color:#2e7663;background:#13312a}.session-entry-label{display:block;margin-bottom:6px;color:#8fe4d0;font:800 11px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.08em;text-transform:uppercase}.session-entry--user .session-entry-label{color:#b6e3d6}.session-entry p{margin:0;color:#e0edf5;white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.6 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.session-empty{margin:0;color:#8fa8b8;font-size:13px}#workspace>header,#workspace>#compose,#workspace>footer{flex-shrink:0}#user-mode{padding:20px 16px}.user-mode-intro h1{font-size:28px}#workspace>footer{padding-bottom:calc(8px + env(safe-area-inset-bottom))}
@media(prefers-reduced-motion:reduce){.user-activity-dot,.neuralops-orbit i{animation:none!important}}
 @media (max-width:640px){#user-mode{padding:28px 12px 18px}.user-mode-intro h1{font-size:32px}.conversation-card--user,.conversation-card--agent{max-width:94%}.readable-heading{align-items:flex-start;flex-direction:column;gap:4px}.readable-heading span{overflow-wrap:anywhere}}

/* User workspace blocks expand with the available browser width. */
.user-mode-intro,.quick-actions,.request-cards,.user-activity{width:100%;max-width:none}
.request-preview{width:100%}
#latest-response{flex:none;align-self:center;min-height:40px}#audit-dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto}#audit-dialog p{overflow-wrap:anywhere}
.permission-panel{display:flex;align-items:center;justify-content:space-between;gap:18px;width:100%;margin:18px 0 0;padding:18px 20px;border:1px solid #d6a94c;border-radius:16px;background:#241e12;box-shadow:0 10px 28px #0003}.permission-kicker{color:#f3c76b;font:800 10px monospace;letter-spacing:.16em}.permission-panel h2{margin:6px 0 4px;color:#fff;font-size:18px}.permission-panel p{margin:0;color:#d9c99c;font-size:13px;overflow-wrap:anywhere}.permission-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;flex:none}.permission-actions button{padding:9px 12px;font-size:12px}.permission-actions button[data-permission-reply="always"]{background:#52e2bd;border-color:#52e2bd;color:#08251f;font-weight:750}.permission-actions button[data-permission-reply="reject"]{color:#f4a5a5}
.header-identity{display:flex;align-items:center;gap:16px;min-width:0}.top-quick-actions{position:static;display:flex;width:100%;max-width:none;margin:0;padding:8px 0 0;border-top:1px solid #263846;overflow-x:auto;scrollbar-width:none}.top-quick-actions::-webkit-scrollbar{display:none}.top-quick-actions button{flex:none;padding:7px 10px;font-size:11px}
/* Quick actions now share the nav row so they sit level with Pasang Aplikasi
   instead of forming a third stacked band. Inside nav they must flow inline and
   wrap to whole rows only when the row truly runs out of space. */
#header-controls .top-quick-actions{width:auto;flex:1 1 auto;flex-wrap:nowrap;padding:0;border-top:0;overflow-x:auto;scrollbar-width:none}
#header-controls .top-quick-actions::-webkit-scrollbar{display:none}
#header-controls .top-quick-actions::before{margin-right:0}
#header-controls .top-quick-actions button{border-radius:999px;background:#10242d;color:#a9d9cd;border-color:#285366}
#header-controls .top-quick-actions button:hover{background:#173640;color:#e7f4fa;border-color:var(--accent)}
/* With the advanced toggle in the same row the label is the first thing to go,
   so the five actions and the toggle still fit on one desktop line. */
@media(max-width:1600px){#header-controls .top-quick-actions::before{display:none}}
/* Keep nav buttons centred: the quick-action row can be taller than one button,
   and the default stretch made the buttons grow with it. */
header nav{align-items:center}
.composer-attachments{display:flex;flex-wrap:wrap;gap:8px;padding:0 12px 8px}.composer-file-preview{width:42px;height:42px;object-fit:cover;border-radius:6px}.composer-file{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:6px 7px 6px 10px;border:1px solid #315263;border-radius:9px;background:#162b37;color:#c8e8e0;font-size:11px}.composer-file span{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.composer-file button{display:grid;place-items:center;width:25px;height:25px;padding:0;border:1px solid #ff7b83;border-radius:50%;background:#ef5965;color:#fff;font-size:20px;font-weight:800;line-height:20px;box-shadow:0 0 0 3px #ef596533}.composer-file button:hover{background:#ff3342;border-color:#fff;transform:scale(1.06)}
#files-compose-button{background:#243f4d;border-color:#52e2bd;color:#bff6e7;font-weight:750;box-shadow:0 0 0 2px #52e2bd22,0 5px 16px #0003}#files-compose-button:hover{background:#315d68;color:#fff;box-shadow:0 0 0 3px #52e2bd55}#attach-compose-button{background:#162733;color:#b9cbd8}#attach-compose-button.has-files{background:#52e2bd;border-color:#b8ffed;color:#08251f;box-shadow:0 0 0 3px #52e2bd55,0 0 22px #52e2bd66;animation:attachmentPulse 1.8s ease-in-out infinite}.composer-file + .composer-file{margin-left:2px}@keyframes attachmentPulse{50%{box-shadow:0 0 0 5px #52e2bd22,0 0 28px #0003}}
@media(max-width:640px){.permission-panel{display:block;padding:15px 14px}.permission-actions{justify-content:stretch;margin-top:14px}.permission-actions button{flex:1;min-width:0;padding-inline:7px}}
@media(max-width:640px){.header-identity{width:100%;justify-content:space-between}.top-quick-actions{gap:6px;padding-top:8px}.top-quick-actions button{font-size:10px;padding:7px 8px}}
.quick-actions{position:sticky;top:0;z-index:1;padding:8px 0;background:#0b1018}
.website-file-list li{display:flex;align-items:center;justify-content:space-between;gap:10px}.website-file-list li span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.website-file-list li button{flex:none;padding:5px 8px;border-radius:7px;font-size:11px}.website-publish:disabled{background:#697077;border-color:#697077}
@media (max-width:640px){header nav{flex-wrap:wrap}header nav .add-website-button{flex-basis:100%;font-size:13px}header nav button:not(.add-website-button){min-width:0}.website-actions{flex-wrap:wrap}.website-actions button{flex:1}}
.user-activity[data-state="working"]{color:#f3c76b}.user-activity[data-state="working"] .user-activity-dot{background:#f3bb4d;box-shadow:0 0 12px #f3bb4d}.user-activity[data-state="error"]{color:#f4a5a5}.user-activity[data-state="error"] .user-activity-dot{background:#ef6b73;box-shadow:0 0 12px #ef6b73}
@media (max-width:640px) and (max-height:650px){#user-mode{padding-top:12px}.user-mode-intro{margin-bottom:12px}.user-mode-intro h1{margin:5px 0;font-size:23px}.user-mode-intro p{display:none}.quick-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:12px}.quick-actions button{padding:7px 4px;font-size:10px;line-height:1.25}}

/* SME polish: keep the simple flow calm and the technical flow clearly secondary. */
body{background:#080e16}
#workspace{background:#080e16}
#workspace>header{position:relative;background:linear-gradient(180deg,#101c27 0%,#0c151f 100%);box-shadow:0 8px 24px #0003;z-index:2}
.header-identity strong{font-size:15px;letter-spacing:.08em}.header-identity #status{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border:1px solid #294654;border-radius:999px;background:#0c1b25;color:#a7c2d1}
#status::first-letter{color:var(--accent)}
header nav button{min-height:40px;transition:background .18s ease,border-color .18s ease,transform .18s ease}
header nav button:hover{transform:translateY(-1px)}
.top-quick-actions{border-top-color:#294654;background:linear-gradient(90deg,#0d1b25,#0b151e);padding:10px 0 2px}
.top-quick-actions::before{content:'Tindakan pantas';align-self:center;margin-right:2px;color:#71899a;font:700 10px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.1em;text-transform:uppercase;white-space:nowrap}
#terminal-details{background:#09151f;border-bottom-color:#294654}
#terminal-details .terminal-details-head{max-width:1120px;margin:auto;padding:10px 16px}
/* The Advanced CLI toggle now lives among the quick actions instead of its own
   bar, so it only needs its own colour to stay distinguishable. */
#terminal-details-toggle{background:#132a35;border-color:#3b6978;color:#c9eee5}
#header-controls .top-quick-actions #terminal-details-toggle{border-radius:999px}
#user-mode{padding:clamp(32px,6vh,68px) clamp(16px,4vw,56px) 30px;background:radial-gradient(circle at 82% 0%,#1c4b5122,transparent 32%),linear-gradient(180deg,#0d1721 0%,#0a1119 74%)}
.user-mode-intro{max-width:1120px;margin:0 auto 24px}.user-mode-kicker{display:inline-flex;padding:5px 9px;border:1px solid #285366;border-radius:999px;background:#10242d;letter-spacing:.14em}.user-mode-intro h1{margin:14px 0 9px;font-size:clamp(32px,4.6vw,56px);letter-spacing:-.055em}.user-mode-intro p{max-width:650px;color:#a9bfcc}
.quick-actions{max-width:1120px;margin:0 auto 16px;padding:12px 0;background:transparent}.quick-actions button{box-shadow:0 4px 14px #0002}
.readable-session{max-width:860px;margin:0 auto;padding:20px 22px;border-color:#335463;background:linear-gradient(145deg,#122632,#0f1e29);box-shadow:0 18px 40px #0003}.readable-heading strong{font-size:13px}.session-history{max-width:none}.session-entry{box-shadow:0 8px 20px #0002}.session-empty{padding:8px 0}
.user-activity{max-width:860px;margin:16px auto 0;padding-inline:22px;box-sizing:border-box}
.permission-panel{max-width:860px;margin:16px auto 0;box-sizing:border-box}
#compose{background:linear-gradient(180deg,#0b151e,#080e16);padding:10px clamp(12px,4vw,56px) 8px}.compose-attachments{max-width:860px;margin-inline:auto}.composer-attachments{max-width:860px;margin-inline:auto}#compose-shell{max-width:860px;margin:auto;background:linear-gradient(145deg,#122632,#0e1b25);border-color:#335463;box-shadow:0 16px 36px #0004}
#request-cards{max-width:860px;margin-inline:auto;box-sizing:border-box}
#workspace>footer{background:#080e16;color:#71899a;border-top:1px solid #182b37;text-align:center}
#cli-surface{background:#060b11;padding:0 clamp(8px,2vw,22px)}#terminal{border:1px solid #1f3947;border-bottom:0;border-radius:12px 12px 0 0;background:radial-gradient(circle at 75% 20%,#12313a55,transparent 28%),#080d14;box-shadow:inset 0 1px #1c3541;margin-top:8px}
.keys{max-width:1120px;margin:auto;padding:8px 4px;background:#09131c;border:1px solid #1f3947;border-top:0;border-radius:0 0 10px 10px}.keys button{background:#122532;border-color:#315363}.keys button:hover{background:#173643}
@media(max-width:640px){
  .header-identity #status{padding:4px 7px;font-size:11px}.top-quick-actions::before{display:none}
  .top-quick-actions{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain}
  #user-mode{padding:26px 12px 18px}.user-mode-intro{margin-bottom:18px}.user-mode-intro h1{font-size:32px}.user-mode-intro p{font-size:14px}
  .readable-session{padding:16px 15px}.session-history{gap:9px}.session-entry{padding:12px 13px}
  #compose{padding-inline:8px}.composer-attachments{padding-inline:4px}#cli-surface{padding-inline:4px}#terminal{margin-top:4px}
}

/* Truthful action feedback: motion shows an operation is alive, never that it succeeded. */
button{position:relative;overflow:hidden;transition:transform .28s ease,box-shadow .28s ease,background-color .28s ease,border-color .28s ease,color .28s ease}
button::after{pointer-events:none}
button:not(:disabled):active{transform:translateY(1px) scale(.985);transition-duration:.08s}
button[data-state="busy"]{cursor:wait!important;box-shadow:0 0 0 2px #f3c76b33,0 0 20px #f3c76b22;animation:buttonWaiting 1.7s ease-in-out infinite}
button[data-state="busy"]::after{content:"";position:absolute;right:9px;top:50%;width:10px;height:10px;margin-top:-5px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:buttonSpin .9s linear infinite}
button[data-state="busy"]{padding-right:29px}
button[data-state="success"]{border-color:#52e2bd!important;box-shadow:0 0 0 2px #52e2bd33;color:#bff6e7}
button[data-state="success"]::after{content:"✓";position:absolute;right:9px;top:50%;margin-top:-8px;color:#52e2bd;font-weight:900;animation:buttonConfirmed .32s ease both}
button[data-state="error"]{border-color:#ef6b73!important;box-shadow:0 0 0 2px #ef6b7333;color:#ffc0c0}
.founder-tasks{display:flex;gap:6px;min-width:0}
#task-build-zip{display:inline-flex;align-items:center;justify-content:center;gap:6px}
#task-build-zip svg{width:15px;height:15px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#workspace>header #header-controls>#task-build-zip{display:flex;align-items:center;justify-content:flex-start;gap:10px;min-height:44px;padding:10px 12px;background:#12362c;color:#bff6e7;border-color:#3d7d72;font-weight:700;text-align:left}
#workspace>header #header-controls>#task-build-zip svg{width:19px;height:19px}
#workspace>header #header-controls>.menu-addon-toggle svg{display:none}
#workspace>header #header-controls>.menu-addon-toggle[aria-pressed="true"]::after{content:"✓" / "";margin-inline-start:auto;padding-inline-start:8px;font-weight:700}
.website-addons{display:grid;gap:9px;margin:12px 0;padding:12px 14px;border:1px solid #314859;border-radius:10px;background:#101d28}
.website-addons legend{padding:0 6px;color:#9cb5c5;font-size:13px;font-weight:700}
.website-addons label{display:flex;align-items:center;gap:10px;color:#dbe8f5;font-size:14px}
.website-addons input{width:18px;height:18px;margin:0;accent-color:#52e2bd;flex:none}
#advanced-menu summary::-webkit-details-marker{display:none}
#advanced-menu{color:#9cb4c6}
#advanced-menu summary{cursor:pointer;list-style:none;padding:10px 12px;border:1px solid #314859;border-radius:8px}
#advanced-menu summary::-webkit-details-marker{display:none}
.advanced-tools{display:flex;flex-wrap:wrap;gap:8px;padding:8px 0}
#file-dir{display:none}
.session-entry p{font-family:Inter,system-ui,sans-serif;font-size:16px;line-height:1.55}
button[data-state="error"]::after{content:"!";position:absolute;right:10px;top:50%;margin-top:-9px;color:#ef6b73;font-weight:900;animation:buttonConfirmed .32s ease both}
#action-truth{display:inline-flex;align-items:center;min-width:0;max-width:min(360px,32vw);padding:5px 9px;border:1px solid #294654;border-radius:999px;background:#0c1b25;color:#a7c2d1;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .3s ease,border-color .3s ease,background-color .3s ease}
#action-truth::before{content:"";width:6px;height:6px;flex:none;margin-right:6px;border-radius:50%;background:#52e2bd;box-shadow:0 0 10px #52e2bd;transition:background .3s ease,box-shadow .3s ease}
#action-truth[data-state="busy"]{color:#f3c76b;border-color:#7a6130;background:#241e12}
#action-truth[data-state="busy"]::before{background:#f3bb4d;box-shadow:0 0 10px #f3bb4d;animation:truthPulse 1.1s ease-in-out infinite}
#action-truth[data-state="success"]{color:#bff6e7;border-color:#347d70;background:#102c2c}
#action-truth[data-state="error"]{color:#ffc0c0;border-color:#7a3840;background:#2a171c}
#action-truth[data-state="error"]::before{background:#ef6b73;box-shadow:0 0 10px #ef6b73}
@keyframes buttonSpin{to{transform:rotate(360deg)}}@keyframes buttonWaiting{50%{box-shadow:0 0 0 4px #f3c76b1c,0 0 26px #f3c76b33}}@keyframes buttonConfirmed{from{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}@keyframes truthPulse{50%{opacity:.4;transform:scale(.7)}}
@media(max-width:640px){#action-truth{max-width:118px;font-size:10px;padding:4px 7px}.header-identity{gap:7px}.header-identity strong{font-size:13px}.header-identity #status{max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media(prefers-reduced-motion:reduce){button,button[data-state="busy"],button[data-state="busy"]::after,#action-truth[data-state="busy"]::before{animation:none!important;transition:none!important}}

/* Header collapse: one toggle hides the nav and quick-action bars so the
   session and composer get the full height on small screens. The toggle itself
   stays visible inside the identity row so the header can always be restored. */
#header-toggle{
  flex:none;min-height:32px;padding:6px 10px;
  border-radius:999px;font-size:11px;font-weight:600;
  background:#0e2029;border-color:#2f5566;color:#a9d9cd;
}
#header-toggle:hover{background:#173640;color:#e7f4fa;border-color:var(--accent)}
#header-toggle::before{content:"▾ ";font-size:10px;opacity:.8}
#header-toggle[aria-expanded="false"]::before{content:"▸ "}
#workspace.header-collapsed #header-toggle{background:#2a1f10;border-color:#7a6130;color:#f3c76b}

/* Terminal scroll bar: swipe scrolling is disabled while the TUI runs with
   mouse tracking (xterm skips touch handlers), so expose explicit scroll
   buttons that send the TUI's page and line scroll keybinds. */
.scroll-bar{display:flex;flex:none;gap:6px;padding:8px 12px;background:#0a141d;border:1px solid #1f3947;border-bottom:0;overflow-x:auto}
.scroll-bar button{
  flex:none;min-height:36px;padding:7px 12px;font-size:12px;font-weight:600;
  background:#16303d;border-color:#3a6b7d;color:#bfe4da;white-space:nowrap;
}
.scroll-bar button:hover{background:#1d4152;color:#fff;border-color:var(--accent)}
.scroll-bar button[data-scroll="up"],.scroll-bar button[data-scroll="lineup"]{border-left:3px solid var(--accent)}
@media (max-width:640px){
  .scroll-bar{padding:6px 8px;gap:5px}
  .scroll-bar button{min-height:44px;flex:1 1 0;min-width:0;padding:8px 4px;font-size:11px}
}
@media (max-height:520px){
  .scroll-bar{padding:5px 8px}
  .scroll-bar button{min-height:44px;padding:7px 10px}
}

/* Compact command rail: one visual language, one horizontal action row. */
@media (min-width:641px){
  #workspace>header{padding:8px 14px;gap:10px}
  header nav{gap:5px;align-items:center;min-width:0;overflow-x:auto;scrollbar-width:none}
  header nav::-webkit-scrollbar{display:none}
  header nav button,#header-toggle{min-height:34px;padding:6px 10px;border-radius:7px;font-size:11px;line-height:1.15}
  #header-controls .top-quick-actions{gap:5px;min-width:0}
  #header-controls .top-quick-actions button{padding:6px 10px;border-radius:7px;font-size:11px}
}
@media (max-width:640px){
  #workspace>header{padding:7px 10px;gap:6px}
  .header-identity{gap:5px;flex-wrap:nowrap;overflow:hidden}
  .header-identity strong{font-size:12px;white-space:nowrap}
  .header-identity #status{font-size:10px;padding:4px 6px;white-space:nowrap}
  #action-truth{display:none}
  #header-toggle{min-height:32px;padding:6px 8px;border-radius:7px;font-size:10px;margin-left:auto;white-space:nowrap}
  header nav{width:100%;margin:0;flex-wrap:nowrap;gap:5px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding:2px 18px 2px 0}
  header nav::-webkit-scrollbar{display:none}
  #header-controls .top-quick-actions{order:0;flex:0 0 auto;display:flex;gap:5px;overflow:visible;padding:0;border:0;background:transparent;mask-image:none;-webkit-mask-image:none}
  header nav button,#header-controls .top-quick-actions button,#terminal-details-toggle{flex:0 0 auto;min-height:32px;padding:6px 9px;border-radius:7px;font-size:10px;line-height:1.15;white-space:nowrap}
  header nav #websites-button,header nav #reconnect,header nav #files-button,header nav #terminate-agent,header nav #logout{flex:0 0 auto}
  #header-controls .top-quick-actions::before{display:none}
}

/* Keep readable replies selectable even while terminal controls are active. */
.session-history,.session-entry,.session-entry-label,.session-entry p{user-select:text;-webkit-user-select:text}
.session-entry{cursor:text}
.session-entry-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px}
/* View toggle reads as a plain label; the +/− glyph made it look like an expandable. */
#terminal-details-toggle .tdt-sign{display:none}
.session-copy{flex:none;padding:5px 9px;border-radius:7px;color:#9ed6c7;background:#162b37;border-color:#315263;font-size:11px;cursor:pointer}
.session-copy:hover{color:#fff;background:#245260;border-color:var(--accent)}

/* Website Saya — list of websites built through Bina Website. */
.websites-dialog{width:min(680px,94vw)}
.websites-kicker{margin:0 0 4px;font-size:10px;letter-spacing:.18em;color:var(--accent)}
.websites-dialog h2{margin:0;font-size:24px}
.websites-dialog #websites-description{margin:6px 0 0;font-size:12px;color:#9cb4c6}
.websites-dialog #websites-status{min-height:20px;margin:12px 0 6px;font-size:12px;color:#8edbc9}
.websites-list{display:grid;gap:9px;margin:0 0 16px;padding:0;list-style:none}
.websites-empty{padding:18px;border:1px dashed #2f4c5d;border-radius:11px;color:#8aa2b4;font-size:13px;text-align:center}
.website-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid #284555;border-radius:11px;background:#0b1722}
.website-info{display:flex;min-width:0;flex-direction:column;gap:4px}
.website-info strong{color:#fff;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.website-info span{color:#8aa2b4;font-size:11px}
.website-row-actions{display:flex;flex:none;gap:7px}
.website-row-actions a,.website-row-actions button{display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;border-radius:8px;font-size:12px;text-decoration:none}
.website-open{background:var(--accent);color:#08251f;border:1px solid var(--accent);font-weight:700}
.websites-actions{display:flex;justify-content:flex-end;gap:9px}
@media(max-width:640px){.website-row{align-items:flex-start;flex-direction:column}.website-row-actions{width:100%}.website-row-actions a,.website-row-actions button{flex:1;min-height:44px}.websites-actions button{flex:1;min-height:44px}}

/* Mobile access audit fixes.
   Measured before: header 233px (31-35% of a phone viewport), only ~61% of the
   screen left for work, 10+ controls under the 44px touch minimum, the quick
   action strip clipped by 53-123px with no cue, and the two live-status chips
   ellipsised down to ~5 readable characters. These rules turn the two action
   groups into single scrollable rows with a visible right-edge fade, raise
   every control to a 44px target, and let status text wrap instead of being
   cut. Scoped to small screens so desktop keeps its current layout.
   ──────────────────────────────────────────────────────────────────────────── */
@media (max-width:640px){
  /* Identity row: brand + live pill stay on line one; the action-feedback chip
     wraps to its own line and grows to full width, so long messages such as
     "Arahan website dihantar; menunggu kerja agent." stay readable instead of
     being clipped to a few characters. */
  .header-identity{width:100%;flex-wrap:wrap;gap:7px;justify-content:flex-start;align-items:center}
  .header-identity strong{flex:none}
  .header-identity #status{flex:0 1 auto;min-width:0;max-width:none;font-size:11px}
  #action-truth{
    flex:1 1 auto;min-width:0;max-width:none;
    white-space:normal;overflow:visible;text-overflow:clip;
    overflow-wrap:anywhere;line-height:1.3;font-size:11px;padding:3px 8px;
  }

  /* Nav: two fully visible rows instead of a horizontally scrolled strip, so no
     action can be missed and no label is truncated. Row 1 pairs the two website
     actions; row 2 holds the three utilities. Total height matches a single
     44px-per-control block while keeping every target at 44px. */
  header nav{
    width:100%;margin-left:0;flex-wrap:wrap;gap:6px;
  }
  header nav button{
    flex:1 1 0;min-width:0;min-height:44px;
    padding:10px 6px;font-size:12px;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
  header nav #websites-button,header nav #reconnect,header nav #files-button{flex:1 1 calc(33.333% - 4px)}
  header nav #terminate-agent,header nav #logout{flex:1 1 calc(50% - 3px)}
  /* Quick actions become a full-width row inside the same nav, so the header is
     still two bands total instead of three. */
  #header-controls .top-quick-actions{
    flex:1 1 100%;order:-1;gap:6px;
    flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;
    padding-right:26px;border-top:0;
    -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 30px),transparent);
    mask-image:linear-gradient(90deg,#000 calc(100% - 30px),transparent);
  }
  header nav .add-website-button{min-height:46px;font-size:14px;font-weight:700}

  .top-quick-actions{
    flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;
    padding:5px 0 0;
    -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 30px),transparent);
    mask-image:linear-gradient(90deg,#000 calc(100% - 30px),transparent);
  }
  .top-quick-actions button{flex:none;min-height:44px;padding:10px 12px;font-size:12px}
  #header-controls .top-quick-actions{padding:0}

  /* Advanced CLI toggle and composer controls: raise to the 44px minimum. */
  #terminal-details-toggle{min-height:44px}
  #compose-actions button{min-height:44px;padding:10px 12px;font-size:12px}
  #compose-row textarea{min-height:48px}

  /* Reclaim vertical space: on touch keyboards the Enter/Shift+Enter hint does
     not apply, so hide just that line while keeping the live attachment status
     visible. */
  #compose-meta{padding:4px 9px 6px}
  #compose-meta span:first-child{display:none}
  #workspace>header{padding:8px 12px;gap:8px}
  .top-quick-actions{padding:5px 0 0}
  .header-identity{gap:6px}

  /* The header toggle sits in the identity row and must stay a full touch
     target even when everything else collapses. */
  #header-toggle{flex:0 0 auto;min-height:44px;padding:8px 12px;font-size:12px}

  /* The welcome hero was 158px of a 223px visible work pane on iPhone SE, so
     the live session below it was pushed off-screen. Compact it on phones: the
     composer placeholder already explains what to do, so the paragraph is
     redundant once the user is in the workspace. */
  #user-mode{padding:14px 12px 16px}
  .user-mode-intro{margin:0 auto 12px}
  .user-mode-kicker{padding:4px 8px;font-size:9px}
  .user-mode-intro h1{margin:8px 0 0;font-size:23px;letter-spacing:-.03em}
  .user-mode-intro p{display:none}
  .readable-session{padding:13px 13px}
  .readable-heading{gap:2px;font-size:11px}
  .session-history{margin-top:11px;gap:9px}

  /* Footer only restates what the toggle already says; drop it to reclaim a row. */
  #workspace>footer{display:none}
}

/* Touch devices above the phone breakpoint (tablets): raise every interactive
   control to the 44px target. Desktop with a fine pointer keeps compact sizing. */
@media (pointer:coarse){
  .top-quick-actions button,#terminal-details-toggle,#compose-actions button{min-height:44px}
  .top-quick-actions button{padding-top:10px;padding-bottom:10px}
  #compose-actions button{padding-top:10px;padding-bottom:10px}
}

/* Landscape phones and other short viewports: the header alone was 57% of the
   screen. Tighten the intro and keep the working area usable. */
@media (max-height:520px){
  #workspace>header{padding:6px 10px;gap:6px}
  .header-identity{gap:6px}
  .header-identity h1,.header-identity strong{font-size:12px}
  #status{padding:3px 7px;font-size:10px}
  #action-truth{padding:3px 7px;font-size:10px}
  .top-quick-actions{padding-top:5px}

  /* One scrollable action row instead of a wrapped block, with a right fade. */
  header nav{
    flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;
    scrollbar-width:none;padding-right:22px;
    -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 26px),transparent);
    mask-image:linear-gradient(90deg,#000 calc(100% - 26px),transparent);
  }
  header nav::-webkit-scrollbar{display:none}
  header nav button,.top-quick-actions button,#terminal-details-toggle,#compose-actions button{
    min-height:44px;padding-top:8px;padding-bottom:8px;
  }
  #compose-meta{display:none}

  .user-mode-intro{margin-bottom:10px}
  .user-mode-kicker{display:none}
  .user-mode-intro h1{margin:0 0 6px;font-size:22px}
  .user-mode-intro p{display:none}
  #terminal-details-toggle{font-size:12px}
  #workspace>footer{display:none}
}

/* ─────────────────────────────────────────────────────────────────────────────
   Compact bottom controls.
   The terminal keys and scroll controls were deliberately 44px, but on a phone
   they crowded the session. Shrink them moderately (34-38px, 10-11px font) and
   tighten the composer. These buttons send input over the socket and no longer
   refocus the terminal, so a smaller target does not summon the keyboard.
   Placed last so it wins over the earlier 44px audit rules.
   ──────────────────────────────────────────────────────────────────────────── */
.scroll-bar{gap:5px;padding:6px 10px}
.scroll-bar button{min-height:36px;padding:6px 10px;font-size:11px;font-weight:600}
.keys{gap:4px;padding:5px 8px}
.keys button{min-height:34px;padding:5px 9px;font:11px monospace}

@media (max-width:640px){
  .scroll-bar{padding:4px 6px;gap:4px}
  .scroll-bar button{min-height:36px;padding:6px 4px;font-size:10px}
  .keys{padding:4px 6px;gap:4px}
  .keys button{min-height:34px;padding:5px 7px;font-size:11px}
  #compose{padding:6px 8px 4px}
  #compose-actions{gap:5px;padding-bottom:6px}
  #compose-actions button{min-height:38px;padding:8px 10px;font-size:11px}
}

@media (max-height:520px){
  .scroll-bar{padding:3px 6px}
  .scroll-bar button{min-height:34px;padding:5px 8px;font-size:10px}
  .keys{padding:3px 6px}
  .keys button{min-height:32px;padding:4px 8px;font-size:10px}
  #compose-actions button{min-height:36px;padding:6px 10px;font-size:11px}
}

/* When the header is collapsed, keep only the identity row and the unhide
   button so the session and composer get the full height. The collapsed header
   is a single row: brand, live status and the unhide button; the
   action-feedback chip steps aside so nothing wraps. */
#workspace.header-collapsed>header{padding:8px 12px;gap:0}
#workspace.header-collapsed .top-quick-actions{display:none!important}
#workspace.header-collapsed #header-controls{display:none!important}
#workspace.header-collapsed #terminal-details{display:none!important}
#workspace.header-collapsed .header-identity{flex-wrap:nowrap;width:100%;align-items:center;gap:8px}
#workspace.header-collapsed #action-truth{display:none}
#workspace.header-collapsed .header-identity #status{flex:1 1 auto;min-width:0;max-width:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#workspace.header-collapsed #header-toggle{flex:0 0 auto;margin-left:auto}

/* ─────────────────────────────────────────────────────────────────────────────
   Uniform bottom control sizing.
   The key bar mixed auto widths (23px arrows next to 56px Ctrl+C), which looked
   uneven and risked the last key clipping. Lay the keys out on a 6-column grid:
   Esc/Tab/arrows fill row one, and Ctrl+C/Ctrl+P/Enter each span two columns so
   every row is flush edge to edge. The scroll bar already shares four equal
   columns. Placed last so these win over earlier audit rules.
   ──────────────────────────────────────────────────────────────────────────── */
.keys{
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));
  /* #cli-surface is a column flex container, where margin:auto would shrink
     this row to its content width. Force full width so it lines up with the
     scroll bar above it. */
  width:100%;max-width:none;margin:0;
  gap:4px;padding:5px 6px;
}
.keys button{
  min-width:0;min-height:34px;padding:5px 4px;
  font:11px monospace;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.keys button[data-terminal-action]{color:#bff6e7;border-color:#3b6978;background:#16303d;font-weight:700}
.keys button[data-key="ctrlc"],.keys button[data-key="ctrlp"],.keys button[data-key="enter"]{grid-column:span 2;grid-row:2}
.keys #copy-selection{grid-column:1/-1}

.scroll-bar{display:grid;width:100%;max-width:none;margin:0;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:5px 6px}
.scroll-bar button{min-width:0;min-height:36px;padding:6px 4px;font-size:11px;font-weight:600}

/* ─────────────────────────────────────────────────────────────────────────────
   One-viewport workspace.
   The page no longer scrolls as a whole. The intro can be hidden with its own
   toggle, and only the "Sesi langsung" list scrolls, with a dedicated scrollbar
   pinned to its right edge. The composer, activity and permission panel stay
   fixed so the input is always reachable without fighting the page scroll.
   ──────────────────────────────────────────────────────────────────────────── */
#user-mode{display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden}
#user-mode .user-mode-intro{
  flex:none;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;
}
#user-mode .intro-copy{flex:1 1 auto;min-width:0}
#user-mode.intro-collapsed .user-mode-intro{gap:0}
#user-mode.intro-collapsed #intro-toggle{margin-left:auto}
#user-mode #request-preview,
#user-mode .user-activity,
#user-mode .permission-panel{flex:none}
#user-mode .readable-session{
  flex:1 1 auto;min-height:0;margin:0 auto;width:100%;
  display:flex;flex-direction:column;overflow:hidden;
}
#user-mode .session-scroll{position:relative;flex:1 1 auto;min-height:0;display:flex}
#user-mode .session-history{
  flex:1 1 auto;min-height:140px;overflow-y:scroll;overflow-x:hidden;
  padding-right:12px;
}
/* Chrome/Edge/Safari: a persistent, always-visible scrollbar pinned to the right
   edge of the session list, so it reads as "only this area scrolls". */
#user-mode .session-history::-webkit-scrollbar{width:11px}
#user-mode .session-history::-webkit-scrollbar-track{background:#0b1722;border-radius:999px}
#user-mode .session-history::-webkit-scrollbar-thumb{background:#3a6b7d;border:2px solid #0b1722;border-radius:999px}
#user-mode .session-history::-webkit-scrollbar-thumb:hover{background:#52e2bd}
/* Firefox has no ::-webkit-scrollbar, so use the standard properties there only.
   Scoping them avoids Chrome dropping the WebKit rules above. */
@supports not selector(::-webkit-scrollbar){
  #user-mode .session-history{scrollbar-width:thin;scrollbar-color:#3a6b7d #0b1722}
}
/* Guaranteed right-edge indicator: some browsers/OS settings render overlay or
   hidden scrollbars, so draw our own thin rail that mirrors the real scroll
   position. It is decorative (aria-hidden) and never intercepts pointer events. */
#user-mode .session-scrollbar{
  position:absolute;top:0;right:0;width:7px;height:100%;
  border-radius:999px;background:#0b1722;opacity:0;
  pointer-events:none;transition:opacity .2s ease;
}
#user-mode .session-scrollbar span{
  position:absolute;left:0;width:100%;border-radius:999px;
  background:#3a6b7d;min-height:26px;transition:background .2s ease;
}
#user-mode .session-scroll.has-overflow:not(.has-native-scrollbar) .session-scrollbar{opacity:1}
#user-mode .session-scroll.scrolling .session-scrollbar span{background:#52e2bd}

#intro-toggle{
  flex:none;min-height:32px;padding:6px 12px;border-radius:999px;
  font-size:11px;font-weight:600;
  background:#0e2029;border-color:#2f5566;color:#a9d9cd;
}
#intro-toggle:hover{background:#173640;color:#e7f4fa;border-color:var(--accent)}
#intro-toggle::before{content:"▴ ";font-size:10px;opacity:.8}
#intro-toggle[aria-expanded="false"]::before{content:"▾ "}
#user-mode.intro-collapsed .intro-copy{display:none}
#user-mode.intro-collapsed .user-mode-intro{margin-bottom:10px}
#user-mode.intro-collapsed .user-mode-intro{min-height:0;padding-block:0;margin-bottom:3px}

@media (max-width:640px){
  #user-mode{padding-bottom:10px}
  #user-mode .session-history{padding-right:9px}
  #user-mode .session-history::-webkit-scrollbar{width:9px}
  #intro-toggle{min-height:32px;padding:6px 10px;font-size:10px}
  #user-mode.intro-collapsed .user-mode-intro{margin-bottom:6px}
}

@media (max-height:520px){
  .keys{padding:4px 6px;gap:3px}
  .keys button{min-height:32px;padding:4px 3px;font-size:10px}
  .scroll-bar{padding:4px 6px;gap:3px}
  .scroll-bar button{min-height:34px;padding:5px 3px;font-size:10px}
}


/* Destructive agent action: visually separate from ordinary logout. */
.danger-action{border-color:#b85b67;color:#ffd9dd;background:#351c25}
/* Start-agent state: positive green so it never reads as a destructive tap. */
.start-agent-action{border-color:#3f7d63;color:#d9f7ea;background:#17322a}
.terminate-agent-dialog{max-width:440px;padding:0;border:1px solid #b85b67;border-radius:18px;background:#10161d;color:#eef6f4;box-shadow:0 24px 80px #000b}
.terminate-agent-dialog::backdrop{background:#05070bb8;backdrop-filter:blur(3px)}
.terminate-agent-dialog form{padding:26px}
.terminate-agent-dialog h2{margin:6px 0 10px}
.terminate-agent-dialog p:not(.eyebrow){line-height:1.55;color:#b9c8c7}
.session-recovery-dialog{max-width:500px;padding:0;border:1px solid #3b6978;border-radius:18px;background:#10161d;color:#eef6f4;box-shadow:0 24px 80px #000b}
.session-recovery-dialog::backdrop{background:#05070bb8;backdrop-filter:blur(3px)}
.session-recovery-dialog form{padding:26px}
.session-recovery-dialog h2{margin:6px 0 10px}
.session-recovery-dialog p:not(.eyebrow){line-height:1.55;color:#b9c8c7}
.session-recovery-preview{margin:16px 0;padding:12px 14px;border:1px solid #29414e;border-radius:11px;background:#0d1923;color:#a9d9cd;font-size:12px;line-height:1.45;overflow-wrap:anywhere}
.session-recovery-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:18px}
html[data-theme="light"] .session-recovery-dialog{background:#fff;color:var(--ink);border-color:#bcd7f8}
html[data-theme="light"] .session-recovery-dialog::backdrop{background:#00000059}
html[data-theme="light"] .session-recovery-dialog p:not(.eyebrow){color:#52616b}
html[data-theme="light"] .session-recovery-preview{background:#f0f6ff;border-color:#bcd7f8;color:#245c4d}
@media(max-width:640px){.session-recovery-dialog{max-width:calc(100vw - 24px)}.session-recovery-actions{flex-direction:column-reverse}.session-recovery-actions button{width:100%}}
.terminate-agent-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:22px}

/* Terminal controls are hidden by default and revealed on demand.
   The scroll bar and key bar previously occupied ~150px of every screen even
   when unused. They now sit behind a single compact toggle that stays visible
   directly under the terminal, so the work area is reclaimed without losing
   access to the controls. The preference is remembered per workspace, exactly
   like the header collapse, because the two serve the same "give me space"
   intent on small screens.
   ──────────────────────────────────────────────────────────────────────────── */
#terminal-controls-toggle{
  flex:none;align-self:flex-start;
  margin:6px 0 2px;padding:6px 12px;
  background:#0d1f29;border:1px solid #2b4a58;border-radius:8px;
  color:#a9d9cd;font:600 11px ui-monospace,SFMono-Regular,Menlo,monospace;
  min-height:34px;
}
#terminal-controls-toggle:hover{background:#173643;color:#e7f4fa;border-color:var(--accent)}
#terminal-controls-toggle[aria-expanded="true"]{background:#16303d;border-color:#3b6978;color:#bff6e7}
#terminal-controls{display:flex;flex-direction:column;width:100%}
@media (max-width:640px){
  #terminal-controls-toggle{min-height:44px;padding:8px 14px;font-size:12px}
}

/* Final compact header pass: all workspace actions share one small rectangular style. */
header nav{gap:5px;align-items:center;min-width:0;overflow-x:auto;scrollbar-width:none}
header nav::-webkit-scrollbar{display:none}
header nav button,#header-toggle{min-height:34px;padding:6px 10px;border-radius:7px;font-size:11px;line-height:1.15}
#header-controls .top-quick-actions{flex:0 0 auto;gap:5px;min-width:0;overflow:visible;padding:0;border:0;background:transparent;mask-image:none;-webkit-mask-image:none}
#header-controls .top-quick-actions{height:34px;align-self:center;align-items:center;margin:0}
#header-controls .top-quick-actions button{padding:6px 10px;border-radius:7px;font-size:11px}
@media (max-width:640px){
  #workspace>header{padding:7px 10px;gap:6px}
  .header-identity{width:auto;flex:0 0 auto;flex-wrap:nowrap;gap:5px;overflow:hidden}
  .header-identity strong{font-size:12px;white-space:nowrap}
  .header-identity #status{font-size:10px;padding:4px 6px;white-space:nowrap}
  #action-truth{display:none}
  #header-toggle{min-height:32px;padding:6px 8px;font-size:10px;margin-left:auto;white-space:nowrap}
  #header-controls{min-width:0;flex:1 1 auto}
  header nav{width:100%;margin:0;flex-wrap:nowrap;gap:5px;overflow-x:auto;padding:2px 18px 2px 0;overscroll-behavior-x:contain}
  header nav button,#header-controls .top-quick-actions button,#terminal-details-toggle{flex:0 0 auto;min-height:32px;padding:6px 9px;border-radius:7px;font-size:10px;white-space:nowrap}
  #header-controls .top-quick-actions{display:flex;flex:0 0 auto;order:0}
  #header-controls .top-quick-actions{height:32px;align-self:center;align-items:center}
  header nav #websites-button,header nav #reconnect,header nav #files-button,header nav #terminate-agent,header nav #logout{flex:0 0 auto}
  #header-controls .top-quick-actions::before{display:none}
}

/* ─────────────────────────────────────────────────────────────────────────────
   Single-row header (final pass).
   Every workspace control — brand, live status, theme, hide, the quick audits,
   Advanced toggle and the utility buttons — now shares exactly one horizontal
   line at every breakpoint. The control strip scrolls sideways on narrow
   screens instead of stacking into several header bands, and labels were
   shortened so the row stays readable. Placed last so it wins over the earlier
   multi-row mobile audit rules.
   ──────────────────────────────────────────────────────────────────────────── */
#workspace>header{flex-wrap:nowrap;align-items:center;gap:8px;overflow:hidden}
#workspace>header .header-identity{
  flex:0 0 auto;width:auto;min-width:0;flex-wrap:nowrap;gap:6px;
  justify-content:flex-start;
}
#workspace>header .header-identity strong{flex:none}
#workspace>header .header-identity #status{flex:none;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#workspace>header .header-identity #action-truth{flex:0 1 auto;min-width:0;max-width:min(360px,32vw);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#workspace>header .header-identity #theme-toggle,
#workspace>header .header-identity #header-toggle{flex:none}
#workspace:not(.header-collapsed)>header .header-identity #header-toggle{margin-left:0}
#workspace>header #header-controls{
  flex:1 1 auto;display:flex;flex-wrap:nowrap;align-items:center;gap:5px;
  min-width:0;margin-left:auto;overflow-x:auto;scrollbar-width:none;
}
#workspace>header #header-controls::-webkit-scrollbar{display:none}
#workspace>header #header-controls .top-quick-actions{
  flex:0 0 auto;order:0;display:flex;flex-wrap:nowrap;align-items:center;gap:5px;
  width:auto;max-width:none;height:auto;margin:0;padding:0;
  border:0;background:transparent;overflow:visible;
  -webkit-mask-image:none;mask-image:none;
}
#workspace>header #header-controls>button,
#workspace>header #header-controls .top-quick-actions button{
  flex:0 0 auto;min-height:34px;padding:6px 10px;border-radius:7px;
  font-size:11px;line-height:1.15;white-space:nowrap;
}
#workspace>header #header-controls .top-quick-actions::before{display:none}
@media (max-width:640px){
  #workspace>header{padding:7px 10px;gap:6px}
  #workspace>header .header-identity{gap:5px}
  #workspace>header .header-identity strong{font-size:12px}
  #workspace>header .header-identity #status{font-size:10px;padding:4px 6px}
  #workspace>header .header-identity #theme-toggle,
  #workspace>header .header-identity #header-toggle{min-height:32px;padding:6px 8px;font-size:10px}
  #workspace>header #header-controls>button,
  #workspace>header #header-controls .top-quick-actions button{min-height:32px;padding:6px 9px;font-size:10px}
}
#workspace>header .header-identity #action-truth{display:none!important}

/* Personal positioning tagline in the workspace top bar. Muted next to the
   AINNA brand, truncated before it can push the control strip off one row, and
   hidden on narrow screens where the header must stay compact. */
#workspace>header .header-identity .header-tagline{
  flex:0 1 auto;min-width:0;max-width:280px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:#7c97a8;font-size:11px;font-weight:500;letter-spacing:.02em;
}
html[data-theme="light"] #workspace>header .header-identity .header-tagline{color:#5b7386}
@media (max-width:1080px){#workspace>header .header-identity .header-tagline{max-width:180px;font-size:10px}}
@media (max-width:860px){#workspace>header .header-identity .header-tagline{display:none}}

/* Compact workspace intro: the hero was tall with a lot of empty space above
   the live session. Tighten the padding, kicker, heading and spacing so the
   conversation sits closer to the top. Placed last so it wins over the earlier
   hero rules. */
#user-mode{padding:clamp(14px,3vh,30px) clamp(16px,4vw,56px) 20px}
#user-mode .user-mode-intro{max-width:1120px;margin:0 auto 14px}
#user-mode .user-mode-kicker{padding:4px 8px;font-size:9px;letter-spacing:.14em}
#user-mode .user-mode-intro h1{margin:8px 0 4px;font-size:clamp(24px,3.2vw,38px);letter-spacing:-.045em;line-height:1.08}
#user-mode .user-mode-intro p{margin:0;max-width:650px;font-size:14px}
@media (max-width:640px){
  #user-mode{padding:12px 12px 12px}
  #user-mode .user-mode-intro{margin:0 auto 10px}
  #user-mode .user-mode-kicker{padding:3px 7px;font-size:9px}
  #user-mode .user-mode-intro h1{margin:7px 0 0;font-size:21px}
  #user-mode .user-mode-intro p{font-size:13px}
}
@media (max-height:520px){
  #user-mode{padding-top:10px}
  #user-mode .user-mode-intro{margin-bottom:8px}
  #user-mode .user-mode-intro h1{font-size:19px}
}

/* ─────────────────────────────────────────────────────────────────────────────
   Mobile burger menu.
   On narrow screens the whole control strip moves into one menu instead of a
   sideways-scrolling single row: #header-controls is hidden until the burger is
   tapped, then opens as a full-width vertical sheet under the header. Desktop is
   untouched because every rule here is scoped to max-width:640px.
   ──────────────────────────────────────────────────────────────────────────── */
#menu-toggle{display:none}
@media (max-width:640px){
  /* The header clips its overflow for the desktop scroll strip; the menu sheet
     is absolutely positioned inside it, so release the clip on mobile only. */
  #workspace>header{overflow:visible}
  #workspace>header .header-identity{flex:1 1 auto;min-width:0}
  #workspace>header .header-identity #header-toggle{display:none!important}
  #workspace>header #menu-toggle{
    display:inline-flex;flex:none;align-items:center;gap:5px;
    min-height:34px;padding:6px 11px;font-size:12px;
  }
  #workspace>header #header-controls{
    display:none;position:absolute;left:0;right:0;top:100%;z-index:30;
    flex-direction:column;align-items:stretch;gap:6px;
    min-width:0;margin:0;padding:10px 12px calc(12px + env(safe-area-inset-bottom));
    max-height:72dvh;overflow-y:auto;overflow-x:hidden;
    background:linear-gradient(180deg,#101c27 0%,#0c151f 100%);
    border-top:1px solid #263846;border-bottom:1px solid #263846;
    box-shadow:0 18px 44px #0007;
  }
  #workspace.menu-open>header #header-controls{display:flex!important}
  #workspace>header #header-controls .top-quick-actions{
    flex-direction:column;align-items:stretch;gap:6px;
    width:100%;max-width:none;overflow:visible;padding:0;border:0;
  }
  #workspace>header #header-controls>button,
  #workspace>header #header-controls .top-quick-actions button{
    width:100%;justify-content:flex-start;text-align:left;
    min-height:44px;padding:10px 13px;font-size:13px;border-radius:10px;
  }
  #workspace>header #header-controls .top-quick-actions button{flex:none}
}
html[data-theme="light"] #workspace>header #header-controls{background:linear-gradient(180deg,#eef4f8,#e2ebf1);border-color:#bdccd6}

/* Question tool: interactive option prompts (same family as the permission
   panel). Rendered inside Paparan Mudah so a blocking question is answerable
   without switching to Advanced CLI. Placed last so it wins over the base
   permission rules where they overlap. */
.question-panel{display:flex;flex-direction:column;gap:14px;width:100%;margin:18px 0 0;padding:18px 20px;border:1px solid #3c6f8c;border-radius:16px;background:#0f2330;box-shadow:0 10px 28px #0003}
.question-kicker{color:#7fd6ef;font:800 10px monospace;letter-spacing:.16em;text-transform:uppercase}
.question-panel h2{margin:6px 0 4px;color:#fff;font-size:18px}
.question-panel #question-description{margin:0;color:#a9c7d6;font-size:13px;overflow-wrap:anywhere}
.question-list{display:grid;gap:14px}
.question-item{display:grid;gap:9px;padding:13px 14px;border:1px solid #29414e;border-radius:13px;background:#0d1923}
.question-item-head{display:grid;gap:5px}
.question-header{display:inline-block;width:max-content;padding:3px 8px;border-radius:999px;background:#16323d;color:#8edbc9;font:800 10px monospace;letter-spacing:.12em;text-transform:uppercase}
.question-text{margin:0;color:#e0edf5;font-size:14px;line-height:1.45;overflow-wrap:anywhere}
.question-options{display:grid;gap:8px}
.question-option{display:grid;gap:3px;width:100%;padding:11px 13px;border:1px solid #314859;border-radius:11px;background:#122632;text-align:left;cursor:pointer}
.question-option strong{color:#e7f4fa;font-size:13px;font-weight:700}
.question-option span{color:#9cb4c6;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.question-option:hover{border-color:#52e2bd}
.question-option.is-selected{border-color:#52e2bd;background:#12352f;box-shadow:0 0 0 1px #52e2bd inset}
.question-option.is-selected strong{color:#8edbc9}
.question-custom{width:100%;margin:0;padding:10px 12px;border:1px dashed #3c6f8c;border-radius:11px;background:#0a1721;color:#e7f4fa;font-size:13px}
.question-custom:focus{border-style:solid;border-color:#52e2bd;outline:none}
.question-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.question-actions button{padding:9px 13px;font-size:12px}
.question-actions #question-submit{background:#52e2bd;border-color:#52e2bd;color:#08251f;font-weight:750}
.question-actions #question-reject{color:#f4a5a5}
@media (max-width:640px){
  .question-panel{padding:14px 13px;gap:11px}
  .question-panel h2{font-size:16px}
  .question-option{padding:11px 11px}
  .question-actions button{flex:1 1 auto;min-height:42px}
}
html[data-theme="light"] .question-panel{background:#eef6fa;border-color:#a9cfdd;color:#142033}
html[data-theme="light"] .question-panel h2{color:#142033}
html[data-theme="light"] .question-item{background:#fff;border-color:#c3d7e0}
html[data-theme="light"] .question-text{color:#1d2c38}
html[data-theme="light"] .question-option{background:#f3f9fc;border-color:#c3d7e0}
html[data-theme="light"] .question-option strong{color:#1d2c38}
html[data-theme="light"] .question-custom{background:#fff;color:#142033}

/* Center the readable workspace and let short sessions hug their content.
   The previous flex growth made an otherwise short session look like a blank
   panel under the live-session heading. Longer sessions still scroll locally. */
#workspace>header{justify-content:center;text-align:center}
#workspace>header .header-identity{justify-content:center}
#workspace>header #header-controls{justify-content:center;margin-inline:auto}
#user-mode .user-mode-intro{justify-content:center;text-align:center}
#user-mode .intro-copy{display:grid;justify-items:center}
#user-mode .user-mode-intro p{margin-inline:auto}
#user-mode .readable-session{flex:1 1 auto;min-height:260px;margin-inline:auto;text-align:center}
#user-mode .readable-heading{justify-content:center;text-align:center}
#user-mode .session-scroll{flex:1 1 auto;display:flex;min-height:0}
#user-mode .session-history{width:100%;max-width:860px;min-height:180px;max-height:none;flex:1 1 auto;margin-inline:auto;overflow-y:auto;text-align:left}
#user-mode .session-entry{width:100%;margin-inline:auto}
#user-mode .session-entry-label{text-align:center}
#user-mode .user-activity{text-align:center;justify-content:center}
#user-mode .permission-panel,#user-mode .question-panel{margin-inline:auto;text-align:center}
#user-mode .permission-actions,#user-mode .question-actions{justify-content:center}
#user-mode .question-heading{display:grid;justify-items:center}
#workspace.easy-mode #compose-meta{display:none}
@media(max-width:640px){
  #workspace>header .header-identity{flex-wrap:wrap}
  #workspace>header #header-controls{justify-content:center}
  #user-mode .readable-session{width:100%;min-height:220px}
}

/* The transcript frames the available height: the panel fills its space so the
   composer stays pinned to the bottom, while align-content:start keeps each
   message card hugging its own text instead of stretching to fill the panel.
   Long conversations scroll locally inside the same frame. */
#user-mode .readable-session{
  display:flex;
  flex:1 1 auto;
  flex-direction:column;
  width:100%;
  max-width:none;
  min-height:0;
  margin-inline:auto;
}
#user-mode .readable-heading{flex:none;width:100%;}
#user-mode .session-scroll{width:100%;flex:1 1 auto;min-height:0;}
#user-mode .session-history{width:100%;max-width:none;min-height:0;align-content:start;}
#user-mode .session-entry{max-width:none;}
@media(max-width:640px){
  #user-mode .readable-session{padding:14px 12px;}
  #user-mode .readable-heading{align-items:flex-start;text-align:left;}
  #user-mode .session-history{gap:8px;}
  #user-mode .session-entry{padding:11px 12px;}
}

/* Keep Day Mode readable without the glare of pure white surfaces. */
html[data-theme="light"] body{background:#dfe7ec;color:#223442}
html[data-theme="light"] #workspace{background:#dfe7ec}
html[data-theme="light"] #workspace>header{background:linear-gradient(180deg,#e8eef2,#d8e2e8);border-bottom-color:#b6c6d0}
html[data-theme="light"] #user-mode{background:linear-gradient(180deg,#e5edf1,#d6e1e7)}
html[data-theme="light"] .readable-session{background:#d9e4e9;border-color:#aebfc9;box-shadow:0 14px 30px #60788720}
html[data-theme="light"] .session-entry{background:#e5edf1;border-color:#b4c6d0}
html[data-theme="light"] .session-entry--user{background:#d8e9e6;border-color:#8bb9b1}
html[data-theme="light"] .session-entry p{color:#243844}
html[data-theme="light"] #compose,html[data-theme="light"] #workspace>footer{background:#d6e1e7;color:#526b7b}
html[data-theme="light"] #compose-shell{background:#e1eaee;border-color:#aebfc9}
html[data-theme="light"] #compose-row textarea{color:#223442}
html[data-theme="light"] #theme-toggle{background:#d4e0e6;color:#244351;border-color:#8fa8b5}
#user-mode.intro-collapsed .user-mode-intro{height:32px;min-height:32px;margin-bottom:3px;overflow:visible}
#user-mode{padding-top:8px}
#user-mode .user-mode-intro{display:none}
#user-mode .readable-session{margin-top:0;min-height:0}
.cli-choices{width:100%;margin:14px 0 0;padding:14px;border:1px solid #3d7d72;border-radius:14px;background:#10242d}
.cli-choices-title{margin:0 0 8px;color:#b7f3e4;font-size:13px;font-weight:700}
.cli-choices-list{display:grid;gap:8px}
.cli-choices-list button{display:flex;align-items:center;text-align:left;min-height:42px;border-radius:10px}
.cli-choices-list button.is-selected{border-color:#52e2bd;background:#12352f}
.cli-choice-n{display:inline-grid;place-items:center;min-width:22px;height:22px;margin-right:8px;border-radius:6px;background:#16382f;color:#b7f3e4;font-size:12px;font-weight:800}
.session-entry{content-visibility:visible}
#workspace>header #status{display:none}
#action-dock{padding:0 12px}
.session-entry p{font-size:17px;line-height:1.55}
.session-open{display:inline-flex;margin-top:8px;min-height:40px;align-items:center;padding:8px 12px;border-radius:8px;background:#12362c;color:#e7fff6;text-decoration:none;font-weight:700}
#permission-panel:not([hidden]),#question-panel:not([hidden]),#cli-choices:not([hidden]){box-shadow:0 0 0 2px #52e2bd55}
.file-row{display:flex;align-items:center;justify-content:space-between;gap:8px;list-style:none;margin:0;padding:8px 10px;border:1px solid #284555;border-radius:10px}
.file-thumb{width:48px;height:48px;object-fit:cover;border-radius:8px;flex:none;background:#0e202c;border:1px solid #355465}
#dashboard-panel{margin-top:14px;padding:12px;border:1px solid #3d7d72;border-radius:12px;background:#0e1c27}
#dashboard-panel h3{margin:0 0 6px}
.dashboard-tabs,.dashboard-columns,.dashboard-picks{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.dashboard-tabs button.is-selected{border-color:#52e2bd;background:#12352f}
.dashboard-columns label,.dashboard-picks label{display:flex;align-items:center;gap:6px;font-size:13px}
#dashboard-chart-view svg{width:100%;height:auto;background:#0b1722;border-radius:10px}
.file-select-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px}
.file-select-all{display:flex;align-items:center;gap:8px;margin:0;font-size:13px;color:#dbe8f5}
.file-pick,.file-select-all input{width:22px;height:22px;margin:0;accent-color:#52e2bd}
.file-row a{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.file-delete{flex:none;min-height:36px;padding:6px 10px;color:#f4a5a5;border-color:#6e3a40}
@media (max-width:720px){
  #compose{position:sticky;bottom:0;z-index:5;padding-bottom:calc(8px + env(safe-area-inset-bottom))}
  #compose-row textarea,input,textarea{font-size:16px}
  #compose-actions button,.founder-tasks button,.cli-choices-list button,.question-option,.permission-actions button{min-height:44px}
  #workspace>header .founder-tasks button{min-height:44px;font-size:13px}
  button[data-state="busy"]{animation:none}
}
@media (pointer:coarse){
  button:hover{transform:none}
}
@media (prefers-reduced-motion:reduce){
  button,button::after{animation:none!important;transition:none!important}
}

/* Top bar: brand kiri, tiga tugas tengah, alat kanan. Satu baris di desktop. */
#workspace>header{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  justify-content:stretch;
  gap:8px 12px;
  padding:8px 12px;
  text-align:left;
  overflow:visible;
}
#workspace>header .header-identity{justify-content:flex-start;flex-wrap:nowrap;width:auto}
#workspace>header .founder-tasks{display:flex;justify-content:center;gap:6px;min-width:0;overflow-x:auto}
#workspace>header .founder-tasks button{
  flex:0 0 auto;min-height:34px;padding:6px 12px;border-radius:8px;
  background:#12362c;color:#e7fff6;border-color:#3d7d72;font-size:12px;font-weight:700;white-space:nowrap;
}
/* Single accent CTA in the header; secondary tasks render as quiet ghosts. */
#workspace>header #task-check{background:transparent;color:#a9d9cd;border-color:#2d4a44}
#workspace>header #task-check:hover{color:#e7fff6;border-color:#3d7d72}
#workspace>header .header-tools{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0}
#workspace>header #logout{order:5;margin-left:2px}
#workspace>header #header-controls{
  position:static;display:flex;flex:0 0 auto;flex-direction:row;align-items:center;
  gap:6px;width:auto;margin:0;padding:0;overflow:visible;background:transparent;
  border:0;box-shadow:none;max-height:none;
}
#workspace>header #advanced-menu{position:relative}
#workspace>header #advanced-menu summary{
  display:inline-flex;align-items:center;min-height:34px;padding:6px 10px;
  border:1px solid #314859;border-radius:8px;background:#182a36;color:#e7f4fa;
  font-size:12px;list-style:none;cursor:pointer;
}
#workspace>header #advanced-menu .advanced-tools{
  position:static;right:auto;top:auto;z-index:auto;
  display:flex;gap:6px;width:auto;margin:0;padding:0;
  background:transparent;border:none;box-shadow:none;
}
#workspace>header #advanced-menu .advanced-tools button{width:auto;text-align:center;min-height:36px}
@media (max-width:720px){
  #workspace>header{grid-template-columns:minmax(0,1fr) auto;padding:8px 10px}
  #workspace>header .founder-tasks{grid-column:1 / -1;justify-content:stretch}
  #workspace>header .founder-tasks button{flex:1 1 0;padding-inline:8px;font-size:11px}
  #workspace>header #header-controls{
    display:none;position:absolute;left:0;right:0;top:100%;z-index:30;
    flex-direction:column;align-items:stretch;width:auto;
    padding:10px 12px calc(12px + env(safe-area-inset-bottom));
    background:linear-gradient(180deg,#101c27,#0c151f);
    border-top:1px solid #263846;border-bottom:1px solid #263846;
    box-shadow:0 18px 44px #0007;max-height:72dvh;overflow:auto;
  }
  #workspace.menu-open>header #header-controls{display:flex}
  #workspace>header #header-controls>button,
  #workspace>header #advanced-menu{width:100%}
  #workspace>header #advanced-menu summary{width:100%}
  #workspace>header #advanced-menu .advanced-tools{position:static;width:100%;box-shadow:none;margin-top:6px}
}

/* Resource-limit admin modal (masli instance only). */
.limits-table{width:100%;border-collapse:collapse;margin:14px 0 6px;font-size:12px}
.limits-table-wrap{width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.limits-table-wrap .limits-table{min-width:640px}
.limits-table th,.limits-table td{text-align:left;padding:7px 6px;border-bottom:1px solid #263846}
.limits-table th{font-size:11px;letter-spacing:.08em;color:#9cb4c6;font-weight:600}
.limits-table td:first-child{font-weight:600;color:var(--accent)}
.limits-table input[type=number]{width:64px;margin:0;padding:6px 8px;font-size:12px}
.limits-table input[type=checkbox]{width:18px;height:18px;margin:0;accent-color:var(--accent)}
.limits-table tr.is-manager td{opacity:.75}
.limits-table tr.is-manager td:first-child::after{content:" · pengurus";font-size:10px;color:#9cb4c6;font-weight:400}
.password-admin{margin-top:24px;padding-top:16px;border-top:1px solid #263846}
.password-admin h3{margin:0;font-size:15px}
.password-table input[type=password]{width:min(100%,240px);margin:0;padding:7px 9px;font-size:12px}
.password-table button{padding:7px 10px;font-size:12px}
#password-truth{min-height:20px;margin:6px 0;font-size:12px;color:#8edbc9}
#password-truth[data-state=error]{color:#f8b486}
.limits-note{margin:10px 0 4px;font-size:11px;color:#9cb4c6;line-height:1.5}
.agent-idle-policy{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:10px;margin:18px 0;padding:14px;border:1px solid var(--line,#34495a);border-radius:12px}
.agent-idle-policy h3,.agent-idle-policy p{grid-column:1/-1;margin:0}
.agent-idle-policy label{font-size:13px}
.agent-idle-policy select{min-width:145px}
.agent-idle-policy [role=status]{grid-column:1/-1;margin:0;font-size:12px}
@media(max-width:560px){.agent-idle-policy{grid-template-columns:1fr}.agent-idle-policy h3,.agent-idle-policy p,.agent-idle-policy [role=status]{grid-column:1}.agent-idle-policy select,.agent-idle-policy button{width:100%}}
#limits-truth{min-height:20px;margin:6px 0;font-size:12px;color:#8edbc9}
#limits-truth[data-state=error]{color:#f8b486}
.limits-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
@media(max-width:650px){
  .limits-table{font-size:11px}
  .limits-table th,.limits-table td{padding:6px 3px}
  .limits-table input[type=number]{width:52px;padding:5px 6px}
}

/* Background agents (Hermes / OpenClaw) toggle panel inside Lanjutan. Each row
   carries its own state dot, start/stop button and live CPU gauge. */
.services-dialog .dialog-head{margin-bottom:6px}
.services-list{display:flex;flex-direction:column;gap:10px;margin:14px 0 6px}
.service-row{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #263846;border-radius:12px;background:#0b1620}
.service-row[data-active=false]{opacity:.72}
.service-row[data-state=busy]{border-color:rgba(245,196,81,.45)}
.service-id{display:flex;align-items:center;gap:9px;min-width:0;flex:1 1 auto}
.service-dot{width:9px;height:9px;border-radius:50%;background:#ef5965;box-shadow:0 0 8px rgba(239,89,101,.7);flex-shrink:0}
.service-row[data-active=true] .service-dot{background:#52e2bd;box-shadow:0 0 8px rgba(82,226,189,.7)}
.service-meta{min-width:0}
.service-name{display:block;font-size:13px;font-weight:700;color:#dbe8f5}
.service-sub{display:block;font-size:11px;color:#9cb4c6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.service-cpu{display:flex;flex-direction:column;align-items:flex-end;gap:3px;min-width:64px;flex-shrink:0}
.service-cpu-value{font:700 13px ui-monospace,Menlo,monospace;color:var(--accent);font-variant-numeric:tabular-nums}
.service-cpu-value[data-state=idle]{color:#7c93a5}
.service-cpu-gauge{width:60px;height:5px;border-radius:99px;background:#1b2a36;overflow:hidden}
.service-cpu-gauge span{display:block;height:100%;width:0;background:linear-gradient(90deg,#52e2bd,#f5c451 60%,#ef5965);transition:width .5s ease}
.service-toggle{min-width:92px;flex-shrink:0;font-size:12px;padding:8px 10px}
.service-toggle[data-role=stop]{border-color:rgba(239,89,101,.45);color:#ffc2c7}
.service-truth{min-height:20px;margin:6px 0;font-size:12px;color:#8edbc9}
.service-truth[data-state=error]{color:#f8b486}
.services-note{margin:4px 0 0;font-size:11px;color:#9cb4c6;line-height:1.5}
.services-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:12px}.smart-router-cache-button{display:inline-flex;align-items:center;margin-right:auto;background:#163b43;border:1px solid #52e2bd;border-radius:8px;color:#bff6e7;font-weight:750;padding:10px 14px}.smart-router-cache-button:hover{background:#20535b;color:#fff}.smart-router-cache-dialog{width:min(1120px,96vw)}.smart-router-cache-table-wrap{overflow:auto;border:1px solid #263846;border-radius:12px;background:#0b1620}.smart-router-cache-table{width:100%;min-width:760px;border-collapse:collapse}.smart-router-cache-table th,.smart-router-cache-table td{padding:11px 12px;border-bottom:1px solid #20303b;text-align:left;vertical-align:top;font-size:12px}.smart-router-cache-table th{color:#8edbc9;font-size:10px;letter-spacing:.08em;text-transform:uppercase}.smart-router-cache-table td{white-space:pre-wrap}.smart-router-cache-table .cache-intent-cell{font-weight:750;color:#fff}.smart-router-cache-table .cache-reply-cell{max-width:460px;line-height:1.45}
.smart-router-dialog{width:min(760px,94vw)}
.smart-router-dialog .dialog-head{margin-bottom:12px}
.smart-router-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid #263846;border-radius:12px;background:#0b1620}
.smart-router-toggle{position:relative;display:flex;align-items:center;gap:10px;margin:0;color:#dbe8f5;font-weight:700;cursor:pointer}
.smart-router-toggle input{position:absolute;left:0;top:calc(50% - 12px);width:42px;height:24px;margin:0;opacity:0;cursor:pointer;z-index:2}
.smart-router-switch{position:relative;display:inline-flex;flex:none;width:42px;height:24px;border-radius:999px;background:#2a3b48;border:1px solid #3d5565;transition:background .2s ease,border-color .2s ease}
.smart-router-switch span{position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:#9db3c4;transition:transform .2s ease,background .2s ease}
.smart-router-toggle input:checked + .smart-router-switch{background:#0f7a5a;border-color:#2fd6a0}
.smart-router-toggle input:checked + .smart-router-switch span{transform:translateX(18px);background:#eafff8}
.smart-router-toggle input:focus-visible + .smart-router-switch{outline:2px solid var(--accent);outline-offset:2px}
.smart-router-toggle input:disabled + .smart-router-switch{opacity:.45;cursor:not-allowed}
#smart-router-enabled-label{font-size:13px}
.smart-router-power-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.smart-router-save-btn{padding:8px 14px;border:1px solid #2fd6a0;border-radius:8px;background:#0f7a5a;color:#eafff8;font:700 12px/1 inherit;cursor:pointer}
.smart-router-save-btn:hover:not(:disabled){background:#12946b}
.smart-router-save-btn:disabled{opacity:.42;cursor:not-allowed}
.smart-router-power-truth{margin:6px 2px 0;min-height:0;font-size:11px;line-height:1.45;color:#8edbc9}
.smart-router-power-truth:empty{display:none}
.smart-router-power-truth[data-state="error"]{color:#ff9c9c}
.smart-router-power-truth[data-state="busy"]{color:#f4d58a}
#smart-router-updated{font-size:11px;color:#7c93a5}
.smart-router-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.smart-router-card{padding:14px;border:1px solid #263846;border-radius:12px;background:linear-gradient(145deg,#0d1b27,#0b141e)}
.smart-router-card-wide{grid-column:1/-1}
.smart-router-card-kicker{display:block;font-size:10px;letter-spacing:.14em;color:#8edbc9;margin-bottom:8px}
.smart-router-card>strong{display:block;font:700 26px ui-monospace,Menlo,monospace;color:var(--accent)}
.smart-router-card>span:not(.smart-router-card-kicker){display:block;font-size:11px;color:#9cb4c6}
.smart-router-card dl{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0 0}
.smart-router-card dt{font-size:10px;color:#7c93a5}
.smart-router-card dd{margin:3px 0 0;font:700 14px ui-monospace,Menlo,monospace;color:#dbe8f5}
.smart-router-use-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}
.smart-router-use-grid strong{display:block;font:700 20px ui-monospace,Menlo,monospace;color:var(--accent)}
.smart-router-use-grid span{display:block;font-size:10px;color:#9cb4c6;margin-top:3px}
.smart-router-note{margin:10px 0 0;font-size:11px;color:#9cb4c6;line-height:1.5}
.smart-router-route-note{margin:12px 0 0;padding:10px 12px;border-left:3px solid #52e2bd;border-radius:8px;background:#10232d;color:#c1d4df;font-size:11px;line-height:1.5}
.smart-router-passwords{margin-top:14px;padding:14px;border:1px solid #263846;border-radius:12px;background:#0b1620}
.smart-router-passwords h3{margin:0;color:#dbe8f5;font-size:14px}
.smart-router-passwords>div:first-child p{margin:5px 0 12px;color:#9cb4c6;font-size:11px}
.smart-router-password-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.smart-router-password-form{display:grid;gap:8px;padding:12px;border:1px solid #263846;border-radius:10px;background:#0d1923}
.smart-router-password-form h4{margin:0;color:#8edbc9;font-size:13px}
.smart-router-password-state{font-size:11px;color:#9cb4c6}
.smart-router-password-form label,.smart-router-unlock-dialog label{display:grid;gap:5px;color:#b8cbd8;font-size:11px}
.smart-router-password-form input,.smart-router-unlock-dialog input{width:100%;min-width:0;background:#08121b;border:1px solid #324955;border-radius:8px;color:#e7f4fa;padding:9px;font:inherit}
.smart-router-unlock-dialog{width:min(420px,92vw)}
.smart-router-unlock-dialog .dialog-head{align-items:flex-start}
@media(max-width:650px){.smart-router-password-grid{grid-template-columns:1fr}.smart-router-password-form{min-width:0}}
.smart-router-chain{margin-top:14px;padding:14px;border:1px solid #263846;border-radius:12px;background:#0b1620}
.smart-router-chain h3{margin:0;color:#dbe8f5;font-size:14px}
.smart-router-chain-head p{margin:5px 0 12px;color:#9cb4c6;font-size:11px}
.smart-router-chain-list{list-style:none;margin:0 0 12px;padding:0;display:grid;gap:6px}
.smart-router-chain-item{display:flex;align-items:center;gap:8px;padding:7px 9px;border:1px solid #263846;border-radius:9px;background:#0d1923;min-width:0}
.smart-router-chain-rank{flex:none;width:20px;height:20px;display:grid;place-items:center;border-radius:6px;background:#16323f;color:#8edbc9;font:700 11px ui-monospace,Menlo,monospace}
.smart-router-chain-name{flex:1 1 auto;min-width:0;color:#dbe8f5;font-size:12px;overflow-wrap:anywhere}
.smart-router-chain-gate{display:inline-block;margin-inline-start:4px;padding:1px 6px;border-radius:999px;background:#3a2a12;color:#f3c76b;font-size:10px}
.smart-router-chain-item-actions{flex:none;display:flex;gap:4px}
.smart-router-chain-item-actions button{width:26px;height:26px;padding:0;border-radius:6px;font-size:13px;line-height:1}
.smart-router-chain-item-actions button:disabled{opacity:.4}
.smart-router-chain-empty{padding:9px;color:#9cb4c6;font-size:11px}
.smart-router-chain-add{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:12px}
.smart-router-chain-add label{color:#b8cbd8;font-size:11px}
.smart-router-chain-add select{flex:1 1 220px;min-width:0;background:#08121b;border:1px solid #324955;border-radius:8px;color:#e7f4fa;padding:8px;font:inherit}
.smart-router-chain-actions{display:flex;flex-wrap:wrap;gap:8px}
@media(max-width:650px){.smart-router-chain-add select{flex-basis:100%}}
html[data-theme="light"] .smart-router-chain{background:#f1f6ff;border-color:#c4d3dd}
html[data-theme="light"] .smart-router-chain h3{color:#0f2430}
html[data-theme="light"] .smart-router-chain-item{background:#fff;border-color:#c4d3dd}
html[data-theme="light"] .smart-router-chain-name{color:#193042}
@media(max-width:650px){
  .smart-router-grid{grid-template-columns:1fr}
  .smart-router-card-wide{grid-column:auto}
  .smart-router-use-grid{grid-template-columns:repeat(3,1fr)}
  .smart-router-toolbar{align-items:flex-start;flex-direction:column}
}
@media(max-width:650px){
  .service-row{flex-wrap:wrap;gap:8px}
  .service-id{flex-basis:100%}
  .service-cpu{margin-left:auto}
}

/* Server admin modal: restart buttons reuse .service-row, snapshots get their
   own compact list with a single destructive action per row. */
.server-dialog{width:min(680px,94vw)}
.server-section-title{margin:20px 0 4px;font-size:13px;letter-spacing:.06em;color:#9cb4c6;text-transform:uppercase}
.snapshot-list{list-style:none;margin:10px 0 4px;padding:0;display:flex;flex-direction:column;gap:8px;max-height:34dvh;overflow:auto}
.snapshot-item{display:flex;align-items:center;gap:12px;padding:10px 13px;border:1px solid #263846;border-radius:10px;background:#0b1620}
.snapshot-meta{min-width:0;flex:1 1 auto}
.snapshot-name{display:block;font-size:13px;font-weight:700;color:#dbe8f5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.snapshot-sub{display:block;font-size:11px;color:#9cb4c6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.snapshot-delete{flex-shrink:0;min-width:72px;font-size:12px;padding:7px 10px;border-color:rgba(239,89,101,.45);color:#ffc2c7}
.snapshot-empty{margin:0;padding:12px 4px;font-size:12px;color:#7c93a5;list-style:none}

/* Icon close button for dialogs: square target, no text padding. Sized to the
   44px touch target the mobile audit standardises on, so it stays tappable. */
.dialog-close{width:44px;height:44px;min-width:44px;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:24px;line-height:1;flex-shrink:0}
@media(max-width:650px){.dialog-close{width:40px;height:40px;min-width:40px;font-size:22px}}

/* Request-viz head: title + progress flow + hide toggle share ONE row so the
   status panel stays minimal instead of stacking into a tall column. The detail
   (meter, caption, stats, CPU gauge) sits in .request-viz-body behind the
   toggle. Placed last so it wins over the earlier request-viz rules. */
.request-viz-head{display:flex;align-items:center;gap:10px;min-width:0}
.request-viz-head .request-viz-flow{flex:1 1 auto;min-width:0;gap:4px}
.request-viz-toggle{flex:0 0 auto;min-height:26px;min-width:26px;padding:2px 7px;border-radius:6px;
  font-size:17px;font-weight:700;line-height:1;white-space:nowrap;text-align:center;
  background:#0e2029;border-color:#2f5566;color:#a9d9cd}
.request-viz-toggle:hover{background:#173640;color:#e7f4fa;border-color:var(--accent)}
.request-viz-body{display:flex;flex-direction:column;gap:10px;min-width:0}
/* Always visible: force full card even if is-collapsed class lingers (Semua kondisi terpapar). */
.request-viz.is-collapsed .request-viz-body,
.request-viz.is-collapsed .request-viz-flow { display: flex !important; }
.request-viz.is-collapsed { flex: 1 1 auto; width: auto; gap: 10px; padding: 13px 15px; }
@media(max-width:420px){
  /* Too narrow for title + flow + button on one line: drop the flow graphic and
     keep the title and toggle, so the head still never wraps to a second row. */
  .request-viz-head .request-viz-flow{display:none}
}

/* ── Paparan lanjutan: ONE row at every width ─────────────────────────────┐
   Title, flow, live detail (meter + caption + status + CPU/disk/load) and the    │
   hide toggle share a single horizontal strip on desktop AND mobile. The    │
   detail shrinks and truncates instead of wrapping, and the needle gauge is │
   reduced to a small inline readout so the strip stays one line tall.       │
   Placed last so it wins over every earlier request-viz rule.               │
   ────────────────────────────────────────────────────────────────────────── */
.request-viz{flex-direction:row;align-items:center;gap:9px;flex-wrap:nowrap;overflow:hidden;padding:9px 12px}
.request-viz-title{flex:0 0 auto}
.request-viz-flow{flex:0 0 auto;gap:4px}
.request-viz-body{flex:1 1 auto;display:flex;flex-direction:row;align-items:center;gap:9px;min-width:0}
.request-viz-body .request-viz-meter{flex:1 1 40px;min-width:28px;height:4px;margin:0}
.request-viz-caption{flex:0 1 auto;min-width:0;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px}
.request-viz-stats{flex:0 0 auto;display:flex;flex-direction:row;gap:9px;margin:0}
.request-viz-stats div{flex-direction:row;align-items:baseline;gap:4px}
.request-viz-stats dt{font-size:8px}
.request-viz-stats dd{font-size:11px}
.request-viz-gauges{flex:0 0 auto;display:flex;flex-direction:row;align-items:center;gap:9px;margin:0;padding:0;border-top:0}
.rv-gauge{flex-direction:row;align-items:center;gap:4px}
.rv-gauge svg{width:30px;height:20px}
.rv-gauge figcaption{margin-top:0;gap:3px}
.rv-gauge figcaption b{font-size:11px}
.rv-gauge figcaption small{font-size:8px}
.rv-load{display:flex;flex-direction:row;align-items:center;gap:5px}
.rv-load-bars{display:none}
@media(max-width:640px){
  /* No room for the flow graphic or the status pair on a phone: keep the title,
     the progress meter, the CPU/load readout and the toggle on one line. */
  .request-viz-flow{display:none}
  .request-viz-stats{display:none}
  .request-viz-caption{flex:1 1 auto;min-width:0}
  .request-viz-gauges{gap:7px}
}
@media(max-width:420px){
  .request-viz-title{font-size:9px;letter-spacing:.06em}
  .request-viz-caption{display:none}
  .rv-gauge figcaption small{display:none}
}

/* The advanced strip also runs on phones, but compressed to a single scrollable
   row: title, progress meter, CPU/load readout and the hide toggle. The flow
   graphic and the status pair are already dropped by the 640px rules above, so
   no extra mobile override is needed here. */
@media(max-width:640px){
  .request-viz{gap:7px;padding:8px 10px;overflow-x:auto;scrollbar-width:none}
  .request-viz::-webkit-scrollbar{display:none}
  .request-viz-title{flex:0 0 auto}
  .request-viz-caption{flex:1 1 auto}
  .request-viz-toggle{flex:0 0 auto}
}

/* ==========================================================================
   APPLE-WHITE MINIMALIST (Terang / Day theme) — 2026-10-03
   Palette: page #f5f5f7 · surface #ffffff · ink #1d1d1f · muted #6e6e73
            line #d2d2d7 · accent #0071e3 (Apple blue)
   Appended last so it wins over the scattered dark values defined above.
   ========================================================================== */
html[data-theme="light"]{color-scheme:light;--accent:#0071e3;--ink:#1d1d1f;--muted:#6e6e73;--surface:#fff;--page:#f5f5f7;--line:#d2d2d7}
html[data-theme="light"] body{background:var(--page);color:var(--ink)}
html[data-theme="light"] button{background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme="light"] button:hover{border-color:var(--accent)}

/* --- Login --- */
html[data-theme="light"] #login{background:radial-gradient(at 85% 10%,#e6f0fb,transparent 60%)}
html[data-theme="light"] #login-form{background:var(--surface);border-color:var(--line);box-shadow:0 18px 50px #0000000f}
html[data-theme="light"] .eyebrow{color:var(--accent)}
html[data-theme="light"] h1 span,html[data-theme="light"] header strong span{color:var(--accent)}
html[data-theme="light"] input,html[data-theme="light"] textarea{background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme="light"] #login-button{background:var(--accent);color:#fff}
html[data-theme="light"] #login-error,html[data-theme="light"] #file-status{color:#c0392b}

/* --- Workspace shell + header --- */
html[data-theme="light"] #workspace{background:var(--page)}
html[data-theme="light"] #workspace>header{background:linear-gradient(180deg,#ffffff,#f0f0f2);border-bottom-color:var(--line)}
html[data-theme="light"] #workspace>header .header-identity strong{color:var(--ink)}
html[data-theme="light"] #workspace>header .header-identity .header-tagline{color:var(--muted)}
html[data-theme="light"] #status,html[data-theme="light"] #action-truth{background:#fff;color:#3a3a3c;border-color:var(--line)}
html[data-theme="light"] #header-controls{background:linear-gradient(180deg,#fbfbfd,#f0f0f2);border-color:var(--line)}
html[data-theme="light"] #header-toggle{background:#eef1f5;color:#3a3a3c;border-color:var(--line)}
html[data-theme="light"] #header-toggle:hover{background:#e3e8ee;color:var(--ink)}
html[data-theme="light"] #workspace.header-collapsed #header-toggle{background:#fff3d6;color:#8a5a00;border-color:#e6cf9a}
html[data-theme="light"] #intro-toggle{background:#eef1f5;color:#3a3a3c;border-color:var(--line)}
html[data-theme="light"] #intro-toggle:hover{background:#e3e8ee;color:var(--ink)}
html[data-theme="light"] .founder-tasks button{background:#fff;color:#1d1d1f;border-color:var(--line)}
/* Same hierarchy in light: one filled accent CTA, secondary as ghost. */
html[data-theme="light"] #workspace>header #task-build{background:var(--accent);border-color:var(--accent);color:#fff}
html[data-theme="light"] #workspace>header #task-check{background:#fff;color:#3a4c58;border-color:var(--line)}
html[data-theme="light"] #advanced-menu summary{background:#fff;color:#1d1d1f;border-color:var(--line)}
html[data-theme="light"] #advanced-menu .advanced-tools{background:#fff;border-color:var(--line)}
html[data-theme="light"] #logout{background:#fff;color:#1d1d1f;border-color:var(--line)}

/* --- Theme switch --- */
html[data-theme="light"] .theme-switch{background:#e8eaee;border-color:var(--line)}
html[data-theme="light"] .theme-switch button{color:#5a5a5f}
html[data-theme="light"] .theme-switch button:hover{color:var(--ink);border-color:#b9c0c9}
html[data-theme="light"] .theme-switch button[aria-pressed="true"]{background:#fff;color:var(--ink);border-color:var(--line);box-shadow:0 1px 3px #00000014}
html[data-theme="light"] #terminal-details-toggle{background:#eef1f5;color:#3a3a3c;border-color:var(--line)}
html[data-theme="light"] #terminal-details-toggle .tdt-sign{background:#dde3ea;color:#2c3f4c}
html[data-theme="light"] #terminal-details-toggle[aria-expanded="true"] .tdt-sign{background:var(--accent);color:#fff}

/* --- Conversation surface --- */
html[data-theme="light"] #user-mode{background:linear-gradient(180deg,#fff,#f5f5f7);color:var(--ink)}
html[data-theme="light"] .user-mode-intro p,html[data-theme="light"] .session-empty,html[data-theme="light"] .readable-heading span{color:var(--muted)}
html[data-theme="light"] .user-mode-kicker{background:#e8f1fd;color:#0058b0}
html[data-theme="light"] .conversation-card{background:#fff;border-color:var(--line);box-shadow:0 10px 26px #0000000d}
html[data-theme="light"] .conversation-card--user{background:#e9f2ff;border-color:#bcd7f8}
html[data-theme="light"] .conversation-card p{color:var(--ink)}
html[data-theme="light"] .conversation-label{color:var(--accent)}
html[data-theme="light"] .conversation-card--user .conversation-label{color:#0058b0}
html[data-theme="light"] .readable-session,html[data-theme="light"] .session-entry{background:#fff;border-color:var(--line)}
html[data-theme="light"] .session-entry p,html[data-theme="light"] .session-entry-label{color:#2c2c2e}
/* Perbualan text: reduce the current 17px size by 25%, not to 25%. */
.session-entry p{font-size:13px}
html[data-theme="light"] .user-activity{color:var(--muted)}
html[data-theme="light"] .quick-actions{background:transparent}
html[data-theme="light"] .quick-actions button{background:#fff;color:#0058b0;border-color:var(--line)}
html[data-theme="light"] .quick-actions button:hover{background:#f0f6ff;color:var(--ink);border-color:var(--accent)}

/* --- Terminal (must match the xterm theme in app.js) --- */
html[data-theme="light"] #terminal{background:#fff}
html[data-theme="light"] #cli-surface{background:#f5f5f7}
html[data-theme="light"] .keys{background:#eef0f3}
html[data-theme="light"] .keys button{background:#fff;color:#1d1d1f;border-color:var(--line)}
html[data-theme="light"] .keys button:hover{background:#f0f6ff}
html[data-theme="light"] .keys button[data-terminal-action]{background:#fff;color:#0058b0;border-color:var(--line)}
html[data-theme="light"] .scroll-bar button{background:#eef0f3;color:#3a3a3c;border-color:var(--line)}
html[data-theme="light"] .scroll-bar button:hover{background:#e3e8ee;color:var(--ink)}

/* --- Composer --- */
html[data-theme="light"] #compose,html[data-theme="light"] #workspace>footer{background:#f5f5f7;color:var(--muted)}
html[data-theme="light"] #compose-shell{background:#fff;border-color:var(--line)}
html[data-theme="light"] #compose-row textarea{color:var(--ink)}
html[data-theme="light"] #compose-model{background:#eef1f5;color:#3a3a3c}
html[data-theme="light"] #files-compose-button{background:#eef1f5;color:#0058b0}
html[data-theme="light"] #files-compose-button:hover{background:#e0e7ef;color:var(--ink)}
html[data-theme="light"] #attach-compose-button{background:#eef1f5;color:#0058b0}
html[data-theme="light"] #attach-compose-button:hover{background:#e0e7ef;color:var(--ink)}
html[data-theme="light"] .composer-file{background:#eef1f5;color:#0058b0;border-color:var(--line)}
html[data-theme="light"] .composer-file button{background:#ff3b30;color:#fff;border-color:#ff6b61}
html[data-theme="light"] #compose-submit{background:var(--accent);border-color:var(--accent);color:#fff}

/* --- Files panel --- */
html[data-theme="light"] .file-upload-panel{background:#fff;border-color:var(--line)}
html[data-theme="light"] .file-dropzone{background:#f5f8fb;border-color:var(--line)}
html[data-theme="light"] .file-dropzone:hover{background:#eef4fa;border-color:var(--accent)}
html[data-theme="light"] .file-dropzone strong,html[data-theme="light"] .file-list-head{color:var(--ink)}
html[data-theme="light"] .file-thumb{background:#f0f2f5;border-color:var(--line)}
html[data-theme="light"] .file-select-all{color:#1d1d1f}
html[data-theme="light"] .file-delete{color:#c0392b;border-color:#e6b3ae}

/* --- Dialogs --- */
html[data-theme="light"] dialog{background:#fff;color:var(--ink);border-color:var(--line);box-shadow:0 24px 60px #00000026}
html[data-theme="light"] dialog::backdrop{background:#00000059}
html[data-theme="light"] code{color:#0058b0}
html[data-theme="light"] a{color:var(--accent)}
html[data-theme="light"] .terminate-agent-dialog{background:#fff;color:var(--ink);border-color:#e6b3ae}
html[data-theme="light"] .terminate-agent-dialog::backdrop{background:#00000059}

/* --- Action-truth states --- */
html[data-theme="light"] #action-truth[data-state="busy"]{background:#fff7e6;color:#8a5a00;border-color:#e6cf9a}
html[data-theme="light"] #action-truth[data-state="success"]{background:#e8f7ee;color:#0a6b3d;border-color:#a9d9bf}
html[data-theme="light"] #action-truth[data-state="error"]{background:#fdeceb;color:#c0392b;border-color:#e8b4ae}
html[data-theme="light"] .user-activity[data-state="working"]{color:#8a5a00}
html[data-theme="light"] .user-activity[data-state="error"]{color:#c0392b}
html[data-theme="light"] button[data-state="error"]{color:#c0392b;border-color:#e8b4ae}

/* --- Panels: request viz, choices, questions, dashboard, services --- */
html[data-theme="light"] .request-preview{background:#f0f6ff;border-color:#bcd7f8}
html[data-theme="light"] .request-preview p{color:#22303c}
@media(max-width:720px){.request-preview>span,.request-technical-title{display:none!important}}
html[data-theme="light"] .request-viz-toggle{background:#eef1f5;color:#3a3a3c;border-color:var(--line)}
html[data-theme="light"] .request-viz-toggle:hover{background:#e3e8ee;color:var(--ink)}
html[data-theme="light"] .cli-choices{background:#f0f6ff;border-color:#bcd7f8}
html[data-theme="light"] .cli-choices-list button{background:#fff;color:#1d1d1f;border-color:var(--line)}
html[data-theme="light"] .cli-choices-list button.is-selected{background:#e9f2ff;border-color:var(--accent)}
html[data-theme="light"] .cli-choice-n{background:#e8f1fd;color:#0058b0}
html[data-theme="light"] .session-open{background:#e8f7ee;color:#0a6b3d;border-color:#a9d9bf}
html[data-theme="light"] .session-copy{background:#eef1f5;color:#0058b0;border-color:var(--line)}
html[data-theme="light"] .session-copy:hover{background:#e0e7ef;color:var(--ink)}
html[data-theme="light"] .question-panel{background:#f2f8fd;border-color:#bcd7f8;color:var(--ink)}
html[data-theme="light"] .question-header{background:#e8f1fd;color:#0058b0}
html[data-theme="light"] .question-item{background:#fff;border-color:var(--line)}
html[data-theme="light"] .question-text{color:var(--ink)}
html[data-theme="light"] .question-option.is-selected{background:#e9f2ff;border-color:var(--accent)}
html[data-theme="light"] .question-actions #question-reject{color:#c0392b}
html[data-theme="light"] #dashboard-panel{background:#fff;border-color:var(--line)}
html[data-theme="light"] .dashboard-tabs button{background:#eef1f5;color:#3a3a3c}
html[data-theme="light"] .dashboard-tabs button.is-selected{background:#e9f2ff;border-color:var(--accent)}
html[data-theme="light"] #dashboard-chart-view svg{background:#fff}
html[data-theme="light"] .service-row{background:#fafafa;border-color:#e2e2e5}
html[data-theme="light"] .service-name{color:var(--ink)}
html[data-theme="light"] .service-cpu-gauge{background:#e8eaee}
html[data-theme="light"] .service-toggle[data-role=stop]{color:#c0392b}
html[data-theme="light"] .service-truth[data-state=error],html[data-theme="light"] #limits-truth[data-state=error]{color:#c0392b}
html[data-theme="light"] .smart-router-toolbar{background:#fafafa;border-color:#e2e2e5}
html[data-theme="light"] .smart-router-toggle,html[data-theme="light"] .smart-router-card dd{color:var(--ink)}
html[data-theme="light"] .smart-router-switch{background:#d6dee6;border-color:#b9c6d2}
html[data-theme="light"] .smart-router-toggle input:checked + .smart-router-switch{background:#0f7a5a;border-color:#0b8f64}
html[data-theme="light"] .smart-router-power-truth{color:#0b6b54}
html[data-theme="light"] .smart-router-power-truth[data-state="error"]{color:#b42318}
html[data-theme="light"] .snapshot-item{background:#fafafa;border-color:#e2e2e5}
html[data-theme="light"] .snapshot-name{color:var(--ink)}
html[data-theme="light"] .snapshot-delete{color:#c0392b}
html[data-theme="light"] .permission-kicker{color:#8a5a00}
html[data-theme="light"] .permission-panel h2{color:var(--ink)}
html[data-theme="light"] .permission-panel p{color:#6b5a2e}
html[data-theme="light"] .permission-actions button[data-permission-result]{color:#c0392b}

/* --- Websites --- */
html[data-theme="light"] .website-row{background:#fff;border-color:var(--line)}
html[data-theme="light"] .website-info strong{color:var(--ink)}
html[data-theme="light"] .website-publish{background:var(--accent);color:#fff;border-color:var(--accent)}
html[data-theme="light"] .website-dialog::backdrop{background:#00000059}

/* --- Single-icon theme toggle (mobile) ------------------------------------
   Desktop keeps the two-button Terang/Gelap switch. On phones that switch is
   replaced by one icon button that cycles the theme, saving header width. */
#theme-cycle{display:none;align-items:center;justify-content:center;flex:none;
  min-height:34px;min-width:34px;padding:6px;border-radius:999px;
  background:#162a36;color:#bff6e7;border:1px solid #3b6978}
#theme-cycle:hover{border-color:var(--accent)}
#theme-cycle svg{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
#theme-cycle .tc-sun{display:none}
#theme-cycle .tc-moon{display:block}
#theme-cycle[aria-pressed="true"] .tc-sun{display:block}
#theme-cycle[aria-pressed="true"] .tc-moon{display:none}
@media (max-width:640px){
  .theme-switch{display:none}
  #theme-cycle{display:inline-flex;min-height:32px;min-width:32px;padding:6px}
}
html[data-theme="light"] #theme-cycle{background:#eef1f5;color:#3a3a3c;border-color:var(--line)}
html[data-theme="light"] #theme-cycle:hover{border-color:var(--accent)}

/* On mobile the Lanjutan sheet opens expanded and the Website action lives
   inside it, so the advanced tools are visible the moment the menu opens. */
@media (max-width:640px){
  #workspace>header #advanced-menu .advanced-tools{position:static;width:100%;margin-top:6px;box-shadow:none}
}

/* Mobile header refinement (2026-10-03):
   - "Buat laman" / "Semak laman" sit on the same row as the AINNA logo.
   - The live panel drops the cores/percentage scale, and the Perbualan/Teknikal
     toggle keeps only its +/- sign, so the live strip stays compact. */
@media (max-width:640px){
  #workspace>header{grid-template-columns:auto minmax(0,1fr);align-items:center}
  #workspace>header .header-identity{grid-column:1;grid-row:1}
  #workspace>header .founder-tasks{grid-column:2;grid-row:1;justify-content:flex-end;gap:6px;overflow:visible}
  #workspace>header .founder-tasks button{flex:0 0 auto;padding-inline:8px;font-size:11px}
  #workspace>header .header-tools{grid-column:1 / -1;grid-row:2}

  .rv-load-scale{display:none}

  #terminal-details-toggle .tdt-label{display:none}
  #terminal-details-toggle{gap:0}
}

/* Logout shows a door icon; on mobile the label is dropped for a compact tap. */
#logout{display:inline-flex;align-items:center;gap:6px}
.logout-icon{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
@media (max-width:640px){
  #logout span{display:none}
  #logout{padding:6px 9px}
}

/* Mobile: the compact Live card rides in the header tools row, level with the
   theme toggle and logout, so it no longer takes a full band above the
   conversation. The animated flow, CPU gauge, load and toggle all stay; only
   the text title/caption and decorative meter are dropped. When collapsed, the
   card shrinks to just the + toggle. */
@media (max-width:640px){
  .rv-gauge--disk{display:none}
  #workspace>header .header-tools{flex-wrap:nowrap;gap:6px}
  #workspace>header .header-tools .request-viz{
    flex:1 1 auto;min-width:0;order:-1;
    padding:5px 9px;gap:7px;border-radius:10px;
  }
  #workspace>header .header-tools #request-viz{width:auto;max-width:none;grid-column:auto}
  #workspace>header .header-tools .request-viz-title,
  #workspace>header .header-tools .request-viz-caption{display:none}
  #workspace>header .header-tools .request-viz-flow{display:flex;flex:0 0 auto;gap:3px}
  #workspace>header .header-tools .rv-node small{display:none}
  #workspace>header .header-tools .rv-node i{width:11px;height:11px;border-width:2px}
  #workspace>header .header-tools .rv-link{min-width:8px}
  #workspace>header .header-tools .request-viz-body{flex:0 0 auto;min-width:0}
  #workspace>header .header-tools .request-viz-meter{display:none}
  #workspace>header .header-tools .request-viz-gauges{flex:0 0 auto;display:flex;flex-direction:row;align-items:center;gap:6px}
  #workspace>header .header-tools .rv-gauge svg{width:26px;height:17px}
  #workspace>header .header-tools .rv-gauge figcaption{margin-top:-9px}
  #workspace>header .header-tools .rv-gauge figcaption b{font-size:10px}
  #workspace>header .header-tools .rv-gauge figcaption small{display:none}
  #workspace>header .header-tools .rv-load-head{font-size:9px;white-space:nowrap}
  #workspace>header .header-tools .rv-load-bars{display:none}
  #workspace>header .header-tools .rv-load-scale{display:none}
  /* Always expanded in cards area; no collapse hiding. */
  #workspace>header .header-tools .request-viz.is-collapsed{flex:1 1 auto;padding:13px 15px;border:1px solid #29414e;background:#0d1923}
  #workspace>header .header-tools .request-viz.is-collapsed .request-viz-flow,
  #workspace>header .header-tools .request-viz.is-collapsed .request-viz-body{display:flex !important}
}

/* --- Language switch (EN | MS | ZH) ---------------------------------------
   Desktop shows a three-segment control. On phones it collapses to a single
   button that cycles EN -> MS -> ZH, matching the theme-cycle pattern. */
.lang-switch{display:inline-flex;align-items:center;gap:3px;padding:3px;border-radius:999px;background:#0d1f29;border:1px solid #29414e}
.lang-switch button{display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:5px 9px;border-radius:999px;border:1px solid transparent;background:transparent;color:#9cb4c6;font-size:11px;font-weight:700;line-height:1}
.lang-switch button:hover{color:#e7f4fa;border-color:#3b6978}
.lang-switch button[aria-pressed="true"]{background:#16303d;color:#bff6e7;border-color:#3b6978;box-shadow:0 0 0 1px #52e2bd45 inset}
html[data-theme="light"] .lang-switch{background:#e8eaee;border-color:var(--line)}
html[data-theme="light"] .lang-switch button{color:#5a5a5f}
html[data-theme="light"] .lang-switch button:hover{color:var(--ink);border-color:#b9c0c9}
html[data-theme="light"] .lang-switch button[aria-pressed="true"]{background:#fff;color:var(--ink);border-color:var(--line);box-shadow:0 1px 3px #00000014}
#lang-cycle{display:none;align-items:center;justify-content:center;flex:none;min-height:34px;min-width:34px;padding:6px;border-radius:999px;background:#162a36;color:#bff6e7;border:1px solid #3b6978;font-size:11px;font-weight:800;letter-spacing:.04em}
#lang-cycle:hover{border-color:var(--accent)}
@media (max-width:640px){
  .lang-switch{display:none}
  #lang-cycle{display:inline-flex;min-height:32px;min-width:32px;padding:6px}
}
html[data-theme="light"] #lang-cycle{background:#eef1f5;color:#3a3a3c;border-color:var(--line)}
html[data-theme="light"] #lang-cycle:hover{border-color:var(--accent)}

/* --- Live activity preview (2 lines) --------------------------------------
   Shows the tail of the agent's current narration/code inside the Live card.
   Clamped to 2 lines; monospace so code fragments read cleanly. */
.request-viz-live{
  margin:0;width:100%;
  font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;
  color:#8fd8c6;white-space:pre-wrap;overflow-wrap:anywhere;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.request-viz-live-wrap{flex:1 1 100%;min-width:0;order:10}
.request-viz-live-label{display:block;margin-bottom:2px;color:#6f8a9c;font:800 8px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.1em;text-transform:uppercase}
html[data-theme="light"] .request-viz-live{color:#bff6e7}
@media (max-width:640px){
  #workspace>header .header-tools .request-viz-live-wrap{display:none}
}

/* Desktop: the 2-line activity preview sits on its own row under the Live
   strip (the card wraps). Hidden on mobile, where the card is a single row. */
@media (min-width:641px){
  #request-viz:has(.request-viz-live:not([hidden])){flex-wrap:wrap;row-gap:6px}
   #request-viz .request-viz-live-wrap{flex:1 1 100%;order:10}
}

/* Keep changing technical text inside fixed slots. Without this, a one-line /
   two-line update changes the grid row height and makes the whole conversation
   jump while the agent is working. */
.request-preview{height:82px;min-height:82px;overflow:hidden}
#request-technical{height:96px;min-height:96px;overflow:hidden}
.request-preview p{height:31px;min-height:31px}
#request-technical .request-viz-live{height:42px;min-height:42px}
.request-viz-caption{height:17px;min-height:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:720px){
  .request-preview{height:46px;min-height:46px}
  #request-technical{height:82px;min-height:82px}
  .request-preview p{height:30px;min-height:30px}
}

/* Keep both prompt context cards visible on mobile. */
@media(max-width:720px){
  #request-preview>span,#request-technical-title{display:block!important;margin-bottom:3px;font-size:8px;line-height:1.2;letter-spacing:.08em}
  #request-preview{height:60px;min-height:60px;padding:7px 8px}
  #request-technical{height:82px;min-height:82px;padding:7px 8px}
  #request-preview p{height:30px;min-height:30px;font-size:10px;line-height:1.3}
}
/* Two stable rows on every screen: live animation + Esc above, latest activity below. */
#request-technical{display:flex;flex-direction:column;justify-content:center;gap:7px}
#request-technical .technical-activity-line{display:flex;align-items:center;gap:6px;height:18px;flex:none;min-width:0}
#request-technical #request-technical-title{display:block!important;margin:0;margin-inline-end:auto;line-height:18px}
#request-technical .request-viz-live{display:block;width:100%;height:42px;min-height:42px;margin:0;font:10px/14px ui-monospace,SFMono-Regular,Menlo,monospace;color:#a9d9cd;white-space:pre-wrap;overflow-x:hidden;overflow-y:auto;overflow-wrap:anywhere;text-overflow:clip;scrollbar-width:thin}
.technical-escape-label{flex:none;color:#8995a3;font:700 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace}
#technical-activity-indicator{width:25px;height:9px;flex:none;display:flex;align-items:center;gap:4px}
#technical-activity-indicator i{width:5px;height:5px;display:block;background:#fff;opacity:.48}
#request-technical[data-state="working"] #technical-activity-indicator i{opacity:1;animation:technicalSquareFlow .9s ease-in-out infinite}
#request-technical[data-state="working"] #technical-activity-indicator i:nth-child(2){animation-delay:.14s}
#request-technical[data-state="working"] #technical-activity-indicator i:nth-child(3){animation-delay:.28s}
#request-technical[data-state="error"] #technical-activity-indicator i{background:#ef8d83;opacity:1;animation:none}
html[data-theme="light"] #request-technical{background:#f1f6ff;border-color:#c4d3dd}
html[data-theme="light"] #request-technical .request-viz-live{color:#315d58}
html[data-theme="light"] #request-technical #request-technical-title{color:#315d58}
html[data-theme="light"] .technical-escape-label{color:#5a6872}
html[data-theme="light"] #technical-activity-indicator i{background:#267b64}
html[data-theme="light"] #request-technical[data-state="error"] #technical-activity-indicator i{background:#c0392b}
@media(max-width:720px){
  #request-technical{gap:6px}
  #request-technical .technical-activity-line{height:17px}
  #request-technical #request-technical-title{font-size:8px;line-height:17px}
  #request-technical .request-viz-live{height:42px;min-height:42px;font-size:10px;line-height:14px}
}
@keyframes technicalSquareFlow{0%,100%{transform:translateY(1px);opacity:.4}50%{transform:translateY(-1px);opacity:1}}
/* The owner explicitly wants these tiny live-work indicators to keep moving,
   including on phones configured for reduced motion. */
@media(prefers-reduced-motion:reduce){#request-technical[data-state="working"] #technical-activity-indicator i{animation:technicalSquareFlow .9s ease-in-out infinite!important;opacity:1}}

/* Final responsive pass: keep the conversation calm while status text changes. */
.request-cards>article,.request-cards>aside{min-width:0;contain:layout paint}
.readable-heading{min-height:20px;align-items:center}
.user-activity{min-height:28px;contain:layout paint}
.session-history{overflow-anchor:none}
#action-truth{min-height:28px}
html[data-theme="light"] .user-activity[data-state="working"]{color:#795400}
html[data-theme="light"] .user-activity[data-state="error"]{color:#a32932}
html[data-theme="light"] #action-truth[data-state="busy"]{color:#795400;background:#fff8e8;border-color:#e6cf9a}
html[data-theme="light"] #action-truth[data-state="success"]{color:#176b55;background:#e8f7ee;border-color:#a9d9bf}
@media(min-width:1100px){
  #user-mode{padding-inline:clamp(32px,6vw,96px)}
  .readable-session{padding-inline:26px}
  .session-history{max-width:960px}
}
@media(max-width:720px){
  #user-mode{padding:18px 10px calc(14px + env(safe-area-inset-bottom))}
  .request-cards{gap:7px;margin-bottom:10px}
  .readable-session{padding:13px 12px;border-radius:14px}
  .readable-heading{min-height:22px;font-size:11px}
  .session-history{gap:8px;margin-top:12px}
  .session-entry{padding:11px 12px;border-radius:11px}
  .session-entry p{font-size:14px;line-height:1.5}
  .user-activity{min-height:30px;margin-top:10px;font-size:11px}
  #action-truth{min-height:27px}
}
@media(max-width:420px){
  #user-mode{padding-inline:8px}
  .request-cards{gap:6px}
  .readable-session{padding-inline:10px}
  .session-entry p{font-size:13px}
}

/* Conversation panel: inline formatting for agent replies. Bold and inline code
   are built as real elements (never innerHTML), so this is styling only. */
.session-entry p strong{font-weight:750;color:#f3fbff}
.session-entry p code{padding:1px 5px;border-radius:5px;background:#0a1219;border:1px solid #29414e;font:0.9em ui-monospace,SFMono-Regular,Menlo,monospace;overflow-wrap:anywhere}
html[data-theme="light"] .session-entry p strong{color:#0f2430}
html[data-theme="light"] .session-entry p code{background:#eef3f7;border-color:#c4d3dd;color:#193042}

/* Saved sessions: a restorable snapshot of the conversation, the unsent
   composer draft and the chosen model. The button sits in the conversation
   heading; the dialog lists saved snapshots with load/delete actions. */
.readable-heading .session-save{flex:none;margin-left:auto;padding:6px 12px;border-radius:8px;color:#bff6e7;background:#16343c;border-color:#315263;font-size:11px;font-weight:750;cursor:pointer}
.readable-heading .session-save:hover{color:#fff;background:#20535b;border-color:var(--accent)}
.sessions-dialog{width:min(640px,94vw)}
.sessions-dialog #sessions-status{min-height:20px;margin:12px 0 8px;font-size:12px;color:#8edbc9}
.sessions-list{display:grid;gap:9px;margin:0 0 16px;padding:0;list-style:none;max-height:52dvh;overflow:auto}
.sessions-empty{margin:0;color:#8fa8b8;font-size:13px}
.sessions-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 13px;border:1px solid #29414e;border-radius:12px;background:#0d1923}
.sessions-row-meta{min-width:0}
.sessions-row-meta strong{display:block;font-size:14px;color:#e7f4fa;overflow-wrap:anywhere}
.sessions-row-meta small{display:block;margin-top:4px;color:#8fa8b8;font-size:11px}
.sessions-row-actions{display:flex;flex:none;gap:7px}
.sessions-row-actions button{padding:7px 11px;border-radius:8px;font-size:11px;font-weight:750}
.sessions-row-actions .session-load{color:#bff6e7;background:#16343c;border-color:#315263}
.sessions-row-actions .session-load:hover{color:#fff;background:#20535b;border-color:var(--accent)}
.sessions-row-actions .session-delete{color:#f8b486;background:#2a1a1c;border-color:#5d3a3f}
.sessions-actions{display:flex;justify-content:flex-end;gap:9px}
html[data-theme="light"] .sessions-row{background:#f3f6f9;border-color:#d6e0e8}
html[data-theme="light"] .sessions-row-meta strong{color:#142033}
html[data-theme="light"] .sessions-row-meta small{color:#52616b}
@media(max-width:640px){.readable-heading .session-save{margin-left:0}.sessions-row{align-items:flex-start;flex-direction:column}.sessions-row-actions{width:100%}.sessions-row-actions button{flex:1;min-height:42px}.sessions-actions button{flex:1;min-height:42px}}
.session-saved-banner{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0 0;padding:9px 12px;border:1px solid #2f5b57;border-radius:10px;background:#10302c;color:#bff6e7;font-size:12px}
.session-saved-banner button{padding:5px 10px;border-radius:7px;font-size:11px;font-weight:750;color:#bff6e7;background:#16423b;border-color:#2f6b62}
.session-saved-banner button:hover{color:#fff;background:#1d584f;border-color:var(--accent)}
html[data-theme="light"] .session-saved-banner{background:#e8f6f1;border-color:#b6ddd0;color:#1c4a40}
html[data-theme="light"] .session-saved-banner button{color:#1c4a40;background:#d7efe8;border-color:#a9d4c8}

/* ─────────────────────────────────────────────────────────────────────────────
   Compact conversation + composer (final pass).
   The transcript was still airy: each message card carried generous padding and
   a full-height copy row, the panel had wide inner padding, and the composer
   reserved two tall rows. Tighten every one of those so much more of the
   conversation and the input fit on screen without feeling cramped.
   Placed last so it wins over the earlier generous rules.
   ──────────────────────────────────────────────────────────────────────────── */
#user-mode .readable-session{padding:12px 16px}
#user-mode .readable-heading{min-height:0;line-height:1.2}
#user-mode .session-history{gap:8px;margin-top:10px}
.session-entry{padding:9px 12px;border-radius:11px}
.session-entry-head{margin-bottom:3px}
.session-entry-label{margin-bottom:0}
.session-copy{padding:3px 8px;font-size:10px;border-radius:6px;line-height:1.2}
.user-activity{margin-top:10px}
#compose{padding:7px clamp(12px,4vw,56px) 8px}
#compose-row{padding:6px 8px 0}
#compose-row textarea{min-height:42px;padding:8px 10px}
#compose-meta{padding:4px 12px 6px}
@media(max-width:640px){
  #user-mode .readable-session{padding:12px 12px}
  .session-entry{padding:9px 11px}
  #compose-row textarea{min-height:44px}
}
/* Native web command controls stay usable without opening the technical TUI. */
.commands-dialog{width:min(640px,calc(100vw - 24px));max-height:85dvh;padding:20px;border:1px solid #3b6978;border-radius:16px;background:#101c27;color:#eef6f4}
.commands-dialog::backdrop{background:#05070bb8}
.commands-body,.command-choices{display:grid;gap:8px;min-width:0}
.commands-body{margin-top:14px;max-height:65dvh;overflow:auto}
.commands-body button{display:grid;gap:5px;text-align:left;padding:12px;min-width:0;overflow-wrap:anywhere}
.commands-body small{color:#9cb4c6;font-size:12px}
.commands-body input{box-sizing:border-box;width:100%;padding:12px;border:1px solid #3b6978;border-radius:8px;background:#09141e;color:inherit;font:inherit}
.commands-body form{display:grid;gap:10px}
html[data-theme="light"] .commands-dialog{background:#fff;color:#193042}
html[data-theme="light"] .commands-body input{background:#f5f8fa}

/* Technical terminal: keep the work surface and its controls inside the phone
   viewport. These final constraints override older desktop flex/width rules. */
#cli-surface{width:100%;min-width:0;min-height:0;flex:1 1 0;overflow:hidden}
#terminal{width:100%;min-width:0;min-height:0;flex:1 1 0}
#terminal .xterm,#terminal .xterm-screen,#terminal .xterm-viewport{max-width:100%}
.keys,.scroll-bar{width:100%;min-width:0;max-width:none}
@media(max-width:640px){
  #cli-surface{padding:4px 6px calc(6px + env(safe-area-inset-bottom));gap:4px}
  #terminal{margin:0;padding:4px 2px 0;border-radius:8px 8px 0 0}
  #terminal .xterm{padding:0}
  .keys{grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;padding:4px}
  .keys button{min-width:0;padding:5px 2px;font-size:10px;overflow:hidden;text-overflow:ellipsis}
  .scroll-bar{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;padding:4px}
  .scroll-bar button{min-width:0;padding:5px 2px;font-size:10px;overflow:hidden;text-overflow:ellipsis}
  #terminal-controls-toggle{align-self:stretch;margin:2px 0 0}
}

/* Conversation + request status are paired on every screen size. */
#user-mode{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);grid-template-areas:"intro intro" "requests conversation";grid-template-rows:auto auto;align-content:start;align-items:start;column-gap:14px;row-gap:0}
#user-mode .user-mode-intro{grid-area:intro;width:100%;max-width:860px;justify-self:center}
#user-mode #request-cards{grid-area:requests;display:flex;flex-direction:column;gap:10px;width:100%;max-width:none;margin:0;min-width:0}
#user-mode #request-preview,#user-mode #request-technical,#user-mode #request-viz{width:100%;min-width:0}
#user-mode #request-preview{height:auto;min-height:76px;padding:12px}
#user-mode #request-preview>span,#user-mode #request-technical-title{display:block!important;margin:0 0 5px;font-size:9px;line-height:1.25}
#user-mode #request-preview p{height:auto;min-height:0;font-size:12px;line-height:1.4}
#user-mode #request-technical{height:96px;min-height:96px;padding:10px 12px}
#user-mode #request-cards>.request-viz.is-collapsed{width:fit-content;align-self:flex-end}
#user-mode .readable-session{grid-area:conversation;width:100%;max-width:860px;height:min(50dvh,560px);min-height:260px;flex:none;margin:0;min-width:0;padding:14px}
#user-mode .readable-heading{width:100%;min-width:0}
#user-mode .session-scroll,#user-mode .session-history{width:100%;min-width:0;max-width:none;min-height:0}
#user-mode .session-entry{width:fit-content;max-width:min(86%,840px);margin:0;padding:10px 12px;justify-self:start}
#user-mode .session-entry--user{justify-self:end}
html[dir="rtl"] #request-technical,html[dir="rtl"] #cli-surface{direction:ltr;text-align:left}
html[dir="rtl"] #request-preview p,html[dir="rtl"] #request-viz-caption{direction:auto}
html[dir="rtl"] #compose-model,html[dir="rtl"] .session-entry p code{direction:ltr;unicode-bidi:isolate}
@media(min-width:641px){html[dir="rtl"] #user-mode .session-entry--user{justify-self:start}html[dir="rtl"] #user-mode .session-entry--agent{justify-self:end}}
@media(max-width:640px){html[dir="rtl"] #user-mode .session-entry--user{justify-self:start}html[dir="rtl"] #user-mode .session-entry--agent{justify-self:end}}
@media(max-width:900px){
  #user-mode{grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);column-gap:10px}
  #user-mode .readable-session{height:min(50dvh,520px);min-height:240px}
  #user-mode .session-entry{max-width:92%}
}
@media(max-width:640px){
  #user-mode{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:8px;row-gap:0;padding:18px 8px calc(14px + env(safe-area-inset-bottom))}
  #user-mode .user-mode-intro{grid-column:1/-1;margin-bottom:10px}
  #user-mode #request-cards{gap:8px}
  #user-mode #request-preview{min-height:72px;padding:10px}
  #user-mode #request-technical{height:82px;min-height:82px;padding:8px 9px}
  #user-mode #request-technical .technical-activity-line{height:17px}
  #user-mode #request-technical #request-technical-title{font-size:8px;line-height:17px}
  #user-mode .readable-session{height:min(48dvh,440px);min-height:220px;padding:10px}
  #user-mode .readable-heading{align-items:center;flex-wrap:wrap;gap:5px;font-size:10px}
  #user-mode .readable-heading .session-save{margin-inline-start:auto;padding:5px 7px;font-size:10px}
  #user-mode .session-history{gap:8px;margin-top:9px}
  #user-mode .session-entry{max-width:90%;padding:9px 9px}
  #user-mode .session-entry p{font-size:12px;line-height:1.45}
}

/* Primary cards requested by users: Request + Technical in one row, conversation below. */
#user-mode{display:flex!important;flex-direction:column;align-items:stretch;gap:0}
#user-mode .user-mode-intro{grid-area:auto;width:100%;max-width:860px;margin-inline:auto}
#user-mode #request-cards{grid-area:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;max-width:860px;margin:0 auto 12px}
#user-mode #request-preview,#user-mode #request-technical{grid-column:auto;width:100%;height:auto;min-height:96px;min-width:0}
#user-mode #request-viz{grid-column:1/-1;width:100%}
#user-mode #request-cards>.request-viz.is-collapsed{grid-column:1/-1;justify-self:end;align-self:center}
#user-mode .readable-session{grid-area:auto;width:100%;max-width:860px;height:min(50dvh,560px);min-height:260px;flex:0 0 auto;margin:0 auto}
@media(max-width:900px){
  #user-mode .readable-session{height:min(50dvh,520px);min-height:240px}
}
@media(max-width:640px){
  #user-mode .request-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:10px}
  #user-mode #request-preview,#user-mode #request-technical{min-height:82px;padding:9px}
  #user-mode .readable-session{height:min(48dvh,440px);min-height:220px;padding:10px}
}

/* Technical view keeps the full CLI beside the request and activity cards, with
   the conversation transcript out of the way. */
#workspace.technical-view-mode #user-mode .user-mode-intro,
#workspace.technical-view-mode #user-mode .readable-session{display:none!important}
#workspace.technical-view-mode #user-mode{display:block!important;min-height:0;padding:12px 16px}
#workspace.technical-view-mode #user-mode #request-cards{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%;max-width:980px;margin:0 auto}
#workspace.technical-view-mode #user-mode #request-preview,
#workspace.technical-view-mode #user-mode #request-technical{min-height:110px}
@media(max-width:640px){
  #workspace.technical-view-mode #user-mode{padding:10px 8px}
  #workspace.technical-view-mode #user-mode #request-cards{gap:8px}
  #workspace.technical-view-mode #user-mode #request-preview,
  #workspace.technical-view-mode #user-mode #request-technical{min-height:96px}
}

/* Keep the status row compact so the CLI receives the remaining viewport. */
#workspace.technical-view-mode #user-mode{flex:0 0 auto;overflow:visible;padding:4px 10px 0}
#workspace.technical-view-mode #user-mode #request-cards{gap:8px;margin:0 auto}
#workspace.technical-view-mode #user-mode #request-preview,
#workspace.technical-view-mode #user-mode #request-technical{height:58px;min-height:58px;padding:5px 9px}
#workspace.technical-view-mode #user-mode #request-preview>span,
#workspace.technical-view-mode #user-mode #request-technical-title{margin-bottom:2px;font-size:8px;line-height:12px}
#workspace.technical-view-mode #user-mode #request-preview p{-webkit-line-clamp:1;font-size:10px;line-height:13px}
#workspace.technical-view-mode #user-mode #request-technical{gap:3px}
#workspace.technical-view-mode #user-mode #request-technical .technical-activity-line{height:14px}
#workspace.technical-view-mode #user-mode #request-technical #request-technical-title{line-height:14px}
#workspace.technical-view-mode #user-mode #request-technical .request-viz-live{height:24px;min-height:24px;font-size:9px;line-height:11px}
#workspace.technical-view-mode #cli-surface{flex:1 1 0;min-height:0;padding:0 6px}
#workspace.technical-view-mode #terminal{min-height:0;margin:0;padding:2px 4px 0;border-radius:8px 8px 0 0}
@media(max-width:640px){
  #workspace.technical-view-mode #user-mode{padding:3px 6px 0}
  #workspace.technical-view-mode #user-mode #request-preview,
  #workspace.technical-view-mode #user-mode #request-technical{height:54px;min-height:54px;padding:4px 6px}
  #workspace.technical-view-mode #cli-surface{padding:0 3px}
}

/* "Permintaan anda" and "Teknikal" always sit side by side (one row), on every
   screen size and in both Conversation and Technical views. Placed last and
   marked important so it beats the legacy `#request-cards{display:flex}` lock. */
#user-mode #request-cards{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
  align-items:stretch;
}
#user-mode #request-preview,
#user-mode #request-technical{grid-column:auto!important;min-width:0}
@media(max-width:640px){
  #user-mode #request-cards{gap:8px!important}
}

/* ─────────────────────────────────────────────────────────────────────────────
   Conversation message cards — clean chat bubbles.
   Agent sits left, your request sits right. Placed last so it wins over the
   older card rules. Shared by /web-cli and /web-cli2.
   ───────────────────────────────────────────────────────────────────────────── */
#user-mode .session-history{gap:10px}
#user-mode .session-entry{
  position:relative;
  width:fit-content;
  max-width:min(80%,760px);
  padding:11px 14px 12px;
  border-radius:16px;
  border:1px solid #29414e;
  background:#0e1f2a;
  box-shadow:0 8px 22px #0003;
  justify-self:start;
}
#user-mode .session-entry--agent{
  border-color:#27414f;
  background:linear-gradient(150deg,#102330,#0c1a23);
  border-top-left-radius:6px;
}
#user-mode .session-entry--user{
  justify-self:end;
  border-color:#2f6d5f;
  background:linear-gradient(150deg,#123a33,#0f2c27);
  border-top-right-radius:6px;
}
#user-mode .session-entry-head{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0 0 6px;
}
#user-mode .session-entry-label{
  flex:1 1 auto;
  min-width:0;
  text-align:left;
  margin:0;
  font:800 9.5px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#7fd9c2;
}
#user-mode .session-entry--user .session-entry-label{color:#9fdccb}
#user-mode .session-copy{
  flex:0 0 auto;
  padding:3px 8px;
  border-radius:999px;
  font-size:10px;
  line-height:1.2;
  color:#9cb4c6;
  background:#132632;
  border:1px solid #29414e;
  opacity:.75;
  transition:opacity .15s ease,color .15s ease,background .15s ease;
}
#user-mode .session-entry:hover .session-copy{opacity:1}
#user-mode .session-copy:hover{color:#fff;background:#1d3b49;border-color:var(--accent)}
#user-mode .session-entry p{
  margin:0;
  color:#dce9f3;
  font:14.5px/1.62 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
#user-mode .session-entry--user p{color:#eafff8}
#user-mode .session-entry .session-open{
  display:inline-flex;
  margin-top:9px;
  min-height:34px;
  align-items:center;
  padding:7px 12px;
  border-radius:999px;
  background:#12362c;
  color:#e7fff6;
  text-decoration:none;
  font-weight:700;
  font-size:12px;
}
@media(max-width:640px){
  #user-mode .session-entry{max-width:88%;padding:10px 12px 11px;border-radius:14px}
  #user-mode .session-entry p{font-size:13.5px;line-height:1.55}
}
html[data-theme="light"] #user-mode .session-entry--agent{background:linear-gradient(150deg,#ffffff,#f2f6f9);border-color:#c4d3dd;box-shadow:0 8px 22px #0a1a260f}
html[data-theme="light"] #user-mode .session-entry--user{background:linear-gradient(150deg,#e6f5f0,#d9ede7);border-color:#8bb9b1}
html[data-theme="light"] #user-mode .session-entry p{color:#22333d}
html[data-theme="light"] #user-mode .session-entry--user p{color:#123a33}
html[data-theme="light"] #user-mode .session-entry-label{color:#0a7d5f}
html[data-theme="light"] #user-mode .session-entry--user .session-entry-label{color:#0a6b52}
html[data-theme="light"] #user-mode .session-copy{background:#eef1f5;color:#41586a;border-color:#c4d3dd}

/* Search dalam perbualan: full-width bar aligned with the transcript column,
   with a magnifier glyph embedded in the field. */
.session-search{display:flex;align-items:center;gap:8px;width:100%;max-width:none;margin:10px 0 2px}
.session-search input{flex:1;min-width:0;margin:0;padding:9px 34px 9px 38px;border-radius:999px;background:#09141e;border:1px solid #324955;color:#fff;font-size:13px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237e95a6' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:12px center;background-size:16px 16px}
.session-search input::placeholder{color:#7e95a6}
.session-search input::-webkit-search-cancel-button,.session-search input::-webkit-search-decoration{-webkit-appearance:none}
#session-search-clear{flex:none;padding:7px 12px;border-radius:999px;font-size:12px}
html[data-theme="light"] .session-search input{background-color:var(--surface);border-color:var(--line);color:var(--ink);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa0' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:12px center;background-size:16px 16px}
html[data-theme="light"] .session-search input::placeholder{color:#9a9aa0}
html[data-theme="light"] #session-search-clear{background:#eef1f5;color:#3a3a3c;border-color:var(--line)}
html[data-theme="light"] .session-entry--agent{border-left-color:#0a7d5f}
@media(max-width:650px){.session-search input{font-size:16px;padding:8px 34px}}

/* Keluar: icon-only ghost on narrow header rows; label hidden, tooltip remains. */
@media(min-width:721px){
  #workspace>header #logout span{display:none}
  #workspace>header #logout{padding:7px 9px;background:transparent;border-color:transparent;color:#9cb4c6}
  #workspace>header #logout:hover{color:#f4a5a5;border-color:#7a3840}
}

/* Copy affordance only when it can be used: hover-capable pointers reveal it
   on rest; touch devices keep it visible. Last in cascade to beat #user-mode. */
@media(hover:hover) and (pointer:fine){
  #user-mode .session-copy{opacity:0}
  #user-mode .session-entry:hover .session-copy,#user-mode .session-copy:focus-visible{opacity:1}
}

/* Mobile toolbar: keep the Pengguna status, language and day/night choices in one compact row. */
@media(max-width:640px){
  #live-status-bar.is-mobile-docked{display:none!important}
  #workspace>header .header-tools{display:flex;flex-wrap:nowrap!important;align-items:center;gap:3px;min-width:0;overflow:hidden}
  #workspace>header .header-tools #request-viz{order:-1;flex:1 1 96px;min-width:78px;max-width:none;width:auto;height:32px;min-height:32px;max-height:32px;margin:0;padding:0 2px;gap:3px;overflow:hidden;border:0;background:transparent;box-shadow:none;border-radius:0}
  #workspace>header .header-tools .request-viz-title{display:inline-flex!important;flex:0 0 auto;font-size:8px;letter-spacing:0;text-transform:none}
  #workspace>header .header-tools .request-viz-flow,#workspace>header .header-tools .request-viz-body{display:none!important}
  #workspace>header .header-tools .live-summary{display:flex;flex:1 1 auto;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:2px}
  #workspace>header .header-tools .live-summary>span:not(.live-username){display:none!important}
  #workspace>header .header-tools .live-username{display:inline-flex;flex:0 1 auto;max-width:8ch;min-width:0;padding:2px 4px;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #workspace>header .header-tools .request-viz-toggle{display:inline-grid;place-items:center;flex:0 0 22px;width:22px;min-width:22px;height:28px;min-height:28px;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;color:var(--accent)!important;font-size:0!important;line-height:1}
  #workspace>header .header-tools .request-viz-toggle::before{content:"+";font:700 22px/1 ui-monospace,SFMono-Regular,Menlo,monospace}
  #workspace>header .header-tools .request-viz-toggle[aria-expanded="true"]::before{content:"−"}
  #workspace>header .header-tools .request-viz-toggle:hover{border:0!important;background:transparent!important;box-shadow:none!important}
  #live-status-bar #request-viz-toggle{border:0!important;background:transparent!important;box-shadow:none!important}
  .theme-switch{display:inline-flex!important;flex:none;align-items:center;gap:1px;padding:0 2px;border:0;background:transparent}
  .theme-switch button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:auto;min-width:0;min-height:30px;padding:4px 5px;border:0;border-radius:999px;background:transparent;gap:3px;font-size:8px}
  .theme-switch button svg{width:12px;height:12px}
  .theme-switch button span{display:inline!important;font-size:8px;line-height:1}
  #theme-cycle{display:none!important}
  #lang-switch{display:none!important}
  #lang-cycle{display:inline-flex!important;flex:0 0 auto;width:auto;min-width:44px;min-height:30px;padding:6px 7px;font-size:0;white-space:nowrap}
  #lang-cycle::before{content:none}
  #lang-cycle::after{content:attr(data-current-language);font-size:11px;font-weight:800;line-height:1;opacity:1}
  #workspace>header .header-tools #terminal-details-toggle{display:inline-grid;place-items:center;flex:0 0 28px;width:28px;min-width:28px;height:30px;min-height:30px;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
  #workspace>header .header-tools #terminal-details-toggle .tdt-sign{display:inline-grid!important;place-items:center;width:24px;height:24px;border:0!important;border-radius:0!important;background:transparent!important;color:var(--accent)!important;font-size:20px;line-height:1}
  #workspace>header .header-tools #menu-toggle{flex:0 0 30px;width:30px;min-width:30px;min-height:30px;padding:5px;border:0;background:transparent}
  #workspace>header .header-tools #logout{flex:0 0 30px;width:30px;min-width:30px;min-height:30px;padding:5px;border:0;background:transparent}
}
@media(max-width:360px){
  #workspace>header .header-tools{gap:2px}
  #workspace>header .header-tools .request-viz{flex-basis:58px;min-width:58px}
  #workspace>header .header-tools .request-viz-title{font-size:7px}
  #workspace>header .header-tools .live-username{max-width:5ch;font-size:8px}
  .theme-switch button{flex-basis:24px;width:24px;min-width:24px;padding:3px}
  .theme-switch button span{display:none!important}
  #lang-cycle{min-width:44px;padding-inline:5px}
  #lang-cycle::before{content:none}
  #lang-cycle::after{font-size:10px}
  #workspace>header .header-tools #terminal-details-toggle{flex-basis:24px;width:24px;min-width:24px}
  #workspace>header .header-tools #menu-toggle{flex-basis:26px;width:26px;min-width:26px}
  #workspace>header .header-tools #logout{flex-basis:24px;width:24px;min-width:24px}
}

/* Mobile composer: keep status pills in their own rows so their intrinsic
   widths can never overlap the attachment/terminal/send controls. */
@media(max-width:640px){
  #compose #compose-actions:has(#openai-quota:not([hidden])){
    display:grid!important;
    grid-template-columns:repeat(4,minmax(28px,32px))!important;
    grid-template-rows:22px 26px 24px 32px!important;
    gap:3px!important;
    width:max-content!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    flex:0 0 auto!important;
    align-items:center!important;
    justify-content:center!important;
  }
  #compose #compose-actions:has(#openai-quota:not([hidden])) #compose-model{
    grid-column:1/-1!important;grid-row:1!important;width:100%!important;max-width:none!important;
    height:22px!important;min-height:22px!important;justify-content:center!important;text-align:center!important;
  }
  #compose #compose-actions:has(#openai-quota:not([hidden])) #openai-quota{
    grid-column:1/-1!important;grid-row:2!important;justify-self:center!important;width:max-content!important;min-width:0!important;max-width:100%!important;
    height:26px!important;min-height:26px!important;padding:2px 6px!important;gap:3px!important;font-size:8px!important;
  }
  #compose #compose-actions:has(#openai-quota:not([hidden])) #compose-smart-routing{
    grid-column:1/-1!important;grid-row:3!important;width:100%!important;height:24px!important;min-height:24px!important;
  }
  #compose #compose-actions:has(#openai-quota:not([hidden])) #level-card-toggle{grid-column:1!important;grid-row:4!important}
  #compose #compose-actions:has(#openai-quota:not([hidden])) #attach-compose-button{grid-column:2!important;grid-row:4!important}
  #compose #compose-actions:has(#openai-quota:not([hidden])) #compose-terminal{grid-column:3!important;grid-row:4!important}
  #compose #compose-actions:has(#openai-quota:not([hidden])) #compose-submit{grid-column:4!important;grid-row:4!important}
  #compose-row:has(#openai-quota:not([hidden])){grid-template-rows:112px!important}
  #compose-row:has(#openai-quota:not([hidden])) textarea{grid-row:1!important;min-height:112px!important}
  #compose-row:has(#openai-quota:not([hidden])) #compose-actions{grid-row:1!important}
}

/* ─────────────────────────────────────────────────────────────────────────────
   WhatsApp-style conversation surface.
   Replaces the technical dark card look (monospace labels, heavy borders,
   black fields) with a familiar chat: wallpaper transcript, left/right
   bubbles, green outgoing. Scoped to #user-mode and placed last so it wins
   the cascade. Shared by /web-cli and /web-cli2.
   ───────────────────────────────────────────────────────────────────────────── */
#user-mode .readable-session{
  padding:0;
  border:1px solid #1f2c34;
  border-radius:16px;
  background:#0b141a;
  box-shadow:0 18px 44px #0006;
  text-align:left;
  overflow:hidden;
}
#user-mode .readable-heading{
  flex:none;width:100%;
  justify-content:flex-start;
  text-align:left;
  padding:12px 16px;
  background:#1f2c34;
  border-bottom:1px solid #2a3942;
}
#user-mode .readable-heading strong{font-size:15px;letter-spacing:0;color:#e9edef}
#user-mode .readable-heading span{color:#8696a0}
#user-mode #session-save{
  background:#00a884;border-color:#00a884;color:#062019;font-weight:700;
  border-radius:999px;padding:6px 12px;font-size:11.5px;
}
#user-mode #session-save:hover{background:#06cf9c;border-color:#06cf9c;color:#062019}
#user-mode .session-search{margin:10px 14px 0}
#user-mode .session-search input{background-color:#202c33;border-color:transparent;color:#e9edef}
#user-mode .session-search input::placeholder{color:#8696a0}
#user-mode #session-search-clear{background:#2a3942;border-color:transparent;color:#8696a0}
#user-mode .session-scroll{background:#0b141a}
#user-mode .session-history{
  padding:14px;gap:8px;
  background-color:#0b141a;
  background-image:radial-gradient(#ffffff0a 1px,transparent 1px);
  background-size:22px 22px;
}
#user-mode .session-history::-webkit-scrollbar-track{background:#0b141a}
#user-mode .session-history::-webkit-scrollbar-thumb{background:#374248;border-color:#0b141a}
#user-mode .session-history::-webkit-scrollbar-thumb:hover{background:#00a884}
#user-mode .session-scrollbar{background:#0b141a}
#user-mode .session-scrollbar span{background:#374248}
#user-mode .session-empty{color:#8696a0;font-size:13.5px;text-align:center;padding:18px 8px}
#user-mode .session-entry{
  width:fit-content;
  max-width:min(82%,760px);
  padding:7px 10px 8px 11px;
  border:0;
  border-radius:10px 10px 10px 3px;
  background:#202c33;
  box-shadow:0 1px 1px #00000040;
  justify-self:start;
}
#user-mode .session-entry--agent{background:#202c33}
#user-mode .session-entry--user{
  justify-self:end;
  border-radius:10px 10px 3px 10px;
  background:#005c4b;
}
#user-mode .session-entry-head{gap:8px;margin:0 0 3px}
#user-mode .session-entry-label{
  font:700 11px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  letter-spacing:0;text-transform:none;color:#8696a0;
}
#user-mode .session-entry--user .session-entry-label{color:#a7d9c9}
#user-mode .session-copy{background:#2a3942;border-color:transparent;color:#8696a0;border-radius:999px;font-size:10px}
#user-mode .session-copy:hover{background:#3b4a54;color:#e9edef;border-color:transparent}
#user-mode .session-entry p{
  color:#e9edef;
  font:14.5px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
#user-mode .session-entry--user p{color:#e9edef}
#user-mode .session-entry .session-open{
  margin-top:8px;background:#111b21;color:#00a884;border-radius:999px;font-weight:700;
}
#user-mode .session-entry .session-open:hover{background:#0b141a}
#user-mode .composer-attachments{padding:0 14px 8px}

/* WhatsApp-style composer bar */
#compose{background:#0b141a}
#compose-shell{background:#1f2c34;border-color:#2a3942;border-radius:22px;box-shadow:none}
#compose-row textarea{color:#e9edef}
#compose-row textarea::placeholder{color:#8696a0}
#compose-meta{color:#8696a0}
#compose-submit{background:#00a884;border-color:#00a884;color:#062019;font-weight:750;border-radius:999px}

/* WhatsApp light theme */
html[data-theme="light"] #user-mode .readable-session{background:#efeae2;border-color:#d1d7db}
html[data-theme="light"] #user-mode .readable-heading{background:#008069;border-bottom-color:#006b58}
html[data-theme="light"] #user-mode .readable-heading strong{color:#fff}
html[data-theme="light"] #user-mode .readable-heading span{color:#d9fdd3}
html[data-theme="light"] #user-mode #session-save{background:#d9fdd3;border-color:#d9fdd3;color:#02775c}
html[data-theme="light"] #user-mode #session-save:hover{background:#c5f7bd;border-color:#c5f7bd;color:#02775c}
html[data-theme="light"] #user-mode .session-search input{background-color:#f0f2f5;color:#111b21}
html[data-theme="light"] #user-mode .session-search input::placeholder{color:#667781}
html[data-theme="light"] #user-mode #session-search-clear{background:#e9edef;color:#54656f}
html[data-theme="light"] #user-mode .session-scroll{background:#efeae2}
html[data-theme="light"] #user-mode .session-history{
  background-color:#efeae2;
  background-image:radial-gradient(#0000000a 1px,transparent 1px);
}
html[data-theme="light"] #user-mode .session-history::-webkit-scrollbar-track{background:#d1d7db}
html[data-theme="light"] #user-mode .session-history::-webkit-scrollbar-thumb{background:#b1b8bd;border-color:#d1d7db}
html[data-theme="light"] #user-mode .session-scrollbar{background:#d1d7db}
html[data-theme="light"] #user-mode .session-scrollbar span{background:#b1b8bd}
html[data-theme="light"] #user-mode .session-empty{color:#667781}
html[data-theme="light"] #user-mode .session-entry{background:#fff;box-shadow:0 1px 1px #0b141a1f}
html[data-theme="light"] #user-mode .session-entry--agent{background:#fff}
html[data-theme="light"] #user-mode .session-entry--user{background:#d9fdd3}
html[data-theme="light"] #user-mode .session-entry-label{color:#667781}
html[data-theme="light"] #user-mode .session-entry--user .session-entry-label{color:#02775c}
html[data-theme="light"] #user-mode .session-copy{background:#f0f2f5;color:#54656f}
html[data-theme="light"] #user-mode .session-copy:hover{background:#e2e5e7;color:#111b21}
html[data-theme="light"] #user-mode .session-entry p{color:#111b21}
html[data-theme="light"] #user-mode .session-entry--user p{color:#111b21}
html[data-theme="light"] #user-mode .session-entry .session-open{background:#d9fdd3;color:#02775c}
html[data-theme="light"] #compose{background:#efeae2}
html[data-theme="light"] #compose-shell{background:#fff;border-color:#e2e5e7}
html[data-theme="light"] #compose-row textarea{color:#111b21}
html[data-theme="light"] #compose-meta{color:#667781}

/* WhatsApp header: one row — title left, live status beside it, action right. */
#user-mode .readable-heading{flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:10px}
#user-mode .readable-heading strong{flex:0 0 auto}
#user-mode .readable-heading>span{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
#user-mode #session-save{flex:0 0 auto;margin-left:auto}

/* WhatsApp header on mobile: force a single row (override the column rule). */
#user-mode .readable-heading{flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;text-align:left}

/* Light theme: keep the WhatsApp green send button (override the blue accent). */
html[data-theme="light"] #compose-submit{background:#00a884;border-color:#00a884;color:#fff}
html[data-theme="light"] #compose-submit:hover{background:#06cf9c;border-color:#06cf9c;color:#fff}

/* Keep the saved-session banner inset now that the card padding is zeroed. */
#user-mode .session-saved-banner{margin:12px 14px 0}

/* Conversation-first polish: later workspace layout rules must not stretch
   chat bubbles back to full width. Keep technical/request cards available but
   compact by default; users can expand them when they need the detail. */
#user-mode .session-history{justify-items:start}
#user-mode .session-entry{
  width:fit-content;
  max-width:min(82%,760px);
  justify-self:start;
  margin-inline:0;
  text-align:left;
}
#user-mode .session-entry--user{
  justify-self:end;
  margin-left:auto;
}
#user-mode .session-entry-label{text-align:left}
#user-mode #request-preview.card-collapsed,
#user-mode #request-technical.card-collapsed{width:fit-content;max-width:100%}
#user-mode #request-preview.card-collapsed .request-card-head{margin:0}
#user-mode #compose{position:sticky;bottom:0;z-index:5;flex:none}
@media(max-width:640px){
  #user-mode .session-entry{max-width:92%}
  #user-mode #request-preview.card-collapsed,
  #user-mode #request-technical.card-collapsed{width:100%}
}

/* Composer compaction (2026-10-12): send is a round WhatsApp-style icon button,
   the model button is a compact pill. Voice and Documents were removed from the
   composer; hide them defensively if any cached markup still carries them.
   Two-id selectors so the many "#compose-actions button" media rules cannot
   stretch them back out. */
#voice-input,#files-compose-button{display:none!important}

#compose-actions #compose-model{
  padding:5px 11px;min-height:34px;font-size:11px;border-radius:999px;
}

#compose-actions #compose-submit{
  width:44px;height:44px;min-width:44px;min-height:44px;padding:0;
  border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:0!important;line-height:0;letter-spacing:0;
}
#compose-actions #compose-submit::before{
  content:"";display:block;width:22px;height:22px;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M2,21L23,12L2,3L2,10L17,12L2,14Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M2,21L23,12L2,3L2,10L17,12L2,14Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
#compose-actions #compose-submit:disabled{opacity:.45}
#compose-actions #compose-submit[data-state="busy"]{opacity:.7}

/* Bottom-anchor the conversation so the newest message sits just above the
   "Sedia" status row. Before this, a short conversation left a large empty
   gap inside the Perbualan card because .readable-session stretches (flex:1)
   and messages aligned to the top. */
/* Keep the newest message near the composer for short chats, but let long
   conversations scroll normally: a flex column with margin-top:auto on the
   first item absorbs free space only while the content fits. */
#user-mode .session-history{display:flex!important;flex-direction:column;align-items:flex-start;gap:12px;align-content:normal}
#user-mode .session-history>:first-child{margin-top:auto}

/* Tighten the space below the latest message and before the composer. */
#user-mode{padding-bottom:0!important}
#user-mode .readable-session{padding-bottom:8px}
#user-mode .user-activity{margin-top:4px}

/* Correct target: activity status is a sibling in #action-dock, not inside #user-mode. */
#user-mode .readable-session{padding-bottom:0!important}
#action-dock .user-activity{margin:0 auto!important}

/* Remove reserved transcript/attachment padding when there is no attachment. */
#user-mode #session-history{padding-bottom:0}
#user-mode #composer-attachments:empty{display:none}


/* Apple-inspired low-glare light palette: soft gray canvas, raised gray cards,
   restrained blue accent, and near-black text. */
html[data-theme="light"]{
  color-scheme:light;
  --accent:#007aff;
  --ink:#1d1d1f;
  --muted:#686b70;
  --page:#f1f2f4;
  --surface:#f7f8fa;
  --line:#d5d8dd;
  background:#f1f2f4;
  color:#1d1d1f;
}
html[data-theme="light"] body,
html[data-theme="light"] #workspace,
html[data-theme="light"] #user-mode,
html[data-theme="light"] #compose,
html[data-theme="light"] #workspace>footer,
html[data-theme="light"] #live-status-bar,
html[data-theme="light"] #action-dock{
  background:#f1f2f4!important;
  color:#1d1d1f;
}
html[data-theme="light"] #workspace>header{
  background:#e9eaed!important;
  border-bottom-color:#d5d8dd;
}
html[data-theme="light"] .header-identity #status,
html[data-theme="light"] #action-truth,
html[data-theme="light"] .live-chip,
html[data-theme="light"] .service-state-pill{
  background:#f4f5f7;
  border-color:#d5d8dd;
  color:#555a61;
}
html[data-theme="light"] .readable-session,
html[data-theme="light"] #request-viz,
html[data-theme="light"] #request-technical,
html[data-theme="light"] #request-preview,
html[data-theme="light"] #compose-shell,
html[data-theme="light"] .question-panel,
html[data-theme="light"] .cli-choices,
html[data-theme="light"] .file-upload-panel,
html[data-theme="light"] .file-list-panel,
html[data-theme="light"] #dashboard-panel,
html[data-theme="light"] .service-row,
html[data-theme="light"] .snapshot-item,
html[data-theme="light"] .smart-router-card,
html[data-theme="light"] dialog{
  background:#f7f8fa!important;
  border-color:#d5d8dd;
  color:#1d1d1f;
  box-shadow:0 2px 10px #1d1d1f0a;
}
html[data-theme="light"] .session-scroll,
html[data-theme="light"] .session-history,
html[data-theme="light"] #cli-surface,
html[data-theme="light"] #terminal,
html[data-theme="light"] .technical-result,
html[data-theme="light"] .live-summary,
html[data-theme="light"] .request-viz-body,
html[data-theme="light"] .file-dropzone,
html[data-theme="light"] .dashboard-chart-view,
html[data-theme="light"] .commands-body{
  background:#f3f4f6!important;
}
html[data-theme="light"] .session-history{
  background-image:none!important;
}
html[data-theme="light"] .session-entry--agent,
html[data-theme="light"] .request-preview,
html[data-theme="light"] .question-item,
html[data-theme="light"] .cli-choices-list button,
html[data-theme="light"] .website-row,
html[data-theme="light"] .sessions-row,
html[data-theme="light"] .file-row,
html[data-theme="light"] .dashboard-tabs button,
html[data-theme="light"] .composer-file{
  background:#f8f9fb!important;
  border-color:#d5d8dd;
  color:#1d1d1f;
}
html[data-theme="light"] .session-entry--user,
html[data-theme="light"] .conversation-card--user,
html[data-theme="light"] .cli-choices-list button.is-selected,
html[data-theme="light"] .question-option.is-selected{
  background:#e7effb!important;
  border-color:#b8cce8;
}
html[data-theme="light"] .session-search input,
html[data-theme="light"] #session-search-input,
html[data-theme="light"] #compose-row textarea,
html[data-theme="light"] .commands-body input,
html[data-theme="light"] .question-custom,
html[data-theme="light"] .dashboard-picks select,
html[data-theme="light"] .password-table input{
  background:#eceef1!important;
  border-color:#d2d5da;
  color:#1d1d1f;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder,
html[data-theme="light"] .session-search input::placeholder{
  color:#73777e!important;
}
html[data-theme="light"] #compose-submit,
html[data-theme="light"] #compose-submit:hover,
html[data-theme="light"] #task-build,
html[data-theme="light"] .website-publish{
  background:#007aff!important;
  border-color:#007aff!important;
  color:#fff!important;
}
html[data-theme="light"] .readable-heading,
html[data-theme="light"] .dialog-head,
html[data-theme="light"] .file-list-head{
  background:#e9eaed!important;
  color:#1d1d1f;
  border-color:#d5d8dd;
}
html[data-theme="light"] .readable-heading strong,
html[data-theme="light"] .dialog h2,
html[data-theme="light"] .request-viz-title,
html[data-theme="light"] .request-technical-title,
html[data-theme="light"] .service-name,
html[data-theme="light"] .session-entry p,
html[data-theme="light"] .session-entry-label{
  color:#1d1d1f;
}
html[data-theme="light"] .readable-heading span,
html[data-theme="light"] .user-activity,
html[data-theme="light"] .session-empty,
html[data-theme="light"] .compose-meta,
html[data-theme="light"] .request-viz-caption,
html[data-theme="light"] .service-truth,
html[data-theme="light"] .sessions-row-meta small{
  color:#686b70;
}
html[data-theme="light"] .theme-switch,
html[data-theme="light"] .lang-switch,
html[data-theme="light"] #theme-cycle,
html[data-theme="light"] #lang-cycle{
  background:#e2e4e8!important;
  border-color:#d0d3d8;
}
html[data-theme="light"] .theme-switch button[aria-pressed="true"],
html[data-theme="light"] .lang-switch button[aria-pressed="true"]{
  background:#f8f9fb!important;
  color:#1d1d1f;
}
html[data-theme="light"] #compose-model,
html[data-theme="light"] #attach-compose-button,
html[data-theme="light"] #session-save,
html[data-theme="light"] #terminal-details-toggle,
html[data-theme="light"] #advanced-menu summary,
html[data-theme="light"] #header-controls>button{
  background:#e5e7eb!important;
  color:#34383d;
  border-color:#d1d4d9;
}
html[data-theme="light"] #compose-model:hover,
html[data-theme="light"] #attach-compose-button:hover,
html[data-theme="light"] #session-save:hover,
html[data-theme="light"] #terminal-details-toggle:hover,
html[data-theme="light"] #header-controls>button:hover{
  background:#dfe3e8!important;
}
html[data-theme="light"] #terminal-details-toggle[aria-expanded="true"] .tdt-sign{
  background:#007aff!important;color:#fff;
}
html[data-theme="light"] a{color:#0066cc}
html[data-theme="light"] .user-activity-dot{background:#25855a;box-shadow:0 0 8px #25855a55}
html[data-theme="light"] .request-viz-gauges,
html[data-theme="light"] .smart-router-note,
html[data-theme="light"] .services-note,
html[data-theme="light"] .limits-note{border-color:#d5d8dd}

/* Final light-theme contrast corrections for nested WhatsApp-era overrides. */
html[data-theme="light"] #user-mode .readable-heading{background:#e7e8eb!important;border-bottom-color:#d5d8dd!important}
html[data-theme="light"] #user-mode .readable-heading strong{color:#1d1d1f!important}
html[data-theme="light"] #user-mode .readable-heading span{color:#686b70!important}
html[data-theme="light"] #user-mode #session-save,
html[data-theme="light"] #user-mode #session-save:hover{background:#e2e8f0!important;border-color:#cbd5e1!important;color:#1d1d1f!important}
html[data-theme="light"] #workspace>header #advanced-menu summary{background:#e5e7eb!important;color:#34383d!important;border-color:#d1d4d9!important}
html[data-theme="light"] #workspace>header #advanced-menu .advanced-tools{background:#f7f8fa!important;border-color:#d5d8dd!important}
html[data-theme="light"] #request-technical .request-technical-title,
html[data-theme="light"] #request-viz .request-viz-title,
html[data-theme="light"] #request-viz .request-viz-details-title{color:#30343a!important}
html[data-theme="light"] #request-technical .technical-result,
html[data-theme="light"] #request-viz .request-viz-caption{color:#50565e!important}


/* Unified soft 3D surfaces for all primary cards in Apple light mode. */
html[data-theme="light"]{
  --light-card:#f7f8fa;
  --light-card-edge:#d6d9de;
  --light-card-shadow:0 1px 2px #1d1d1f0a,0 7px 18px #1d1d1f0b,0 18px 34px #1d1d1f08;
}
html[data-theme="light"] #request-viz,
html[data-theme="light"] #request-preview,
html[data-theme="light"] #request-technical,
html[data-theme="light"] .readable-session,
html[data-theme="light"] .file-upload-panel,
html[data-theme="light"] .file-list-panel,
html[data-theme="light"] .question-panel,
html[data-theme="light"] .cli-choices,
html[data-theme="light"] #dashboard-panel,
html[data-theme="light"] .website-row,
html[data-theme="light"] .sessions-row,
html[data-theme="light"] .service-row,
html[data-theme="light"] .snapshot-item,
html[data-theme="light"] .smart-router-card,
html[data-theme="light"] .session-entry{
  background:linear-gradient(155deg,#fafbfc 0%,var(--light-card) 68%,#eef0f3 100%)!important;
  border:1px solid var(--light-card-edge);
  border-radius:16px;
  box-shadow:var(--light-card-shadow),inset 0 1px 0 #ffffffd9;
}
html[data-theme="light"] .session-entry--user,
html[data-theme="light"] .conversation-card--user{
  background:linear-gradient(155deg,#edf4ff 0%,#e7effb 72%,#dfe8f4 100%)!important;
  border-color:#c9d7e9;
  box-shadow:0 1px 2px #1d1d1f08,0 7px 16px #36557a12,inset 0 1px 0 #ffffffd9;
}
html[data-theme="light"] .session-entry--agent,
html[data-theme="light"] .conversation-card--agent{
  background:linear-gradient(155deg,#fafbfc 0%,#f5f6f8 75%,#eceef1 100%)!important;
  border-color:var(--light-card-edge);
  box-shadow:0 1px 2px #1d1d1f08,0 7px 16px #1d1d1f0a,inset 0 1px 0 #ffffffd9;
}
@media(hover:hover){
  html[data-theme="light"] #request-viz:hover,
  html[data-theme="light"] #request-preview:hover,
  html[data-theme="light"] #request-technical:hover,
  html[data-theme="light"] .readable-session:hover{
    box-shadow:0 2px 4px #1d1d1f0c,0 12px 26px #1d1d1f12,inset 0 1px 0 #ffffffd9;
  }
}


/* Force one visible, consistent 3D elevation across light-mode card surfaces;
   !important wins over older per-card WhatsApp and panel overrides. */
html[data-theme="light"]{
  --light-card-shadow:0 2px 4px #1d1d1f12,0 10px 24px #1d1d1f18,inset 0 1px 0 #ffffffd9;
}
html[data-theme="light"] #request-viz,
html[data-theme="light"] #request-preview,
html[data-theme="light"] #request-technical,
html[data-theme="light"] .readable-session,
html[data-theme="light"] .file-upload-panel,
html[data-theme="light"] .file-list-panel,
html[data-theme="light"] .question-panel,
html[data-theme="light"] .cli-choices,
html[data-theme="light"] #dashboard-panel,
html[data-theme="light"] .website-row,
html[data-theme="light"] .sessions-row,
html[data-theme="light"] .service-row,
html[data-theme="light"] .snapshot-item,
html[data-theme="light"] .smart-router-card{
  border-radius:16px!important;
  box-shadow:var(--light-card-shadow)!important;
}
@media(hover:hover){
  html[data-theme="light"] #request-viz:hover,
  html[data-theme="light"] #request-preview:hover,
  html[data-theme="light"] #request-technical:hover,
  html[data-theme="light"] .readable-session:hover{
    box-shadow:0 3px 6px #1d1d1f16,0 14px 30px #1d1d1f20,inset 0 1px 0 #ffffffd9!important;
  }
}


/* Mobile: keep the System-details + sign distinct from the Terminal-view control. */
@media(max-width:640px){
  #workspace #request-technical #terminal-details-toggle .tdt-sign{
    display:inline-grid!important;place-items:center;width:20px!important;height:18px!important;
    font-size:0!important;line-height:0!important;position:relative;
  }
  #workspace #request-technical #terminal-details-toggle .tdt-sign::before{
    content:"";display:block;width:13px;height:9px;border:1.5px solid currentColor;border-radius:2px;
  }
  #workspace #request-technical #terminal-details-toggle .tdt-sign::after{
    content:"";position:absolute;left:6px;bottom:1px;width:8px;height:1.5px;background:currentColor;
  }
}


/* Mobile browsers auto-hide native scrollbars; use the mirrored rail whenever
   the transcript overflows so users can see that the Perbualan area scrolls. */
@media(max-width:640px){
  #user-mode .session-history{scrollbar-width:none}
  #user-mode .session-history::-webkit-scrollbar{display:none;width:0}
  #user-mode .session-scroll.has-content .session-scrollbar{opacity:1!important;width:9px;right:2px;background:#2b3a44;border-radius:999px}
  #user-mode .session-scroll.has-content .session-scrollbar span{background:#a3b3bf;min-height:30px;border-radius:999px}
  #user-mode .session-scroll.scrolling .session-scrollbar span{background:#52e2bd}
  html[data-theme=light] #user-mode .session-scroll.has-content .session-scrollbar{background:#dbe0e5}
  html[data-theme=light] #user-mode .session-scroll.has-content .session-scrollbar span{background:#7a8792}
}

/* Mobile: stack the Permintaan/Teknikal cards full width with readable text
   instead of two cramped half-width chips. */
@media(max-width:640px){
  #user-mode #request-cards{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    margin:6px 0 9px!important;
  }
  #workspace #user-mode #request-preview,
  #workspace #user-mode #request-technical,
  #workspace #user-mode #request-preview.card-collapsed,
  #workspace #user-mode #request-technical.card-collapsed{
    grid-column:auto!important;
    height:auto!important;min-height:0!important;max-height:none!important;
    padding:9px 11px!important;border-radius:12px!important;
    background:#0d1923;border:1px solid #2a4350;
  }
  #user-mode #request-preview>span,
  #user-mode #request-technical-title,
  #workspace #user-mode #request-preview>span,
  #workspace #user-mode #request-technical-title{
    font-size:10px!important;line-height:1.3!important;letter-spacing:.08em!important;color:#8fb7ac!important;
  }
  #user-mode #request-preview p,
  #workspace #user-mode #request-preview p,
  #user-mode #request-technical .request-viz-live,
  #workspace #user-mode #request-technical .request-viz-live{
    font-size:12px!important;line-height:1.45!important;height:auto!important;min-height:0!important;
    -webkit-line-clamp:3;color:#dbe8f5;
  }
  #workspace #user-mode #request-technical{gap:6px!important}
  #workspace #user-mode #request-technical .technical-activity-line{height:20px!important;min-height:20px!important;gap:6px!important}
  html[data-theme=light] #workspace #user-mode #request-preview,
  html[data-theme=light] #workspace #user-mode #request-technical{
    background:#f7f8fa;border-color:#d5d8dd;
  }
  html[data-theme=light] #user-mode #request-preview p,
  html[data-theme=light] #user-mode #request-technical .request-viz-live{color:#1d1d1f}
}

/* The two status cards sit side by side at every width (the Live card lives in
   the status bar, so only these two occupy the grid). */
#user-mode #request-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}

/* Permintaan Anda / Teknikal hide controls: plain +/− glyphs, no boxed button. */
#workspace #user-mode #request-preview-toggle,
#workspace #user-mode #request-technical-toggle{
  border:0!important;background:transparent!important;box-shadow:none!important;
  width:auto!important;min-width:26px!important;padding:0 4px!important;
  color:var(--accent)!important;font:800 21px/1 system-ui,sans-serif!important;
}
#workspace #user-mode #request-preview-toggle:hover,
#workspace #user-mode #request-technical-toggle:hover{background:transparent!important;color:#e7f4fa!important}
html[data-theme=light] #workspace #user-mode #request-preview-toggle,
html[data-theme=light] #workspace #user-mode #request-technical-toggle{color:#0a7d5f!important}

/* Light theme: the Permintaan/Teknikal card text must stay dark on the pale card. */
html[data-theme=light] #request-preview p,
html[data-theme=light] #request-preview #request-preview-content p{color:#1d1d1f!important}
html[data-theme=light] #request-preview>span,
html[data-theme=light] #request-technical-title{color:#0a6b52!important}
html[data-theme=light] #request-technical .request-viz-live{color:#1d1d1f!important}

/* Permintaan/Teknikal toggles now live inside the Live card; collapsed cards hide. */
.live-card-toggles{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;margin-inline-start:auto}
#request-preview.card-collapsed,
#request-technical.card-collapsed{display:none!important}

/* Jiha account-guide modal. */
.guide-body{display:grid;gap:14px;margin-top:14px;max-height:62dvh;overflow:auto}
.guide-section h3{margin:0 0 6px;font-size:14px;color:#a9d9cd}
.guide-section p{margin:0;font-size:13px;line-height:1.5;color:#dbe8f5}
.guide-section ul{margin:6px 0 0;padding-left:18px;font-size:13px;line-height:1.6;color:#dbe8f5}
.guide-section code{display:inline;font-size:12px;background:#0b1722;border:1px solid #29414e;border-radius:5px;padding:1px 5px;color:#8de8c5;overflow-wrap:anywhere}
.guide-section--deny{border-top:1px solid #29414e;padding-top:12px}
.guide-section--deny h3{color:#f0a6a6}
html[data-theme=light] .guide-section h3{color:#0a6b52}
html[data-theme=light] .guide-section p,html[data-theme=light] .guide-section ul{color:#1d1d1f}
html[data-theme=light] .guide-section code{background:#eef1f5;border-color:#d5d8dd;color:#0a6b52}
html[data-theme=light] .guide-section--deny{border-top-color:#d5d8dd}
html[data-theme=light] .guide-section--deny h3{color:#b3261e}

/* Sections default to hidden; keep the Live card shell (with its toggles) so
   the user can reveal them again. */
#live-status-bar #request-viz.live-summary-collapsed:not(.live-details-open){display:flex!important}
#live-status-bar:has(#request-viz.live-summary-collapsed:not(.live-details-open)){display:block!important}
/* Jiha account-guide entry in the menu. */
#header-controls #guide-button{border-color:#3d7d72;color:#bff6e7}
html[data-theme=light] #header-controls #guide-button{border-color:#9ec9b2;color:#17633f}

/* Finger-sized controls, including the compact mobile header. */
@media(max-width:640px){
  #workspace>header .header-tools{flex-wrap:wrap!important;overflow:visible;gap:4px}
  #workspace .header-tools>button,
  #workspace #request-viz-body-toggle,
  #workspace #session-save,
  #workspace #header-controls button,
  #workspace .live-card-toggles button,
  #workspace #user-mode .session-copy,
  #workspace #request-viz-toggle,
  #workspace #live-system-toggle,
  #workspace #request-preview-toggle,
  #workspace #request-technical-toggle{
    min-width:44px!important;min-height:44px!important;
  }
  #workspace .session-entry-head{align-items:center}
}

/* Mobile: replace the +/- card toggle glyphs with relevant icons (CSS-only; JS untouched). */
@media(max-width:640px){
  #workspace #request-viz-toggle,
  #workspace #request-viz-body-toggle,
  #workspace #request-preview-toggle,
  #workspace #request-technical-toggle{font-size:0!important}
  #workspace #request-viz-toggle::before,
  #workspace #request-viz-body-toggle::before,
  #workspace #request-preview-toggle::before,
  #workspace #request-technical-toggle::before{
    content:""!important;display:inline-block!important;width:18px;height:18px;vertical-align:middle;
    background-color:currentColor;-webkit-mask:var(--tg) center/contain no-repeat;mask:var(--tg) center/contain no-repeat;
  }
  #workspace #request-viz-toggle{--tg:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%2013h4l2-6%204%2012%202-6h6%27%2F%3E%3C%2Fsvg%3E")}
  #workspace #request-viz-body-toggle{--tg:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%277%27%20y%3D%277%27%20width%3D%2710%27%20height%3D%2710%27%20rx%3D%271.5%27%2F%3E%3Cpath%20d%3D%27M10%203v3M14%203v3M10%2018v3M14%2018v3M3%2010h3M3%2014h3M18%2010h3M18%2014h3%27%2F%3E%3C%2Fsvg%3E")}
  #workspace #request-preview-toggle{--tg:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27black%27%3E%3Cpath%20d%3D%27M4%205h16a1%201%200%200%201%201%201v9a1%201%200%200%201-1%201H9l-4%203v-3H4a1%201%200%200%201-1-1V6a1%201%200%200%201%201-1z%27%2F%3E%3C%2Fsvg%3E")}
  #workspace #request-technical-toggle{--tg:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%274%27%20width%3D%2718%27%20height%3D%2716%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27M7%209l3%203-3%203M13%2015h4%27%2F%3E%3C%2Fsvg%3E")}
  #workspace #request-viz-toggle[aria-expanded="false"]::before,
  #workspace #request-viz-body-toggle[aria-expanded="false"]::before,
  #workspace #request-preview-toggle[aria-expanded="false"]::before,
  #workspace #request-technical-toggle[aria-expanded="false"]::before{opacity:.5}
}


/* Mobile: the four hide toggles live in the top bar. Each is a centred icon in
   its own box, and every box gets a distinct colour. */
@media(max-width:640px){
  #mobile-live-controls{display:inline-flex!important;align-items:center;gap:6px}
  #mobile-live-controls #request-viz-toggle,
  #mobile-live-controls #request-viz-body-toggle,
  #mobile-live-controls #request-preview-toggle,
  #mobile-live-controls #request-technical-toggle{
    display:inline-grid!important;place-items:center!important;
    width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;
    padding:0!important;border:1px solid!important;border-radius:9px!important;
    box-shadow:none!important;font-size:0!important;
  }
  #mobile-live-controls #request-viz-toggle::before,
  #mobile-live-controls #request-viz-body-toggle::before,
  #mobile-live-controls #request-preview-toggle::before,
  #mobile-live-controls #request-technical-toggle::before{margin:auto!important}
  /* One distinct colour per box (icon inherits currentColor via the mask). */
  #mobile-live-controls #request-viz-toggle{border-color:#34d399!important;background:rgba(52,211,153,.14)!important;color:#34d399!important}
  #mobile-live-controls #request-viz-body-toggle{border-color:#60a5fa!important;background:rgba(96,165,250,.14)!important;color:#60a5fa!important}
  #mobile-live-controls #request-preview-toggle{border-color:#fbbf24!important;background:rgba(251,191,36,.14)!important;color:#fbbf24!important}
  #mobile-live-controls #request-technical-toggle{border-color:#c084fc!important;background:rgba(192,132,252,.14)!important;color:#c084fc!important}
  html[data-theme=light] #mobile-live-controls #request-viz-toggle{border-color:#0a9e6b!important;background:rgba(10,158,107,.12)!important;color:#0a7d5f!important}
  html[data-theme=light] #mobile-live-controls #request-viz-body-toggle{border-color:#2563eb!important;background:rgba(37,99,235,.1)!important;color:#1d4ed8!important}
  html[data-theme=light] #mobile-live-controls #request-preview-toggle{border-color:#b45309!important;background:rgba(180,83,9,.1)!important;color:#b45309!important}
  html[data-theme=light] #mobile-live-controls #request-technical-toggle{border-color:#7c3aed!important;background:rgba(124,58,237,.1)!important;color:#6d28d9!important}
  /* With the toggles in the top bar, a collapsed Permintaan/Teknikal card hides fully. */
  #workspace #user-mode #request-preview.card-collapsed,
  #workspace #user-mode #request-technical.card-collapsed{display:none!important}
}


/* Mobile: toggles now live in the top bar, so the Live card hides completely
   when both of its sections (Live summary + System details) are closed. */
@media(max-width:640px){
  #live-status-bar #request-viz.live-summary-collapsed:not(.live-details-open){display:none!important}
  #live-status-bar:has(#request-viz.live-summary-collapsed:not(.live-details-open)){display:none!important}
}


/* Mobile: centre the theme (day/night) icon and the burger menu glyph in their boxes. */
@media(max-width:640px){
  #workspace>header .header-tools #theme-cycle,
  #workspace>header .header-tools #menu-toggle{
    display:inline-grid!important;place-items:center!important;padding:0!important;
  }
  #workspace>header .header-tools #theme-cycle svg{width:18px;height:18px;margin:auto}
  #workspace>header .header-tools #menu-toggle{line-height:1!important;font-size:20px!important}
}


/* Mobile: clear hide/unhide indicator. Full colour = shown (aria-expanded=true),
   muted grey = hidden (aria-expanded=false). */
@media(max-width:640px){
  #mobile-live-controls #request-viz-toggle[aria-expanded="false"],
  #mobile-live-controls #request-viz-body-toggle[aria-expanded="false"],
  #mobile-live-controls #request-preview-toggle[aria-expanded="false"],
  #mobile-live-controls #request-technical-toggle[aria-expanded="false"]{
    border-color:#3a4753!important;background:transparent!important;color:#6b7a88!important;
  }
  html[data-theme=light] #mobile-live-controls #request-viz-toggle[aria-expanded="false"],
  html[data-theme=light] #mobile-live-controls #request-viz-body-toggle[aria-expanded="false"],
  html[data-theme=light] #mobile-live-controls #request-preview-toggle[aria-expanded="false"],
  html[data-theme=light] #mobile-live-controls #request-technical-toggle[aria-expanded="false"]{
    border-color:#c4d3dd!important;background:transparent!important;color:#8a99a6!important;
  }
}


/* Desktop: use the same icon method as mobile for the four hide toggles
   (same icons + same hide/unhide indicator), so both surfaces behave alike. */
#workspace #request-viz-toggle,
#workspace #request-viz-body-toggle,
#workspace #request-preview-toggle,
#workspace #request-technical-toggle{font-size:0!important}
#workspace #request-viz-toggle::before,
#workspace #request-viz-body-toggle::before,
#workspace #request-preview-toggle::before,
#workspace #request-technical-toggle::before{
  content:""!important;display:inline-block!important;width:18px;height:18px;vertical-align:middle;
  background-color:currentColor;-webkit-mask:var(--tg) center/contain no-repeat;mask:var(--tg) center/contain no-repeat;
}
#workspace #request-viz-toggle{--tg:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%2013h4l2-6%204%2012%202-6h6%27%2F%3E%3C%2Fsvg%3E")}
#workspace #request-viz-body-toggle{--tg:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%277%27%20y%3D%277%27%20width%3D%2710%27%20height%3D%2710%27%20rx%3D%271.5%27%2F%3E%3Cpath%20d%3D%27M10%203v3M14%203v3M10%2018v3M14%2018v3M3%2010h3M3%2014h3M18%2010h3M18%2014h3%27%2F%3E%3C%2Fsvg%3E")}
#workspace #request-preview-toggle{--tg:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27black%27%3E%3Cpath%20d%3D%27M4%205h16a1%201%200%200%201%201%201v9a1%201%200%200%201-1%201H9l-4%203v-3H4a1%201%200%200%201-1-1V6a1%201%200%200%201%201-1z%27%2F%3E%3C%2Fsvg%3E")}
#workspace #request-technical-toggle{--tg:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%274%27%20width%3D%2718%27%20height%3D%2716%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27M7%209l3%203-3%203M13%2015h4%27%2F%3E%3C%2Fsvg%3E")}
#workspace #request-viz-toggle[aria-expanded="false"]::before,
#workspace #request-viz-body-toggle[aria-expanded="false"]::before,
#workspace #request-preview-toggle[aria-expanded="false"]::before,
#workspace #request-technical-toggle[aria-expanded="false"]::before{opacity:.5}


/* Desktop: "Laman saya" sits beside the quick tasks (Buat laman / Semak laman). */
#workspace>header>#websites-button{
  flex:0 0 auto;min-height:34px;padding:6px 12px;border-radius:8px;
  background:transparent;color:#a9d9cd;border-color:#2d4a44;font-size:12px;font-weight:700;white-space:nowrap;
}
#workspace>header>#websites-button:hover{color:#e7fff6;border-color:#3d7d72}
html[data-theme=light] #workspace>header>#websites-button{background:#fff;color:#3a4c58;border-color:var(--line)}


/* Desktop: "Laman saya" sits inside the quick-tasks group, right after Semak laman. */
#workspace>header .founder-tasks #websites-button{background:transparent;color:#a9d9cd;border-color:#2d4a44}
#workspace>header .founder-tasks #websites-button:hover{color:#e7fff6;border-color:#3d7d72}
html[data-theme=light] #workspace>header .founder-tasks #websites-button{background:#fff;color:#3a4c58;border-color:var(--line)}


/* Desktop: language and theme show only the current value (click to change). */
@media(min-width:641px){
  #workspace>header .lang-switch,
  #workspace>header .theme-switch{display:none!important}
  #workspace>header #lang-cycle,
  #workspace>header #theme-cycle{display:inline-flex!important;align-items:center;justify-content:center;min-height:34px;min-width:34px;padding:6px;border-radius:9px}
}

/* Desktop: the four hide toggles sit in the same top-bar group as on mobile. */
@media(min-width:641px){
  #mobile-live-controls{display:inline-flex!important;align-items:center;gap:6px}
  #mobile-live-controls #request-viz-toggle,
  #mobile-live-controls #request-viz-body-toggle,
  #mobile-live-controls #request-preview-toggle,
  #mobile-live-controls #request-technical-toggle{
    display:inline-grid!important;place-items:center!important;
    width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;
    padding:0!important;border:1px solid!important;border-radius:9px!important;box-shadow:none!important;font-size:0!important;
  }
  #mobile-live-controls #request-viz-toggle{border-color:#34d399!important;background:rgba(52,211,153,.14)!important;color:#34d399!important}
  #mobile-live-controls #request-viz-body-toggle{border-color:#60a5fa!important;background:rgba(96,165,250,.14)!important;color:#60a5fa!important}
  #mobile-live-controls #request-preview-toggle{border-color:#fbbf24!important;background:rgba(251,191,36,.14)!important;color:#fbbf24!important}
  #mobile-live-controls #request-technical-toggle{border-color:#c084fc!important;background:rgba(192,132,252,.14)!important;color:#c084fc!important}
  #mobile-live-controls #request-viz-toggle[aria-expanded="false"],
  #mobile-live-controls #request-viz-body-toggle[aria-expanded="false"],
  #mobile-live-controls #request-preview-toggle[aria-expanded="false"],
  #mobile-live-controls #request-technical-toggle[aria-expanded="false"]{border-color:#3a4753!important;background:transparent!important;color:#6b7a88!important}
  html[data-theme=light] #mobile-live-controls #request-viz-toggle[aria-expanded="false"],
  html[data-theme=light] #mobile-live-controls #request-viz-body-toggle[aria-expanded="false"],
  html[data-theme=light] #mobile-live-controls #request-preview-toggle[aria-expanded="false"],
  html[data-theme=light] #mobile-live-controls #request-technical-toggle[aria-expanded="false"]{border-color:#c4d3dd!important;background:transparent!important;color:#8a99a6!important}
}

/* The Live card stays hidden until its toggle is switched on (desktop + mobile). */
#live-status-bar #request-viz.live-summary-collapsed:not(.live-details-open){display:none!important}
#live-status-bar:has(#request-viz.live-summary-collapsed:not(.live-details-open)){display:none!important}

.smart-router-level{margin-top:14px;padding:14px;border:1px solid #263846;border-radius:12px;background:#0b1620}
.smart-router-level h3{margin:0;color:#dbe8f5;font-size:14px}
.smart-router-level-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}
.smart-router-level-head p{margin:5px 0 12px;color:#9cb4c6;font-size:11px;max-width:640px}
.smart-router-level-toggle{display:flex;align-items:center;gap:7px;color:#b8cbd8;font-size:11px;white-space:nowrap;flex:none}
.smart-router-level-readout{display:flex;align-items:baseline;gap:12px;margin-bottom:10px}
.smart-router-level-readout strong{font:800 22px ui-monospace,Menlo,monospace;color:var(--accent)}
.smart-router-level-readout span{color:#9cb4c6;font-size:11px}
.smart-router-level-chart{border:1px solid #263846;border-radius:10px;background:#08121b;padding:6px;min-height:120px}
.smart-router-level-chart svg{display:block;width:100%;height:200px}
.smart-router-level-empty{margin:0;padding:22px;text-align:center;color:#8aa0bd;font-size:11px}
.smart-router-level-controls{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0}
.smart-router-level-controls label{display:grid;gap:4px;color:#b8cbd8;font-size:10px}
.smart-router-level-controls input{width:100%;min-width:0;background:#08121b;border:1px solid #324955;border-radius:7px;color:#e7f4fa;padding:7px;font:inherit}
html[data-theme="light"] .smart-router-level{background:#f1f6ff;border-color:#c4d3dd}
html[data-theme="light"] .smart-router-level h3{color:#0f2430}
html[data-theme="light"] .smart-router-level-chart{background:#fff;border-color:#c4d3dd}
@media(max-width:650px){.smart-router-level-head{flex-direction:column}.smart-router-level-controls{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Level chart card above the conversation (hideable from the composer). */
.level-card{width:100%;max-width:860px;margin:0 auto 12px;padding:12px 14px;border:1px solid #29414e;border-radius:14px;background:#0d1923;box-shadow:0 12px 30px #0002}
.level-card[hidden]{display:none}
.level-card-head{display:flex;align-items:baseline;gap:10px;margin-bottom:8px;flex-wrap:wrap}
.level-card-title{color:#a9d9cd;font:800 10px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.12em;text-transform:uppercase}
.level-card-value{font:800 16px ui-monospace,Menlo,monospace;color:var(--accent)}
.level-card-band{margin-left:auto;color:#9cb4c6;font-size:11px}
.level-card-chart{border:1px solid #23353f;border-radius:10px;background:#08121b;padding:4px}
.level-card-chart svg{display:block;width:100%;height:120px}
#level-card-toggle{background:#162733;color:#b9cbd8}
#level-card-toggle.is-collapsed{color:#7c93a5}
#level-card-toggle svg,#attach-compose-button svg{display:block;width:16px;height:16px}
#level-card-toggle,#attach-compose-button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:38px}
#attach-compose-button{position:relative}
.attach-count{font:800 10px ui-monospace,Menlo,monospace;color:#08251f;background:#52e2bd;border-radius:999px;padding:1px 5px;line-height:1.4}
#attach-compose-button.has-files .attach-count{background:#08251f;color:#52e2bd}
html[data-theme="light"] .level-card{background:#f1f6ff;border-color:#c4d3dd}
html[data-theme="light"] .level-card-chart{background:#fff;border-color:#c4d3dd}
@media(max-width:640px){.level-card-chart svg{height:96px}.level-card-band{margin-left:0;flex-basis:100%}}

.level-card{display:flex;gap:12px;align-items:stretch}
.level-card-main{flex:1 1 auto;min-width:0}
.level-card-models{flex:0 0 auto;display:flex;flex-direction:column;justify-content:center;gap:6px;padding-left:12px;border-left:1px solid #23353f;min-width:140px;max-width:200px}
.level-model{display:flex;align-items:center;gap:7px;color:#9cb4c6;line-height:1.3;overflow-wrap:anywhere}
.level-model .lamp{width:8px;height:8px;border-radius:50%;background:#2b4352;flex:none}
.level-model.is-active{color:#dbe8f5;font-weight:700}
.level-model.is-active .lamp{background:#52e2bd;box-shadow:0 0 8px #52e2bd}
html[data-theme="light"] .level-card-models{border-left-color:#c4d3dd}
html[data-theme="light"] .level-model{color:#526b7b}
html[data-theme="light"] .level-model.is-active{color:#0f2430}
@media(max-width:640px){.level-card{flex-direction:column}.level-card-models{flex-direction:row;flex-wrap:wrap;border-left:0;border-top:1px solid #23353d;padding-left:0;padding-top:8px;max-width:none;justify-content:flex-start}}

.level-model-key{display:inline-flex;align-items:center;color:#f3c76b;margin-left:2px}
html[data-theme="light"] .level-model-key{color:#a06a00}

/* Full reply popup: the conversation view shortens long answers, this shows all. */
.session-entry-actions{display:inline-flex;align-items:center;gap:6px;flex:none}
.session-read-full{flex:none;padding:5px 9px;border-radius:7px;color:#a9d9cd;background:#162b37;border:1px solid #315263;font-size:11px;cursor:pointer}
.session-read-full:hover{color:#fff;background:#245260;border-color:var(--accent)}
.full-reply-dialog{border:0;padding:0;background:transparent;max-width:none;max-height:none;width:100%;height:100%}
.full-reply-dialog::backdrop{background:#050b12cc;backdrop-filter:blur(6px)}
.full-reply-shell{width:min(760px,calc(100vw - 28px));max-height:86dvh;margin:auto;display:flex;flex-direction:column;border:1px solid #29414e;border-radius:18px;background:#0e1a22;color:#e6f0f5;box-shadow:0 30px 80px #000a;overflow:hidden}
.full-reply-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid #22333d}
.full-reply-head h2{margin:0;font-size:14px;letter-spacing:.02em;color:#a9d9cd}
#full-reply-close{width:34px;height:34px;border-radius:9px;border:1px solid #33474f;background:#162733;color:#dbe8f5;font-size:19px;line-height:1;cursor:pointer}
#full-reply-close:hover{border-color:var(--accent)}
.full-reply-body{padding:16px;overflow:auto}
.full-reply-body p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;font-size:14px;color:#e0edf5}
.full-reply-body p strong{font-weight:750;color:#f3fbff}
.full-reply-body p code{padding:1px 5px;border-radius:5px;background:#0a1219;border:1px solid #29414e;font:.9em ui-monospace,SFMono-Regular,Menlo,monospace;overflow-wrap:anywhere}
html[data-theme="light"] .session-read-full{background:#eef1f5;color:#41586a;border-color:#c4d3dd}
html[data-theme="light"] .session-read-full:hover{color:#fff;background:#1d3b49;border-color:var(--accent)}
html[data-theme="light"] .full-reply-shell{background:#fff;color:#142033;border-color:#c4d3dd}
html[data-theme="light"] .full-reply-head{border-bottom-color:#e2eaf0}
html[data-theme="light"] .full-reply-head h2{color:#0f2430}
html[data-theme="light"] #full-reply-close{background:#eef3f7;color:#142033;border-color:#c4d3dd}
html[data-theme="light"] .full-reply-body p{color:#142033}
html[data-theme="light"] .full-reply-body p strong{color:#0f2430}
html[data-theme="light"] .full-reply-body p code{background:#eef3f7;border-color:#c4d3dd;color:#193042}
@media(max-width:640px){.session-read-full{padding:4px 8px;font-size:10px}.full-reply-body{padding:13px}.full-reply-body p{font-size:13.5px}}

/* Site preview popup: "Buka laman" opens the page inside WebCLI. */
.preview-dialog{border:0;padding:0;background:transparent;max-width:none;max-height:none;width:100%;height:100%}
.preview-dialog::backdrop{background:#050b12dd;backdrop-filter:blur(5px)}
.preview-shell{width:min(1100px,calc(100vw - 28px));max-height:92dvh;margin:auto;display:flex;flex-direction:column;border:1px solid #29414e;border-radius:18px;background:#0e1a22;box-shadow:0 30px 90px #000c;overflow:hidden}
.preview-head{flex:none;display:flex;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid #22333d}
.preview-kicker{color:#a9d9cd;font:800 10px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.12em}
.preview-tab{margin-left:auto;color:#9ed6c7;font-size:11.5px;font-weight:700;text-decoration:none;padding:6px 10px;border-radius:8px;border:1px solid #315263;background:#162b37}
.preview-tab:hover{color:#fff;background:#245260;border-color:var(--accent)}
#preview-close{flex:none;width:34px;height:34px;border-radius:9px;border:1px solid #33474f;background:#162733;color:#dbe8f5;font-size:19px;line-height:1;cursor:pointer}
#preview-close:hover{border-color:var(--accent)}
.preview-frame{display:block;width:100%;height:min(76dvh,780px);border:0;background:#0b1018}
html[data-theme="light"] .preview-shell{background:#fff;border-color:#c4d3dd}
html[data-theme="light"] .preview-head{border-bottom-color:#e2eaf0}
html[data-theme="light"] .preview-kicker{color:#0f2430}
html[data-theme="light"] .preview-tab{background:#eef1f5;color:#41586a;border-color:#c4d3dd}
html[data-theme="light"] .preview-tab:hover{color:#fff;background:#1d3b49;border-color:var(--accent)}
html[data-theme="light"] #preview-close{background:#eef3f7;color:#142033;border-color:#c4d3dd}
html[data-theme="light"] .preview-frame{background:#f6f8fa}
@media(max-width:640px){.preview-shell{width:calc(100vw - 18px);border-radius:14px}.preview-tab{font-size:10.5px;padding:5px 8px}.preview-frame{height:min(74dvh,640px)}}

/* The unified popup also renders a long reply as a page. */
.preview-text{padding:18px;overflow:auto;max-height:min(76dvh,780px)}
.preview-text p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;font-size:14.5px;color:#e0edf5}
.preview-text p strong{font-weight:750;color:#f3fbff}
.preview-text p code{padding:1px 5px;border-radius:5px;background:#0a1219;border:1px solid #29414e;font:.9em ui-monospace,SFMono-Regular,Menlo,monospace;overflow-wrap:anywhere}
html[data-theme="light"] .preview-text p{color:#142033}
html[data-theme="light"] .preview-text p strong{color:#0f2430}
html[data-theme="light"] .preview-text p code{background:#eef3f7;border-color:#c4d3dd;color:#193042}
@media(max-width:640px){.preview-text{padding:14px;max-height:min(74dvh,640px)}.preview-text p{font-size:13.5px}}

/* Single power control beside logout: state is shown by the same icon and its color. */
.agent-control-pair{display:inline-flex;flex:0 0 auto;align-items:center;gap:5px;white-space:nowrap}
#agent-power-toggle{order:4;display:inline-flex;flex:0 0 34px;align-items:center;justify-content:center;width:34px;min-width:34px;height:34px;min-height:34px;padding:7px;border:1px solid #3d8c68;border-radius:50%;background:rgba(24,78,54,.2);color:#72e5a7;cursor:pointer;transition:color .2s ease,border-color .2s ease,background .2s ease,box-shadow .2s ease,transform .2s ease}
#agent-power-toggle svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#agent-power-toggle.is-on{box-shadow:0 0 12px rgba(82,226,151,.24)}
#agent-power-toggle.is-off{color:#e28a96;border-color:#8e4853;background:rgba(109,37,47,.18);box-shadow:0 0 10px rgba(226,92,108,.14)}
#agent-power-toggle:hover{transform:translateY(-1px);box-shadow:0 0 18px currentColor}
#agent-power-toggle:focus-visible{outline:2px solid currentColor;outline-offset:3px}
#agent-power-toggle[aria-busy="true"]{animation:agentPowerPulse 1s ease-in-out infinite}
@keyframes agentPowerPulse{50%{opacity:.5}}
html[data-theme="light"] #agent-power-toggle.is-on{color:#087a4b;border-color:#0c9b62;background:#e8f7ef;box-shadow:0 0 10px rgba(12,155,98,.16)}
html[data-theme="light"] #agent-power-toggle.is-off{color:#9b303e;border-color:#cf727a;background:#fff0f1;box-shadow:0 0 8px rgba(207,114,122,.12)}
@media(max-width:640px){#workspace>header .header-tools #agent-power-toggle{order:4;flex:0 0 30px;width:30px;min-width:30px;height:30px;min-height:30px;padding:5px}}
@media(max-width:360px){#workspace>header .header-tools #agent-power-toggle{flex-basis:24px;width:24px;min-width:24px;height:24px;min-height:24px;padding:4px}#workspace>header .header-tools #agent-power-toggle svg{width:16px;height:16px}}
@media(max-width:720px){#workspace>header .advanced-tools .agent-control-pair{width:auto;justify-content:flex-end}#workspace>header .advanced-tools .agent-control-pair #agent-power-toggle,#workspace>header .advanced-tools .agent-control-pair #logout{flex:0 0 34px;width:34px;min-width:34px;height:34px;min-height:34px;padding:6px;text-align:center}#workspace>header .advanced-tools .agent-control-pair #logout span{display:none}}
@media(max-width:360px){#workspace>header .advanced-tools .agent-control-pair #agent-power-toggle,#workspace>header .advanced-tools .agent-control-pair #logout{flex-basis:30px;width:30px;min-width:30px;height:30px;min-height:30px;padding:5px}}

@media(max-width:640px){
  #workspace>header .header-identity>strong{display:none!important}
  #workspace>header .header-tools{gap:3px;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:none}
  #workspace>header .header-tools::-webkit-scrollbar{display:none}
  #workspace>header .header-tools .mobile-live-controls{order:1;flex:0 0 auto;gap:2px}
  #mobile-live-controls #request-viz-toggle,
  #mobile-live-controls #request-viz-body-toggle,
  #mobile-live-controls #request-preview-toggle,
  #mobile-live-controls #request-technical-toggle{width:28px!important;min-width:28px!important;height:28px!important;min-height:28px!important;border-radius:7px!important}
  #workspace>header .header-tools #theme-cycle,
  #workspace>header .header-tools .theme-switch{order:2}
  #workspace>header .header-tools #theme-cycle{flex:0 0 30px;width:30px;min-width:30px;height:30px;min-height:30px;padding:4px}
  #workspace>header .header-tools #terminal-details-toggle{order:3}
  #workspace>header .header-tools .agent-control-pair{order:4;display:inline-flex!important;flex:0 0 auto;align-items:center;gap:2px}
  #workspace>header .header-tools #menu-toggle{order:5;flex:0 0 30px;width:30px;min-width:30px;height:30px;min-height:30px;margin-left:auto;padding:4px}
  #workspace>header .header-tools #terminal-details-toggle{display:inline-grid!important;place-items:center;flex:0 0 28px;width:28px;min-width:28px;height:30px;min-height:30px;padding:0!important}
  #workspace>header .header-tools #agent-power-toggle,
  #workspace>header .header-tools #logout{display:inline-flex;flex:0 0 28px;width:28px;min-width:28px;height:28px;min-height:28px;padding:4px;align-items:center;justify-content:center}
  #workspace>header .header-tools #logout span{display:none!important}
}
@media(max-width:360px){
  #workspace>header .header-tools{gap:2px}
  #mobile-live-controls #request-viz-toggle,
  #mobile-live-controls #request-viz-body-toggle,
  #mobile-live-controls #request-preview-toggle,
  #mobile-live-controls #request-technical-toggle{width:24px!important;min-width:24px!important;height:24px!important;min-height:24px!important}
  #workspace>header .header-tools #theme-cycle{flex-basis:26px;width:26px;min-width:26px;height:26px;min-height:26px;padding:3px}
  #workspace>header .header-tools #terminal-details-toggle{flex-basis:24px;width:24px;min-width:24px}
  #workspace>header .header-tools #agent-power-toggle,
  #workspace>header .header-tools #logout,
  #workspace>header .header-tools #menu-toggle{flex-basis:26px;width:26px;min-width:26px;height:26px;min-height:26px;padding:3px}
}

/* Keep every icon control in the Web CLI header the same size at every width. */
#workspace>header .header-tools #mobile-live-controls button,
#workspace>header .header-tools #theme-cycle,
#workspace>header .header-tools .theme-switch button,
#workspace>header .header-tools #terminal-details-toggle,
#workspace>header .header-tools #agent-power-toggle,
#workspace>header .header-tools #logout,
#workspace>header .header-tools #menu-toggle{
  box-sizing:border-box!important;
  flex:0 0 36px!important;
  width:36px!important;
  min-width:36px!important;
  height:36px!important;
  min-height:36px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
#workspace>header .header-tools #mobile-live-controls button svg,
#workspace>header .header-tools #theme-cycle svg,
#workspace>header .header-tools .theme-switch button svg,
#workspace>header .header-tools #terminal-details-toggle svg,
#workspace>header .header-tools #agent-power-toggle svg,
#workspace>header .header-tools #logout svg,
#workspace>header .header-tools #menu-toggle svg{width:18px!important;height:18px!important;flex:none!important}
@media(max-width:640px){
  #workspace>header .header-tools{gap:4px!important}
  #workspace>header .header-tools #mobile-live-controls{gap:4px!important}
  #workspace>header .header-tools #menu-toggle{order:0!important;margin-inline:0 auto!important}
  #workspace>header .header-tools #mobile-live-controls{order:1!important}
  #workspace>header .header-tools #theme-cycle,
  #workspace>header .header-tools .theme-switch{order:2!important}
  #workspace>header .header-tools #terminal-details-toggle{order:3!important}
  #workspace>header .header-tools .agent-control-pair{order:4!important;margin-inline-start:auto!important}
}

/* Make burger menu sheet work on BOTH desktop and mobile */
#workspace.menu-open>header #header-controls{
  display:flex!important;
  position:absolute;
  left:0;
  right:0;
  top:100%;
  z-index:30;
  flex-direction:column;
  align-items:stretch;
  gap:4px;
  background:#101c27;
  border:1px solid #314859;
  border-top:none;
  box-shadow:0 16px 40px #0008;
  max-height:70vh;
  overflow:auto;
  padding:8px;
}

/* Burger menu fixes for both desktop and mobile: hide nav by default, show as menu on .menu-open */
#workspace>header #header-controls { display: none !important; }
#workspace.menu-open > header #header-controls {
  display: flex !important;
  position: absolute;
  left: auto;
  right: 10px;
  top: 100%;
  z-index: 100;
  flex-direction: column;
  background: #101c27;
  border: 1px solid #314859;
  box-shadow: 0 8px 24px #0003;
  padding: 4px 0;
  max-height: 60vh;
  overflow-y: auto;
  margin: 0;
  min-width: 220px;
  width: auto;
}
#workspace.menu-open > header #header-controls button {
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: none;
  border-bottom: 1px solid #263846;
  background: transparent;
  color: #dbe8f5;
}
#workspace.menu-open > header #header-controls button:last-child {
  border-bottom: none;
}
#workspace.menu-open > header #header-controls > * {
  display: block;
  width: 100%;
}
#workspace.menu-open > header #header-controls button,
#workspace.menu-open > header #header-controls .founder-tasks button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: none;
  border-bottom: 1px solid #263846;
  background: transparent;
  color: #dbe8f5;
  font-size: 14px;
  min-height: 44px;
}
#workspace.menu-open > header #header-controls button:last-child,
#workspace.menu-open > header #header-controls .founder-tasks button:last-child {
  border-bottom: none;
}
#workspace.menu-open > header #header-controls .founder-tasks {
  display: block;
  border-bottom: 1px solid #263846;
}
#workspace.menu-open > header #header-controls .advanced-tools {
  display: block;
  padding: 0;
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  position: static;
}

/* === Burger menu for both desktop and mobile (always visible toggle, menu only on open) === */
#workspace > header { overflow: visible; }
#menu-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 32px;
  min-width: 32px;
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
  border: 1px solid #314859;
  background: #182a36;
  color: #e7f4fa;
  border-radius: 6px;
}
#menu-toggle:hover { border-color: var(--accent); }

/* Desktop: ensure burger visible and not squished in tools row */
@media (min-width: 641px) {
  #workspace > header .header-tools #menu-toggle {
    margin-left: 2px;
    margin-right: 2px;
  }
}

/* Ensure header controls (the menu sheet) hidden by default, shown only when .menu-open on workspace */
#workspace > header #header-controls { display: none !important; }

/* Desktop + mobile menu sheet (right dropdown on wide, adapts on narrow) */
#workspace.menu-open > header #header-controls {
  display: flex !important;
  position: absolute;
  left: auto;
  right: 10px;
  top: 100%;
  z-index: 200;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  background: #101c27;
  border: 1px solid #314859;
  border-top: none;
  box-shadow: 0 12px 32px #0009;
  padding: 6px 0;
  max-height: 65vh;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
  min-width: 210px;
  width: auto;
  border-radius: 0 0 8px 8px;
}

/* Menu items as clean vertical list */
#workspace.menu-open > header #header-controls button,
#workspace.menu-open > header #header-controls .founder-tasks button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 16px;
  border: none;
  border-bottom: 1px solid #263846;
  background: transparent;
  color: #dbe8f5;
  font-size: 14px;
  min-height: 40px;
  border-radius: 0;
}
#workspace.menu-open > header #header-controls button:last-child,
#workspace.menu-open > header #header-controls .founder-tasks button:last-child {
  border-bottom: none;
}
#workspace.menu-open > header #header-controls .founder-tasks {
  display: block;
  border-bottom: 1px solid #263846;
  padding-bottom: 2px;
  margin-bottom: 2px;
}

/* Full width sheet on phones */
@media (max-width: 640px) {
  #workspace.menu-open > header #header-controls {
    left: 8px;
    right: 8px;
    min-width: 0;
    width: calc(100% - 16px);
    border-radius: 0 0 10px 10px;
  }
  #workspace.menu-open > header #header-controls button,
  #workspace.menu-open > header #header-controls .founder-tasks button {
    min-height: 44px;
    font-size: 15px;
    padding: 11px 16px;
  }
}

/* Light theme menu */
html[data-theme="light"] #workspace.menu-open > header #header-controls {
  background: #f7f8f8!important;
  border-color: #c7ccca!important;
  color: #26313a!important;
}
html[data-theme="light"] #workspace.menu-open > header #header-controls button,
html[data-theme="light"] #workspace.menu-open > header #header-controls .founder-tasks button {
  color: #111;
  border-color: #d1dce6;
}

/* =========================================================
   DEFINITIVE BURGER MENU FIX (both desktop + mobile)
   This block is LAST so it wins over all previous accumulated rules.
   The menu only appears when #workspace has .menu-open.
   ========================================================= */
#workspace > header { overflow: visible !important; }

#workspace > header #header-controls,
#workspace.header-collapsed > header #header-controls {
  display: none !important;
  visibility: hidden !important;
}

/* Show only when the class is present. Use very specific selector. */
#workspace.menu-open > header #header-controls {
  display: flex !important;
  visibility: visible !important;
  position: absolute !important;
  left: auto !important;
  right: 12px !important;
  top: 100% !important;
  z-index: 9999 !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  background: #0f1a24 !important;
  border: 1px solid #3a5a6e !important;
  border-top: none !important;
  box-shadow: 0 16px 48px rgba(0,0,0,0.85) !important;
  padding: 4px 0 !important;
  min-width: 230px !important;
  max-height: 70vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin: 0 !important;
  border-radius: 0 0 8px 8px !important;
}

/* All direct content and buttons in the menu must be block and visible */
#workspace.menu-open > header #header-controls,
#workspace.menu-open > header #header-controls * {
  display: block !important;
}

#workspace.menu-open > header #header-controls button,
#workspace.menu-open > header #header-controls .founder-tasks,
#workspace.menu-open > header #header-controls .founder-tasks button {
  width: 100% !important;
  text-align: left !important;
  padding: 10px 16px !important;
  margin: 0 !important;
  border: none !important;
  border-bottom: 1px solid #263846 !important;
  background: transparent !important;
  color: #dbe8f5 !important;
  font-size: 14px !important;
  min-height: 42px !important;
  line-height: 1.3 !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
}

#workspace.menu-open > header #header-controls button:last-child,
#workspace.menu-open > header #header-controls .founder-tasks button:last-child {
  border-bottom: none !important;
}

#workspace.menu-open > header #header-controls .founder-tasks {
  border-bottom: 1px solid #263846 !important;
  padding-bottom: 4px !important;
  margin-bottom: 4px !important;
}

/* Mobile full bleed sheet */
@media (max-width: 640px) {
  #workspace.menu-open > header #header-controls {
    left: 6px !important;
    right: 6px !important;
    min-width: 0 !important;
    width: calc(100% - 12px) !important;
    border-radius: 0 0 10px 10px !important;
  }
  #workspace.menu-open > header #header-controls button,
  #workspace.menu-open > header #header-controls .founder-tasks button {
    min-height: 46px !important;
    font-size: 15px !important;
    padding: 12px 16px !important;
  }
}

/* Force the toggle button itself to always be clickable and visible */
#workspace > header #menu-toggle {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Ensure all composer / send area buttons are always clickable (model, attach, smart routing toggle, send).
   Protect against any overlay, low z, or pointer-events from other UI fixes (including menu/burger changes). */
#compose,
#compose form,
#compose-shell,
#compose-row,
#compose-actions,
#compose button,
#compose-submit,
#attach-compose-button,
#compose-model,
#level-card-toggle,
#compose-actions button,
#compose * {
  pointer-events: auto !important;
  position: relative !important;
  cursor: pointer !important;
  opacity: 1 !important;
  visibility: visible !important;
}
#compose {
  z-index: 300 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
#compose-actions,
#compose-actions button,
#compose-submit,
#attach-compose-button,
#compose-model,
#level-card-toggle {
  z-index: 301 !important;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
#compose-row {
  display: flex !important;
}
#compose-actions {
  display: flex !important;
  gap: 6px !important;
}

/* Compact, uniform burger-menu rows on desktop and mobile. */
#workspace.menu-open > header #header-controls {
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:3px!important;
  width:min(280px,calc(100vw - 16px))!important;
  min-width:0!important;
  max-width:calc(100vw - 16px)!important;
  max-height:70vh!important;
  overflow:auto!important;
  padding:6px!important;
  border-radius:12px!important;
}
#workspace.menu-open > header #header-controls .founder-tasks {
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:3px!important;
  width:100%!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}
#workspace.menu-open > header #header-controls button,
#workspace.menu-open > header #header-controls .founder-tasks button {
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  width:100%!important;
  min-width:0!important;
  height:38px!important;
  min-height:38px!important;
  margin:0!important;
  padding:0 12px!important;
  border:1px solid transparent!important;
  border-radius:8px!important;
  background:transparent!important;
  color:#dbe8f5!important;
  box-shadow:none!important;
  font-size:12px!important;
  line-height:1.2!important;
  text-align:start!important;
  white-space:nowrap;
}
#workspace.menu-open > header #header-controls button:hover,
#workspace.menu-open > header #header-controls .founder-tasks button:hover {
  border-color:#315364!important;
  background:#182a36!important;
}
html[data-theme="light"] #workspace.menu-open > header #header-controls button,
html[data-theme="light"] #workspace.menu-open > header #header-controls .founder-tasks button {
  color:#142033!important;
}
html[data-theme="light"] #workspace.menu-open > header #header-controls button:hover,
html[data-theme="light"] #workspace.menu-open > header #header-controls .founder-tasks button:hover {
  border-color:#c6d4dc!important;
  background:#edf2f5!important;
}

/* Mobile composer: message on the left, compact icon controls on the right. */
@media(max-width:640px){
  #compose-row {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:34px 38px!important;
    align-items:stretch!important;
    gap:4px 6px!important;
    padding:7px!important;
  }
  #compose-row textarea {
    grid-column:1!important;
    grid-row:1 / span 2!important;
    align-self:stretch!important;
    height:100%!important;
    width:100%!important;
    min-width:0!important;
    min-height:76px!important;
    max-height:34dvh!important;
    padding:9px 10px!important;
  }
  #compose-actions {
    display:grid!important;
    grid-column:2!important;
    grid-row:1 / span 2!important;
    grid-template-columns:repeat(3,34px)!important;
    grid-template-rows:34px 38px!important;
    align-items:center!important;
    justify-content:end!important;
    align-self:stretch!important;
    gap:4px!important;
    width:auto!important;
    height:76px!important;
    padding:0!important;
  }
  #compose-actions #compose-model {grid-column:1 / span 3;grid-row:1;justify-self:end;width:110px!important;min-width:110px!important;max-width:110px!important;height:34px!important;min-height:34px!important;padding:4px 8px!important;font-size:10px!important;line-height:1.1!important;text-align:center;white-space:nowrap;text-overflow:ellipsis}
  #compose-actions #level-card-toggle {grid-column:1;grid-row:2}
  #compose-actions #attach-compose-button {grid-column:2;grid-row:2}
  #compose-actions #compose-submit {grid-column:3;grid-row:2}
  #compose-actions button {
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:34px!important;
    min-width:34px!important;
    height:34px!important;
    min-height:34px!important;
    padding:4px!important;
    overflow:hidden;
    font-size:11px!important;
  }
  #compose-actions #compose-model::before{display:none!important;content:none!important}
  #compose-actions #compose-submit{width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important}
}

/* Desktop technical terminal: use the same compact, balanced structure as mobile. */
@media(min-width:641px){
  #workspace.technical-view-mode #user-mode{padding:8px 24px 4px!important;overflow:hidden}
  #workspace.technical-view-mode #user-mode #request-cards{max-width:1280px!important;gap:8px!important;margin:0 auto!important}
  #workspace.technical-view-mode #user-mode #request-preview,
  #workspace.technical-view-mode #user-mode #request-technical{height:58px!important;min-height:58px!important;padding:5px 10px!important;border-radius:10px}
  #workspace.technical-view-mode #cli-surface{width:min(100%,1440px)!important;max-width:1440px!important;margin:0 auto!important;padding:0 16px 12px!important;flex:1 1 0!important;min-height:0!important;background:transparent!important}
  #workspace.technical-view-mode #terminal{width:100%!important;height:100%!important;min-height:0!important;flex:1 1 0!important;margin:0!important;padding:10px 12px!important;border:1px solid #29414e!important;border-radius:12px!important;background:#080d14!important;box-shadow:inset 0 1px #1c3541,0 8px 24px #0003}
  #workspace.technical-view-mode #terminal .xterm{padding:2px}
}

.limits-agent-stop{min-width:88px;min-height:32px;padding:6px 10px;border-color:#9c414c;background:#3a1c24;color:#ffdce0;font-size:11px;font-weight:700;white-space:nowrap}
.limits-agent-stop:hover{border-color:#ff8d98;background:#54242e;color:#fff}
.limits-agent-stop:disabled{border-color:#46505a;background:#222a31;color:#aab4bc;opacity:.7;cursor:default}
html[data-theme="light"] .limits-agent-stop{border-color:#d88991;background:#fff1f2;color:#8b1f2d}
html[data-theme="light"] .limits-agent-stop:disabled{border-color:#d2d6dc;background:#f1f2f4;color:#66717a}

/* Small affordance showing that the selected model can be changed. */
#compose-actions #compose-model{gap:6px}
#compose-actions #compose-model::after{
  content:"";display:block;flex:0 0 9px;width:9px;height:9px;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
@media(max-width:640px){
  #compose-actions #compose-model{position:relative!important}
  #compose-actions #compose-model::after{content:"⌄";position:static;display:block;flex:0 0 auto;width:auto;height:auto;margin-inline-start:5px;background:none;mask:none;-webkit-mask:none;font:700 10px/1 system-ui,sans-serif}
}

/* Let the selected workspace surface consume all space between the status bar and composer. */
#workspace:not(.technical-view-mode) #user-mode{
  flex:1 1 0!important;min-width:0!important;min-height:0!important;overflow:hidden!important;padding:0!important
}
#workspace:not(.technical-view-mode) #user-mode .user-mode-intro{display:none!important}
#workspace:not(.technical-view-mode) #user-mode #request-cards{
  flex:0 0 auto!important;width:100%!important;max-width:none!important;margin:0 0 8px!important
}
#workspace:not(.technical-view-mode) #user-mode .readable-session{
  flex:1 1 0!important;width:100%!important;max-width:none!important;min-width:0!important;
  height:auto!important;min-height:0!important;max-height:none!important;margin:0!important
}
#workspace:not(.technical-view-mode) #user-mode .session-scroll{
  flex:1 1 0!important;width:100%!important;min-height:0!important
}
#workspace:not(.technical-view-mode) #user-mode .session-history{
  flex:1 1 0!important;width:100%!important;max-width:none!important;min-height:0!important;max-height:none!important
}
#workspace.technical-view-mode #cli-surface{
  flex:1 1 0!important;width:100%!important;max-width:none!important;min-width:0!important;min-height:0!important;
  margin:0!important;padding:0 12px 8px!important;align-self:stretch!important;overflow:hidden!important
}
#workspace.technical-view-mode #terminal{
  flex:1 1 0!important;width:100%!important;height:100%!important;max-width:none!important;min-width:0!important;min-height:0!important;
  margin:0!important
}
@media(max-width:640px){
  #workspace:not(.technical-view-mode) #user-mode #request-cards{margin-bottom:6px!important}
  #workspace:not(.technical-view-mode) #user-mode .readable-session{padding:10px!important}
  #workspace.technical-view-mode #cli-surface{padding:0 4px calc(4px + env(safe-area-inset-bottom))!important}
  #workspace.technical-view-mode #terminal{padding:4px!important}
  #workspace>header .header-tools #menu-toggle{order:-2!important;margin:0!important}
}
@media(min-width:641px){
  #workspace>header .header-tools #menu-toggle{order:-2!important;margin:0!important}
  #workspace>header .header-tools #lang-cycle{order:-1!important}
}

.scheduled-prompts-dialog,.scheduled-prompt-view-dialog{
  width:min(980px,calc(100vw - 24px));max-width:none;max-height:92dvh;overflow:auto;
  padding:18px;border:1px solid #335463;border-radius:18px;background:#101c27;color:#dbe8f5;box-shadow:0 24px 80px #0008
}
.scheduled-prompts-dialog::backdrop,.scheduled-prompt-view-dialog::backdrop{background:#050a10bd;backdrop-filter:blur(4px)}
.scheduled-prompt-form{display:grid;gap:12px;padding:12px 0 16px;border-bottom:1px solid #29414e}
.scheduled-prompt-form label{display:grid;gap:6px;margin:0;color:#b7c9d7;font-size:12px;font-weight:650}
.scheduled-prompt-form textarea,.scheduled-prompt-form input,.scheduled-prompt-form select{
  box-sizing:border-box;width:100%;min-width:0;margin:0;padding:10px 12px;border:1px solid #324955;border-radius:9px;
  background:#09141e;color:#e7f4fa;font:inherit;font-size:14px
}
.scheduled-prompt-form textarea{min-height:108px;max-height:36dvh;resize:vertical;line-height:1.45}
.scheduled-prompt-timing{display:grid;grid-template-columns:minmax(160px,.8fr) minmax(220px,1.2fr);gap:10px;align-items:end}
.scheduled-prompt-actions,.scheduled-prompts-actions{display:flex;justify-content:flex-end;gap:8px}
.scheduled-prompts-truth{min-height:20px}
.scheduled-prompts-table-wrap{max-height:38dvh;overflow:auto;margin-top:12px;border:1px solid #29414e;border-radius:10px}
.scheduled-prompts-table{width:100%;min-width:660px;border-collapse:collapse;text-align:left;font-size:12px}
.scheduled-prompts-table th,.scheduled-prompts-table td{padding:9px 10px;border-bottom:1px solid #29414e;vertical-align:middle}
.scheduled-prompts-table th{position:sticky;top:0;background:#162733;color:#a9d9cd;font-size:10px;letter-spacing:.06em;text-transform:uppercase}
.scheduled-prompts-table tbody tr:last-child td{border-bottom:0}
.scheduled-prompts-table td:nth-child(3){white-space:nowrap;color:#9cb4c6}
.scheduled-prompts-table td:nth-child(4){white-space:nowrap}
.scheduled-prompts-table td:nth-child(4) button{min-height:32px;margin-inline-end:5px;padding:5px 8px;font-size:11px}
.scheduled-prompts-table td:nth-child(4) button[data-schedule-action="delete"]{color:#f4a5a5;border-color:#73454a}
.scheduled-prompts-table td:nth-child(4) button:disabled{opacity:.45}
.scheduled-prompt-preview{display:block;width:min(460px,100%);max-width:100%;min-height:32px;overflow:hidden;padding:4px 6px;border-color:transparent;background:transparent;color:#dbe8f5;text-align:left;text-overflow:ellipsis;white-space:nowrap}
.scheduled-prompt-preview:hover{border-color:#3b6978;background:#132631}
.scheduled-prompts-empty{padding:14px 4px;color:#8fa8b8;text-align:center}
.scheduled-prompts-actions{margin-top:10px}
.scheduled-prompt-view-dialog{width:min(760px,calc(100vw - 24px))}
.scheduled-prompt-view-dialog pre{max-height:72dvh;overflow:auto;margin:0;padding:14px;border:1px solid #29414e;border-radius:10px;background:#09141e;color:#e7f4fa;font:13px/1.55 system-ui,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere}
html[data-theme="light"] .scheduled-prompts-dialog,html[data-theme="light"] .scheduled-prompt-view-dialog{border-color:#c4d3dd;background:#fff;color:#142033}
html[data-theme="light"] .scheduled-prompt-form label{color:#425768}
html[data-theme="light"] .scheduled-prompt-form textarea,html[data-theme="light"] .scheduled-prompt-form input,html[data-theme="light"] .scheduled-prompt-form select{border-color:#c4d3dd;background:#f5f8fa;color:#142033}
html[data-theme="light"] .scheduled-prompts-table-wrap{border-color:#d2dbe1}
html[data-theme="light"] .scheduled-prompts-table th{border-color:#d2dbe1;background:#eef3f6;color:#315d58}
html[data-theme="light"] .scheduled-prompts-table td{border-color:#e0e5e9}
html[data-theme="light"] .scheduled-prompts-table td:nth-child(3),html[data-theme="light"] .scheduled-prompts-empty{color:#526b7b}
html[data-theme="light"] .scheduled-prompt-preview{color:#142033}
html[data-theme="light"] .scheduled-prompt-view-dialog pre{border-color:#d2dbe1;background:#f5f8fa;color:#142033}
@media(max-width:640px){
  .scheduled-prompts-dialog,.scheduled-prompt-view-dialog{width:calc(100vw - 12px);max-height:94dvh;padding:12px;border-radius:14px}
  .scheduled-prompt-form{gap:9px;padding:8px 0 12px}
  .scheduled-prompt-timing{grid-template-columns:minmax(0,1fr);gap:8px}
  .scheduled-prompts-table-wrap{max-height:32dvh}
  .scheduled-prompts-table{min-width:610px}
  .scheduled-prompt-view-dialog pre{max-height:75dvh;font-size:12px}
}

/* Composer: borderless shell and icon-only actions (2026-10-19). */
#compose-shell{
  border:0!important;border-radius:0!important;background:transparent!important;
  box-shadow:none!important;overflow:visible!important;padding:0!important;
}
#compose-actions{gap:12px!important;padding-bottom:0!important}
#compose-actions button{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
  padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;
  box-shadow:none!important;color:#9cb4c6!important;font-size:0!important;line-height:0!important;
}
#compose-actions button:hover,
#compose-actions button:focus-visible{color:var(--accent)!important;background:transparent!important}
#compose-actions button svg{width:20px!important;height:20px!important}
#compose-actions #compose-model{
  width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
  padding:0!important;border-radius:0!important;background:transparent!important;
}
#compose-actions #compose-model::before{
  content:"";display:block;width:20px;height:20px;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='4'%20y='4'%20width='16'%20height='16'%20rx='3'/%3E%3Cpath%20d='M9%209h6v6H9z'/%3E%3Cpath%20d='M9%202v2M15%202v2M9%2020v2M15%2020v2M2%209h2M2%2015h2M20%209h2M20%2015h2'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='4'%20y='4'%20width='16'%20height='16'%20rx='3'/%3E%3Cpath%20d='M9%209h6v6H9z'/%3E%3Cpath%20d='M9%202v2M15%202v2M9%2020v2M15%2020v2M2%209h2M2%2015h2M20%209h2M20%2015h2'/%3E%3C/svg%3E") center/contain no-repeat;
}
#compose-actions #compose-submit{
  width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
  border-radius:0!important;background:transparent!important;border:0!important;box-shadow:none!important;
  color:#9cb4c6!important;
}
#compose-actions #compose-submit::before{width:20px!important;height:20px!important}
#compose-actions #compose-submit:hover{color:var(--accent)!important;background:transparent!important}
#compose-actions #compose-submit:disabled{opacity:.4!important}
html[data-theme="light"] #compose-shell{background:transparent!important;border:0!important;box-shadow:none!important}
html[data-theme="light"] #compose-actions button{background:transparent!important;border:0!important;color:#5b6b7a!important}
html[data-theme="light"] #compose-actions #compose-submit{background:transparent!important;border:0!important;color:#5b6b7a!important}
html[data-theme="light"] #compose-actions #compose-submit:hover,
html[data-theme="light"] #compose-actions button:hover{color:#0071e3!important}

/* Composer override: icon-only model chip on every breakpoint. */
#compose-actions #compose-model{
  grid-column:auto!important;grid-row:auto!important;justify-self:auto!important;
  width:34px!important;min-width:34px!important;max-width:34px!important;
  height:34px!important;min-height:34px!important;padding:0!important;
  font-size:0!important;line-height:0!important;text-align:center!important;
  border:0!important;border-radius:0!important;background:transparent!important;
}
#compose-actions #compose-model::before{
  display:block!important;content:""!important;
  width:20px;height:20px;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='4'%20y='4'%20width='16'%20height='16'%20rx='3'/%3E%3Cpath%20d='M9%209h6v6H9z'/%3E%3Cpath%20d='M9%202v2M15%202v2M9%2020v2M15%2020v2M2%209h2M2%2015h2M20%209h2M20%2015h2'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='4'%20y='4'%20width='16'%20height='16'%20rx='3'/%3E%3Cpath%20d='M9%209h6v6H9z'/%3E%3Cpath%20d='M9%202v2M15%202v2M9%2020v2M15%2020v2M2%209h2M2%2015h2M20%209h2M20%2015h2'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Conversation: live activity row after the last instruction (2026-10-19). */
.session-live-activity{
  display:flex;align-items:center;gap:10px;position:relative;overflow:hidden;
  padding:12px 15px;border:1px dashed #2e7663;border-radius:13px;
  background:#0d1923;color:#a9d9cd;font:600 12px/1.45 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.session-live-activity[hidden]{display:none!important}
.sla-dots{display:inline-flex;flex:none;gap:4px}
.sla-dots i{width:6px;height:6px;border-radius:50%;background:var(--accent);animation:slaBounce 1.1s infinite ease-in-out}
.sla-dots i:nth-child(2){animation-delay:.15s}
.sla-dots i:nth-child(3){animation-delay:.3s}
.sla-text{min-width:0;overflow-wrap:anywhere}
.session-live-activity::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(90deg,transparent,rgba(82,226,189,.10),transparent);
  animation:slaSweep 2.4s linear infinite;
}
@keyframes slaBounce{0%,80%,100%{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
@keyframes slaSweep{from{transform:translateX(-100%)}to{transform:translateX(100%)}}
html[data-theme="light"] .session-live-activity{background:#f2f8f6;border-color:#a6cdbb;color:#126b59}
html[data-theme="light"] .session-live-activity::after{background:linear-gradient(90deg,transparent,rgba(10,125,95,.08),transparent)}
@media(prefers-reduced-motion:reduce){.sla-dots i,.session-live-activity::after{animation:none}}

/* Composer model: plain text label, no icon and no outer card. */
.archive-session-actions{display:flex;flex-wrap:wrap;gap:7px;margin:8px 0 12px}
.archive-session-actions button{font-size:12px;padding:7px 10px}
.archive-session-messages{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.archive-message-group{max-width:min(86%,720px);padding:10px 13px;border:1px solid var(--line,#34495a);border-radius:15px;background:var(--surface,#14212b);overflow-wrap:anywhere}
.archive-message-group--user{align-self:flex-end;background:#123c36;border-color:#347767}
.archive-message-group--assistant{align-self:flex-start;background:#17242d}
.archive-message-group>strong{font-size:11px;opacity:.72}
.archive-message-group>p{margin:6px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
.archive-attachment{margin:8px 0}
.archive-attachment--image img{display:block;max-width:min(320px,100%);max-height:320px;object-fit:contain;border:1px solid var(--line,#34495a);border-radius:10px;background:#0b1118}
.archive-attachment-file{display:inline-flex;align-items:center;gap:9px;max-width:100%;padding:9px 12px;border:1px solid var(--line,#34495a);border-radius:10px;color:inherit;text-decoration:none;background:var(--surface,#14212b)}
.archive-attachment-file>span:nth-child(2){overflow-wrap:anywhere}
.archive-attachment-file small{opacity:.7;white-space:nowrap}
.archive-attachment-icon{display:grid;place-items:center;min-width:42px;height:32px;padding:0 4px;border-radius:6px;background:#254653;color:#a5ecda;font-size:10px;font-weight:800}
#compose-actions #compose-model{
  grid-column:auto!important;grid-row:auto!important;justify-self:auto!important;
  width:auto!important;min-width:0!important;max-width:46vw!important;
  height:34px!important;min-height:34px!important;padding:0 2px!important;
  font-size:12px!important;line-height:1!important;text-align:left!important;
  border:0!important;border-radius:0!important;background:transparent!important;
  color:#9cb4c6!important;white-space:nowrap!important;overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#compose-actions #compose-model::before{display:none!important;content:none!important}
#compose-actions #compose-model:hover{color:var(--accent)!important}
html[data-theme="light"] #compose-actions #compose-model{background:transparent!important;border:0!important;color:#5b6b7a!important}
html[data-theme="light"] #compose-actions #compose-model:hover{color:#0071e3!important}
@media(max-width:640px){
  #compose-actions #compose-model{
    grid-column:1 / span 3!important;grid-row:1!important;justify-self:end!important;
    width:auto!important;max-width:100%!important;font-size:11px!important;padding:0!important;
  }
}

/* Composer action rhythm: model label aligns with the icon row. */
#compose-actions #compose-model{margin:0!important}
@media(max-width:640px){
  #compose-actions #compose-model{
    justify-self:start!important;
    align-self:center!important;
    text-align:left!important;
    padding-left:0!important;
  }
  #compose-actions{grid-template-columns:repeat(3,34px)!important;justify-content:end!important}
}

/* Independent expandable toolbar; the burger continues to own #header-controls. */
#toolbar-expand-toggle{
  order:1;flex:0 0 34px;display:inline-flex;align-items:center;justify-content:center;
  width:34px;min-width:34px;height:34px;min-height:34px;padding:0;
  border-radius:9px;background:#132630;color:#a9d9cd;border-color:#315565;
  font-size:22px;line-height:1;transition:background .18s ease,border-color .18s ease,color .18s ease;
}
#toolbar-expand-toggle:hover{background:#173640;color:#e7f4fa;border-color:var(--accent)}
#toolbar-expand-toggle svg{display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .38s cubic-bezier(.22,1,.36,1)}
#toolbar-expand-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
#workspace>header .header-tools [data-toolbar-item]{
  flex:0 0 auto;max-width:500px;overflow:hidden;opacity:1;visibility:visible;
  transform:translateX(0) scale(1);pointer-events:auto;
  transition:max-width .38s cubic-bezier(.22,1,.36,1),opacity .32s ease,transform .38s cubic-bezier(.22,1,.36,1),padding .38s cubic-bezier(.22,1,.36,1),margin-inline .38s cubic-bezier(.22,1,.36,1),border-width .38s cubic-bezier(.22,1,.36,1),gap .38s cubic-bezier(.22,1,.36,1),visibility 0s;
  transition-delay:calc(var(--toolbar-index,0)*45ms);
}
#workspace>header .header-tools.toolbar-collapsed [data-toolbar-item]{
  min-width:0!important;max-width:0!important;padding:0!important;
  margin-inline:0!important;border-width:0!important;gap:0!important;opacity:0;visibility:hidden;
  transform:translateX(-10px) scale(.96);pointer-events:none;
  transition-delay:calc((var(--toolbar-count,1) - var(--toolbar-index,0))*45ms);
}
#workspace>header .header-tools [data-toolbar-item] button:not([data-toolbar-item]){
  opacity:1;visibility:visible;transform:translateX(0) scale(1);pointer-events:auto;
  transition:opacity .32s ease,transform .38s cubic-bezier(.22,1,.36,1),visibility 0s;
  transition-delay:calc(var(--toolbar-index,0)*45ms);
}
#workspace>header .header-tools.toolbar-collapsed [data-toolbar-item] button:not([data-toolbar-item]){
  opacity:0;visibility:hidden;transform:translateX(-10px) scale(.96);pointer-events:none;
  transition-delay:calc((var(--toolbar-count,1) - var(--toolbar-index,0))*45ms);
}
@media(max-width:640px){
  #workspace>header .header-tools{justify-content:flex-start!important;min-width:0}
  #workspace>header .header-tools #toolbar-expand-toggle{
    order:-1!important;flex:0 0 30px;width:30px;min-width:30px;height:30px;min-height:30px;
    margin:0!important;padding:0;font-size:20px;
  }
  #workspace>header .header-tools #menu-toggle{order:-2!important;margin:0!important}
}
@media(min-width:641px){#workspace>header .header-tools #toolbar-expand-toggle{order:-1!important}}
#workspace>header .header-tools #lang-cycle{order:0!important}
@media(prefers-reduced-motion:reduce){
  #toolbar-expand-toggle svg,#workspace>header .header-tools [data-toolbar-item]{transition:none!important}
}

/* Softer day-mode surfaces; keep the terminal from rendering as a white panel. */
html[data-theme="light"]{
  --page:#e5e8eb;
  --surface:#eceff1;
  background:#e5e8eb;
}
html[data-theme="light"] body,
html[data-theme="light"] #workspace,
html[data-theme="light"] #user-mode,
html[data-theme="light"] #compose,
html[data-theme="light"] #workspace>footer,
html[data-theme="light"] #live-status-bar,
html[data-theme="light"] #action-dock{background:#e5e8eb!important}
html[data-theme="light"] #terminal,
html[data-theme="light"] #cli-surface{background:#e5e8eb!important}

/* Uniform square icon cards across the desktop and mobile header toolbars. */
#workspace>header .header-tools #mobile-live-controls button,
#workspace>header .header-tools #theme-cycle,
#workspace>header .header-tools .theme-switch button,
#workspace>header .header-tools #lang-cycle,
#workspace>header .header-tools #terminal-details-toggle,
#workspace>header .header-tools #agent-power-toggle,
#workspace>header .header-tools #logout,
#workspace>header .header-tools #menu-toggle,
#workspace>header .header-tools #toolbar-expand-toggle{
  box-sizing:border-box!important;
  display:inline-flex!important;
  flex:0 0 34px!important;
  align-items:center!important;
  justify-content:center!important;
  width:34px!important;
  min-width:34px!important;
  max-width:34px!important;
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  padding:0!important;
}
#workspace>header .header-tools #mobile-live-controls button svg,
#workspace>header .header-tools #theme-cycle svg,
#workspace>header .header-tools .theme-switch button svg,
#workspace>header .header-tools #terminal-details-toggle svg,
#workspace>header .header-tools #agent-power-toggle svg,
#workspace>header .header-tools #logout svg,
#workspace>header .header-tools #menu-toggle svg,
#workspace>header .header-tools #toolbar-expand-toggle svg{
  flex:none!important;
  width:18px!important;
  height:18px!important;
}
.browser-script-run{flex:none;margin-inline-start:7px;padding:5px 9px;border-color:#3b7467;background:#102d28;color:#a9e4d3;font-size:10px;font-weight:750}
.browser-script-run:hover{border-color:#52e2bd;background:#153b33;color:#e6fff6}
html[data-theme="light"] .browser-script-run{border-color:#9ec9b2;background:#e8f7ef;color:#176b55}
.browser-script-result{max-height:260px;overflow:auto;margin:8px 0 0;padding:10px;border:1px solid #31525c;border-radius:10px;background:#0b171e;color:#bfe7d9;font:11px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.browser-script-result[data-kind="error"]{border-color:#754b50;color:#ffb7b7}
.browser-script-runner-frame{position:fixed;left:-10000px;top:-10000px;width:1px;height:1px;border:0;opacity:0;pointer-events:none}
html[data-theme="light"] .browser-script-result{border-color:#c4d3dd;background:#f5f8fa;color:#193042}

/* Day mode: the burger sheet must keep dark text on a light surface.
   The earlier "definitive" menu block hard-codes a dark sheet and light labels,
   so a later light-theme label override produced dark-on-dark text. */
html[data-theme="light"] #workspace.menu-open > header #header-controls{
  background:#f7f8f8!important;
  border-color:#c7ccca!important;
  box-shadow:0 14px 32px #2632381f!important;
  color:#30373c!important;
}
html[data-theme="light"] #workspace.menu-open > header #header-controls button,
html[data-theme="light"] #workspace.menu-open > header #header-controls .founder-tasks button{
  background:transparent!important;
  color:#26313a!important;
  border-color:#e2e6e5!important;
}
html[data-theme="light"] #workspace.menu-open > header #header-controls button:hover,
html[data-theme="light"] #workspace.menu-open > header #header-controls .founder-tasks button:hover{
  background:#e8ebea!important;
  color:#141a1f!important;
  border-color:#c7ccca!important;
}
html[data-theme="light"] #workspace>header #menu-toggle{
  background:#eef1f5!important;
  color:#26313a!important;
  border-color:#c4ccd4!important;
}
html[data-theme="light"] #workspace>header #menu-toggle:hover{
  background:#e3e8ee!important;
  color:#141a1f!important;
  border-color:var(--accent)!important;
}

/* Routing status sits between the model label and the three composer icons. */
#compose #compose-smart-routing{display:inline-flex!important;align-items:center!important;justify-content:center!important;align-self:center!important;gap:4px!important;width:100%!important;max-width:100%;min-height:26px!important;height:26px!important;margin:0!important;padding:3px 5px!important;border:1px solid #3a5a68!important;border-radius:7px!important;background:#172833!important;color:#dce7ec!important;font:600 10px/1.2 system-ui,sans-serif!important;white-space:nowrap!important;overflow:hidden}
#compose #compose-smart-routing::before{content:"";flex:none;width:7px;height:7px;border-radius:50%;background:#84949d}
#compose #compose-smart-routing[data-state="on"]{color:#b2f1d8!important;border-color:#39775f!important;background:#14382c!important}
#compose #compose-smart-routing[data-state="on"]::before{background:#71e4ac}
#compose #compose-smart-routing[data-state="off"]::before{background:#adbac2}
#compose #compose-smart-routing:disabled{cursor:wait!important;opacity:.65!important}
#compose #compose-smart-routing[hidden]{display:none!important}
html[data-theme="light"] #compose #compose-smart-routing{background:#e8ebee!important;color:#35424b!important;border-color:#aebac2!important}
html[data-theme="light"] #compose #compose-smart-routing[data-state="on"]{background:#e0eee5!important;color:#21533c!important;border-color:#8fb59c!important}
html[data-theme="light"] #compose #compose-smart-routing[data-state="on"]::before{background:#237545}
#compose-actions:has(#compose-smart-routing:not([hidden])){display:grid!important;grid-template-columns:repeat(3,38px)!important;grid-template-rows:24px 26px 34px!important;gap:4px!important;height:92px!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important}
#compose-actions:has(#compose-smart-routing:not([hidden])) #compose-model{grid-column:1 / -1!important;grid-row:1!important;justify-self:center!important;width:auto!important;max-width:122px!important;height:24px!important;min-height:24px!important;padding:0!important;margin:0!important;text-align:center!important}
#compose-actions:has(#compose-smart-routing:not([hidden])) #compose-smart-routing{grid-column:1 / -1!important;grid-row:2!important}
#compose-actions:has(#compose-smart-routing:not([hidden])) #level-card-toggle{grid-column:1!important;grid-row:3!important}
#compose-actions:has(#compose-smart-routing:not([hidden])) #attach-compose-button{grid-column:2!important;grid-row:3!important}
#compose-actions:has(#compose-smart-routing:not([hidden])) #compose-submit{grid-column:3!important;grid-row:3!important}
@media(max-width:640px){
  #compose-row:has(#compose-smart-routing:not([hidden])){grid-template-rows:92px!important}
  #compose-row:has(#compose-smart-routing:not([hidden])) textarea{grid-row:1!important;min-height:92px!important}
  #compose-row:has(#compose-smart-routing:not([hidden])) #compose-actions{grid-row:1!important}
}

/* Responsive composer: on phones the message shares a row with the compact
   three-row action rail and keeps the larger share of the available width. */
#compose #compose-actions:has(#compose-smart-routing:not([hidden])){
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  width:max-content!important;min-width:122px!important;max-width:min(220px,46vw)!important;
  height:auto!important;flex:0 0 auto!important
}
#compose #compose-actions:has(#compose-smart-routing:not([hidden])) #compose-model,
#compose #compose-actions:has(#compose-smart-routing:not([hidden])) #compose-smart-routing{
  width:100%!important;max-width:100%!important;min-width:0!important
}
#compose #compose-actions:has(#compose-smart-routing:not([hidden])) #compose-model{
  justify-self:stretch!important;justify-content:flex-start!important;text-align:start!important;overflow:hidden!important;text-overflow:ellipsis!important
}
#compose #compose-actions:has(#compose-smart-routing:not([hidden])) #compose-smart-routing{
  justify-self:stretch!important;text-overflow:ellipsis!important
}
@media(max-width:360px){
  #compose #compose-shell #compose-row #compose-actions #compose-model{font-size:10px!important}
  #compose #compose-shell #compose-row #compose-actions #level-card-toggle,
  #compose #compose-shell #compose-row #compose-actions #attach-compose-button,
  #compose #compose-shell #compose-row #compose-actions #compose-submit{flex-basis:30px!important;width:30px!important;min-width:30px!important;height:30px!important;min-height:30px!important}
}

/* The conversation surface is full-bleed in conversation mode, so the composer
   follows the same edges instead of staying a narrower centred card. */
#workspace:not(.technical-view-mode) #compose{padding-inline:0!important}
#workspace:not(.technical-view-mode) #compose-shell{max-width:none!important;width:100%!important;margin:0!important}
#workspace:not(.technical-view-mode) #compose-row{padding-inline:clamp(10px,2vw,20px)!important}
#workspace:not(.technical-view-mode) #compose-meta{padding-inline:clamp(12px,2vw,22px)!important}
@media(max-width:640px){
  #workspace:not(.technical-view-mode) #compose{padding:6px 0 4px!important}
  #workspace:not(.technical-view-mode) #compose-row{padding-inline:10px!important}
  #workspace:not(.technical-view-mode) #compose-shell{border-radius:0!important;border-inline:0!important}
}
/* Composer input border + Perbualan cleanup (2026-10-23). The shell had been
   flattened to a borderless strip; restore a visible input frame without
   changing the mobile two-column, three-row action layout. */
#workspace #compose #compose-shell{
  border:1px solid #5b7f92!important;
  border-radius:16px!important;
  background:#101c27!important;
  box-shadow:0 0 0 1px #5b7f9233,0 10px 28px #0004!important;
}
html[data-theme="light"] #workspace #compose #compose-shell{
  border-color:#a9b8c4!important;
  background:#fff!important;
  box-shadow:0 0 0 1px #a9b8c433,0 6px 20px #0000000f!important;
}
#session-save,
#session-search,
#session-search-clear{display:none!important}
@media(max-width:640px){
  #workspace:not(.technical-view-mode) #compose{
    padding:6px 8px calc(6px + env(safe-area-inset-bottom))!important;
  }
  #workspace #compose #compose-shell{
    border:1px solid #5b7f92!important;
    border-radius:14px!important;
  }
  html[data-theme="light"] #workspace #compose #compose-shell{
    border-color:#a9b8c4!important;
  }
}
/* Keep the key-in area itself visibly framed, not just the outer composer card. */
#compose-row #message{
  border:1px solid #5b7f92!important;
  border-radius:10px!important;
  background:#0b141a!important;
}
html[data-theme="light"] #compose-row #message{
  border-color:#a9b8c4!important;
  background:#fff!important;
}
/* The conversation card no longer needs its "Perbualan" title row. */
#user-mode .readable-heading{display:none!important}
/* The active-turn / next-model note is not needed below the composer. */
#model-turn-note{display:none!important}

/* Completion cue: obvious "Selesai" toast paired with the short ting. */
#task-complete-toast{
  position:fixed;
  left:50%;
  top:calc(12px + env(safe-area-inset-top));
  transform:translate(-50%,-16px);
  z-index:9999;
  max-width:min(92vw,420px);
  padding:10px 16px;
  border:1px solid #3ddc97;
  border-radius:999px;
  background:#0c2019;
  color:#eafff6;
  font:600 13px/1.35 system-ui,-apple-system,"Segoe UI",sans-serif;
  box-shadow:0 8px 24px #0006,0 0 0 1px #3ddc9733;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease,transform .18s ease;
  text-align:center;
}
#task-complete-toast::before{content:"✓";margin-right:8px;color:#3ddc97}
#task-complete-toast[data-variant="error"]{border-color:#ff6b6b;background:#2a1010f2;color:#ffecec}
#task-complete-toast[data-variant="error"]::before{content:"!";color:#ff6b6b}
#task-complete-toast.is-visible{opacity:1;transform:translate(-50%,0)}
html[data-theme="light"] #task-complete-toast{background:#ffffff;color:#10352a;box-shadow:0 8px 24px #0000001f,0 0 0 1px #3ddc9733}
html[data-theme="light"] #task-complete-toast[data-variant="error"]{background:#fff5f5f2;color:#5a1010}
@media(prefers-reduced-motion:reduce){#task-complete-toast{transition:none!important}}
@media(max-width:640px){
  #task-complete-toast{
    top:auto;
    bottom:calc(112px + env(safe-area-inset-bottom));
    transform:translate(-50%,16px);
    max-width:calc(100vw - 24px);
    padding:9px 14px;
    font-size:12.5px;
  }
  #task-complete-toast.is-visible{transform:translate(-50%,0)}
}

/* web-cli2 tak perlu ada sesi indicator (Sesi aktif —/7 Sesi log masuk dikesan) */
.web-cli2 #rv-webcli-login-meter,
.web-cli2 #rv-webcli-login-coverage,
.web-cli2 .live-status-coverage {
  display: none !important;
  visibility: hidden !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   FINAL WhatsApp conversation surface for Web CLI.
   Fixes the grid→flex migration: justify-self no longer aligns bubbles, so use
   align-self + margins. The panel fills the available column and each side has
   a distinct balloon colour in dark and light themes.
   ───────────────────────────────────────────────────────────────────────────── */
#user-mode .readable-session{
  width:100%!important;max-width:1120px!important;
  height:min(72dvh,820px)!important;min-height:420px!important;
  padding:0!important;border:1px solid #1f2c34!important;border-radius:16px!important;
  overflow:hidden!important;background:#0b141a!important;box-shadow:0 18px 44px #0006!important;
}
#user-mode .session-scroll{background:#0b141a!important}
#user-mode .session-history{
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  gap:7px!important;padding:16px 14px!important;background-color:#0b141a!important;
  background-image:radial-gradient(#ffffff0a 1px,transparent 1px)!important;
  background-size:22px 22px!important;
}
#user-mode .session-entry{
  width:fit-content!important;max-width:min(78%,760px)!important;
  align-self:flex-start!important;justify-self:auto!important;
  margin:0 auto 0 0!important;padding:7px 11px 6px!important;
  border:0!important;border-radius:9px 9px 9px 2px!important;
  background:#202c33!important;box-shadow:0 1px 1px #00000040!important;
  position:relative!important;
}
#user-mode .session-entry--agent{background:#202c33!important;border-radius:9px 9px 9px 2px!important}
#user-mode .session-entry--user{
  align-self:flex-end!important;margin:0 0 0 auto!important;
  border-radius:9px 9px 2px 9px!important;background:#005c4b!important;
}
#user-mode .session-entry--agent::before{
  content:"";position:absolute;left:-6px;top:0;border:6px solid transparent;
  border-top-color:#202c33;border-right-color:#202c33;
}
#user-mode .session-entry--user::before{
  content:"";position:absolute;right:-6px;top:0;border:6px solid transparent;
  border-top-color:#005c4b;border-left-color:#005c4b;
}
#user-mode .session-entry-head{gap:6px!important;margin:0 0 2px!important}
#user-mode .session-entry-label{
  font:700 10px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  letter-spacing:0!important;text-transform:none!important;color:#8696a0!important;
}
#user-mode .session-entry--user .session-entry-label{color:#a7d9c9!important}
#user-mode .session-entry p{
  color:#e9edef!important;font:14.5px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  white-space:pre-wrap!important;overflow-wrap:anywhere!important;
}
#user-mode .session-entry--user p{color:#e9edef!important}
#user-mode .session-copy{background:#2a3942!important;border-color:transparent!important;color:#8696a0!important;border-radius:999px!important;font-size:10px!important}
#user-mode .session-copy:hover{background:#3b4a54!important;color:#e9edef!important}
#user-mode .session-entry .session-open{margin-top:8px!important;background:#111b21!important;color:#00a884!important;border-radius:999px!important;font-weight:700!important}
#user-mode .session-empty{color:#8696a0!important;font-size:13.5px!important;text-align:center!important;padding:18px 8px!important}

html[data-theme="light"] #user-mode .readable-session{
  background:#efeae2!important;border-color:#d7d0c4!important;box-shadow:0 18px 44px #1d1d1f14!important;
}
html[data-theme="light"] #user-mode .session-scroll,
html[data-theme="light"] #user-mode .session-history{
  background-color:#efeae2!important;
  background-image:radial-gradient(#00000008 1px,transparent 1px)!important;
}
html[data-theme="light"] #user-mode .session-entry,
html[data-theme="light"] #user-mode .session-entry--agent{
  background:#ffffff!important;border:0!important;box-shadow:0 1px 1px #00000014!important;
}
html[data-theme="light"] #user-mode .session-entry--user{background:#d9fdd3!important}
html[data-theme="light"] #user-mode .session-entry--agent::before{border-top-color:#ffffff!important;border-right-color:#ffffff!important}
html[data-theme="light"] #user-mode .session-entry--user::before{border-top-color:#d9fdd3!important;border-left-color:#d9fdd3!important}
html[data-theme="light"] #user-mode .session-entry p,
html[data-theme="light"] #user-mode .session-entry--user p{color:#111b21!important}
html[data-theme="light"] #user-mode .session-entry-label{color:#667781!important}
html[data-theme="light"] #user-mode .session-entry--user .session-entry-label{color:#5b7f70!important}
html[data-theme="light"] #user-mode .session-copy{background:#e9e2d8!important;color:#54656f!important}
html[data-theme="light"] #user-mode .session-empty{color:#667781!important}

@media(max-width:900px){
  #user-mode .readable-session{height:min(68dvh,760px)!important}
}
@media(max-width:640px){
  #user-mode .readable-session{
    height:calc(100dvh - 210px)!important;min-height:360px!important;
    max-height:none!important;border-radius:13px!important;
  }
  #user-mode .session-history{gap:6px!important;padding:13px 10px!important}
  #user-mode .session-entry{max-width:88%!important;padding:7px 10px 6px!important}
  #user-mode .session-entry p{font-size:14px!important}
}

/* ─────────────────────────────────────────────────────────────────────────────
   Archive transcript parity with the WhatsApp conversation surface.
   Masli's reload view renders the latest saved session as .archive-session
   (title/date/export/ringkasan + details transcript). The earlier WhatsApp
   override only painted .session-entry, so the real transcript kept the old
   card look and its user bubble stayed dark in light mode. These rules map the
   archive metadata to WhatsApp chips and every archive message to a balloon.
   ───────────────────────────────────────────────────────────────────────────── */
#user-mode .session-history>.archive-session:first-child{margin-top:0!important}
#user-mode .archive-session{
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  gap:8px!important;width:100%!important;margin:0!important;
}
#user-mode .archive-session-title{
  align-self:center!important;margin:2px 0 0!important;padding:5px 12px!important;
  border:0!important;border-radius:999px!important;background:#182229!important;
  color:#8696a0!important;font:600 11px/1.3 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  text-align:center!important;
}
#user-mode .archive-session-date{
  align-self:center!important;margin:0!important;color:#8696a0!important;
  font:500 10.5px/1.3 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
}
#user-mode .archive-session-actions{
  align-self:center!important;display:flex!important;flex-wrap:wrap!important;
  justify-content:center!important;gap:6px!important;margin:2px 0 6px!important;
}
#user-mode .archive-session-actions button{
  padding:4px 10px!important;border:0!important;border-radius:999px!important;
  background:#202c33!important;color:#8696a0!important;box-shadow:none!important;
  font:600 10.5px/1.3 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
}
#user-mode .archive-session-actions button:hover{background:#2a3942!important;color:#e9edef!important}
#user-mode .archive-session-summary{
  margin:0 auto 0 0!important;max-width:min(78%,760px)!important;
}
#user-mode .archive-session-summary>strong{
  display:block!important;margin:0 0 2px!important;color:#8696a0!important;
  font:700 10px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  letter-spacing:0!important;text-transform:none!important;
}
#user-mode .archive-session-original{
  display:flex!important;flex-direction:column!important;gap:7px!important;
  width:100%!important;margin:0!important;padding:0!important;
}
#user-mode .archive-session-original>summary{
  align-self:center!important;list-style:none!important;cursor:pointer!important;
  padding:5px 12px!important;border-radius:999px!important;background:#182229!important;
  color:#8696a0!important;font:600 10.5px/1.3 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  text-align:center!important;
}
#user-mode .archive-session-original>summary::-webkit-details-marker{display:none!important}
#user-mode .archive-session-original>summary:hover{background:#202c33!important;color:#e9edef!important}
#user-mode .archive-session-messages{
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  gap:7px!important;width:100%!important;margin:0!important;padding:0!important;
}
#user-mode .archive-message-group{
  position:relative!important;width:fit-content!important;max-width:min(78%,760px)!important;
  align-self:flex-start!important;margin:0 auto 0 0!important;padding:7px 11px 6px!important;
  border:0!important;border-radius:9px 9px 9px 2px!important;
  background:#202c33!important;color:#e9edef!important;
  box-shadow:0 1px 1px #00000040!important;overflow-wrap:anywhere!important;
}
#user-mode .archive-message-group--assistant{background:#202c33!important}
#user-mode .archive-message-group--user{
  align-self:flex-end!important;margin:0 0 0 auto!important;
  border-radius:9px 9px 2px 9px!important;background:#005c4b!important;
}
#user-mode .archive-message-group--assistant::before{
  content:"";position:absolute;left:-6px;top:0;border:6px solid transparent;
  border-top-color:#202c33;border-right-color:#202c33;
}
#user-mode .archive-message-group--user::before{
  content:"";position:absolute;right:-6px;top:0;border:6px solid transparent;
  border-top-color:#005c4b;border-left-color:#005c4b;
}
#user-mode .archive-message-group>strong{
  display:block!important;margin:0 0 2px!important;color:#8696a0!important;
  font:700 10px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  opacity:1!important;
}
#user-mode .archive-message-group--user>strong{color:#a7d9c9!important}
#user-mode .archive-message-group>p{
  margin:0!important;color:#e9edef!important;
  font:14.5px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  white-space:pre-wrap!important;overflow-wrap:anywhere!important;
}
#user-mode .archive-attachment-file{
  background:#111b21!important;border-color:transparent!important;color:#e9edef!important;
}
#user-mode .archive-attachment{border-color:transparent!important}

html[data-theme="light"] #user-mode .archive-session-title,
html[data-theme="light"] #user-mode .archive-session-original>summary{
  background:#ffffff!important;color:#667781!important;
}
html[data-theme="light"] #user-mode .archive-session-original>summary:hover{background:#f0f2f5!important;color:#111b21!important}
html[data-theme="light"] #user-mode .archive-session-date{color:#667781!important}
html[data-theme="light"] #user-mode .archive-session-actions button{background:#ffffff!important;color:#667781!important}
html[data-theme="light"] #user-mode .archive-session-actions button:hover{background:#f0f2f5!important;color:#111b21!important}
html[data-theme="light"] #user-mode .archive-message-group,
html[data-theme="light"] #user-mode .archive-message-group--assistant{
  background:#ffffff!important;color:#111b21!important;box-shadow:0 1px 1px #00000014!important;
}
html[data-theme="light"] #user-mode .archive-message-group--user{background:#d9fdd3!important}
html[data-theme="light"] #user-mode .archive-message-group--assistant::before{border-top-color:#ffffff!important;border-right-color:#ffffff!important}
html[data-theme="light"] #user-mode .archive-message-group--user::before{border-top-color:#d9fdd3!important;border-left-color:#d9fdd3!important}
html[data-theme="light"] #user-mode .archive-message-group>strong{color:#667781!important}
html[data-theme="light"] #user-mode .archive-message-group--user>strong{color:#5b7f70!important}
html[data-theme="light"] #user-mode .archive-message-group>p{color:#111b21!important}
html[data-theme="light"] #user-mode .archive-session-summary>strong{color:#667781!important}
html[data-theme="light"] #user-mode .archive-attachment-file{background:#ffffff!important;border-color:#00000012!important;color:#111b21!important}

@media(max-width:640px){
  #user-mode .archive-session{gap:7px!important}
  #user-mode .archive-session-actions button{font-size:10px!important;padding:4px 9px!important}
  #user-mode .archive-message-group{max-width:88%!important;padding:7px 10px 6px!important}
  #user-mode .archive-message-group>p{font-size:14px!important}
}

/* ─────────────────────────────────────────────────────────────────────────────
   Inline images in Perbualan.
   Both directions use the same gallery: a pasted/attached image (user) and an
   image URL or local screenshot path mentioned by AINNA. The text bubble keeps
   its normal width; the image is a separate clickable card under the message.
   ───────────────────────────────────────────────────────────────────────────── */
#user-mode .session-entry p[hidden]{display:none!important}
#user-mode .session-entry-media{
  display:flex!important;flex-wrap:wrap!important;gap:8px!important;
  max-width:100%!important;margin-top:8px!important;
}
#user-mode .session-media-item{margin:0!important;max-width:100%!important;line-height:0!important}
#user-mode .session-media-item>a{
  display:block!important;max-width:100%!important;line-height:0!important;
  border:1px solid #ffffff1f!important;border-radius:10px!important;
  overflow:hidden!important;background:#0b141a!important;
}
#user-mode .session-media-item img{
  display:block!important;width:auto!important;height:auto!important;
  max-width:min(360px,100%)!important;max-height:320px!important;
  object-fit:contain!important;border-radius:10px!important;
}
#user-mode .session-media-item figcaption{
  margin-top:5px!important;color:#8696a0!important;line-height:1.35!important;
  font:500 10.5px/1.35 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  overflow-wrap:anywhere!important;
}
#user-mode .archive-attachment--image img{max-width:min(360px,100%)!important;max-height:320px!important}
html[data-theme="light"] #user-mode .session-media-item>a{
  border-color:#0000001a!important;background:#ffffff!important;
}
html[data-theme="light"] #user-mode .session-media-item figcaption{color:#667781!important}
html[data-theme="light"] #user-mode .archive-attachment--image img{border-color:#0000001a!important}
@media(max-width:640px){
  #user-mode .session-entry-media{gap:6px!important;margin-top:7px!important}
  #user-mode .session-media-item img{max-height:240px!important}
  #user-mode .archive-attachment--image img{max-height:240px!important}
}

/* ─────────────────────────────────────────────────────────────────────────────
   Live "what is AINNA doing" bubble in Perbualan.
   Same WhatsApp surface as the messages, but with a phase pill, three bouncing
   dots and a one-line summary. Long tool names are ellipsised; the full text is
   kept in the title/aria-label so hover or screen readers still get it.
   ───────────────────────────────────────────────────────────────────────────── */
#user-mode .session-live-activity{
  display:flex!important;align-items:center!important;gap:8px!important;
  align-self:flex-start!important;width:fit-content!important;
  max-width:min(78%,760px)!important;margin:0 auto 0 0!important;
  padding:8px 12px!important;border:1px solid #ffffff14!important;
  border-radius:9px!important;background:#202c33!important;color:#e9edef!important;
  box-shadow:0 1px 1px #00000040!important;position:relative!important;overflow:hidden!important;
  font:500 13px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  animation:slaBreathe 2.6s ease-in-out infinite;
}
#user-mode .session-live-activity .sla-dots{flex:none!important}
#user-mode .session-live-activity .sla-phase{
  flex:none!important;padding:2px 6px!important;border-radius:999px!important;
  background:#00a88424!important;color:#7fe3c6!important;
  font:800 9px/1.25 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  letter-spacing:.08em!important;white-space:nowrap!important;
}
#user-mode .session-live-activity .sla-text{
  flex:1 1 auto!important;min-width:0!important;max-width:100%!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  overflow-wrap:normal!important;
}
#user-mode .session-live-activity::after{
  background:linear-gradient(90deg,transparent,#00a88422,transparent)!important;
  animation:slaSweep 2.4s linear infinite!important;
}
@keyframes slaBreathe{
  0%,100%{box-shadow:0 1px 1px #00000040,0 0 0 0 #00a88400}
  50%{box-shadow:0 1px 1px #00000040,0 0 0 3px #00a8841f}
}
html[data-theme="light"] #user-mode .session-live-activity{
  background:#ffffff!important;border-color:#00000010!important;color:#111b21!important;
  box-shadow:0 1px 1px #00000014!important;
}
html[data-theme="light"] #user-mode .session-live-activity::after{
  background:linear-gradient(90deg,transparent,#00a88414,transparent)!important;
}
html[data-theme="light"] #user-mode .session-live-activity .sla-phase{
  background:#d9fdd3!important;color:#0b6b53!important;
}
html[data-theme="light"] #user-mode .session-live-activity .sla-dots i{background:#008f72!important}
@media(max-width:640px){
  #user-mode .session-live-activity{
    max-width:88%!important;padding:7px 10px!important;gap:7px!important;font-size:12.5px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #user-mode .session-live-activity,
  #user-mode .session-live-activity::after,
  #user-mode .session-live-activity .sla-dots i{animation:none!important}
}

/* The final live-activity card uses display:flex!important, which otherwise
   overrides the hidden attribute. Keep the idle "Sedia…" node invisible. */
#user-mode .session-live-activity[hidden]{display:none!important}


/* ── Requested conversation polish ───────────────────────────────────────────
   Full-width WhatsApp-style bubbles: incoming on the left, outgoing on the
   right. The row is full width, while the colour/tail still makes the speaker
   obvious. Keep this block last so it wins over the older card rules. */
#user-mode .session-history{gap:10px}
#user-mode .session-entry,
#user-mode .session-entry--agent,
#user-mode .session-entry--user{
  width:100%!important;
  max-width:100%!important;
  align-self:stretch!important;
  justify-self:auto!important;
  margin:0!important;
  box-sizing:border-box;
}
#user-mode .session-entry--agent{border-top-left-radius:6px;border-top-right-radius:16px}
#user-mode .session-entry--user{border-top-right-radius:6px;border-top-left-radius:16px}
#user-mode .session-entry p{width:100%;line-height:1.62}
@media(max-width:640px){
  #user-mode .session-entry,
  #user-mode .session-entry--agent,
  #user-mode .session-entry--user{width:100%!important;max-width:100%!important;align-self:stretch!important;justify-self:auto!important;margin:0!important}
}

/* Live card: keep the readings, drop the explanatory sub-text under each
   indicator (e.g. "masa CPU", RAM/swap sizes and session detail). */
#request-viz-gauges .rv-linear-meter > small,
#live-status-bar #request-viz .rv-linear-meter > small{display:none!important}

/* Saved/archive transcript: same full-width left/right bubble treatment as the
   live conversation, with WhatsApp-like formatting preserved. */
#user-mode .archive-message-group,
#user-mode .archive-message-group--assistant,
#user-mode .archive-message-group--user{
  width:100%!important;
  max-width:100%!important;
  align-self:stretch!important;
  margin:0!important;
  box-sizing:border-box;
}
#user-mode .archive-message-group > p{font-size:14.5px!important;line-height:1.62!important}
@media(max-width:640px){
  #user-mode .archive-message-group,
  #user-mode .archive-message-group--assistant,
  #user-mode .archive-message-group--user{width:100%!important;max-width:100%!important}
}

/* Inline code inside conversation must be inline, not the global block-style
   code field. This keeps bullet lines and short code snippets readable instead
   of turning each one into a black box. */
#user-mode .session-entry p code,
#user-mode .archive-message-group p code,
#user-mode .archive-session-summary code,
#user-mode .archive-session-messages code,
#user-mode .archive-session-original code,
.full-reply-body p code,
.preview-text p code{
  display:inline!important;
  width:auto!important;
  max-width:none!important;
  margin:0!important;
  padding:0 2px!important;
  border:0!important;
  border-radius:3px!important;
  background:rgba(255,255,255,.06)!important;
  color:inherit!important;
  font:inherit!important;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace!important;
  text-decoration:underline dotted currentColor!important;
  text-underline-offset:2px;
  overflow-wrap:anywhere;
}
html[data-theme="light"] #user-mode .session-entry p code,
html[data-theme="light"] #user-mode .archive-message-group p code,
html[data-theme="light"] .full-reply-body p code,
html[data-theme="light"] .preview-text p code{background:#eef3f7!important;color:inherit!important}

/* Conversation line blocks: bullet lines keep a clean hanging indent and never
   inherit the global block <code> field. */
#user-mode .session-entry p .conv-line,
#user-mode .archive-message-group p .conv-line{display:block;min-height:1.1em}
#user-mode .session-entry p .conv-bullet,
#user-mode .archive-message-group p .conv-bullet{
  padding-left:1.15em;
  text-indent:-1.15em;
}
#user-mode .session-entry p .conv-bullet::before,
#user-mode .archive-message-group p .conv-bullet::before{
  content:"• ";
  text-indent:0;
}

/* Mobile V3 terminal shortcut lives in the composer; desktop keeps its
   existing header/menu terminal control. */
#compose-terminal{display:none!important}
