:root{
  --rex-focus-blue:#1687ff;
  --rex-focus-cyan:#18dfff;
  --rex-focus-green:#21efa5;
  --rex-focus-violet:#785cff;
  --rex-focus-red:#ff4565;
  --rex-focus-bg:#020912;
  --rex-focus-panel:#071522;
  --rex-focus-panel-2:#0a1d2d;
  --rex-focus-line:rgba(45,151,215,.32);
  --rex-focus-text:#eefaff;
  --rex-focus-muted:#7798aa;
}

/* Every focused mode owns the full workspace beneath the global Rex header. */
#workspace.rex-window-active[data-rex-window-mode="browser"] #webPanel,
#workspace.rex-window-active[data-rex-window-mode="progress"] #progressWorkspace,
#workspace.rex-window-active[data-rex-window-mode="files"] #filesWorkspace,
#workspace.rex-window-active[data-rex-window-mode="creator"] #visualWorkspace,
#workspace.rex-window-active[data-rex-window-mode="apps"] #rexAppsWorkspace,
#workspace.rex-window-active[data-rex-window-mode="connect"] #connectWorkspace,
#workspace.rex-window-active[data-rex-window-mode="mission"] #missionWorkspace,
#workspace.rex-window-active[data-rex-window-mode="security"] #securityWorkspace,
#workspace.rex-window-active[data-rex-window-mode="home"] #rexHomeV7,
#workspace.rex-window-active[data-rex-window-mode="settings"] #rexSettingsWorkspace{
  position:absolute!important;
  inset:var(--rex-window-header,68px) 0 0 0!important;
  width:auto!important;
  max-width:none!important;
  height:auto!important;
  max-height:none!important;
  box-sizing:border-box!important;
  overflow:auto!important;
  overflow-x:hidden!important;
  color:var(--rex-focus-text)!important;
  background:
    linear-gradient(rgba(12,45,67,.11) 1px,transparent 1px),
    linear-gradient(90deg,rgba(12,45,67,.09) 1px,transparent 1px),
    radial-gradient(circle at 72% 8%,rgba(21,128,255,.11),transparent 30%),
    linear-gradient(180deg,#04101a,#020811 76%)!important;
  background-size:46px 46px,46px 46px,auto,auto!important;
}

/* Shared focused-view typography and panel geometry. */
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
:is(#progressWorkspace,#filesWorkspace,#visualWorkspace,#rexAppsWorkspace,#connectWorkspace,#missionWorkspace,#securityWorkspace,#rexHomeV7,#rexSettingsWorkspace){
  padding:22px 26px 34px!important;
}
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
:is(h2,h3,h4){
  color:#f1fbff;
}
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
:is(p,.connection-note){
  color:#7899aa;
}
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
:is(.action-panel,.mission-hero,.creator-hero,.creator-form,.workspace-card,.rex-supplement-card){
  border:1px solid var(--rex-focus-line)!important;
  border-radius:10px!important;
  background:
    radial-gradient(circle at 10% 0%,rgba(25,129,255,.08),transparent 36%),
    linear-gradient(180deg,rgba(7,26,41,.96),rgba(4,15,25,.97))!important;
  box-shadow:inset 0 1px 0 rgba(104,216,255,.035),0 20px 50px rgba(0,0,0,.18)!important;
}
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
:is(.panel-kicker,.creator-kicker){
  color:#54ddff!important;
  font-size:9px!important;
  font-weight:900!important;
  letter-spacing:.16em!important;
}
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
:is(button,.action){
  border:1px solid rgba(44,137,186,.42)!important;
  border-radius:8px!important;
  background:linear-gradient(180deg,#0b293d,#071c2a)!important;
  color:#dff7ff!important;
  font-weight:800!important;
  letter-spacing:.03em!important;
  box-shadow:none!important;
}
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
:is(button,.action):hover,
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
:is(button,.action):focus-visible{
  border-color:#42dfff!important;
  background:linear-gradient(180deg,#0c4770,#082b49)!important;
  color:#fff!important;
  outline:none!important;
  box-shadow:0 0 16px rgba(22,135,255,.16)!important;
}
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
:is(input,textarea,select){
  box-sizing:border-box!important;
  border:1px solid rgba(43,127,169,.42)!important;
  border-radius:8px!important;
  background:#041521!important;
  color:#eefaff!important;
  outline:none!important;
}
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
:is(input,textarea,select):focus{
  border-color:#34d8ff!important;
  box-shadow:0 0 0 2px rgba(22,135,255,.12)!important;
}

/* Browser */
#workspace.rex-window-active[data-rex-window-mode="browser"] #webPanel{
  display:flex!important;
  flex-direction:column!important;
  padding:0!important;
}
#workspace.rex-window-active[data-rex-window-mode="browser"] .web-toolbar{
  display:grid!important;
  grid-template-columns:auto auto auto minmax(220px,1fr) auto!important;
  align-items:center!important;
  gap:6px!important;
  min-height:56px!important;
  padding:9px 14px!important;
  box-sizing:border-box!important;
  border-bottom:1px solid rgba(40,149,214,.3)!important;
  background:linear-gradient(180deg,rgba(6,25,39,.98),rgba(3,15,24,.98))!important;
}
#workspace.rex-window-active[data-rex-window-mode="browser"] .web-toolbar button{
  min-height:35px!important;
  padding:7px 10px!important;
  border:1px solid rgba(48,145,192,.38)!important;
  border-radius:7px!important;
  background:#071d2b!important;
  color:#a9c9d9!important;
}
#workspace.rex-window-active[data-rex-window-mode="browser"] #webAddressInput{
  min-height:37px!important;
  width:100%!important;
  padding:0 13px!important;
  border:1px solid rgba(49,166,225,.5)!important;
  border-radius:8px!important;
  background:#031522!important;
  color:#f0fbff!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025)!important;
}
#workspace.rex-window-active[data-rex-window-mode="browser"] #webGo{
  border-color:#45dfff!important;
  background:linear-gradient(180deg,#1687ff,#075ce1)!important;
  color:#fff!important;
}
#workspace.rex-window-active[data-rex-window-mode="browser"] #webFullscreen,
#workspace.rex-window-active[data-rex-window-mode="browser"] #webMinimize{
  display:none!important;
}
#workspace.rex-window-active[data-rex-window-mode="browser"] #webFrameStatus{
  margin:0!important;
  min-height:28px!important;
  padding:7px 14px!important;
  box-sizing:border-box!important;
  border-bottom:1px solid rgba(38,105,142,.22)!important;
  background:#04111b!important;
  color:#5f93ab!important;
  font-size:8px!important;
  font-weight:800!important;
  letter-spacing:.14em!important;
}
#workspace.rex-window-active[data-rex-window-mode="browser"] #rexWebFrame,
#workspace.rex-window-active[data-rex-window-mode="browser"] #rexAppView{
  flex:1 1 auto!important;
  width:100%!important;
  min-height:0!important;
  border:0!important;
  background:#07121b!important;
}

/* Progress */
#workspace.rex-window-active[data-rex-window-mode="progress"] #progressWorkspace{
  display:block!important;
}
#workspace.rex-window-active[data-rex-window-mode="progress"] #progressWorkspace>h3{
  margin:0 0 5px!important;
  font-size:24px!important;
  letter-spacing:.02em!important;
}
#workspace.rex-window-active[data-rex-window-mode="progress"] #progressWorkspace>p{
  max-width:760px!important;
  margin:0 0 18px!important;
  color:#7698aa!important;
}
#workspace.rex-window-active[data-rex-window-mode="progress"] .progress-job{
  max-width:1180px!important;
  margin:0 0 10px!important;
  padding:15px 16px!important;
  border:1px solid rgba(42,137,187,.36)!important;
  border-radius:10px!important;
  background:
    radial-gradient(circle at 8% 0%,rgba(20,126,255,.12),transparent 31%),
    linear-gradient(180deg,#071a28,#04131f)!important;
}
#workspace.rex-window-active[data-rex-window-mode="progress"] .progress-job-top{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
}
#workspace.rex-window-active[data-rex-window-mode="progress"] .progress-job-top b{
  color:#e8f9ff!important;
  font-size:11px!important;
}
#workspace.rex-window-active[data-rex-window-mode="progress"] .progress-job-top span{
  color:#5fe2ff!important;
  font-size:8px!important;
  font-weight:900!important;
  letter-spacing:.12em!important;
}
#workspace.rex-window-active[data-rex-window-mode="progress"] .rex-progress{
  width:100%!important;
  height:6px!important;
  margin:12px 0 8px!important;
  overflow:hidden!important;
  border:0!important;
  border-radius:999px!important;
  background:#0c2b3e!important;
  accent-color:var(--rex-focus-blue);
}
#workspace.rex-window-active[data-rex-window-mode="progress"] .progress-current{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  color:#8eaebe!important;
}
#workspace.rex-window-active[data-rex-window-mode="progress"] .progress-current span{
  color:#4cdfff!important;
  font-size:7px!important;
  font-weight:900!important;
  letter-spacing:.14em!important;
}
#workspace.rex-window-active[data-rex-window-mode="progress"] .progress-percent{
  margin-top:7px!important;
  color:#5d879b!important;
  font-size:7px!important;
  font-weight:800!important;
  letter-spacing:.1em!important;
}

/* Projects / Files */
#workspace.rex-window-active[data-rex-window-mode="files"] #filesWorkspace>.action-panel{
  max-width:1320px!important;
  margin:0 auto!important;
  padding:22px!important;
}
#workspace.rex-window-active[data-rex-window-mode="files"] #filesWorkspace h3{
  margin:0 0 6px!important;
  font-size:23px!important;
}
#workspace.rex-window-active[data-rex-window-mode="files"] #filesWorkspace .panel-actions{
  display:grid!important;
  grid-template-columns:minmax(220px,1fr) auto!important;
  gap:8px!important;
  margin:16px 0!important;
}
#workspace.rex-window-active[data-rex-window-mode="files"] #rexProjectSelect{
  min-height:40px!important;
}
#workspace.rex-window-active[data-rex-window-mode="files"] #rexProjectRefresh{
  min-width:110px!important;
  border-color:#37cfff!important;
  background:linear-gradient(180deg,#0d6bd5,#074b9f)!important;
}
#workspace.rex-window-active[data-rex-window-mode="files"] #rexProjectStatus,
#workspace.rex-window-active[data-rex-window-mode="files"] #rexProjectPath{
  color:#6f96a9!important;
  font-size:10px!important;
}
#workspace.rex-window-active[data-rex-window-mode="files"] #rexProjectEntries{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr))!important;
  gap:8px!important;
}
#workspace.rex-window-active[data-rex-window-mode="files"] #rexProjectPreview{
  box-sizing:border-box!important;
  width:100%!important;
  margin-top:12px!important;
  padding:14px!important;
  border:1px solid rgba(44,126,166,.34)!important;
  border-radius:9px!important;
  background:#03111a!important;
  color:#a9c7d6!important;
}

/* Creator */
#workspace.rex-window-active[data-rex-window-mode="creator"] #visualWorkspace{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  align-content:start!important;
  gap:10px!important;
}
#workspace.rex-window-active[data-rex-window-mode="creator"] .creator-hero{
  max-width:1320px!important;
  width:100%!important;
  box-sizing:border-box!important;
  margin:0 auto!important;
  padding:18px 20px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:20px!important;
  background:
    radial-gradient(circle at 80% 5%,rgba(106,68,255,.15),transparent 28%),
    radial-gradient(circle at 10% 10%,rgba(20,142,255,.14),transparent 31%),
    linear-gradient(180deg,#081c2d,#04131f)!important;
}
#workspace.rex-window-active[data-rex-window-mode="creator"] .creator-hero h3{
  margin:6px 0!important;
  font-size:25px!important;
}
#workspace.rex-window-active[data-rex-window-mode="creator"] .creator-construction{
  color:#8b6fff!important;
  font-size:8px!important;
  font-weight:850!important;
  letter-spacing:.11em!important;
}
#workspace.rex-window-active[data-rex-window-mode="creator"] .creator-primary{
  border-color:#55dfff!important;
  background:linear-gradient(180deg,#167eff,#0950cf)!important;
  color:#fff!important;
}
#workspace.rex-window-active[data-rex-window-mode="creator"] .creator-form{
  max-width:1320px!important;
  width:100%!important;
  box-sizing:border-box!important;
  margin:0 auto!important;
  padding:16px 18px!important;
}
#workspace.rex-window-active[data-rex-window-mode="creator"] .creator-formats{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:6px!important;
  margin-bottom:10px!important;
}
#workspace.rex-window-active[data-rex-window-mode="creator"] .creator-formats button.active{
  border-color:#40ddff!important;
  background:linear-gradient(180deg,#115ba5,#0a3769)!important;
  color:#fff!important;
}
#workspace.rex-window-active[data-rex-window-mode="creator"] #creatorBrief{
  width:100%!important;
  min-height:150px!important;
  padding:13px!important;
  resize:vertical!important;
}
#workspace.rex-window-active[data-rex-window-mode="creator"] .creator-row{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:7px!important;
  margin-top:10px!important;
}
#workspace.rex-window-active[data-rex-window-mode="creator"] #creatorAdvancedPanel{
  margin-top:12px!important;
}

/* Apps and Settings */
#workspace.rex-window-active[data-rex-window-mode="apps"] #rexAppsWorkspace,
#workspace.rex-window-active[data-rex-window-mode="settings"] #rexSettingsWorkspace{
  display:block!important;
}
#workspace.rex-window-active[data-rex-window-mode="apps"] .rex-supplement-head,
#workspace.rex-window-active[data-rex-window-mode="settings"] .rex-supplement-head{
  max-width:900px!important;
  margin:0 0 20px!important;
}
#workspace.rex-window-active[data-rex-window-mode="apps"] .rex-supplement-head h3,
#workspace.rex-window-active[data-rex-window-mode="settings"] .rex-supplement-head h3{
  font-size:26px!important;
}
#workspace.rex-window-active[data-rex-window-mode="apps"] .rex-supplement-grid,
#workspace.rex-window-active[data-rex-window-mode="settings"] .rex-supplement-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr))!important;
  gap:10px!important;
}
#workspace.rex-window-active[data-rex-window-mode="apps"] .rex-supplement-card,
#workspace.rex-window-active[data-rex-window-mode="settings"] .rex-supplement-card{
  min-height:145px!important;
  padding:16px!important;
  border-color:rgba(39,132,184,.35)!important;
}
#workspace.rex-window-active[data-rex-window-mode="apps"] .rex-supplement-card:hover,
#workspace.rex-window-active[data-rex-window-mode="settings"] .rex-supplement-card:hover{
  transform:translateY(-1px)!important;
  border-color:#37d9ff!important;
  background:
    radial-gradient(circle at 10% 0%,rgba(18,124,255,.18),transparent 39%),
    linear-gradient(180deg,#0a2639,#061826)!important;
}

/* Communicate */
#workspace.rex-window-active[data-rex-window-mode="connect"] #connectWorkspace>.action-panel{
  max-width:980px!important;
  margin:0 auto!important;
  padding:22px!important;
}
#workspace.rex-window-active[data-rex-window-mode="connect"] #connectWorkspace h3{
  font-size:24px!important;
  margin:5px 0 7px!important;
}
#workspace.rex-window-active[data-rex-window-mode="connect"] #connectWorkspace label{
  display:grid!important;
  gap:6px!important;
  margin-top:12px!important;
  color:#86a8b8!important;
  font-size:9px!important;
  font-weight:800!important;
  letter-spacing:.05em!important;
}
#workspace.rex-window-active[data-rex-window-mode="connect"] #connectWorkspace input{
  min-height:42px!important;
  padding:0 12px!important;
}
#workspace.rex-window-active[data-rex-window-mode="connect"] #connectWorkspace .panel-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  margin-top:16px!important;
}
#workspace.rex-window-active[data-rex-window-mode="connect"] #connectSave{
  border-color:#39dbff!important;
  background:linear-gradient(180deg,#116bc6,#09498d)!important;
}

/* Mission Control */
#workspace.rex-window-active[data-rex-window-mode="mission"] #missionWorkspace{
  display:block!important;
}
#workspace.rex-window-active[data-rex-window-mode="mission"] .mission-hero{
  max-width:1220px!important;
  margin:0 auto!important;
  padding:24px!important;
  background:
    radial-gradient(circle at 82% 0%,rgba(117,72,255,.14),transparent 31%),
    radial-gradient(circle at 12% 5%,rgba(19,136,255,.15),transparent 34%),
    linear-gradient(180deg,#081d2e,#04131f)!important;
}
#workspace.rex-window-active[data-rex-window-mode="mission"] .mission-hero h3{
  margin:5px 0 8px!important;
  font-size:27px!important;
}
#workspace.rex-window-active[data-rex-window-mode="mission"] #missionGoal{
  width:100%!important;
  min-height:160px!important;
  padding:14px!important;
  margin-top:12px!important;
}
#workspace.rex-window-active[data-rex-window-mode="mission"] .mission-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  margin-top:11px!important;
}
#workspace.rex-window-active[data-rex-window-mode="mission"] #missionExecute{
  border-color:#41ddff!important;
  background:linear-gradient(180deg,#147be8,#0854b0)!important;
}
#workspace.rex-window-active[data-rex-window-mode="mission"] #missionOutput{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr))!important;
  gap:8px!important;
  margin-top:14px!important;
}
#workspace.rex-window-active[data-rex-window-mode="mission"] #missionOutput>h4{
  grid-column:1/-1!important;
}

/* PC Repair */
#workspace.rex-window-active[data-rex-window-mode="security"] #securityWorkspace>.action-panel{
  max-width:1220px!important;
  margin:0 auto!important;
  padding:22px!important;
}
#workspace.rex-window-active[data-rex-window-mode="security"] #securityWorkspace h3{
  font-size:24px!important;
}
#workspace.rex-window-active[data-rex-window-mode="security"] #securityWorkspace>.action-panel>.panel-actions{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
  margin:15px 0!important;
}
#workspace.rex-window-active[data-rex-window-mode="security"] #securityScan{
  border-color:#ffb14c!important;
  color:#ffe0a7!important;
  background:linear-gradient(180deg,#5b3a12,#34220e)!important;
}
#workspace.rex-window-active[data-rex-window-mode="security"] #securityScanReview,
#workspace.rex-window-active[data-rex-window-mode="security"] .rex-repair-manuals{
  box-sizing:border-box!important;
  border:1px solid rgba(45,133,178,.34)!important;
  border-radius:9px!important;
  background:#051824!important;
}
#workspace.rex-window-active[data-rex-window-mode="security"] .rex-repair-manuals a{
  display:inline-flex!important;
  align-items:center!important;
  min-height:32px!important;
  padding:5px 9px!important;
  border:1px solid rgba(48,133,176,.38)!important;
  border-radius:7px!important;
  background:#071e2c!important;
  color:#83ddff!important;
  text-decoration:none!important;
}

/* Smart Home */
#workspace.rex-window-active[data-rex-window-mode="home"] #rexHomeV7{
  padding:20px 24px 34px!important;
}
#workspace.rex-window-active[data-rex-window-mode="home"] #rexHomeV7 :is(section,article,.workspace-card,.rex-home-card){
  border-color:rgba(39,133,182,.32)!important;
  border-radius:10px!important;
  background:
    radial-gradient(circle at 10% 0%,rgba(18,126,255,.1),transparent 36%),
    linear-gradient(180deg,#071a29,#04131e)!important;
  box-shadow:none!important;
}
#workspace.rex-window-active[data-rex-window-mode="home"] #rexHomeV7 :is(button,.action){
  border-radius:8px!important;
}
#workspace.rex-window-active[data-rex-window-mode="home"] #rexHomeV7 input{
  background:#041521!important;
  border-color:rgba(44,128,168,.4)!important;
  color:#eefaff!important;
}

/* Keep cards and grids compact at enterprise desktop sizes. */
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
.workspace-grid{
  gap:8px!important;
}
#workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
.workspace-card{
  padding:12px!important;
}
@media(max-width:900px){
  #workspace.rex-window-active[data-rex-window-mode]:not([data-rex-window-mode="portal"]):not([data-rex-window-mode="chat"])
  :is(#progressWorkspace,#filesWorkspace,#visualWorkspace,#rexAppsWorkspace,#connectWorkspace,#missionWorkspace,#securityWorkspace,#rexHomeV7,#rexSettingsWorkspace){
    padding:14px!important;
  }
  #workspace.rex-window-active[data-rex-window-mode="security"] #securityWorkspace>.action-panel>.panel-actions{
    grid-template-columns:1fr!important;
  }
}
@media(max-width:700px){
  #workspace.rex-window-active[data-rex-window-mode="browser"] .web-toolbar{
    grid-template-columns:auto auto minmax(0,1fr) auto!important;
    padding:7px!important;
  }
  #workspace.rex-window-active[data-rex-window-mode="browser"] #webReload{display:none!important}
  #workspace.rex-window-active[data-rex-window-mode="creator"] .creator-hero{
    align-items:stretch!important;
    flex-direction:column!important;
  }
  #workspace.rex-window-active[data-rex-window-mode="files"] #filesWorkspace .panel-actions{
    grid-template-columns:1fr!important;
  }
}
